aboutsummaryrefslogtreecommitdiff
path: root/src/client/documents/Documents.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/documents/Documents.ts')
-rw-r--r--src/client/documents/Documents.ts29
1 files changed, 17 insertions, 12 deletions
diff --git a/src/client/documents/Documents.ts b/src/client/documents/Documents.ts
index b32cbd3d0..080270321 100644
--- a/src/client/documents/Documents.ts
+++ b/src/client/documents/Documents.ts
@@ -151,7 +151,10 @@ export interface DocumentOptions {
_curPage?: number;
_currentTimecode?: number; // the current timecode of a time-based document (e.g., current time of a video) value is in seconds
_currentFrame?: number; // the current frame of a frame-based collection (e.g., progressive slide)
- displayTimecode?: number; // the time that a document should be displayed (e.g., time an annotation should be displayed on a video)
+ _timecodeToShow?: number; // the time that a document should be displayed (e.g., when an annotation shows up as a video plays)
+ _timecodeToHide?: number; // the time that a document should be hidden
+ anchorStartTime?: number; // the time when an annotation starts on a timeline (e.g., when an audio anchor starts on an audio/video timeline)
+ anchorEndTime?: number; // the time when an annotaiton ends on a timeline
lastFrame?: number; // the last frame of a frame-based collection (e.g., progressive slide)
activeFrame?: number; // the active frame of a document in a frame base collection
appearFrame?: number; // the frame in which the document appears
@@ -226,8 +229,6 @@ export interface DocumentOptions {
linearViewIsExpanded?: boolean; // is linear view expanded
isLabel?: boolean; // whether the document is a label or not (video / audio)
useLinkSmallAnchor?: boolean; // whether links to this document should use a miniature linkAnchorBox
- audioStart?: number; // the time frame where the audio should begin playing
- audioEnd?: number; // the time frame where the audio should stop playing
border?: string; //for searchbox
hovercolor?: string;
}
@@ -280,7 +281,7 @@ export namespace Docs {
}],
[DocumentType.WEB, {
layout: { view: WebBox, dataField: defaultDataKey },
- options: { _height: 300 }
+ options: { _height: 300, scrollHeight: 100000, _fitWidth: true }
}],
[DocumentType.COL, {
layout: { view: CollectionView, dataField: defaultDataKey },
@@ -304,7 +305,7 @@ export namespace Docs {
}],
[DocumentType.PDF, {
layout: { view: PDFBox, dataField: defaultDataKey },
- options: { _curPage: 1 }
+ options: { _curPage: 1, _fitWidth: true }
}],
[DocumentType.IMPORT, {
layout: { view: DirectoryImportBox, dataField: defaultDataKey },
@@ -721,8 +722,8 @@ export namespace Docs {
linkDocProto.treeViewOpen = true;// setting this in the instance creator would set it on the view document.
linkDocProto.anchor1 = source.doc;
linkDocProto.anchor2 = target.doc;
- linkDocProto.anchor1_timecode = source.doc._currentTimecode || source.doc.displayTimecode;
- linkDocProto.anchor2_timecode = target.doc._currentTimecode || target.doc.displayTimecode;
+ linkDocProto.anchor1_timecode = source.doc._currentTimecode || source.doc._timecodeToShow;
+ linkDocProto.anchor2_timecode = target.doc._currentTimecode || target.doc._timecodeToShow;
if (linkDocProto.linkBoxExcludedKeys === undefined) {
Cast(linkDocProto.proto, Doc, null).linkBoxExcludedKeys = new List(["treeViewExpandedView", "aliases", "treeViewHideTitle", "removeDropProperties", "linkBoxExcludedKeys", "treeViewOpen", "aliasNumber", "isPrototype", "creationDate", "author"]);
@@ -764,11 +765,16 @@ export namespace Docs {
}
export function PdfDocument(url: string, options: DocumentOptions = {}) {
- return InstanceFromProto(Prototypes.get(DocumentType.PDF), new PdfField(new URL(url)), options);
+ const pdfProto = Prototypes.get(DocumentType.PDF);
+ pdfProto._fitWidth = true; // backward compatibility -- can be removed after db is reset
+ return InstanceFromProto(pdfProto, new PdfField(new URL(url)), options);
}
export function WebDocument(url: string, options: DocumentOptions = {}) {
- return InstanceFromProto(Prototypes.get(DocumentType.WEB), url ? new WebField(new URL(url)) : undefined, { _fitWidth: true, _chromeStatus: url ? "disabled" : "enabled", isAnnotating: false, _lockedTransform: true, ...options });
+ const webProto = Prototypes.get(DocumentType.WEB);
+ webProto.scrollHeight = 100000; // backward compatibility -- can be removed after db is reset
+ webProto._fitWidth = true; // backward compatibility -- can be removed after db is reset
+ return InstanceFromProto(webProto, url ? new WebField(new URL(url)) : undefined, { _chromeStatus: url ? "disabled" : "enabled", isAnnotating: false, _lockedTransform: true, ...options });
}
export function HtmlDocument(html: string, options: DocumentOptions = {}) {
@@ -1110,7 +1116,6 @@ export namespace DocUtils {
}
if (type.indexOf("pdf") !== -1) {
ctor = Docs.Create.PdfDocument;
- if (!options._fitWidth) options._fitWidth = true;
if (!options._width) options._width = 400;
if (!options._height) options._height = options._width * 1200 / 927;
}
@@ -1131,7 +1136,7 @@ export namespace DocUtils {
});
}
ctor = Docs.Create.WebDocument;
- options = { ...options, _fitWidth: true, _width: 400, _height: 512, title: path, };
+ options = { ...options, _width: 400, _height: 512, title: path, };
}
return ctor ? ctor(path, options) : undefined;
}
@@ -1247,7 +1252,7 @@ export namespace DocUtils {
docList.forEach((d, i) => {
d.x = Math.cos(Math.PI * 2 * i / docList.length) * 10 - w / 2;
d.y = Math.sin(Math.PI * 2 * i / docList.length) * 10 - h / 2;
- d.displayTimecode = undefined; // bcz: this should be automatic somehow.. along with any other properties that were logically associated with the original collection
+ d._timecodeToShow = undefined; // bcz: this should be automatic somehow.. along with any other properties that were logically associated with the original collection
});
});
if (x !== undefined && y !== undefined) {