aboutsummaryrefslogtreecommitdiff
path: root/src/client/documents/Documents.ts
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2022-03-07 12:14:39 -0500
committerbobzel <zzzman@gmail.com>2022-03-07 12:14:39 -0500
commitc21919a2105bd1ed4f060be149624d064739a36c (patch)
treee88bbc4db244a08bd759e2985a31593a4b521911 /src/client/documents/Documents.ts
parent7fa30c3edd851cc42cb68063d9dbdd7335fe7370 (diff)
got rid of include cycles for Scripting globals to make hot updates work better.
Diffstat (limited to 'src/client/documents/Documents.ts')
-rw-r--r--src/client/documents/Documents.ts10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/client/documents/Documents.ts b/src/client/documents/Documents.ts
index b81037085..e2f82fc62 100644
--- a/src/client/documents/Documents.ts
+++ b/src/client/documents/Documents.ts
@@ -23,7 +23,7 @@ import { DocumentManager } from "../util/DocumentManager";
import { dropActionType } from "../util/DragManager";
import { DirectoryImportBox } from "../util/Import & Export/DirectoryImportBox";
import { LinkManager } from "../util/LinkManager";
-import { Scripting } from "../util/Scripting";
+import { ScriptingGlobals } from "../util/ScriptingGlobals";
import { undoBatch, UndoManager } from "../util/UndoManager";
import { CollectionDockingView } from "../views/collections/CollectionDockingView";
import { DimUnit } from "../views/collections/collectionMulticolumn/CollectionMulticolumnView";
@@ -1493,14 +1493,14 @@ 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; });
-Scripting.addGlobal(function generateLinkTitle(self: Doc) {
+ScriptingGlobals.add("Docs", Docs);
+ScriptingGlobals.add(function makeDelegate(proto: any) { const d = Docs.Create.DelegateDocument(proto, { title: "child of " + proto.title }); return d; });
+ScriptingGlobals.add(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}`;
});
-Scripting.addGlobal(function openTabAlias(tab: Doc) {
+ScriptingGlobals.add(function openTabAlias(tab: Doc) {
CollectionDockingView.AddSplit(Doc.MakeAlias(tab), "right");
}); \ No newline at end of file