aboutsummaryrefslogtreecommitdiff
path: root/src/fields
diff options
context:
space:
mode:
Diffstat (limited to 'src/fields')
-rw-r--r--src/fields/DateField.ts4
-rw-r--r--src/fields/Doc.ts4
-rw-r--r--src/fields/RichTextUtils.ts2
-rw-r--r--src/fields/util.ts2
4 files changed, 9 insertions, 3 deletions
diff --git a/src/fields/DateField.ts b/src/fields/DateField.ts
index a925148c2..bee62663e 100644
--- a/src/fields/DateField.ts
+++ b/src/fields/DateField.ts
@@ -29,6 +29,10 @@ export class DateField extends ObjectField {
[ToString]() {
return this.date.toISOString();
}
+
+ getDate() {
+ return this.date;
+ }
}
Scripting.addGlobal(function d(...dateArgs: any[]) {
diff --git a/src/fields/Doc.ts b/src/fields/Doc.ts
index e4d11dd4d..7aa1d528d 100644
--- a/src/fields/Doc.ts
+++ b/src/fields/Doc.ts
@@ -832,12 +832,14 @@ export namespace Doc {
})(doc);
}
export function BrushDoc(doc: Doc) {
+
if (!doc || doc[AclSym] === AclPrivate || Doc.GetProto(doc)[AclSym] === AclPrivate) return doc;
brushManager.BrushedDoc.set(doc, true);
brushManager.BrushedDoc.set(Doc.GetProto(doc), true);
return doc;
}
export function UnBrushDoc(doc: Doc) {
+
if (!doc || doc[AclSym] === AclPrivate || Doc.GetProto(doc)[AclSym] === AclPrivate) return doc;
brushManager.BrushedDoc.delete(doc);
brushManager.BrushedDoc.delete(Doc.GetProto(doc));
@@ -965,7 +967,7 @@ export namespace Doc {
container._docFilters = new List<string>(docFilters);
}
}
- })
+ });
}
export function readDocRangeFilter(doc: Doc, key: string) {
const docRangeFilters = Cast(doc._docRangeFilters, listSpec("string"), []);
diff --git a/src/fields/RichTextUtils.ts b/src/fields/RichTextUtils.ts
index 7c7bf3e12..a590c88c4 100644
--- a/src/fields/RichTextUtils.ts
+++ b/src/fields/RichTextUtils.ts
@@ -392,7 +392,7 @@ export namespace RichTextUtils {
const { attrs } = mark;
switch (converted) {
case "link":
- let url = attrs.allHrefs.length ? attrs.allHrefs[0].href : "";
+ let url = attrs.allLinks.length ? attrs.allLinks[0].href : "";
const delimiter = "/doc/";
const alreadyShared = "?sharing=true";
if (new RegExp(window.location.origin + delimiter).test(url) && !url.endsWith(alreadyShared)) {
diff --git a/src/fields/util.ts b/src/fields/util.ts
index 2869ebed1..2dc21c987 100644
--- a/src/fields/util.ts
+++ b/src/fields/util.ts
@@ -78,7 +78,7 @@ const _setterImpl = action(function (target: any, prop: string | symbol | number
} else {
target.__fields[prop] = value;
}
- if (typeof value === "object" && !(value instanceof ObjectField)) debugger;
+ //if (typeof value === "object" && !(value instanceof ObjectField)) debugger;
if (writeToServer) {
if (value === undefined) target[Update]({ '$unset': { ["fields." + prop]: "" } });
else target[Update]({ '$set': { ["fields." + prop]: value instanceof ObjectField ? SerializationHelper.Serialize(value) : (value === undefined ? null : value) } });