aboutsummaryrefslogtreecommitdiff
path: root/src/client/documents/Documents.ts
diff options
context:
space:
mode:
authorHannah Chow <hannah_chow@brown.edu>2019-03-11 17:11:43 -0400
committerHannah Chow <hannah_chow@brown.edu>2019-03-11 17:11:43 -0400
commit281b4e05a7fbd6b038782d9708839bf7edcf398d (patch)
treed91d9d4b45571b35c6b84d31de8af0487c4aaa2e /src/client/documents/Documents.ts
parentfe4f37c9986e0a6500d63b46e2238b0e0efb102b (diff)
parent618e66a5a070f1aac9224bd3f44b76a5ac314bfa (diff)
uhhhh
Diffstat (limited to 'src/client/documents/Documents.ts')
-rw-r--r--src/client/documents/Documents.ts25
1 files changed, 8 insertions, 17 deletions
diff --git a/src/client/documents/Documents.ts b/src/client/documents/Documents.ts
index d22e61fb7..14ee7f2fd 100644
--- a/src/client/documents/Documents.ts
+++ b/src/client/documents/Documents.ts
@@ -22,6 +22,7 @@ import { AudioBox } from "../views/nodes/AudioBox";
import { PDFField } from "../../fields/PDFField";
import { PDFBox } from "../views/nodes/PDFBox";
import { CollectionPDFView } from "../views/collections/CollectionPDFView";
+import { RichTextField } from "../../fields/RichTextField";
export interface DocumentOptions {
x?: number;
@@ -45,8 +46,8 @@ export namespace Documents {
let webProto: Document;
let collProto: Document;
let kvpProto: Document;
- let videoProto: Document;
- let audioProto: Document;
+ let videoProto: Document;
+ let audioProto: Document;
let pdfProto: Document;
const textProtoId = "textProto";
const pdfProtoId = "pdfProto";
@@ -150,24 +151,14 @@ export namespace Documents {
// doc.SetText(KeyStore.OverlayLayout, FixedCaption());
return doc;
}
- export function VideoDocument(url: string, options: DocumentOptions = {}){
- let doc = SetInstanceOptions(GetVideoPrototype(), { ...options, layoutKeys: [KeyStore.Data, KeyStore.Annotations, KeyStore.Caption] },
- new URL(url), VideoField);
- doc.SetText(KeyStore.Caption, "my caption...");
- doc.SetText(KeyStore.BackgroundLayout, EmbeddedCaption());
- doc.SetText(KeyStore.OverlayLayout, FixedCaption());
- return doc;
+ export function VideoDocument(url: string, options: DocumentOptions = {}) {
+ return SetInstanceOptions(GetVideoPrototype(), options, new URL(url), VideoField);
}
- export function AudioDocument(url: string, options: DocumentOptions = {}){
- let doc = SetInstanceOptions(GetAudioPrototype(), { ...options, layoutKeys: [KeyStore.Data, KeyStore.Annotations, KeyStore.Caption] },
- new URL(url), AudioField);
- doc.SetText(KeyStore.Caption, "my caption...");
- doc.SetText(KeyStore.BackgroundLayout, EmbeddedCaption());
- doc.SetText(KeyStore.OverlayLayout, FixedCaption());
- return doc;
+ export function AudioDocument(url: string, options: DocumentOptions = {}) {
+ return SetInstanceOptions(GetAudioPrototype(), options, new URL(url), AudioField);
}
export function TextDocument(options: DocumentOptions = {}) {
- return SetInstanceOptions(GetTextPrototype(), options, "", TextField);
+ return SetInstanceOptions(GetTextPrototype(), options, "", RichTextField);
}
export function PdfDocument(url: string, options: DocumentOptions = {}) {
return SetInstanceOptions(GetPdfPrototype(), options, new URL(url), PDFField);