From cbce4b61ab4d11f3210ca004b935fae65b023408 Mon Sep 17 00:00:00 2001
From: brynnchernosky <56202540+brynnchernosky@users.noreply.github.com>
Date: Fri, 20 Jan 2023 10:48:58 -0500
Subject: add new view
---
src/client/views/nodes/DocumentContentsView.tsx | 2 ++
src/client/views/nodes/PhysicsSimulationBox.scss | 0
src/client/views/nodes/PhysicsSimulationBox.tsx | 9 +++++++++
3 files changed, 11 insertions(+)
create mode 100644 src/client/views/nodes/PhysicsSimulationBox.scss
create mode 100644 src/client/views/nodes/PhysicsSimulationBox.tsx
(limited to 'src/client/views')
diff --git a/src/client/views/nodes/DocumentContentsView.tsx b/src/client/views/nodes/DocumentContentsView.tsx
index 569579996..c6818bf3c 100644
--- a/src/client/views/nodes/DocumentContentsView.tsx
+++ b/src/client/views/nodes/DocumentContentsView.tsx
@@ -34,6 +34,7 @@ import { LinkAnchorBox } from './LinkAnchorBox';
import { LinkBox } from './LinkBox';
import { MapBox } from './MapBox/MapBox';
import { PDFBox } from './PDFBox';
+import PhysicsSimulationBox from './PhysicsSimulationBox'
import { RecordingBox } from './RecordingBox';
import { ScreenshotBox } from './ScreenshotBox';
import { ScriptingBox } from './ScriptingBox';
@@ -268,6 +269,7 @@ export class DocumentContentsView extends React.Component<
HTMLtag,
ComparisonBox,
LoadingBox,
+ PhysicsSimulationBox,
}}
bindings={bindings}
jsx={layoutFrame}
diff --git a/src/client/views/nodes/PhysicsSimulationBox.scss b/src/client/views/nodes/PhysicsSimulationBox.scss
new file mode 100644
index 000000000..e69de29bb
diff --git a/src/client/views/nodes/PhysicsSimulationBox.tsx b/src/client/views/nodes/PhysicsSimulationBox.tsx
new file mode 100644
index 000000000..b62caf926
--- /dev/null
+++ b/src/client/views/nodes/PhysicsSimulationBox.tsx
@@ -0,0 +1,9 @@
+import "./PhysicsSimulationBox.scss";
+import { FieldView, FieldViewProps } from './FieldView';
+import React = require('react');
+
+export default class PhysicsSimulationBox extends React.Component Hello world! Hello world! Hello world! {questionPartOne} {questionPartTwo} {selectedTutorial.question} {selectedTutorial.steps[stepNumber].content} Resources setMode("Tutorial")}
+ >
+ {" "}
+ Go to walkthrough{" "}
+ Red Weight
+ {positionXDisplay} m
+
+ {positionYDisplay} m
+
+ {velocityXDisplay} m/s
+
+ {velocityYDisplay} m/s
+
+ {Math.round(((angleInRadians * 180) / Math.PI) * 100) / 100}°
+ {mass} kg
+ {Math.round(pendulumLength)} m
+
+ {Math.round(pendulumAngle * 100) / 100}°
+
+ {Math.round(
+ 100 *
+ Math.sqrt(
+ Math.pow(getNewAccelerationX(updatedForces) * 3, 2) +
+ Math.pow(getNewAccelerationY(updatedForces) * 3, 2)
+ )
+ ) / 100}{" "}
+ m/s2
+
+ {Math.round(
+ 100 * Math.sqrt(xVelocity * xVelocity + yVelocity * yVelocity)
+ ) / 100}{" "}
+ m/s
+ {force.description} Force {Math.round(100 * force.magnitude) / 100} N SIMULATION IN PROGRESS {questionPartOne} {questionPartTwo} {selectedTutorial.question} {selectedTutorial.steps[stepNumber].content} Resources setMode("Tutorial")}
- >
- {" "}
- Go to walkthrough{" "}
- Red Weight
- {positionXDisplay} m
-
- {positionYDisplay} m
-
- {velocityXDisplay} m/s
-
- {velocityYDisplay} m/s
- SIMULATION IN PROGRESS Hello world! Hello world! Hello world! Hello world! {mass} kg
- {Math.round(pendulumLength)} m
+ {Math.round(this.props.pendulumLength)} m
- {Math.round(pendulumAngle * 100) / 100}°
+ {Math.round(this.props.pendulumAngle * 100) / 100}°
{Math.round(
- 100 * Math.sqrt(xVelocity * xVelocity + yVelocity * yVelocity)
+ 100 * Math.sqrt(this.state.xVelocity**2 + this.state.yVelocity**2)
) / 100}{" "}
m/s
{mass} kg {this.props.mass} kg {force.description} Force {Math.round(100 * force.magnitude) / 100} N {
}}
>
{Math.round(this.props.pendulumLength)} m
- {
style={{
pointerEvents: "none",
position: "absolute",
- zIndex: -1,
left: 0,
top: 0,
}}
@@ -709,7 +704,6 @@ export default class Weight extends React.Component
- {Math.round(this.props.pendulumLength)} m
- {
backgroundColor: this.labelBackgroundColor,
}}
>
- {Math.round(this.props.pendulumAngle * 100) / 100}°
+ {Math.round(this.props.dataDoc['pendulumAngle'] * 100) / 100}°
{this.props.mass} kg {force.description} Force {Math.round(100 * force.magnitude) / 100} N Elastic collisions Inclined plane angle input field! Pendulum angle input field! Show forces Show acceleration Show velocity Elastic collisions Elastic collisions input field! Pendulum angle input field! Show forces Show forces Show acceleration Show acceleration Show velocity Show velocity Elastic collisions Show forces Show acceleration Show velocity Elastic collisions Inclined plane angle Show forces Show acceleration Show velocity Show forces Show acceleration Show velocity Elastic collisions Show forces Show acceleration Show velocity Elastic collisions Pendulum start angle Inclined plane angle input field! Pendulum angle input field!Problem
+
+ Step {stepNumber + 1}:{" "}
+ {selectedTutorial.steps[stepNumber].description}
+
+
+
+ )}
+
+ μ s: {coefficientOfStaticFriction}
+
+ μ k: {coefficientOfKineticFriction}
+
+
+
+ )}
+
+
+
+ X
+ Y
+
+
+ {
+ window.open(
+ "https://www.khanacademy.org/science/physics/two-dimensional-motion"
+ );
+ }}
+ >
+
+
+ Units: m
+
+ }
+ followCursor
+ >
+
+ {(!simulationPaused || wedge) && (
+
+
+ {(!simulationPaused || wedge) && (
+
+
+
+ {
+ window.open(
+ "https://www.khanacademy.org/science/physics/two-dimensional-motion"
+ );
+ }}
+ >
+
+
+ Units: m/s
+
+ }
+ followCursor
+ >
+
+ {(!simulationPaused || pendulum || wedge) && (
+
+
+ {(!simulationPaused || pendulum || wedge) && (
+
+
+
+
+ {
+ window.open(
+ "https://www.khanacademy.org/science/physics/two-dimensional-motion"
+ );
+ }}
+ >
+
+
+ Units: m/s
+ 2
+
+ }
+ followCursor
+ >
+
+ {accelerationXDisplay} m/s2
+
+
+ {accelerationYDisplay} m/s2
+
+
+
+
+
+
+
+ Value
+
+
+ Potential Energy
+
+ {Math.round(
+ pendulumLength *
+ (1 - Math.cos(pendulumAngle)) *
+ 9.81 *
+ 10
+ ) / 10}{" "}
+ J
+
+
+
+ Kinetic Energy
+
+ {Math.round(
+ (Math.round(
+ pendulumLength *
+ (1 - Math.cos(startPendulumAngle)) *
+ 9.81 *
+ 10
+ ) /
+ 10 -
+ Math.round(
+ pendulumLength *
+ (1 - Math.cos(pendulumAngle)) *
+ 9.81 *
+ 10
+ ) /
+ 10) *
+ 10
+ ) / 10}{" "}
+ J
+
+
+
+
+
+ Total Energy
+
+
+ {Math.round(
+ pendulumLength *
+ (1 - Math.cos(startPendulumAngle)) *
+ 9.81 *
+ 10
+ ) / 10}{" "}
+ J
+
+ Problem
-
- Step {stepNumber + 1}:{" "}
- {selectedTutorial.steps[stepNumber].description}
-
-
-
- )}
-
- μ s: {coefficientOfStaticFriction}
-
- μ k: {coefficientOfKineticFriction}
-
-
-
- )}
-
-
-
- X
- Y
-
-
- {
- window.open(
- "https://www.khanacademy.org/science/physics/two-dimensional-motion"
- );
- }}
- >
-
-
- Units: m
-
- }
- followCursor
- >
-
- {(!simulationPaused || wedge) && (
-
-
- {(!simulationPaused || wedge) && (
-
-
-
- {
- window.open(
- "https://www.khanacademy.org/science/physics/two-dimensional-motion"
- );
- }}
- >
-
-
- Units: m/s
-
- }
- followCursor
- >
-
- {(!simulationPaused || pendulum || wedge) && (
-
-
- {(!simulationPaused || pendulum || wedge) && (
-
-
-
-
- {
- window.open(
- "https://www.khanacademy.org/science/physics/two-dimensional-motion"
- );
- }}
- >
-
-
- Units: m/s
- 2
-
- }
- followCursor
- >
-
- {accelerationXDisplay} m/s2
-
-
- {accelerationYDisplay} m/s2
-
-
-
-
-
-
-
- Value
-
-
- Potential Energy
-
- {Math.round(
- pendulumLength *
- (1 - Math.cos(pendulumAngle)) *
- 9.81 *
- 10
- ) / 10}{" "}
- J
-
-
-
- Kinetic Energy
-
- {Math.round(
- (Math.round(
- pendulumLength *
- (1 - Math.cos(startPendulumAngle)) *
- 9.81 *
- 10
- ) /
- 10 -
- Math.round(
- pendulumLength *
- (1 - Math.cos(pendulumAngle)) *
- 9.81 *
- 10
- ) /
- 10) *
- 10
- ) / 10}{" "}
- J
-
-
-
-
-
- Total Energy
-
-
- {Math.round(
- pendulumLength *
- (1 - Math.cos(startPendulumAngle)) *
- 9.81 *
- 10
- ) / 10}{" "}
- J
-
- Simulation Settings
+ {this.dataDoc.simulationType == "Free Weight" &&
+ Simulation Settings
+ Simulation Settings
{this.dataDoc.simulationType == "Free Weight" &&
Simulation Settings
- {this.dataDoc.simulationType == "Free Weight" &&
- Simulation Settings
+ Simulation Settings
-
+ {this.dataDoc.simulationType == "Free Weight" &&
Elastic collisions
Inclined plane angle
-input field!
+ {this.dataDoc.simulationType == "Inclined Plane" &&Inclined plane angle
{this.props.mass} kg
-- cgit v1.2.3-70-g09d2 From 7934c38ed641f4a10cd008fe415a50aef1240e10 Mon Sep 17 00:00:00 2001 From: mehekj+ + {key} + {info.type ? ', ' : ''} + + + {info.type} + +
+{info.description}
{key} - {info.type ? ', ' : ''} + {info.fieldType ? ', ' : ''} - {info.type} + {info.fieldType}
{info.description}
diff --git a/src/client/views/collections/collectionSchema/SchemaTableCell.tsx b/src/client/views/collections/collectionSchema/SchemaTableCell.tsx index f9319050e..4e31b1e1e 100644 --- a/src/client/views/collections/collectionSchema/SchemaTableCell.tsx +++ b/src/client/views/collections/collectionSchema/SchemaTableCell.tsx @@ -1,15 +1,20 @@ import React = require('react'); import { observer } from 'mobx-react'; -import { Doc, Field } from '../../../../fields/Doc'; -import { emptyFunction, returnEmptyDoclist, returnEmptyFilter, returnFalse, returnZero } from '../../../../Utils'; +import { Doc, DocListCast, Field, Opt } from '../../../../fields/Doc'; +import { Utils, emptyFunction, returnEmptyDoclist, returnEmptyFilter, returnFalse, returnZero } from '../../../../Utils'; import { Transform } from '../../../util/Transform'; import { EditableView } from '../../EditableView'; import { FieldView, FieldViewProps } from '../../nodes/FieldView'; import { KeyValueBox } from '../../nodes/KeyValueBox'; import { DefaultStyleProvider } from '../../StyleProvider'; -import { CollectionSchemaView } from './CollectionSchemaView'; +import { CollectionSchemaView, ColumnType, FInfotoColType } from './CollectionSchemaView'; import './CollectionSchemaView.scss'; -import { computed } from 'mobx'; +import { action, computed, observable } from 'mobx'; +import { extname } from 'path'; +import { Cast, DateCast } from '../../../../fields/Types'; +import { ImageField } from '../../../../fields/URLField'; +import { DateField } from '../../../../fields/DateField'; +import DatePicker from 'react-datepicker'; export interface SchemaTableCellProps { Document: Doc; @@ -23,10 +28,10 @@ export interface SchemaTableCellProps { @observer export class SchemaTableCell extends React.Component() const effectiveAcl = GetEffectiveAcl(this.dataDoc); const indocs = doc instanceof Doc ? [doc] : doc; const docs = indocs.filter(doc => [AclEdit, AclAdmin].includes(effectiveAcl) || GetEffectiveAcl(doc) === AclAdmin); - if (docs.length) { - docs.map(doc => { - Doc.SetInPlace(doc, 'followLinkToggle', undefined, true); - doc.annotationOn === this.props.Document && Doc.SetInPlace(doc, 'annotationOn', undefined, true); + + docs.forEach(doc => doc.annotationOn === this.props.Document && Doc.SetInPlace(doc, 'annotationOn', undefined, true)); + const targetDataDoc = this.dataDoc; + const value = DocListCast(targetDataDoc[annotationKey ?? this.annotationKey]); + const toRemove = value.filter(v => docs.includes(v)); + + if (toRemove.length !== 0) { + const recent = Doc.MyRecentlyClosed; + toRemove.forEach(doc => { + leavePushpin && DocUtils.LeavePushpin(doc, annotationKey ?? this.annotationKey); + Doc.RemoveDocFromList(targetDataDoc, annotationKey ?? this.annotationKey, doc); + doc.context = undefined; + if (recent) { + Doc.RemoveDocFromList(recent, 'data', doc); + doc.type !== DocumentType.LOADING && Doc.AddDocToList(recent, 'data', doc, undefined, true, true); + } }); - const targetDataDoc = this.dataDoc; - const value = DocListCast(targetDataDoc[annotationKey ?? this.annotationKey]); - const toRemove = value.filter(v => docs.includes(v)); - - if (toRemove.length !== 0) { - const recent = Doc.MyRecentlyClosed; - toRemove.forEach(doc => { - leavePushpin && DocUtils.LeavePushpin(doc, annotationKey ?? this.annotationKey); - Doc.RemoveDocFromList(targetDataDoc, annotationKey ?? this.annotationKey, doc); - doc.context = undefined; - if (recent) { - Doc.RemoveDocFromList(recent, 'data', doc); - doc.type !== DocumentType.LOADING && Doc.AddDocToList(recent, 'data', doc, undefined, true, true); - } - }); - this.isAnyChildContentActive() && this.props.select(false); - return true; - } + this.isAnyChildContentActive() && this.props.select(false); + return true; } return false; @@ -190,46 +186,44 @@ export function ViewBoxAnnotatableComponent
()
return false;
}
const targetDataDoc = this.props.Document[DataSym];
- const docList = DocListCast(targetDataDoc[annotationKey ?? this.annotationKey]);
- const added = docs.filter(d => !docList.includes(d));
const effectiveAcl = GetEffectiveAcl(targetDataDoc);
+ if (effectiveAcl === AclPrivate || effectiveAcl === AclReadonly) {
+ return false;
+ }
+ const added = docs;
if (added.length) {
- if (effectiveAcl === AclPrivate || effectiveAcl === AclReadonly) {
- return false;
- } else {
- if (this.props.Document[AclSym] && Object.keys(this.props.Document[AclSym]).length) {
- added.forEach(d => {
- for (const [key, value] of Object.entries(this.props.Document[AclSym])) {
- if (d.author === denormalizeEmail(key.substring(4)) && !d.aliasOf) distributeAcls(key, SharingPermissions.Admin, d);
- }
- });
- }
+ if (this.props.Document[AclSym] && Object.keys(this.props.Document[AclSym]).length) {
+ added.forEach(d => {
+ for (const key of Object.keys(this.props.Document[AclSym])) {
+ if (d.author === denormalizeEmail(key.substring(4)) && !d.aliasOf) distributeAcls(key, SharingPermissions.Admin, d);
+ }
+ });
+ }
- if (effectiveAcl === AclAugment) {
- added.map(doc => {
- if ([AclAdmin, AclEdit].includes(GetEffectiveAcl(doc)) && Doc.ActiveDashboard) inheritParentAcls(Doc.ActiveDashboard, doc);
+ if (effectiveAcl === AclAugment) {
+ added.map(doc => {
+ if ([AclAdmin, AclEdit].includes(GetEffectiveAcl(doc)) && Doc.ActiveDashboard) inheritParentAcls(Doc.ActiveDashboard, doc);
+ doc.context = this.props.Document;
+ if (annotationKey ?? this._annotationKeySuffix()) Doc.GetProto(doc).annotationOn = this.props.Document;
+ Doc.AddDocToList(targetDataDoc, annotationKey ?? this.annotationKey, doc);
+ });
+ } else {
+ added
+ .filter(doc => [AclAdmin, AclEdit].includes(GetEffectiveAcl(doc)))
+ .map(doc => {
+ // only make a pushpin if we have acl's to edit the document
+ //DocUtils.LeavePushpin(doc);
+ doc._stayInCollection = undefined;
doc.context = this.props.Document;
if (annotationKey ?? this._annotationKeySuffix()) Doc.GetProto(doc).annotationOn = this.props.Document;
- Doc.AddDocToList(targetDataDoc, annotationKey ?? this.annotationKey, doc);
+
+ Doc.ActiveDashboard && inheritParentAcls(Doc.ActiveDashboard, doc);
});
- } else {
- added
- .filter(doc => [AclAdmin, AclEdit].includes(GetEffectiveAcl(doc)))
- .map(doc => {
- // only make a pushpin if we have acl's to edit the document
- //DocUtils.LeavePushpin(doc);
- doc._stayInCollection = undefined;
- doc.context = this.props.Document;
- if (annotationKey ?? this._annotationKeySuffix()) Doc.GetProto(doc).annotationOn = this.props.Document;
-
- Doc.ActiveDashboard && inheritParentAcls(Doc.ActiveDashboard, doc);
- });
- const annoDocs = targetDataDoc[annotationKey ?? this.annotationKey] as List
Show forces
Show acceleration
Show velocity
Elastic collisions
Pendulum start angle
Inclined plane angle
+ {Math.round(((this.state.angleInRadians * 180) / Math.PI) * 100) / 100}° +
+{this.props.mass} kg
++ {this.state.angleLabel}° +
++ {Math.round( + 100 * + Math.sqrt( + Math.pow(this.getNewAccelerationX(this.props.dataDoc['updatedForces']) * 3, 2) + + Math.pow(this.getNewAccelerationY(this.props.dataDoc['updatedForces']) * 3, 2) + ) + ) / 100}{" "} + m/s2 +
++ {Math.round( + 100 * Math.sqrt(this.state.xVelocity**2 + this.state.yVelocity**2) + ) / 100}{" "} + m/s +
+{force.description}
} + {!force.description &&Force
} + {this.props.dataDoc['showForceMagnitudes'] && ( +{Math.round(100 * force.magnitude) / 100} N
+ )} +Show forces
Show acceleration
Show velocity
Elastic collisions
Pendulum start angle
Inclined plane angle
- {Math.round(((this.state.angleInRadians * 180) / Math.PI) * 100) / 100}° -
-{this.props.mass} kg
-- {this.state.angleLabel}° -
-- {Math.round( - 100 * - Math.sqrt( - Math.pow(this.getNewAccelerationX(this.props.dataDoc['updatedForces']) * 3, 2) + - Math.pow(this.getNewAccelerationY(this.props.dataDoc['updatedForces']) * 3, 2) - ) - ) / 100}{" "} - m/s2 -
-- {Math.round( - 100 * Math.sqrt(this.state.xVelocity**2 + this.state.yVelocity**2) - ) / 100}{" "} - m/s -
-{force.description}
} - {!force.description &&Force
} - {this.props.dataDoc['showForceMagnitudes'] && ( -{Math.round(100 * force.magnitude) / 100} N
- )} -{user.username}
+ ))} +
diff --git a/src/client/views/MainView.tsx b/src/client/views/MainView.tsx
index e4554c339..43f56dd8c 100644
--- a/src/client/views/MainView.tsx
+++ b/src/client/views/MainView.tsx
@@ -26,6 +26,7 @@ import { ScriptingGlobals } from '../util/ScriptingGlobals';
import { SelectionManager } from '../util/SelectionManager';
import { ColorScheme, SettingsManager } from '../util/SettingsManager';
import { SharingManager } from '../util/SharingManager';
+import { ServerStats } from '../util/ServerStats';
import { SnappingManager } from '../util/SnappingManager';
import { Transform } from '../util/Transform';
import { TimelineMenu } from './animationtimeline/TimelineMenu';
@@ -969,6 +970,7 @@ export class MainView extends React.Component {
{this.inkResources}
+ {`wiki:phrase`} + {` display wikipedia page for entered text (terminate with carriage return)`} +
++ {`#tag `} + {` add hashtag metadata to document. e.g, #idea`} +
++ {`#, ## ... ###### `} + {` set heading style based on number of '#'s between 1 and 6`} +
++ {`#tag `} + {` add hashtag metadata to document. e.g, #idea`} +
++ {`>> `} + {` add a sidebar text document inline`} +
++ {`\`\` `} + {` create a code snippet block`} +
++ {`%% `} + {` restore default styling`} +
++ {`%color `} + {` changes text color styling. e.g., %green.`} +
++ {`%num `} + {` set font size. e.g., %10 for 10pt font`} +
++ {`%eq `} + {` creates an equation block for typeset math`} +
++ {`%alt `} + {` switch between primary and alternate text (see bottom right Button for hover options).`} +
++ {`%f `} + {` create an inline footnote`} +
++ {`%> `} + {` create a bockquote section. Terminate with 2 carriage returns`} +
++ {`%( `} + {` start a section of inline elidable text. Terminate the inline text with %)`} +
++ {`%q `} + {` start a quoted block of text that’s indented on the left and right. Terminate with %q`} +
++ {`%d `} + {` start a block text where the first line is indented`} +
++ {`%h `} + {` start a block of text that begins with a hanging indent`} +
++ {`%[ `} + {` left justify text`} +
++ {`%^ `} + {` center text`} +
++ {`%] `} + {` right justify text`} +
++ {`[:doctitle]] `} + {` hyperlink to document specified by it’s title`} +
++ {`[[fieldname]] `} + {` display value of fieldname`} +
++ {`[[fieldname=value]] `} + {` assign value to fieldname of document and display it`} +
++ {`[[fieldname:doctitle]] `} + {` show value of fieldname from doc specified by it’s title`} +
++ {`cmd-f `} + {` collapse to an inline footnote)`} +
++ {`cmd-e `} + {` collapse to elided text`} +
++ {`cmd-[ `} + {` left justify text`} +
++ {`cmd-\\ `} + {` center text`} +
++ {`cmd-] `} + {` right justify text`} +
{`%% `} {` restore default styling`} @@ -75,18 +95,10 @@ export class RTFMarkup extends React.Component<{}> { {`%alt `} {` switch between primary and alternate text (see bottom right Button for hover options).`}
-- {`%f `} - {` create an inline footnote`} -
{`%> `} {` create a bockquote section. Terminate with 2 carriage returns`}
-- {`%( `} - {` start a section of inline elidable text. Terminate the inline text with %)`} -
{`%q `} {` start a quoted block of text that’s indented on the left and right. Terminate with %q`} @@ -99,18 +111,6 @@ export class RTFMarkup extends React.Component<{}> { {`%h `} {` start a block of text that begins with a hanging indent`}
-- {`%[ `} - {` left justify text`} -
-- {`%^ `} - {` center text`} -
-- {`%] `} - {` right justify text`} -
{`[:doctitle]] `}
{` hyperlink to document specified by it’s title`}
diff --git a/src/client/views/nodes/formattedText/FootnoteView.tsx b/src/client/views/nodes/formattedText/FootnoteView.tsx
index 531a60297..cf48e1250 100644
--- a/src/client/views/nodes/formattedText/FootnoteView.tsx
+++ b/src/client/views/nodes/formattedText/FootnoteView.tsx
@@ -83,13 +83,11 @@ export class FootnoteView {
};
toggle = () => {
- console.log('TOGGLE');
if (this.innerView) this.close();
else this.open();
};
close() {
- console.log('CLOSE');
this.innerView?.destroy();
this.innerView = null;
this.dom.textContent = '';
diff --git a/src/client/views/nodes/formattedText/ProsemirrorExampleTransfer.ts b/src/client/views/nodes/formattedText/ProsemirrorExampleTransfer.ts
index 68b0488a2..4dfe07b24 100644
--- a/src/client/views/nodes/formattedText/ProsemirrorExampleTransfer.ts
+++ b/src/client/views/nodes/formattedText/ProsemirrorExampleTransfer.ts
@@ -8,6 +8,7 @@ import { AclAugment, AclSelfEdit, Doc } from '../../../../fields/Doc';
import { GetEffectiveAcl } from '../../../../fields/util';
import { Utils } from '../../../../Utils';
import { Docs } from '../../../documents/Documents';
+import { RTFMarkup } from '../../../util/RTFMarkup';
import { SelectionManager } from '../../../util/SelectionManager';
import { OpenWhere } from '../DocumentView';
import { liftListItem, sinkListItem } from './prosemirrorPatches.js';
@@ -178,6 +179,83 @@ export function buildKeymap>(schema: S, props: any, mapKey
dispatch(state.tr.setSelection(new TextSelection(state.doc.resolve(1), state.doc.resolve(state.doc.content.size - 1))));
return true;
});
+ bind('Cmd-?', (state: EditorState, dispatch: (tx: Transaction) => void) => {
+ RTFMarkup.Instance.open();
+ return true;
+ });
+ bind('Cmd-e', (state: EditorState, dispatch: (tx: Transaction) => void) => {
+ if (!state.selection.empty) {
+ const mark = state.schema.marks.summarizeInclusive.create();
+ const tr = state.tr.addMark(state.selection.$from.pos, state.selection.$to.pos, mark);
+ const content = tr.selection.content();
+ tr.selection.replaceWith(tr, schema.nodes.summary.create({ visibility: false, text: content, textslice: content.toJSON() }));
+ dispatch(tr);
+ }
+ return true;
+ });
+ bind('Cmd-]', (state: EditorState, dispatch: (tx: Transaction) => void) => {
+ const resolved = state.doc.resolve(state.selection.from) as any;
+ const tr = state.tr;
+ if (resolved?.parent.type.name === 'paragraph') {
+ tr.setNodeMarkup(resolved.path[resolved.path.length - 4], schema.nodes.paragraph, { ...resolved.parent.attrs, align: 'right' }, resolved.parent.marks);
+ } else {
+ const node = resolved.nodeAfter;
+ const sm = state.storedMarks || undefined;
+ if (node) {
+ tr.replaceRangeWith(state.selection.from, state.selection.from, schema.nodes.paragraph.create({ align: 'right' })).setStoredMarks([...node.marks, ...(sm ? sm : [])]);
+ }
+ }
+ dispatch(tr);
+ return true;
+ });
+ bind('Cmd-\\', (state: EditorState, dispatch: (tx: Transaction) => void) => {
+ const resolved = state.doc.resolve(state.selection.from) as any;
+ const tr = state.tr;
+ if (resolved?.parent.type.name === 'paragraph') {
+ tr.setNodeMarkup(resolved.path[resolved.path.length - 4], schema.nodes.paragraph, { ...resolved.parent.attrs, align: 'center' }, resolved.parent.marks);
+ } else {
+ const node = resolved.nodeAfter;
+ const sm = state.storedMarks || undefined;
+ if (node) {
+ tr.replaceRangeWith(state.selection.from, state.selection.from, schema.nodes.paragraph.create({ align: 'center' })).setStoredMarks([...node.marks, ...(sm ? sm : [])]);
+ }
+ }
+ dispatch(tr);
+ return true;
+ });
+ bind('Cmd-[', (state: EditorState, dispatch: (tx: Transaction) => void) => {
+ const resolved = state.doc.resolve(state.selection.from) as any;
+ const tr = state.tr;
+ if (resolved?.parent.type.name === 'paragraph') {
+ tr.setNodeMarkup(resolved.path[resolved.path.length - 4], schema.nodes.paragraph, { ...resolved.parent.attrs, align: 'left' }, resolved.parent.marks);
+ } else {
+ const node = resolved.nodeAfter;
+ const sm = state.storedMarks || undefined;
+ if (node) {
+ tr.replaceRangeWith(state.selection.from, state.selection.from, schema.nodes.paragraph.create({ align: 'left' })).setStoredMarks([...node.marks, ...(sm ? sm : [])]);
+ }
+ }
+ dispatch(tr);
+ return true;
+ });
+
+ bind('Cmd-f', (state: EditorState, dispatch: (tx: Transaction) => void) => {
+ const content = state.tr.selection.empty ? undefined : state.tr.selection.content().content.textBetween(0, state.tr.selection.content().size + 1);
+ const newNode = schema.nodes.footnote.create({}, content ? state.schema.text(content) : undefined);
+ const tr = state.tr;
+ tr.replaceSelectionWith(newNode); // replace insertion with a footnote.
+ dispatch(
+ tr.setSelection(
+ new NodeSelection( // select the footnote node to open its display
+ tr.doc.resolve(
+ // get the location of the footnote node by subtracting the nodesize of the footnote from the current insertion point anchor (which will be immediately after the footnote node)
+ tr.selection.anchor - (tr.selection.$anchor.nodeBefore?.nodeSize || 0)
+ )
+ )
+ )
+ );
+ return true;
+ });
bind('Ctrl-a', (state: EditorState, dispatch: (tx: Transaction) => void) => {
dispatch(state.tr.setSelection(new TextSelection(state.doc.resolve(1), state.doc.resolve(state.doc.content.size - 1))));
diff --git a/src/client/views/nodes/formattedText/RichTextRules.ts b/src/client/views/nodes/formattedText/RichTextRules.ts
index e5943f257..cc19d12bd 100644
--- a/src/client/views/nodes/formattedText/RichTextRules.ts
+++ b/src/client/views/nodes/formattedText/RichTextRules.ts
@@ -8,7 +8,6 @@ import { normalizeEmail } from '../../../../fields/util';
import { Utils } from '../../../../Utils';
import { DocServer } from '../../../DocServer';
import { Docs, DocUtils } from '../../../documents/Documents';
-import { RTFMarkup } from '../../../util/RTFMarkup';
import { FormattedTextBox } from './FormattedTextBox';
import { wrappingInputRule } from './prosemirrorPatches';
import { RichTextMenu } from './RichTextMenu';
@@ -29,7 +28,7 @@ export class RichTextRules {
emDash,
// > blockquote
- wrappingInputRule(/%>\s$/, schema.nodes.blockquote),
+ wrappingInputRule(/%>$/, schema.nodes.blockquote),
// 1. create numerical ordered list
wrappingInputRule(
@@ -191,21 +190,6 @@ export class RichTextRules {
}
}),
- // %f create footnote
- new InputRule(new RegExp(/%f$/), (state, match, start, end) => {
- const newNode = schema.nodes.footnote.create({});
- const tr = state.tr;
- tr.deleteRange(start, end).replaceSelectionWith(newNode); // replace insertion with a footnote.
- return tr.setSelection(
- new NodeSelection( // select the footnote node to open its display
- tr.doc.resolve(
- // get the location of the footnote node by subtracting the nodesize of the footnote from the current insertion point anchor (which will be immediately after the footnote node)
- tr.selection.anchor - (tr.selection.$anchor.nodeBefore?.nodeSize || 0)
- )
- )
- );
- }),
-
// activate a style by name using prefix '%
{key} - {info.fieldType ? ', ' : ''} + {this.fieldInfos.get(key)!.fieldType ? ', ' : ''} - - {info.fieldType} + + {this.fieldInfos.get(key)!.fieldType}
-{info.description}
+{this.fieldInfos.get(key)!.description}
Show forces
Show acceleration
Show velocity
Elastic collisions
Pendulum start angle
Inclined plane angle
- {Math.round(((this.state.angleInRadians * 180) / Math.PI) * 100) / 100}° -
-{this.dataDoc.simulationType} review problems in progress!
+{this.dataDoc.questionPartOne}
+{this.dataDoc.questionPartTwo}
+{this.dataDoc.selectedTutorial.question}
+{this.dataDoc.selectedTutorial.steps[stepNumber].content}
+Resources
} + {this.dataDoc.simulationType == "One Weight" && ( + + )} + {this.dataDoc.simulationType == "Inclined Plane" && ( + + )} + {this.dataDoc.simulationType == "Pendulum" && ( +this.dataDoc.mode = ("Tutorial")} + > + {" "} + Go to walkthrough{" "} +
+Submit
+New question
+| {simulationType == "Pulley" ? "Red Weight" : ""} | +X | +Y | +||
| {
+ window.open(
+ "https://www.khanacademy.org/science/physics/two-dimensional-motion"
+ );
+ }}
+ >
+ |
+ {(!simulationPaused ||
+ simulationType == "Inclined Plane" ||
+ simulationType == "Suspension" ||
+ simulationType == "Circular Motion" ||
+ simulationType == "Pulley") && (
+ + {positionXDisplay} m + | + )}{" "} + {simulationPaused && + simulationType != "Inclined Plane" && + simulationType != "Suspension" && + simulationType != "Circular Motion" && + simulationType != "Pulley" && ( +
+ |
+ )}{" "}
+ {(!simulationPaused ||
+ simulationType == "Inclined Plane" ||
+ simulationType == "Suspension" ||
+ simulationType == "Circular Motion" ||
+ simulationType == "Pulley") && (
+ + {positionYDisplay} m + | + )}{" "} + {simulationPaused && + simulationType != "Inclined Plane" && + simulationType != "Suspension" && + simulationType != "Circular Motion" && + simulationType != "Pulley" && ( +
+ |
+ )}{" "}
+
| {
+ window.open(
+ "https://www.khanacademy.org/science/physics/two-dimensional-motion"
+ );
+ }}
+ >
+ |
+ {(!simulationPaused ||
+ (simulationType != "One Weight" &&
+ simulationType != "Circular Motion")) && (
+ + {velocityXDisplay} m/s + | + )}{" "} + {simulationPaused && + (simulationType == "One Weight" || + simulationType == "Circular Motion") && ( +
+ |
+ )}{" "}
+ {(!simulationPaused || simulationType != "One Weight") && (
+ + {velocityYDisplay} m/s + | + )}{" "} + {simulationPaused && simulationType == "One Weight" && ( +
+ |
+ )}{" "}
+
| {
+ window.open(
+ "https://www.khanacademy.org/science/physics/two-dimensional-motion"
+ );
+ }}
+ >
+ |
+ + {accelerationXDisplay} m/s2 + | ++ {accelerationYDisplay} m/s2 + | +||
|
+ |
+ + {Math.round(velocityXDisplay * mass * 10) / 10} kg*m/s + | ++ {Math.round(velocityYDisplay * mass * 10) / 10} kg*m/s + | +
| Blue Weight | +X | +Y | +
|
+ |
+ {positionXDisplay2} m | +{positionYDisplay2} m | +
|
+ |
+ + {velocityXDisplay2} m/s + | + ++ {velocityYDisplay2} m/s + | +
|
+ |
+ + {accelerationXDisplay2} m/s2 + | ++ {accelerationYDisplay2} m/s2 + | +
|
+ |
+ + {Math.round(velocityXDisplay2 * mass * 10) / 10} kg*m/s + | ++ {Math.round(velocityYDisplay2 * mass * 10) / 10} kg*m/s + | +
Kinematic Equations
+Harmonic Motion Equations: Spring
+Harmonic Motion Equations: Pendulum
++ {simulationType == "Circular Motion" ? "Z" : "Y"} +
++ X +
+| {simulationType == "Pulley" ? "Red Weight" : ""} | +{this.dataDoc.simulationType == "Pulley" ? "Red Weight" : ""} | X | Y | |||||||||
| {
- window.open(
- "https://www.khanacademy.org/science/physics/two-dimensional-motion"
- );
- }}
+ // onClick={() => {
+ // window.open(
+ // "https://www.khanacademy.org/science/physics/two-dimensional-motion"
+ // );
+ // }}
>
|
- {(!simulationPaused ||
- simulationType == "Inclined Plane" ||
- simulationType == "Suspension" ||
- simulationType == "Circular Motion" ||
- simulationType == "Pulley") && (
+ {(!this.dataDoc.simulationPaused ||
+ this.dataDoc.simulationType == "Inclined Plane" ||
+ this.dataDoc.simulationType == "Suspension" ||
+ this.dataDoc.simulationType == "Circular Motion" ||
+ this.dataDoc.simulationType == "Pulley") && (
- {positionXDisplay} m + {this.dataDoc.positionXDisplay} m | )}{" "} - {simulationPaused && - simulationType != "Inclined Plane" && - simulationType != "Suspension" && - simulationType != "Circular Motion" && - simulationType != "Pulley" && ( + {this.dataDoc.simulationPaused && + this.dataDoc.simulationType != "Inclined Plane" && + this.dataDoc.simulationType != "Suspension" && + this.dataDoc.simulationType != "Circular Motion" && + this.dataDoc.simulationType != "Pulley" && (
|
)}{" "}
- {(!simulationPaused ||
- simulationType == "Inclined Plane" ||
- simulationType == "Suspension" ||
- simulationType == "Circular Motion" ||
- simulationType == "Pulley") && (
+ {(!this.dataDoc.simulationPaused ||
+ this.dataDoc.simulationType == "Inclined Plane" ||
+ this.dataDoc.simulationType == "Suspension" ||
+ this.dataDoc.simulationType == "Circular Motion" ||
+ this.dataDoc.simulationType == "Pulley") && (
- {positionYDisplay} m + {this.dataDoc.positionYDisplay} m | )}{" "} - {simulationPaused && - simulationType != "Inclined Plane" && - simulationType != "Suspension" && - simulationType != "Circular Motion" && - simulationType != "Pulley" && ( + {this.dataDoc.simulationPaused && + this.dataDoc.simulationType != "Inclined Plane" && + this.dataDoc.simulationType != "Suspension" && + this.dataDoc.simulationType != "Circular Motion" && + this.dataDoc.simulationType != "Pulley" && (
| {
- window.open(
- "https://www.khanacademy.org/science/physics/two-dimensional-motion"
- );
- }}
+ // onClick={() => {
+ // window.open(
+ // "https://www.khanacademy.org/science/physics/two-dimensional-motion"
+ // );
+ // }}
>
|
- {(!simulationPaused ||
- (simulationType != "One Weight" &&
- simulationType != "Circular Motion")) && (
+ {(!this.dataDoc.simulationPaused ||
+ (this.dataDoc.simulationType != "One Weight" &&
+ this.dataDoc.simulationType != "Circular Motion")) && (
- {velocityXDisplay} m/s
+ {this.dataDoc.velocityXDisplay} m/s
|
)}{" "}
- {simulationPaused &&
- (simulationType == "One Weight" ||
- simulationType == "Circular Motion") && (
+ {this.dataDoc.simulationPaused &&
+ (this.dataDoc.simulationType == "One Weight" ||
+ this.dataDoc.simulationType == "Circular Motion") && (
|
)}{" "}
- {(!simulationPaused || simulationType != "One Weight") && (
+ {(!this.dataDoc.simulationPaused || this.dataDoc.simulationType != "One Weight") && (
- {velocityYDisplay} m/s
+ {this.dataDoc.velocityYDisplay} m/s
|
)}{" "}
- {simulationPaused && simulationType == "One Weight" && (
+ {this.dataDoc.simulationPaused && this.dataDoc.simulationType == "One Weight" && (
| {
- window.open(
- "https://www.khanacademy.org/science/physics/two-dimensional-motion"
- );
- }}
+ // onClick={() => {
+ // window.open(
+ // "https://www.khanacademy.org/science/physics/two-dimensional-motion"
+ // );
+ // }}
>
|
- {accelerationXDisplay} m/s2
+ {this.dataDoc.accelerationXDisplay} m/s2
|
- {accelerationYDisplay} m/s2
+ {this.dataDoc.accelerationYDisplay} m/s2
|
|
| - {Math.round(velocityXDisplay * mass * 10) / 10} kg*m/s + {Math.round(this.dataDoc.velocityXDisplay * this.dataDoc.mass * 10) / 10} kg*m/s | - {Math.round(velocityYDisplay * mass * 10) / 10} kg*m/s + {Math.round(this.dataDoc.velocityYDisplay * this.dataDoc.mass * 10) / 10} kg*m/s |
| {positionXDisplay2} m | -{positionYDisplay2} m | +{this.dataDoc.positionXDisplay2} m | +{this.dataDoc.positionYDisplay2} m |
|
|
- {velocityXDisplay2} m/s + {this.dataDoc.velocityXDisplay2} m/s | - {velocityYDisplay2} m/s + {this.dataDoc.velocityYDisplay2} m/s | |
| - {accelerationXDisplay2} m/s2 + {this.dataDoc.accelerationXDisplay2} m/s2 | - {accelerationYDisplay2} m/s2 + {this.dataDoc.accelerationYDisplay2} m/s2 | ||
| - {Math.round(velocityXDisplay2 * mass * 10) / 10} kg*m/s + {Math.round(this.dataDoc.velocityXDisplay2 * this.dataDoc.mass * 10) / 10} kg*m/s | - {Math.round(velocityYDisplay2 * mass * 10) / 10} kg*m/s + {Math.round(this.dataDoc.velocityYDisplay2 * this.dataDoc.mass * 10) / 10} kg*m/s |
Kinematic Equations
Harmonic Motion Equations: Spring
Harmonic Motion Equations: Pendulum
{this.props.mass} kg
+{mass} kg
+ {Math.round( + ((Math.atan( + (yPosition + radius) / + (xPosition + + radius - + ((xMax + xMin) / 2 - radius - yMin - 200)) + ) * + 180) / + Math.PI) * + 100 + ) / 100} + ° +
++ {Math.round( + ((Math.atan( + (yPosition + radius) / + ((xMax + xMin) / 2 + + yMin + + 200 + + radius - + (xPosition + radius)) + ) * + 180) / + Math.PI) * + 100 + ) / 100} + ° +
++ {Math.round(pendulumLength)} m +
+- {this.state.angleLabel}° + {Math.round(pendulumAngle * 100) / 100}°
+ {Math.round( + ((Math.atan(wedgeHeight / wedgeWidth) * 180) / Math.PI) * 100 + ) / 100} + ° +
+{Math.round( - 100 * - Math.sqrt( - Math.pow(this.getNewAccelerationX(this.props.dataDoc['updatedForces']) * 3, 2) + - Math.pow(this.getNewAccelerationY(this.props.dataDoc['updatedForces']) * 3, 2) - ) + 100 * Math.sqrt(xAccel * xAccel + yAccel * yAccel) ) / 100}{" "} - m/s2 + m/s + 2
{Math.round( - 100 * Math.sqrt(this.state.xVelocity**2 + this.state.yVelocity**2) + 100 * + Math.sqrt( + displayXVelocity * displayXVelocity + + displayYVelocity * displayYVelocity + ) ) / 100}{" "} m/s
@@ -759,23 +1417,134 @@ export default class Weight extends React.Component{force.description}
} + {!force.description &&Force
} + {showForceMagnitudes && ( +{Math.round(100 * force.magnitude) / 100} N
+ )} +{force.description}
} {!force.description &&Force
} - {this.props.dataDoc['showForceMagnitudes'] && ( + {showForceMagnitudes && ({Math.round(100 * force.magnitude) / 100} N
)}{mass} kg
+{this.props.mass} kg
- {Math.round(pendulumLength)} m + {Math.round(this.props.pendulumLength)} m
- {Math.round(pendulumAngle * 100) / 100}° + {Math.round(this.props.pendulumAngle * 100) / 100}°
{Math.round(
- 100 * Math.sqrt(xAccel * xAccel + yAccel * yAccel)
+ 100 * Math.sqrt(this.state.xAccel * this.state.xAccel + this.state.yAccel * this.state.yAccel)
) / 100}{" "}
m/s
2
@@ -1349,7 +1346,7 @@ export default class Weight extends React.Component
{force.description}
} {!force.description &&Force
} - {showForceMagnitudes && ( + {this.props.showForceMagnitudes && ({Math.round(100 * force.magnitude) / 100} N
)}{force.description}
} {!force.description &&Force
} - {showForceMagnitudes && ( + {this.props.showForceMagnitudes && ({Math.round(100 * force.magnitude) / 100} N
)}≈
+≈
{this.dataDoc.selectedTutorial.steps[stepNumber].content}
+{this.dataDoc.selectedTutorial.steps[this.dataDoc.stepNumber].content}
diff --git a/src/client/views/nodes/PhysicsBox/PhysicsSimulationInputField.tsx b/src/client/views/nodes/PhysicsBox/PhysicsSimulationInputField.tsx
index 645c1995e..75bc28919 100644
--- a/src/client/views/nodes/PhysicsBox/PhysicsSimulationInputField.tsx
+++ b/src/client/views/nodes/PhysicsBox/PhysicsSimulationInputField.tsx
@@ -45,7 +45,6 @@ export default class InputField extends React.Component {this.dataDoc.simulationType} review problems in progress!
Date: Tue, 2 May 2023 18:02:04 -0400
Subject: debugging
---
.../nodes/PhysicsBox/PhysicsSimulationWeight.tsx | 29 +++++++++++++++-------
1 file changed, 20 insertions(+), 9 deletions(-)
(limited to 'src/client/views')
diff --git a/src/client/views/nodes/PhysicsBox/PhysicsSimulationWeight.tsx b/src/client/views/nodes/PhysicsBox/PhysicsSimulationWeight.tsx
index 38af55635..368f35f3c 100644
--- a/src/client/views/nodes/PhysicsBox/PhysicsSimulationWeight.tsx
+++ b/src/client/views/nodes/PhysicsBox/PhysicsSimulationWeight.tsx
@@ -179,6 +179,7 @@ export default class Weight extends React.Component
{
position: "absolute",
left: 0,
top: 0,
- zIndex: -2,
}}
>
{
position: "absolute",
left: 0,
top: 0,
- zIndex: -2,
}}
>
{
style={{
pointerEvents: "none",
position: "absolute",
- zIndex: -1,
left: 0,
top: 0,
}}
@@ -1355,7 +1341,6 @@ export default class Weight extends React.Component ()
//DocUtils.LeavePushpin(doc);
doc._stayInCollection = undefined;
doc.context = this.props.Document;
- if (annotationKey ?? this._annotationKeySuffix()) Doc.GetProto(doc).annotationOn = this.props.Document;
+ if (annotationKey ?? this._annotationKeySuffix()) Doc.GetProto(doc).annotationOn = this.rootDoc;
Doc.ActiveDashboard && inheritParentAcls(Doc.ActiveDashboard, doc);
});
diff --git a/src/client/views/collections/CollectionTimeView.tsx b/src/client/views/collections/CollectionTimeView.tsx
index d0f3f2ca5..c3f77205a 100644
--- a/src/client/views/collections/CollectionTimeView.tsx
+++ b/src/client/views/collections/CollectionTimeView.tsx
@@ -7,22 +7,21 @@ import { ObjectField } from '../../../fields/ObjectField';
import { RichTextField } from '../../../fields/RichTextField';
import { listSpec } from '../../../fields/Schema';
import { ComputedField, ScriptField } from '../../../fields/ScriptField';
-import { BoolCast, Cast, NumCast, StrCast } from '../../../fields/Types';
+import { Cast, NumCast, StrCast } from '../../../fields/Types';
import { emptyFunction, returnEmptyString, returnFalse, returnTrue, setupMoveUpEvents } from '../../../Utils';
import { Docs } from '../../documents/Documents';
-import { DocumentType } from '../../documents/DocumentTypes';
import { DocumentManager } from '../../util/DocumentManager';
import { ScriptingGlobals } from '../../util/ScriptingGlobals';
import { ContextMenu } from '../ContextMenu';
import { ContextMenuProps } from '../ContextMenuItem';
import { EditableView } from '../EditableView';
+import { DocFocusOptions, DocumentView } from '../nodes/DocumentView';
+import { PresBox } from '../nodes/trails';
import { computePivotLayout, computeTimelineLayout, ViewDefBounds } from './collectionFreeForm/CollectionFreeFormLayoutEngines';
import { CollectionFreeFormView } from './collectionFreeForm/CollectionFreeFormView';
import { CollectionSubView } from './CollectionSubView';
import './CollectionTimeView.scss';
import React = require('react');
-import { DocFocusOptions, DocumentView } from '../nodes/DocumentView';
-import { PresBox } from '../nodes/trails';
@observer
export class CollectionTimeView extends CollectionSubView() {
diff --git a/src/client/views/nodes/trails/PresBox.tsx b/src/client/views/nodes/trails/PresBox.tsx
index 0b780f589..bd2be8f11 100644
--- a/src/client/views/nodes/trails/PresBox.tsx
+++ b/src/client/views/nodes/trails/PresBox.tsx
@@ -49,7 +49,6 @@ export interface pinDataTypes {
clippable?: boolean;
datarange?: boolean;
dataview?: boolean;
- textview?: boolean;
poslayoutview?: boolean;
dataannos?: boolean;
}
@@ -382,14 +381,13 @@ export class PresBox extends ViewBoxBaseComponent
{this.dataDoc.simulationType} review problems in progress!
@@ -1393,7 +1396,7 @@ export default class Weight extends React.Component
@@ -1506,7 +1509,7 @@ export default class Weight extends React.Component
{this.dataDoc.simulationType} review problems in progress!
+{this.dataDoc.questionPartTwo}
{this.dataDoc.simulationType} review problems in progress!
+{this.dataDoc.questionPartOne}
+{this.dataDoc.questionPartTwo}
+{this.dataDoc.selectedTutorial.question}
+{this.dataDoc.selectedTutorial.steps[this.dataDoc.stepNumber].content}
+Resources
} + {this.dataDoc.simulationType == "One Weight" && ( + + )} + {this.dataDoc.simulationType == "Inclined Plane" && ( + + )} + {this.dataDoc.simulationType == "Pendulum" && ( +{this.dataDoc.simulationType} review problems in progress!
- this.dataDoc.mode = ("Tutorial")}
>
-
- {this.dataDoc.simulationType == "Circular Motion" ? "Z" : "Y"} -
-- X -
++ {this.dataDoc.simulationType == "Circular Motion" ? "Z" : "Y"} +
++ X +
+- {`%alt `} + {`%/ `} {` switch between primary and alternate text (see bottom right Button for hover options).`}
diff --git a/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx b/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx
index 91c5144d8..29bdc0e2d 100644
--- a/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx
+++ b/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx
@@ -1759,6 +1759,7 @@ export class CollectionFreeFormView extends CollectionSubView d{this.props.index} d{this.props.index};
}
@@ -288,7 +302,9 @@ export class SchemaBoolCell extends React.Component
diff --git a/src/client/views/nodes/WebBox.tsx b/src/client/views/nodes/WebBox.tsx
index e05b48c0b..82c8e796d 100644
--- a/src/client/views/nodes/WebBox.tsx
+++ b/src/client/views/nodes/WebBox.tsx
@@ -2,16 +2,16 @@ import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import { action, computed, IReactionDisposer, observable, ObservableMap, reaction, runInAction } from 'mobx';
import { observer } from 'mobx-react';
import * as WebRequest from 'web-request';
-import { Doc, DocListCast, HeightSym, Opt, WidthSym } from '../../../fields/Doc';
+import { Doc, DocListCast, Field, HeightSym, Opt, WidthSym } from '../../../fields/Doc';
import { Id } from '../../../fields/FieldSymbols';
import { HtmlField } from '../../../fields/HtmlField';
import { InkTool } from '../../../fields/InkField';
import { List } from '../../../fields/List';
import { listSpec } from '../../../fields/Schema';
-import { Cast, ImageCast, NumCast, StrCast } from '../../../fields/Types';
+import { Cast, ImageCast, NumCast, StrCast, WebCast } from '../../../fields/Types';
import { ImageField, WebField } from '../../../fields/URLField';
import { TraceMobx } from '../../../fields/util';
-import { emptyFunction, getWordAtPoint, returnFalse, returnOne, returnZero, setupMoveUpEvents, smoothScroll, StopEvent, Utils } from '../../../Utils';
+import { addStyleSheet, addStyleSheetRule, clearStyleSheetRules, emptyFunction, getWordAtPoint, removeStyleSheetRule, returnFalse, returnOne, returnTrue, returnZero, setupMoveUpEvents, smoothScroll, StopEvent, Utils } from '../../../Utils';
import { Docs, DocUtils } from '../../documents/Documents';
import { DocumentManager } from '../../util/DocumentManager';
import { DragManager } from '../../util/DragManager';
@@ -31,12 +31,13 @@ import { Annotation } from '../pdf/Annotation';
import { GPTPopup } from '../pdf/GPTPopup/GPTPopup';
import { SidebarAnnos } from '../SidebarAnnos';
import { StyleProp } from '../StyleProvider';
-import { DocFocusOptions, DocumentView, DocumentViewProps, OpenWhere } from './DocumentView';
+import { DocComponentView, DocFocusOptions, DocumentView, DocumentViewProps, OpenWhere } from './DocumentView';
import { FieldView, FieldViewProps } from './FieldView';
import { LinkDocPreview } from './LinkDocPreview';
import { PinProps, PresBox } from './trails';
import './WebBox.scss';
import React = require('react');
+import { RefField } from '../../../fields/RefField';
const { CreateImage } = require('./WebBoxRenderer');
const _global = (window /* browser */ || global) /* node */ as any;
const htmlToText = require('html-to-text');
@@ -47,6 +48,7 @@ export class WebBox extends ViewBoxAnnotatableComponent