aboutsummaryrefslogtreecommitdiff
path: root/src/fields
diff options
context:
space:
mode:
Diffstat (limited to 'src/fields')
-rw-r--r--src/fields/Doc.ts6
-rw-r--r--src/fields/InkField.ts5
2 files changed, 7 insertions, 4 deletions
diff --git a/src/fields/Doc.ts b/src/fields/Doc.ts
index f4505d475..6163fedbb 100644
--- a/src/fields/Doc.ts
+++ b/src/fields/Doc.ts
@@ -627,7 +627,7 @@ export namespace Doc {
const zip = new JSZip();
- zip.file("doc.json", docString);
+ zip.file(doc.title + ".json", docString);
// // Generate a directory within the Zip file structure
// var img = zip.folder("images");
@@ -639,7 +639,7 @@ export namespace Doc {
zip.generateAsync({ type: "blob" })
.then((content: any) => {
// Force down of the Zip file
- saveAs(content, "download.zip");
+ saveAs(content, doc.title + ".zip"); // glr: Possibly change the name of the document to match the title?
});
}
//
@@ -1266,4 +1266,4 @@ Scripting.addGlobal(function selectedDocs(container: Doc, excludeCollections: bo
return docs.length ? new List(docs) : prevValue;
});
Scripting.addGlobal(function setDocFilter(container: Doc, key: string, value: any, modifiers?: "match" | "check" | "x" | undefined) { Doc.setDocFilter(container, key, value, modifiers); });
-Scripting.addGlobal(function setDocFilterRange(container: Doc, key: string, range: number[]) { Doc.setDocFilterRange(container, key, range); }); \ No newline at end of file
+Scripting.addGlobal(function setDocFilterRange(container: Doc, key: string, range: number[]) { Doc.setDocFilterRange(container, key, range); });
diff --git a/src/fields/InkField.ts b/src/fields/InkField.ts
index 7cfd74cc4..dbe51b24a 100644
--- a/src/fields/InkField.ts
+++ b/src/fields/InkField.ts
@@ -2,6 +2,7 @@ import { Deserializable } from "../client/util/SerializationHelper";
import { serializable, custom, createSimpleSchema, list, object, map } from "serializr";
import { ObjectField } from "./ObjectField";
import { Copy, ToScriptString, ToString, Update } from "./FieldSymbols";
+import { Scripting } from "../client/util/Scripting";
export enum InkTool {
None = "none",
@@ -44,9 +45,11 @@ export class InkField extends ObjectField {
}
[ToScriptString]() {
- return "invalid";
+ return "new InkField([" + this.inkData.map(i => `{X: ${i.X}, Y: ${i.Y}} `) + "])";
}
[ToString]() {
return "InkField";
}
}
+
+Scripting.addGlobal("InkField", InkField); \ No newline at end of file