aboutsummaryrefslogtreecommitdiff
path: root/src/client/documents/Documents.ts
diff options
context:
space:
mode:
authorsrichman333 <sarah_n_richman@brown.edu>2023-07-31 11:24:50 -0400
committersrichman333 <sarah_n_richman@brown.edu>2023-07-31 11:24:50 -0400
commit71c3072bb253682ed16861de24bcb141ccf7f79e (patch)
treea9ae65c5ebce119dd3f85dfea6ce50b75d44ca71 /src/client/documents/Documents.ts
parentb236882faef4e5434158e7a8dfb82daa47031ca5 (diff)
parent08f125f5880247280c02633feeb31a8df1912b97 (diff)
Merge branch 'master' into data-visualization-sarah
Diffstat (limited to 'src/client/documents/Documents.ts')
-rw-r--r--src/client/documents/Documents.ts27
1 files changed, 22 insertions, 5 deletions
diff --git a/src/client/documents/Documents.ts b/src/client/documents/Documents.ts
index 426eaa14d..8fbf73a72 100644
--- a/src/client/documents/Documents.ts
+++ b/src/client/documents/Documents.ts
@@ -58,6 +58,7 @@ import { SliderBox } from '../views/nodes/SliderBox';
import { TaskCompletionBox } from '../views/nodes/TaskCompletedBox';
import { PresBox } from '../views/nodes/trails/PresBox';
import { PresElementBox } from '../views/nodes/trails/PresElementBox';
+import { ImportElementBox } from '../views/nodes/importBox/ImportElementBox';
import { VideoBox } from '../views/nodes/VideoBox';
import { WebBox } from '../views/nodes/WebBox';
import { SearchBox } from '../views/search/SearchBox';
@@ -354,6 +355,7 @@ export class DocumentOptions {
onDoubleClick?: ScriptField;
onChildClick?: ScriptField; // script given to children of a collection to execute when they are clicked
onChildDoubleClick?: ScriptField; // script given to children of a collection to execute when they are double clicked
+ onClickScriptDisable?: STRt = new StrInfo('"always" disable click script, "never" disable click script, or default');
defaultDoubleClick?: 'ignore' | 'default'; // ignore double clicks, or deafult (undefined) means open document full screen
waitForDoubleClickToClick?: 'always' | 'never' | 'default'; // whether a click function wait for double click to expire. 'default' undefined = wait only if there's a click handler, "never" = never wait, "always" = alway wait
onPointerDown?: ScriptField;
@@ -620,7 +622,7 @@ export namespace Docs {
DocumentType.WEBCAM,
{
layout: { view: RecordingBox, dataField: defaultDataKey },
- options: { systemIcon: 'BsFillCameraVideoFill' },
+ options: { systemIcon: 'BsFillCameraVideoFill' },
},
],
[
@@ -634,7 +636,7 @@ export namespace Docs {
DocumentType.CONFIG,
{
layout: { view: CollectionView, dataField: defaultDataKey },
- options: { layout_hideLinkButton: true, pointerEvents: 'none', layout_unrendered: true },
+ options: { layout_hideLinkButton: true, layout_unrendered: true },
},
],
[
@@ -693,7 +695,22 @@ export namespace Docs {
{
data: '',
layout: { view: PhysicsSimulationBox, dataField: defaultDataKey, _width: 1000, _height: 800 },
- options: { _height: 100, layout_forceReflow: true, nativeHeightUnfrozen: true, mass1: '', mass2: '', nativeDimModifiable: true, position: '', acceleration: '', pendulum: '', spring: '', wedge: '', simulation: '', review: '', systemIcon: 'BsShareFill' },
+ options: {
+ _height: 100,
+ layout_forceReflow: true,
+ nativeHeightUnfrozen: true,
+ mass1: '',
+ mass2: '',
+ nativeDimModifiable: true,
+ position: '',
+ acceleration: '',
+ pendulum: '',
+ spring: '',
+ wedge: '',
+ simulation: '',
+ review: '',
+ systemIcon: 'BsShareFill',
+ },
},
],
]);
@@ -837,7 +854,7 @@ export namespace Docs {
dataProps.author_date = new DateField();
if (fieldKey) {
dataProps[`${fieldKey}_modificationDate`] = new DateField();
- dataProps[fieldKey] = data;
+ dataProps[fieldKey] = options.data ?? data;
// so that the list of annotations is already initialised, prevents issues in addonly.
// without this, if a doc has no annotations but the user has AddOnly privileges, they won't be able to add an annotation because they would have needed to create the field's list which they don't have permissions to do.
@@ -1731,7 +1748,7 @@ export namespace DocUtils {
return;
}
const full = { ...options, _width: 400, title: name };
- const pathname = Utils.prepend(result.accessPaths.agnostic.client);
+ const pathname = result.accessPaths.agnostic.client;
const doc = await DocUtils.DocumentFromType(type, pathname, full, overwriteDoc);
if (doc) {
const proto = Doc.GetProto(doc);