From 8fcb1a23224762233ebf3e519b13bc72cdfdf3c5 Mon Sep 17 00:00:00 2001 From: bobzel Date: Tue, 9 Mar 2021 09:49:03 -0500 Subject: got rid of DocHolderBox. changed dontRegisterChildViews to childDontRegisterViews for consistency. --- src/client/views/collections/collectionFreeForm/MarqueeView.tsx | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'src/client/views/collections/collectionFreeForm') diff --git a/src/client/views/collections/collectionFreeForm/MarqueeView.tsx b/src/client/views/collections/collectionFreeForm/MarqueeView.tsx index 2a30e5fd0..e625b5b4b 100644 --- a/src/client/views/collections/collectionFreeForm/MarqueeView.tsx +++ b/src/client/views/collections/collectionFreeForm/MarqueeView.tsx @@ -323,11 +323,9 @@ export class MarqueeView extends React.Component Date: Tue, 9 Mar 2021 10:50:15 -0500 Subject: fixed following portal link to reset camera position. prevent warning errors in loading screen. hide textsidebar until text is selected. fixed link titles to handle case when link anchor is the link document and not infinitely recurse. --- deploy/index.html | 29 +++++++--------------- src/client/documents/Documents.ts | 11 ++++++-- .../collectionFreeForm/CollectionFreeFormView.tsx | 2 +- .../views/nodes/formattedText/FormattedTextBox.tsx | 2 +- 4 files changed, 20 insertions(+), 24 deletions(-) (limited to 'src/client/views/collections/collectionFreeForm') diff --git a/deploy/index.html b/deploy/index.html index f2eb5e2aa..dda0c6457 100644 --- a/deploy/index.html +++ b/deploy/index.html @@ -125,26 +125,15 @@ let load = getCookie("loadtime"); document.startLoad = Date.now(); console.log("Last Load = " + load); - setTimeout(() => { - document.getElementById("dash-progress").style.width = "10%" - document.getElementById("dash-loader-text").innerHTML = "Loading Dash..." - }, load / 10); - setTimeout(() => { - document.getElementById("dash-progress").style.width = "33%" - document.getElementById("dash-loader-text").innerHTML = "Preparing dashboards..." - }, load / 3); - setTimeout(() => { - document.getElementById("dash-progress").style.width = "50%" - document.getElementById("dash-loader-text").innerHTML = "Initializing scripts..." - }, load / 2); - setTimeout(() => { - document.getElementById("dash-progress").style.width = "75%" - document.getElementById("dash-loader-text").innerHTML = "Fetching documents..." - }, load / 4 * 3); - setTimeout(() => { - document.getElementById("dash-progress").style.width = "100%" - document.getElementById("dash-loader-text").innerHTML = "Finalising setup..." - }, load); + let dashmesg = (width, msg) => { + if (document.getElementById("dash-progress")) document.getElementById("dash-progress").style.width = width + if (document.getElementById("dash-progress")) document.getElementById("dash-progress").innerHTML = msg + } + setTimeout(() => dashmesg("10%", "Loading Dash..."), load / 10); + setTimeout(() => dashmesg("33%", "Preparing dashboards..."), load / 3); + setTimeout(() => dashmesg("50%", "Initializing scripts..."), load / 2); + setTimeout(() => dashmesg("75%", "Fetching documents..."), load / 4 * 3); + setTimeout(() => dashmesg("100%", "Finalising setup..."), load);
diff --git a/src/client/documents/Documents.ts b/src/client/documents/Documents.ts index 0da80d2c4..754a0d0f8 100644 --- a/src/client/documents/Documents.ts +++ b/src/client/documents/Documents.ts @@ -59,6 +59,7 @@ import { DashWebRTCVideo } from "../views/webcam/DashWebRTCVideo"; import { DocumentType } from "./DocumentTypes"; import { EquationBox } from "../views/nodes/EquationBox"; import { FunctionPlotBox } from "../views/nodes/FunctionPlotBox"; +import { script } from "googleapis/build/src/apis/script"; const path = require('path'); const defaultNativeImageDim = Number(DFLT_IMAGE_NATIVE_DIM.replace("px", "")); @@ -1135,7 +1136,7 @@ export namespace DocUtils { linkDoc.hidden = true; Doc.GetProto(linkDoc)["acl-Public"] = linkDoc["acl-Public"] = SharingPermissions.Add; linkDoc.layout_linkView = Cast(Cast(Doc.UserDoc()["template-button-link"], Doc, null).dragFactory, Doc, null); - Doc.GetProto(linkDoc).title = ComputedField.MakeFunction('self.anchor1?.title +" (" + (self.linkRelationship||"to") +") " + self.anchor2?.title'); + Doc.GetProto(linkDoc).title = ComputedField.MakeFunction("generateLinkTitle(self)"); showPopup && makeLink(linkDoc, showPopup); return linkDoc; } @@ -1416,4 +1417,10 @@ export namespace DocUtils { } Scripting.addGlobal("Docs", Docs); -Scripting.addGlobal(function makeDelegate(proto: any) { const d = Docs.Create.DelegateDocument(proto, { title: "child of " + proto.title }); return d; }); \ No newline at end of file +Scripting.addGlobal(function makeDelegate(proto: any) { const d = Docs.Create.DelegateDocument(proto, { title: "child of " + proto.title }); return d; }); +Scripting.addGlobal(function generateLinkTitle(self: Doc) { + const anchor1title = self.anchor1 && self.anchor1 !== self ? Cast(self.anchor1, Doc, null).title : ""; + const anchor2title = self.anchor2 && self.anchor2 !== self ? Cast(self.anchor2, Doc, null).title : ""; + const relation = self.linkRelationship || "to"; + return `${anchor1title} (${relation}) ${anchor2title}`; +}) \ No newline at end of file diff --git a/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx b/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx index 660790b11..ec5cb8a61 100644 --- a/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx +++ b/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx @@ -950,7 +950,7 @@ export class CollectionFreeFormView extends CollectionSubView d?.author).length; - return