aboutsummaryrefslogtreecommitdiff
path: root/src/fields
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2023-08-27 20:25:55 -0400
committerbobzel <zzzman@gmail.com>2023-08-27 20:25:55 -0400
commit9d6c7f8100de3a952d20ad41ab20872737cb909e (patch)
tree4e0ac145e4f22649b6516819f094e5ba0e6d6829 /src/fields
parent9405a97acabb70ac671029f61e825ba00a8dc3ce (diff)
lots of cleanup to streamline import orderings (ie packages should not mutually import each other directly or via a chain). change raiseWhenDragged to be keepZWhenDragged and got rid of system wide default.
Diffstat (limited to 'src/fields')
-rw-r--r--src/fields/Doc.ts26
-rw-r--r--src/fields/RichTextUtils.ts10
2 files changed, 26 insertions, 10 deletions
diff --git a/src/fields/Doc.ts b/src/fields/Doc.ts
index 4ad38e7fc..f17e10d9e 100644
--- a/src/fields/Doc.ts
+++ b/src/fields/Doc.ts
@@ -47,7 +47,7 @@ import { FieldId, RefField } from './RefField';
import { RichTextField } from './RichTextField';
import { listSpec } from './Schema';
import { ComputedField, ScriptField } from './ScriptField';
-import { Cast, DocCast, FieldValue, NumCast, StrCast, ToConstructor } from './Types';
+import { BoolCast, Cast, DocCast, FieldValue, NumCast, StrCast, ToConstructor } from './Types';
import { AudioField, CsvField, ImageField, PdfField, VideoField, WebField } from './URLField';
import { containedFieldChangedHandler, deleteProperty, GetEffectiveAcl, getField, getter, makeEditable, makeReadOnly, normalizeEmail, setter, SharingPermissions } from './util';
import JSZip = require('jszip');
@@ -156,7 +156,26 @@ export function updateCachedAcls(doc: Doc) {
@scriptingGlobal
@Deserializable('Doc', updateCachedAcls, ['id'])
export class Doc extends RefField {
- @observable public static CurrentlyLoading: Doc[];
+ @observable public static RecordingEvent = 0;
+
+ // this isn't really used at the moment, but is intended to indicate whether ink stroke are passed through a gesture recognizer
+ static GetRecognizeGestures() {
+ return BoolCast(Doc.UserDoc()._recognizeGestures);
+ }
+ static SetRecognizeGestures(show: boolean) {
+ Doc.UserDoc()._recognizeGestures = show;
+ }
+
+ //
+ // This controls whether fontIconButtons will display labels under their icons or not
+ //
+ static GetShowIconLabels() {
+ return BoolCast(Doc.UserDoc()._showLabel);
+ }
+ static SetShowIconLabels(show: boolean) {
+ Doc.UserDoc()._showLabel = show;
+ }
+ @observable public static CurrentlyLoading: Doc[] = []; // this assignment doesn't work. the actual assignment happens in DocumentManager's constructor
// removes from currently loading display
@action
public static removeCurrentlyLoading(doc: Doc) {
@@ -169,9 +188,6 @@ export class Doc extends RefField {
// adds doc to currently loading display
@action
public static addCurrentlyLoading(doc: Doc) {
- if (!Doc.CurrentlyLoading) {
- Doc.CurrentlyLoading = [];
- }
if (Doc.CurrentlyLoading.indexOf(doc) === -1) {
Doc.CurrentlyLoading.push(doc);
}
diff --git a/src/fields/RichTextUtils.ts b/src/fields/RichTextUtils.ts
index 24cd078f2..5ecf25e08 100644
--- a/src/fields/RichTextUtils.ts
+++ b/src/fields/RichTextUtils.ts
@@ -2,20 +2,20 @@ import { AssertionError } from 'assert';
import { docs_v1 } from 'googleapis';
import { Fragment, Mark, Node } from 'prosemirror-model';
import { sinkListItem } from 'prosemirror-schema-list';
-import { Utils, DashColor } from '../Utils';
-import { Docs, DocUtils } from '../client/documents/Documents';
-import { schema } from '../client/views/nodes/formattedText/schema_rts';
+import { EditorState, TextSelection, Transaction } from 'prosemirror-state';
+import { GoogleApiClientUtils } from '../client/apis/google_docs/GoogleApiClientUtils';
import { GooglePhotos } from '../client/apis/google_docs/GooglePhotosClientUtils';
import { DocServer } from '../client/DocServer';
+import { Docs, DocUtils } from '../client/documents/Documents';
import { Networking } from '../client/Network';
import { FormattedTextBox } from '../client/views/nodes/formattedText/FormattedTextBox';
+import { schema } from '../client/views/nodes/formattedText/schema_rts';
+import { DashColor, Utils } from '../Utils';
import { Doc, Opt } from './Doc';
import { Id } from './FieldSymbols';
import { RichTextField } from './RichTextField';
import { Cast, StrCast } from './Types';
import Color = require('color');
-import { EditorState, TextSelection, Transaction } from 'prosemirror-state';
-import { GoogleApiClientUtils } from '../client/apis/google_docs/GoogleApiClientUtils';
export namespace RichTextUtils {
const delimiter = '\n';