From df33fc10169b45706409748cffdeb84cd44cfdf9 Mon Sep 17 00:00:00 2001 From: bobzel Date: Mon, 22 Apr 2019 11:44:51 -0400 Subject: fixed webbox's --- src/client/views/nodes/VideoBox.tsx | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src/client/views/nodes/VideoBox.tsx') diff --git a/src/client/views/nodes/VideoBox.tsx b/src/client/views/nodes/VideoBox.tsx index 9d7c2bc56..1e6bc58c9 100644 --- a/src/client/views/nodes/VideoBox.tsx +++ b/src/client/views/nodes/VideoBox.tsx @@ -1,13 +1,12 @@ import React = require("react"); +import { action, computed, IReactionDisposer, trace } from "mobx"; import { observer } from "mobx-react"; +import Measure from "react-measure"; import { FieldWaiting, Opt } from '../../../fields/Field'; +import { KeyStore } from "../../../fields/KeyStore"; import { VideoField } from '../../../fields/VideoField'; import { FieldView, FieldViewProps } from './FieldView'; import "./VideoBox.scss"; -import Measure from "react-measure"; -import { action, trace, observable, IReactionDisposer, computed, reaction } from "mobx"; -import { KeyStore } from "../../../fields/KeyStore"; -import { number } from "prop-types"; @observer export class VideoBox extends React.Component { -- cgit v1.2.3-70-g09d2 From 96b1e27da348e47a4d5c83b182a5f55e96e3218e Mon Sep 17 00:00:00 2001 From: Bob Zeleznik Date: Fri, 26 Apr 2019 08:41:53 -0400 Subject: fixed keyboard modifier to not create document. cleaned up videobox render. --- src/client/views/PreviewCursor.tsx | 9 ++++----- src/client/views/nodes/FormattedTextBox.tsx | 2 +- src/client/views/nodes/VideoBox.tsx | 19 ++++++++++--------- 3 files changed, 15 insertions(+), 15 deletions(-) (limited to 'src/client/views/nodes/VideoBox.tsx') diff --git a/src/client/views/PreviewCursor.tsx b/src/client/views/PreviewCursor.tsx index 744ec0535..2e63f751b 100644 --- a/src/client/views/PreviewCursor.tsx +++ b/src/client/views/PreviewCursor.tsx @@ -26,12 +26,11 @@ export class PreviewCursor extends React.Component<{}> { // DASHFormattedTextBoxHandled flag when a text box consumes a key press so that we can ignore // the keyPress here. //if not these keys, make a textbox if preview cursor is active! - if (!e.ctrlKey && !e.altKey && !e.defaultPrevented && !(e as any).DASHFormattedTextBoxHandled) { - PreviewCursor.Visible && PreviewCursor._onKeyPress && PreviewCursor._onKeyPress(e); - PreviewCursor.Visible = false; - } else if (e.ctrlKey) { - if (e.key == "v") { + if (e.key.startsWith("F") && !e.key.endsWith("F")) { + } else if (e.key != "Alt" && e.key != "Shift" && e.key != "Meta" && e.key != "Control" && !e.defaultPrevented && !(e as any).DASHFormattedTextBoxHandled) { + if ((!e.ctrlKey && !e.metaKey) || e.key === "v") { PreviewCursor.Visible && PreviewCursor._onKeyPress && PreviewCursor._onKeyPress(e); + PreviewCursor.Visible = false; } } } diff --git a/src/client/views/nodes/FormattedTextBox.tsx b/src/client/views/nodes/FormattedTextBox.tsx index 4e841af98..8fb86f320 100644 --- a/src/client/views/nodes/FormattedTextBox.tsx +++ b/src/client/views/nodes/FormattedTextBox.tsx @@ -259,7 +259,7 @@ export class FormattedTextBox extends React.Component<(FieldViewProps & Formatte SelectionManager.DeselectAll(); } e.stopPropagation(); - if (e.keyCode === 9) e.preventDefault(); + if (e.key === "Tab") e.preventDefault(); // stop propagation doesn't seem to stop propagation of native keyboard events. // so we set a flag on the native event that marks that the event's been handled. (e.nativeEvent as any).DASHFormattedTextBoxHandled = true; diff --git a/src/client/views/nodes/VideoBox.tsx b/src/client/views/nodes/VideoBox.tsx index 1e6bc58c9..019e5e489 100644 --- a/src/client/views/nodes/VideoBox.tsx +++ b/src/client/views/nodes/VideoBox.tsx @@ -53,25 +53,26 @@ export class VideoBox extends React.Component { (vref as any).AHackBecauseSomethingResetsTheVideoToZero = this.curPage; } } + videoContent(path: string) { + return ; + } render() { let field = this.props.Document.GetT(this.props.fieldKey, VideoField); if (!field || field === FieldWaiting) { return
Loading
; } - let path = field.Data.href; - trace(); - return ( + return (this.props.Document.GetNumber(KeyStore.NativeHeight, 0)) ? + this.videoContent(field.data.href) : {({ measureRef }) =>
- + {this.videoContent(field.data.href)}
} -
- ); + ; } } \ No newline at end of file -- cgit v1.2.3-70-g09d2 From c5fe2f6e225778cfee4cd2d916fd3e4060bb468f Mon Sep 17 00:00:00 2001 From: Bob Zeleznik Date: Fri, 26 Apr 2019 21:12:23 -0400 Subject: fixed PDF selection (somewhat) and inking --- src/client/views/nodes/PDFBox.scss | 8 +++++++- src/client/views/nodes/PDFBox.tsx | 11 +++++++---- src/client/views/nodes/VideoBox.tsx | 1 - 3 files changed, 14 insertions(+), 6 deletions(-) (limited to 'src/client/views/nodes/VideoBox.tsx') diff --git a/src/client/views/nodes/PDFBox.scss b/src/client/views/nodes/PDFBox.scss index 87fdd720a..3760e378a 100644 --- a/src/client/views/nodes/PDFBox.scss +++ b/src/client/views/nodes/PDFBox.scss @@ -4,6 +4,9 @@ top: 0; left:0; } +.react-pdf__Page__textContent span { + user-select: text; +} .react-pdf__Document { position: absolute; } @@ -20,7 +23,10 @@ height:100px; } .pdfBox-cont { - pointer-events: none; + pointer-events: none ; + span { + pointer-events: none !important; + } } .pdfBox-cont-interactive { pointer-events: all; diff --git a/src/client/views/nodes/PDFBox.tsx b/src/client/views/nodes/PDFBox.tsx index 0525d353e..763a29aca 100644 --- a/src/client/views/nodes/PDFBox.tsx +++ b/src/client/views/nodes/PDFBox.tsx @@ -17,6 +17,7 @@ import { FieldView, FieldViewProps } from './FieldView'; import "./PDFBox.scss"; import React = require("react"); import { SelectionManager } from "../../util/SelectionManager"; +import { InkingControl } from "../InkingControl"; /** ALSO LOOK AT: Annotation.tsx, Sticky.tsx * This method renders PDF and puts all kinds of functionalities such as annotation, highlighting, @@ -203,8 +204,10 @@ export class PDFBox extends React.Component { * controls the area highlighting (stickies) Kinda temporary */ onPointerDown = (e: React.PointerEvent) => { - if (this.props.isSelected()) { + if (this.props.isSelected() && !InkingControl.Instance.selectedTool && e.buttons === 1) { e.stopPropagation(); + document.removeEventListener("pointerup", this.onPointerUp); + document.addEventListener("pointerup", this.onPointerUp); } } @@ -212,7 +215,7 @@ export class PDFBox extends React.Component { * controls area highlighting and partially highlighting. Kinda temporary */ @action - onPointerUp = (e: React.PointerEvent) => { + onPointerUp = (e: PointerEvent) => { if (this.props.isSelected()) { this.highlight("rgba(76, 175, 80, 0.3)"); //highlights to this default color. } @@ -314,9 +317,9 @@ export class PDFBox extends React.Component { } render() { trace(); - let classname = "pdfBox-cont" + (this.props.isSelected() ? "-interactive" : ""); + let classname = "pdfBox-cont" + (this.props.isSelected() && !InkingControl.Instance.selectedTool ? "-interactive" : ""); return ( -
+
{this.pdfRenderer}
); diff --git a/src/client/views/nodes/VideoBox.tsx b/src/client/views/nodes/VideoBox.tsx index 019e5e489..b34f1dc08 100644 --- a/src/client/views/nodes/VideoBox.tsx +++ b/src/client/views/nodes/VideoBox.tsx @@ -11,7 +11,6 @@ import "./VideoBox.scss"; @observer export class VideoBox extends React.Component { - private _reactionDisposer: Opt; private _videoRef = React.createRef(); public static LayoutString() { return FieldView.LayoutString(VideoBox); } -- cgit v1.2.3-70-g09d2