From a1a9803096adde0cd932e703080948ef1d1724f7 Mon Sep 17 00:00:00 2001 From: bobzel Date: Mon, 29 Mar 2021 12:22:35 -0400 Subject: fixed doc decorations for dictation. gave dictation docs a title. minor cleanup. --- src/client/views/PropertiesView.tsx | 2 +- .../collections/CollectionStackedTimeline.tsx | 5 +++-- .../nodes/CollectionFreeFormDocumentView.scss | 1 + .../views/nodes/CollectionFreeFormDocumentView.tsx | 1 - src/client/views/nodes/DocumentView.tsx | 4 ++-- src/client/views/nodes/FieldView.tsx | 23 +--------------------- src/client/views/nodes/ScreenshotBox.tsx | 2 +- src/client/views/nodes/VideoBox.tsx | 2 +- 8 files changed, 10 insertions(+), 30 deletions(-) (limited to 'src') diff --git a/src/client/views/PropertiesView.tsx b/src/client/views/PropertiesView.tsx index 73c688029..0b2cdde6f 100644 --- a/src/client/views/PropertiesView.tsx +++ b/src/client/views/PropertiesView.tsx @@ -288,7 +288,7 @@ export class PropertiesView extends React.Component { addDocument={returnFalse} moveDocument={undefined} removeDocument={returnFalse} - parentActive={() => false} + parentActive={returnFalse} whenActiveChanged={emptyFunction} addDocTab={returnFalse} pinToPres={emptyFunction} diff --git a/src/client/views/collections/CollectionStackedTimeline.tsx b/src/client/views/collections/CollectionStackedTimeline.tsx index 73148560a..c0cebf021 100644 --- a/src/client/views/collections/CollectionStackedTimeline.tsx +++ b/src/client/views/collections/CollectionStackedTimeline.tsx @@ -8,7 +8,7 @@ import { List } from "../../../fields/List"; import { listSpec, makeInterface } from "../../../fields/Schema"; import { ComputedField, ScriptField } from "../../../fields/ScriptField"; import { Cast, NumCast } from "../../../fields/Types"; -import { emptyFunction, formatTime, OmitKeys, returnFalse, returnOne, setupMoveUpEvents, StopEvent } from "../../../Utils"; +import { emptyFunction, formatTime, OmitKeys, returnFalse, returnOne, setupMoveUpEvents, StopEvent, returnTrue } from "../../../Utils"; import { Docs } from "../../documents/Documents"; import { LinkManager } from "../../util/LinkManager"; import { Scripting } from "../../util/Scripting"; @@ -236,6 +236,7 @@ export class CollectionStackedTimeline extends CollectionSubView this.props.PanelHeight() / 3; timelineContentHeight = () => this.props.PanelHeight() * 2 / 3; + dictationScreenToLocalTransform = () => this.props.ScreenToLocalTransform().translate(0, -this.timelineContentHeight()); @computed get renderDictation() { const dictation = Cast(this.dataDoc[this.props.fieldKey.replace("annotations", "dictation")], Doc, null); return !dictation ? (null) :
@@ -244,10 +245,10 @@ export class CollectionStackedTimeline extends CollectionSubView {Doc.UserDoc().renderStyle !== "comic" ? (null) : diff --git a/src/client/views/nodes/DocumentView.tsx b/src/client/views/nodes/DocumentView.tsx index 8a2a755ac..80831708d 100644 --- a/src/client/views/nodes/DocumentView.tsx +++ b/src/client/views/nodes/DocumentView.tsx @@ -293,7 +293,7 @@ export class DocumentViewInternal extends DocComponent 3 || Math.abs(this._downY - touch.clientY) > 3)) { if (!e.altKey && (!this.topMost || this.layoutDoc.onDragStart || this.onClickHandler)) { @@ -530,7 +530,7 @@ export class DocumentViewInternal extends DocComponent 3 || Math.abs(this._downY - e.clientY) > 3) { if (!e.altKey && (!this.topMost || this.layoutDoc.onDragStart || this.onClickHandler) && (e.buttons === 1 || InteractionUtils.IsType(e, InteractionUtils.TOUCHTYPE))) { document.removeEventListener("pointermove", this.onPointerMove); diff --git a/src/client/views/nodes/FieldView.tsx b/src/client/views/nodes/FieldView.tsx index 465c18309..97f53aac0 100644 --- a/src/client/views/nodes/FieldView.tsx +++ b/src/client/views/nodes/FieldView.tsx @@ -73,28 +73,7 @@ export class FieldView extends React.Component { return

{field.date.toLocaleString()}

; } else if (field instanceof Doc) { - return

{field.title && field.title.toString()}

; - //return

{field.title + " : id= " + field[Id]}

; - // let returnHundred = () => 100; - // return ( - // - // ); + return

{field.title?.toString()}

; } else if (field instanceof List) { return
{field.length ? field.map(f => Field.toString(f)).join(", ") : ""}
; diff --git a/src/client/views/nodes/ScreenshotBox.tsx b/src/client/views/nodes/ScreenshotBox.tsx index aba7be68d..c00c79eb9 100644 --- a/src/client/views/nodes/ScreenshotBox.tsx +++ b/src/client/views/nodes/ScreenshotBox.tsx @@ -134,7 +134,7 @@ export class ScreenshotBox extends ViewBoxAnnotatableComponent { if (this.dataDoc[this.fieldKey + "-dictation"]) return; - const dictationText = CurrentUserUtils.GetNewTextDoc("", + const dictationText = CurrentUserUtils.GetNewTextDoc("dictation", NumCast(this.rootDoc.x), NumCast(this.rootDoc.y) + NumCast(this.layoutDoc._height) + 10, NumCast(this.layoutDoc._width), 2 * NumCast(this.layoutDoc._height)); dictationText._autoHeight = false; diff --git a/src/client/views/nodes/VideoBox.tsx b/src/client/views/nodes/VideoBox.tsx index da05b0c13..efcddd7b3 100644 --- a/src/client/views/nodes/VideoBox.tsx +++ b/src/client/views/nodes/VideoBox.tsx @@ -564,7 +564,7 @@ export class VideoBox extends ViewBoxAnnotatableComponent + }} onWheel={e => { e.stopPropagation(); e.preventDefault(); }}>