aboutsummaryrefslogtreecommitdiff
path: root/src/client/documents/Documents.ts
diff options
context:
space:
mode:
authormonikahedman <monika_hedman@brown.edu>2019-08-21 17:22:05 -0400
committermonikahedman <monika_hedman@brown.edu>2019-08-21 17:22:05 -0400
commit55ae5df54051d8a0bcc341d51ea7e998635722a6 (patch)
treedd910f79a5e9cc522d52b7d0f4194f697dcfd0da /src/client/documents/Documents.ts
parent6604c40d02b4dd7c6a6c663f301bcaedfee6998f (diff)
parent43d731ef2a6b2bd3fcdb7dd26fb6a8beac8e1306 (diff)
pulled from master
Diffstat (limited to 'src/client/documents/Documents.ts')
-rw-r--r--src/client/documents/Documents.ts35
1 files changed, 12 insertions, 23 deletions
diff --git a/src/client/documents/Documents.ts b/src/client/documents/Documents.ts
index 9c8b6c129..47df17329 100644
--- a/src/client/documents/Documents.ts
+++ b/src/client/documents/Documents.ts
@@ -1,25 +1,3 @@
-export enum DocumentType {
- NONE = "none",
- TEXT = "text",
- HIST = "histogram",
- IMG = "image",
- WEB = "web",
- COL = "collection",
- KVP = "kvp",
- VID = "video",
- AUDIO = "audio",
- PDF = "pdf",
- ICON = "icon",
- IMPORT = "import",
- LINK = "link",
- LINKDOC = "linkdoc",
- BUTTON = "button",
- TEMPLATE = "template",
- EXTENSION = "extension",
- YOUTUBE = "youtube",
- DRAGBOX = "dragbox",
-}
-
import { HistogramField } from "../northstar/dash-fields/HistogramField";
import { HistogramBox } from "../northstar/dash-nodes/HistogramBox";
import { HistogramOperation } from "../northstar/operations/HistogramOperation";
@@ -63,8 +41,12 @@ import { Scripting, CompileScript } from "../util/Scripting";
import { ButtonBox } from "../views/nodes/ButtonBox";
import { DragBox } from "../views/nodes/DragBox";
import { SchemaHeaderField, RandomPastel } from "../../new_fields/SchemaHeaderField";
+import { PresBox } from "../views/nodes/PresBox";
import { ComputedField } from "../../new_fields/ScriptField";
import { ProxyField } from "../../new_fields/Proxy";
+import { DocumentType } from "./DocumentTypes";
+//import { PresBox } from "../views/nodes/PresBox";
+//import { PresField } from "../../new_fields/PresField";
var requestImageSize = require('../util/request-image-size');
var path = require('path');
@@ -180,6 +162,10 @@ export namespace Docs {
[DocumentType.BUTTON, {
layout: { view: ButtonBox },
}],
+ [DocumentType.PRES, {
+ layout: { view: PresBox },
+ options: {}
+ }],
[DocumentType.DRAGBOX, {
layout: { view: DragBox },
options: { width: 40, height: 40 },
@@ -304,7 +290,7 @@ export namespace Docs {
const { omit: protoProps, extract: delegateProps } = OmitKeys(options, delegateKeys);
if (!("author" in protoProps)) {
- protoProps.author = CurrentUserUtils.email;
+ protoProps.author = Doc.CurrentUserEmail;
}
if (!("creationDate" in protoProps)) {
@@ -352,6 +338,9 @@ export namespace Docs {
.catch((err: any) => console.log(err));
return inst;
}
+ export function PresDocument(initial: List<Doc> = new List(), options: DocumentOptions = {}) {
+ return InstanceFromProto(Prototypes.get(DocumentType.PRES), initial, options);
+ }
export function VideoDocument(url: string, options: DocumentOptions = {}) {
return InstanceFromProto(Prototypes.get(DocumentType.VID), new VideoField(new URL(url)), options);