aboutsummaryrefslogtreecommitdiff
path: root/src/client/documents
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/documents')
-rw-r--r--src/client/documents/DocumentTypes.ts3
-rw-r--r--src/client/documents/Documents.ts18
2 files changed, 20 insertions, 1 deletions
diff --git a/src/client/documents/DocumentTypes.ts b/src/client/documents/DocumentTypes.ts
index 9dfadf778..d99cd2dac 100644
--- a/src/client/documents/DocumentTypes.ts
+++ b/src/client/documents/DocumentTypes.ts
@@ -26,6 +26,7 @@ export enum DocumentType {
FUNCPLOT = 'funcplot', // function plotter
MAP = 'map',
DATAVIZ = 'dataviz',
+ LOADING = 'loading',
// special purpose wrappers that either take no data or are compositions of lower level types
LINK = 'link',
@@ -63,5 +64,5 @@ export enum CollectionViewType {
Grid = 'grid',
Pile = 'pileup',
StackedTimeline = 'stacked timeline',
- NoteTaking = "notetaking"
+ NoteTaking = 'notetaking',
}
diff --git a/src/client/documents/Documents.ts b/src/client/documents/Documents.ts
index c7ea04839..6ccb4358a 100644
--- a/src/client/documents/Documents.ts
+++ b/src/client/documents/Documents.ts
@@ -48,6 +48,7 @@ import { KeyValueBox } from '../views/nodes/KeyValueBox';
import { LabelBox } from '../views/nodes/LabelBox';
import { LinkBox } from '../views/nodes/LinkBox';
import { LinkDescriptionPopup } from '../views/nodes/LinkDescriptionPopup';
+import { LoadingBox } from '../views/nodes/LoadingBox';
import { MapBox } from '../views/nodes/MapBox/MapBox';
import { PDFBox } from '../views/nodes/PDFBox';
import { RecordingBox } from '../views/nodes/RecordingBox/RecordingBox';
@@ -648,6 +649,13 @@ export namespace Docs {
options: { _fitWidth: true, nativeDimModifiable: true, links: '@links(self)' },
},
],
+ [
+ DocumentType.LOADING,
+ {
+ layout: { view: LoadingBox, dataField: defaultDataKey },
+ options: { _fitWidth: true, _fitHeight: true, nativeDimModifiable: true, links: '@links(self)' },
+ },
+ ],
]);
const suffix = 'Proto';
@@ -875,6 +883,16 @@ export namespace Docs {
return InstanceFromProto(Prototypes.get(DocumentType.COLOR), '', options);
}
+ export function LoadingDocument(title: string, text: string, width?: number, height?: number, options: DocumentOptions = {}) {
+ let myWidth = 300;
+ let myHeight = 300;
+ if (height && width) {
+ myWidth = width;
+ myHeight = height;
+ }
+ return InstanceFromProto(Prototypes.get(DocumentType.LOADING), '', { ...options, title, text, _width: myWidth, _height: myHeight });
+ }
+
export function RTFDocument(field: RichTextField, options: DocumentOptions = {}, fieldKey: string = 'text') {
return InstanceFromProto(Prototypes.get(DocumentType.RTF), field, options, undefined, fieldKey);
}