diff options
| author | Bob Zeleznik <zzzman@gmail.com> | 2019-03-14 00:23:39 -0400 |
|---|---|---|
| committer | Bob Zeleznik <zzzman@gmail.com> | 2019-03-14 00:23:39 -0400 |
| commit | 100156a0cb778694455a04c8e254054b79f6a06f (patch) | |
| tree | 6418bcc043ace5400c1ce0c1e372c89fc596b215 /src/client/documents | |
| parent | a7952cb33a695d7dd1dc89f5ffe0a98a2e0dfeff (diff) | |
| parent | 41f458fb4f383bfbf8d5b651189c2f4731262ff8 (diff) | |
Merge branch 'master' into ui_improvements
Diffstat (limited to 'src/client/documents')
| -rw-r--r-- | src/client/documents/Documents.ts | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/src/client/documents/Documents.ts b/src/client/documents/Documents.ts index 4edf0229d..8fe20994e 100644 --- a/src/client/documents/Documents.ts +++ b/src/client/documents/Documents.ts @@ -23,6 +23,7 @@ import { PDFField } from "../../fields/PDFField"; import { PDFBox } from "../views/nodes/PDFBox"; import { CollectionPDFView } from "../views/collections/CollectionPDFView"; import { RichTextField } from "../../fields/RichTextField"; +import { CollectionVideoView } from "../views/collections/CollectionVideoView"; export interface DocumentOptions { x?: number; @@ -137,9 +138,13 @@ export namespace Documents { { x: 0, y: 0, width: 300, height: 150, layoutKeys: [KeyStore.Data] }) } function GetVideoPrototype(): Document { - return videoProto ? videoProto : - videoProto = setupPrototypeOptions(videoProtoId, "VIDEO_PROTO", VideoBox.LayoutString(), - { x: 0, y: 0, width: 300, height: 150, layoutKeys: [KeyStore.Data] }) + if (!videoProto) { + videoProto = setupPrototypeOptions(videoProtoId, "VIDEO_PROTO", CollectionVideoView.LayoutString("AnnotationsKey"), + { x: 0, y: 0, nativeWidth: 600, width: 300, layoutKeys: [KeyStore.Data, KeyStore.Annotations] }); + videoProto.SetNumber(KeyStore.CurPage, 0); + videoProto.SetText(KeyStore.BackgroundLayout, VideoBox.LayoutString()); + } + return videoProto; } function GetAudioPrototype(): Document { return audioProto ? audioProto : @@ -151,6 +156,8 @@ export namespace Documents { export function ImageDocument(url: string, options: DocumentOptions = {}) { return SetInstanceOptions(GetImagePrototype(), { ...options, layoutKeys: [KeyStore.Data, KeyStore.Annotations, KeyStore.Caption] }, [new URL(url), ImageField]); + // let doc = SetInstanceOptions(GetImagePrototype(), { ...options, layoutKeys: [KeyStore.Data, KeyStore.Annotations, KeyStore.Caption] }, + // [new URL(url), ImageField]); // doc.SetText(KeyStore.Caption, "my caption..."); // doc.SetText(KeyStore.BackgroundLayout, EmbeddedCaption()); // doc.SetText(KeyStore.OverlayLayout, FixedCaption()); @@ -190,7 +197,7 @@ export namespace Documents { // example of custom display string for an image that shows a caption. function EmbeddedCaption() { return `<div style="height:100%"> - <div style="position:relative; margin:auto; height:85%;" >` + <div style="position:relative; margin:auto; height:85%; width:85%;" >` + ImageBox.LayoutString() + `</div> <div style="position:relative; height:15%; text-align:center; ">` |
