diff options
author | Geireann <60007097+geireann@users.noreply.github.com> | 2021-04-08 16:13:48 -0400 |
---|---|---|
committer | Geireann <60007097+geireann@users.noreply.github.com> | 2021-04-08 16:13:48 -0400 |
commit | 17075237d6450d56c36823b1f31f5c16034f32f9 (patch) | |
tree | 3e0498e5b35303f3fdef70002f0960aa631542db /src/fields/Doc.ts | |
parent | 7fdc6ee98eb77b6c46ebaf09b2eb308d5a317c78 (diff) | |
parent | 5b1de482065a9aaec5ad026c9fecb2c8ae513fd3 (diff) |
Merge branch 'master' into demo_changes
Diffstat (limited to 'src/fields/Doc.ts')
-rw-r--r-- | src/fields/Doc.ts | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/fields/Doc.ts b/src/fields/Doc.ts index 5b3e21e34..2203fc876 100644 --- a/src/fields/Doc.ts +++ b/src/fields/Doc.ts @@ -201,7 +201,7 @@ export class Doc extends RefField { public [FieldsSym] = () => this[Self].___fields; // Object.keys(this).reduce((fields, key) => { fields[key] = this[key]; return fields; }, {} as any); public [WidthSym] = () => NumCast(this[SelfProxy]._width); public [HeightSym] = () => NumCast(this[SelfProxy]._height); - public [ToScriptString] = () => `DOC-"${this[Self][Id]}"-`; + public [ToScriptString] = () => `idToDoc("${this[Self][Id]}")`; public [ToString] = () => `Doc(${GetEffectiveAcl(this[SelfProxy]) === AclPrivate ? "-inaccessible-" : this[SelfProxy].title})`; public get [LayoutSym]() { return this[SelfProxy].__LAYOUT__; } public get [DataSym]() { @@ -1325,6 +1325,7 @@ export namespace Doc { } +Scripting.addGlobal(function idToDoc(id: string) { return DocServer.GetCachedRefField(id); }); Scripting.addGlobal(function renameAlias(doc: any, n: any) { return StrCast(Doc.GetProto(doc).title).replace(/\([0-9]*\)/, "") + `(${n})`; }); Scripting.addGlobal(function getProto(doc: any) { return Doc.GetProto(doc); }); Scripting.addGlobal(function getDocTemplate(doc?: any) { return Doc.getDocTemplate(doc); }); |