diff options
author | Sam Wilkins <abdullah_ahmed@brown.edu> | 2019-05-08 23:16:24 -0400 |
---|---|---|
committer | Sam Wilkins <abdullah_ahmed@brown.edu> | 2019-05-08 23:16:24 -0400 |
commit | 508410d810f61b8f8602dedbbba3e0736c1f5ba3 (patch) | |
tree | b6de0f335ed187f7e795025ba9a304b3146fc6a2 /src/client/documents/Documents.ts | |
parent | 086391b7e45ed4b3cb29602a776f5812f142fff2 (diff) | |
parent | 890d43c23c5aaafc8ebc2978cd1ad2e19bfcd830 (diff) |
Working implementation of remote cursors
Diffstat (limited to 'src/client/documents/Documents.ts')
-rw-r--r-- | src/client/documents/Documents.ts | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/client/documents/Documents.ts b/src/client/documents/Documents.ts index 8706359e4..a770ccc93 100644 --- a/src/client/documents/Documents.ts +++ b/src/client/documents/Documents.ts @@ -33,6 +33,7 @@ import { listSpec } from "../../new_fields/Schema"; import { DocServer } from "../DocServer"; import { StrokeData, InkField } from "../../new_fields/InkField"; import { dropActionType } from "../util/DragManager"; +import { DateField } from "../../new_fields/DateField"; export interface DocumentOptions { x?: number; @@ -131,7 +132,7 @@ export namespace Docs { } function CreateTextPrototype(): Doc { let textProto = setupPrototypeOptions(textProtoId, "TEXT_PROTO", FormattedTextBox.LayoutString(), - { x: 0, y: 0, width: 300, height: 150 }); + { x: 0, y: 0, width: 300, height: 150, backgroundColor: "#f1efeb" }); return textProto; } function CreatePdfPrototype(): Doc { @@ -168,6 +169,13 @@ export namespace Docs { function CreateInstance(proto: Doc, data: Field, options: DocumentOptions) { const { omit: protoProps, extract: delegateProps } = OmitKeys(options, delegateKeys); + if (!("author" in protoProps)) { + protoProps.author = CurrentUserUtils.email; + } + if (!("creationDate" in protoProps)) { + protoProps.creationDate = new DateField; + } + return SetDelegateOptions(SetInstanceOptions(proto, protoProps, data), delegateProps); } |