aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsharkiecodes <lanyi_stroud@brown.edu>2025-04-21 19:58:47 -0400
committersharkiecodes <lanyi_stroud@brown.edu>2025-04-21 19:58:47 -0400
commit7735795a5660ed03a711e29cd0240736c9444fe1 (patch)
tree98b735a291a902380724df21e4ec224bfafbca8c
parent5290e6a69fdadb6037f3d8a03f5ed82e00927520 (diff)
scrapbooks
-rw-r--r--src/client/documents/DocUtils.ts7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/client/documents/DocUtils.ts b/src/client/documents/DocUtils.ts
index 7b36c3a66..db0770b12 100644
--- a/src/client/documents/DocUtils.ts
+++ b/src/client/documents/DocUtils.ts
@@ -308,6 +308,13 @@ export namespace DocUtils {
*/
export async function DocumentFromType(type: string, path: string, options: DocumentOptions, overwriteDoc?: Doc): Promise<Opt<Doc>> {
let ctor: ((path: string, options: DocumentOptions, overwriteDoc?: Doc) => Doc | Promise<Doc | undefined>) | undefined;
+
+ if (type.indexOf('scrapbook') !== -1) {
+ ctor = Docs.Create.ScrapbookDocument;
+ if (!options._width) options._width = 400;
+ if (!options._title) options._title = 'New Scrapbook';
+ }
+
if (type.indexOf('image') !== -1) {
ctor = Docs.Create.ImageDocument;
if (!options._width) options._width = 300;