From 73e2bb22ca4bd1207e73ce5a9fa127c1de426372 Mon Sep 17 00:00:00 2001 From: anika-ahluwalia Date: Wed, 12 Aug 2020 19:55:19 -0500 Subject: all deletes to close --- src/client/views/DocumentDecorations.tsx | 2 +- src/client/views/PropertiesButtons.tsx | 6 +++--- src/client/views/nodes/DocumentView.tsx | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/client/views/DocumentDecorations.tsx b/src/client/views/DocumentDecorations.tsx index fdf802c6a..c5e3e6752 100644 --- a/src/client/views/DocumentDecorations.tsx +++ b/src/client/views/DocumentDecorations.tsx @@ -616,7 +616,7 @@ export class DocumentDecorations extends React.Component<{}, { value: string }>
) : canDelete ? ( -
Delete
} placement="top"> +
Close
} placement="top">
{/* Currently, this is set to be enabled if there is no ink selected. It might be interesting to think about minimizing ink if it's useful? -syip2*/} diff --git a/src/client/views/PropertiesButtons.tsx b/src/client/views/PropertiesButtons.tsx index 2451ff55a..1790acfcb 100644 --- a/src/client/views/PropertiesButtons.tsx +++ b/src/client/views/PropertiesButtons.tsx @@ -416,14 +416,14 @@ export class PropertiesButtons extends React.Component<{}, {}> { get deleteButton() { const targetDoc = this.selectedDoc; return !targetDoc ? (null) :
{"Delete Document"}
} placement="top"> + title={<>
Close Document
} placement="top">
{} + icon="times" size="lg" />}
-
delete
+
close
; } diff --git a/src/client/views/nodes/DocumentView.tsx b/src/client/views/nodes/DocumentView.tsx index a1c934e81..c877e2054 100644 --- a/src/client/views/nodes/DocumentView.tsx +++ b/src/client/views/nodes/DocumentView.tsx @@ -767,7 +767,7 @@ export class DocumentView extends DocComponent(Docu Doc.AreProtosEqual(this.props.Document, Doc.UserDoc()) && moreItems.push({ description: "Toggle Always Show Link End", event: () => Doc.UserDoc()["documentLinksButton-hideEnd"] = !Doc.UserDoc()["documentLinksButton-hideEnd"], icon: "eye" }); } - moreItems.push({ description: "Close", event: this.deleteClicked, icon: "trash" }); + moreItems.push({ description: "Close", event: this.deleteClicked, icon: "times" }); !more && cm.addItem({ description: "More...", subitems: moreItems, icon: "hand-point-right" }); cm.moveAfter(cm.findByDescription("More...")!, cm.findByDescription("OnClick...")!); -- cgit v1.2.3-70-g09d2 From 7a72a369dbce5062fb1d5cad116fd006848ac432 Mon Sep 17 00:00:00 2001 From: bobzel Date: Wed, 12 Aug 2020 23:26:30 -0400 Subject: made addDocTab(..,"replace") reuse the right tab --- .../views/collections/CollectionDockingView.tsx | 8 ++--- src/client/views/nodes/PresBox.tsx | 34 +++++++++++----------- 2 files changed, 19 insertions(+), 23 deletions(-) (limited to 'src') diff --git a/src/client/views/collections/CollectionDockingView.tsx b/src/client/views/collections/CollectionDockingView.tsx index 998e41bd2..ffa0b6439 100644 --- a/src/client/views/collections/CollectionDockingView.tsx +++ b/src/client/views/collections/CollectionDockingView.tsx @@ -839,12 +839,8 @@ export class DockedFrameRenderer extends React.Component { } else if (location === "close") { return CollectionDockingView.CloseRightSplit(doc); } else if (location === "replace") { - const alias = CollectionDockingView.ReplaceTab(doc, this._stack); - if (alias) { - runInAction(() => this._document = alias); - return true; - } - return false; + CollectionDockingView.UseRightSplit(doc); + return true; } else {// if (location === "inPlace") { return CollectionDockingView.Instance.AddTab(this._stack, doc, libraryPath); } diff --git a/src/client/views/nodes/PresBox.tsx b/src/client/views/nodes/PresBox.tsx index f6f6a2333..cada3bc83 100644 --- a/src/client/views/nodes/PresBox.tsx +++ b/src/client/views/nodes/PresBox.tsx @@ -228,21 +228,25 @@ export class PresBox extends ViewBoxBaseComponent const docToJump = curDoc; const willZoom = false; - //docToJump stayed same meaning, it was not in the group or was the last element in the group - if (activeItem.zoomProgressivize && this.rootDoc.presStatus !== 'edit') { - this.zoomProgressivizeNext(targetDoc); - } else if (docToJump === curDoc) { - //checking if curDoc has navigation open - if (curDoc.presNavButton && targetDoc) { - await DocumentManager.Instance.jumpToDocument(targetDoc, false, undefined, srcContext); - } else if (curDoc.presZoomButton && targetDoc) { + // If openDocument is selected then it should open the document for the user + if (activeItem.openDocument) { + this.props.addDocTab(activeItem, "replace"); + } else + //docToJump stayed same meaning, it was not in the group or was the last element in the group + if (activeItem.zoomProgressivize && this.rootDoc.presStatus !== 'edit') { + this.zoomProgressivizeNext(targetDoc); + } else if (docToJump === curDoc) { + //checking if curDoc has navigation open + if (curDoc.presNavButton && targetDoc) { + await DocumentManager.Instance.jumpToDocument(targetDoc, false, undefined, srcContext); + } else if (curDoc.presZoomButton && targetDoc) { + //awaiting jump so that new scale can be found, since jumping is async + await DocumentManager.Instance.jumpToDocument(targetDoc, true, undefined, srcContext); + } + } else { //awaiting jump so that new scale can be found, since jumping is async - await DocumentManager.Instance.jumpToDocument(targetDoc, true, undefined, srcContext); + targetDoc && await DocumentManager.Instance.jumpToDocument(targetDoc, willZoom, undefined, srcContext); } - } else { - //awaiting jump so that new scale can be found, since jumping is async - targetDoc && await DocumentManager.Instance.jumpToDocument(targetDoc, willZoom, undefined, srcContext); - } // After navigating to the document, if it is added as a presPinView then it will // adjust the pan and scale to that of the pinView when it was added. // TODO: Add option to remove presPinView @@ -251,10 +255,6 @@ export class PresBox extends ViewBoxBaseComponent targetDoc._panY = activeItem.presPinViewY; targetDoc._viewScale = activeItem.presPinViewScale; } - // If openDocument is selected then it should open the document for the user - if (collectionDocView && activeItem.openDocument) { - collectionDocView.props.addDocTab(activeItem, "inPlace"); - } // If website and has presWebsite data associated then on click it should // go back to that specific website // TODO: Add progressivize for navigating web (storing websites for given frames) -- cgit v1.2.3-70-g09d2 From 712448a2a9abef831bed8701a87c02ee96a354c1 Mon Sep 17 00:00:00 2001 From: anika-ahluwalia Date: Wed, 12 Aug 2020 23:29:04 -0500 Subject: default to private --- src/client/util/CurrentUserUtils.ts | 1 + src/client/util/SettingsManager.scss | 6 ++++++ 2 files changed, 7 insertions(+) (limited to 'src') diff --git a/src/client/util/CurrentUserUtils.ts b/src/client/util/CurrentUserUtils.ts index e06dec663..dddef33b3 100644 --- a/src/client/util/CurrentUserUtils.ts +++ b/src/client/util/CurrentUserUtils.ts @@ -909,6 +909,7 @@ export class CurrentUserUtils { doc.fontFamily = StrCast(doc.fontFamily, "Arial"); doc.fontColor = StrCast(doc.fontColor, "black"); doc.fontHighlight = StrCast(doc.fontHighlight, ""); + doc.defaultAclPrivate = BoolCast(doc.defaultAclPrivate, true); doc.activeCollectionBackground = StrCast(doc.activeCollectionBackground, "white"); doc.activeCollectionNestedBackground = Cast(doc.activeCollectionNestedBackground, "string", null); doc.noviceMode = BoolCast(doc.noviceMode, true); diff --git a/src/client/util/SettingsManager.scss b/src/client/util/SettingsManager.scss index 560786400..ec513e5d5 100644 --- a/src/client/util/SettingsManager.scss +++ b/src/client/util/SettingsManager.scss @@ -97,6 +97,8 @@ .modes-content { display: flex; + margin-left: 10px; + font-size: 12; .modes-select { // width: 170px; @@ -112,6 +114,8 @@ .modes-playground, .default-acl { display: flex; + margin-left: 10px; + font-size: 12; .playground-check, .acl-check { @@ -125,10 +129,12 @@ .playground-text { color: black; margin-right: 10px; + margin-top: 2; } .acl-text { color: black; + margin-top: 2; } } -- cgit v1.2.3-70-g09d2 From 2583d4cd4b8a5f8b3acc3c0e0970adf295d4d8c5 Mon Sep 17 00:00:00 2001 From: usodhi <61431818+usodhi@users.noreply.github.com> Date: Thu, 13 Aug 2020 14:50:06 +0530 Subject: location of mainviewnotifs notification bubble should be fixed + Anika's defaultaclprivate fix --- src/client/util/CurrentUserUtils.ts | 6 ++++++ src/client/views/MainViewNotifs.tsx | 10 +++++++++- src/client/views/collections/CollectionStackingView.tsx | 9 ++++----- src/client/views/collections/CollectionSubView.tsx | 2 -- 4 files changed, 19 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/client/util/CurrentUserUtils.ts b/src/client/util/CurrentUserUtils.ts index 11c2395ff..09876c736 100644 --- a/src/client/util/CurrentUserUtils.ts +++ b/src/client/util/CurrentUserUtils.ts @@ -23,6 +23,7 @@ import { SchemaHeaderField } from "../../fields/SchemaHeaderField"; import { DimUnit } from "../views/collections/collectionMulticolumn/CollectionMulticolumnView"; import { LabelBox } from "../views/nodes/LabelBox"; import { LinkManager } from "./LinkManager"; +import { Id } from "../../fields/FieldSymbols"; export class CurrentUserUtils { private static curr_id: string; @@ -550,6 +551,10 @@ export class CurrentUserUtils { _yMargin: 0, _yPadding: 0, _xMargin: 0, _autoHeight: false, _width: 60, _columnWidth: 60, lockedPosition: true, _chromeStatus: "disabled", system: true })); + + PromiseValue(Cast(doc.menuStack, Doc)).then(stack => { + stack && !stack.sharingButtonId && (stack.sharingButtonId = menuBtns.find(button => button.title === "Sharing")![Id]); + }); } // this resets all sidebar buttons to being deactivated PromiseValue(Cast(doc.menuStack, Doc)).then(stack => { @@ -909,6 +914,7 @@ export class CurrentUserUtils { doc.fontFamily = StrCast(doc.fontFamily, "Arial"); doc.fontColor = StrCast(doc.fontColor, "black"); doc.fontHighlight = StrCast(doc.fontHighlight, ""); + doc.defaultAclPrivate = BoolCast(doc.defaultAclPrivate, true); doc.activeCollectionBackground = StrCast(doc.activeCollectionBackground, "white"); doc.activeCollectionNestedBackground = Cast(doc.activeCollectionNestedBackground, "string", null); doc.noviceMode = BoolCast(doc.noviceMode, true); diff --git a/src/client/views/MainViewNotifs.tsx b/src/client/views/MainViewNotifs.tsx index 89006ebc8..c0cd7b3a7 100644 --- a/src/client/views/MainViewNotifs.tsx +++ b/src/client/views/MainViewNotifs.tsx @@ -8,6 +8,7 @@ import { DragManager } from '../util/DragManager'; import "./MainViewNotifs.scss"; import { MainView } from './MainView'; import { NumCast } from '../../fields/Types'; +import { Id } from '../../fields/FieldSymbols'; @observer @@ -28,7 +29,14 @@ export class MainViewNotifs extends React.Component { render() { const length = MainViewNotifs.NotifsCol ? DocListCast(MainViewNotifs.NotifsCol.data).length : 0; - return
+ const menuStack = Doc.UserDoc().menuStack as Doc; + const menuButtons = DocListCast(menuStack.data); + let top = 12 - NumCast(menuStack._scrollTop); + for (const button of menuButtons) { + if (button[Id] !== menuStack.sharingButtonId) top += NumCast(button._height); + else break; + } + return
{this.dockingContent} - {this.showProperties ? (null) :
diff --git a/src/client/views/MainViewNotifs.scss b/src/client/views/MainViewNotifs.scss deleted file mode 100644 index 92d7d6ee3..000000000 --- a/src/client/views/MainViewNotifs.scss +++ /dev/null @@ -1,20 +0,0 @@ -.mainNotifs-container { - position:absolute; - z-index: 1000; - top: 12px; - - .mainNotifs-badge { - position: absolute; - top: -10px; - right: -10px; - color: white; - background: #f44b42; - font-weight: 300; - border-radius: 100%; - width: 25px; - height: 25px; - text-align: center; - padding-top: 4px; - font-size: 12px; - } -} \ No newline at end of file diff --git a/src/client/views/MainViewNotifs.tsx b/src/client/views/MainViewNotifs.tsx deleted file mode 100644 index c0cd7b3a7..000000000 --- a/src/client/views/MainViewNotifs.tsx +++ /dev/null @@ -1,46 +0,0 @@ -import { observable } from 'mobx'; -import { observer } from 'mobx-react'; -import "normalize.css"; -import * as React from 'react'; -import { Doc, DocListCast, Opt } from '../../fields/Doc'; -import { returnFalse, setupMoveUpEvents } from '../../Utils'; -import { DragManager } from '../util/DragManager'; -import "./MainViewNotifs.scss"; -import { MainView } from './MainView'; -import { NumCast } from '../../fields/Types'; -import { Id } from '../../fields/FieldSymbols'; - - -@observer -export class MainViewNotifs extends React.Component { - @observable static NotifsCol: Opt; - _notifsRef = React.createRef(); - - onPointerDown = (e: React.PointerEvent) => { - setupMoveUpEvents(this, e, - (e: PointerEvent) => { - const dragData = new DragManager.DocumentDragData([MainViewNotifs.NotifsCol!]); - DragManager.StartDocumentDrag([this._notifsRef.current!], dragData, e.x, e.y); - return true; - }, - returnFalse, - () => MainViewNotifs.NotifsCol && MainView.Instance.selectMenu(MainViewNotifs.NotifsCol, "Sharing")); - } - - render() { - const length = MainViewNotifs.NotifsCol ? DocListCast(MainViewNotifs.NotifsCol.data).length : 0; - const menuStack = Doc.UserDoc().menuStack as Doc; - const menuButtons = DocListCast(menuStack.data); - let top = 12 - NumCast(menuStack._scrollTop); - for (const button of menuButtons) { - if (button[Id] !== menuStack.sharingButtonId) top += NumCast(button._height); - else break; - } - return
- -
; - } -} diff --git a/src/client/views/collections/CollectionStackingView.tsx b/src/client/views/collections/CollectionStackingView.tsx index e479fa639..2b7ae4338 100644 --- a/src/client/views/collections/CollectionStackingView.tsx +++ b/src/client/views/collections/CollectionStackingView.tsx @@ -149,8 +149,6 @@ export class CollectionStackingView extends CollectionSubView(StackingDocument) () => this.pivotField, () => this.layoutDoc._columnHeaders = new List() ); - - this.props.Document._scrollTop = 0; } componentWillUnmount() { super.componentWillUnmount(); @@ -494,7 +492,6 @@ export class CollectionStackingView extends CollectionSubView(StackingDocument) onScroll={action(e => { if (!this.props.isSelected() && this.props.renderDepth) e.currentTarget.scrollTop = this._scroll; else this._scroll = e.currentTarget.scrollTop; - this.props.Document._scrollTop = this._scroll; // used by MainViewNotifs to determine position of the notification bubble })} onDrop={this.onExternalDrop.bind(this)} onContextMenu={this.onContextMenu} diff --git a/src/client/views/nodes/DocumentView.tsx b/src/client/views/nodes/DocumentView.tsx index a1c934e81..820ee2752 100644 --- a/src/client/views/nodes/DocumentView.tsx +++ b/src/client/views/nodes/DocumentView.tsx @@ -6,15 +6,13 @@ import { Document } from '../../../fields/documentSchemas'; import { Id } from '../../../fields/FieldSymbols'; import { InkTool } from '../../../fields/InkField'; import { listSpec } from "../../../fields/Schema"; -import { SchemaHeaderField } from '../../../fields/SchemaHeaderField'; import { ScriptField } from '../../../fields/ScriptField'; import { BoolCast, Cast, NumCast, ScriptCast, StrCast } from "../../../fields/Types"; import { GetEffectiveAcl, TraceMobx } from '../../../fields/util'; import { MobileInterface } from '../../../mobile/MobileInterface'; import { GestureUtils } from '../../../pen-gestures/GestureUtils'; -import { emptyFunction, emptyPath, OmitKeys, returnOne, returnTransparent, Utils } from "../../../Utils"; +import { emptyFunction, OmitKeys, returnOne, returnTransparent, Utils } from "../../../Utils"; import { GooglePhotos } from '../../apis/google_docs/GooglePhotosClientUtils'; -import { ClientRecommender } from '../../ClientRecommender'; import { Docs, DocUtils } from "../../documents/Documents"; import { DocumentType } from '../../documents/DocumentTypes'; import { DocumentManager } from "../../util/DocumentManager"; @@ -22,7 +20,6 @@ import { DragManager, dropActionType } from "../../util/DragManager"; import { InteractionUtils } from '../../util/InteractionUtils'; import { LinkManager } from '../../util/LinkManager'; import { Scripting } from '../../util/Scripting'; -import { SearchUtil } from '../../util/SearchUtil'; import { SelectionManager } from "../../util/SelectionManager"; import SharingManager from '../../util/SharingManager'; import { SnappingManager } from '../../util/SnappingManager'; @@ -33,7 +30,6 @@ import { ContextMenu } from "../ContextMenu"; import { ContextMenuProps } from '../ContextMenuItem'; import { DocComponent } from "../DocComponent"; import { EditableView } from '../EditableView'; -import { KeyphraseQueryView } from '../KeyphraseQueryView'; import { DocumentContentsView } from "./DocumentContentsView"; import { DocumentLinksButton } from './DocumentLinksButton'; import "./DocumentView.scss"; diff --git a/src/client/views/nodes/FontIconBox.scss b/src/client/views/nodes/FontIconBox.scss index 6a540269e..75bc90d7a 100644 --- a/src/client/views/nodes/FontIconBox.scss +++ b/src/client/views/nodes/FontIconBox.scss @@ -13,6 +13,27 @@ width: 100%; } +.fontIconBadge-container { + position:absolute; + z-index: 1000; + top: 12px; + + .fontIconBadge { + position: absolute; + top: -10px; + right: -10px; + color: white; + background: #f44b42; + font-weight: 300; + border-radius: 100%; + width: 25px; + height: 25px; + text-align: center; + padding-top: 4px; + font-size: 12px; + } +} + .menuButton-round { border-radius: 100%; background-color: black; diff --git a/src/client/views/nodes/FontIconBox.tsx b/src/client/views/nodes/FontIconBox.tsx index 168d640e9..fa21a8594 100644 --- a/src/client/views/nodes/FontIconBox.tsx +++ b/src/client/views/nodes/FontIconBox.tsx @@ -5,13 +5,15 @@ import { createSchema, makeInterface } from '../../../fields/Schema'; import { DocComponent } from '../DocComponent'; import './FontIconBox.scss'; import { FieldView, FieldViewProps } from './FieldView'; -import { StrCast, Cast } from '../../../fields/Types'; -import { Utils } from "../../../Utils"; +import { StrCast, Cast, ScriptCast } from '../../../fields/Types'; +import { Utils, setupMoveUpEvents, returnFalse, emptyFunction } from "../../../Utils"; import { runInAction, observable, reaction, IReactionDisposer } from 'mobx'; -import { Doc } from '../../../fields/Doc'; +import { Doc, DocListCast } from '../../../fields/Doc'; import { ContextMenu } from '../ContextMenu'; import { ScriptField } from '../../../fields/ScriptField'; import { Tooltip } from '@material-ui/core'; +import { MainViewNotifs } from '../MainViewNotifs'; +import { DragManager } from '../../util/DragManager'; const FontIconSchema = createSchema({ icon: "string", }); @@ -73,6 +75,7 @@ export class FontIconBox extends DocComponent( {} {!label ? (null) :
{label}
} + {this.props.Document.watchedDocuments ? : (null)}
; return !this.layoutDoc.toolTip ? button : @@ -80,4 +83,34 @@ export class FontIconBox extends DocComponent( {button} ; } +} + +interface FontIconBadgeProps { + collection: Doc; +} + +@observer +export class FontIconBadge extends React.Component { + _notifsRef = React.createRef(); + + onPointerDown = (e: React.PointerEvent) => { + setupMoveUpEvents(this, e, + (e: PointerEvent) => { + const dragData = new DragManager.DocumentDragData([this.props.collection]); + DragManager.StartDocumentDrag([this._notifsRef.current!], dragData, e.x, e.y); + return true; + }, + returnFalse, emptyFunction, false); + } + + render() { + if (!(this.props.collection instanceof Doc)) return (null); + const length = DocListCast(this.props.collection.data).length; + return
+
0 ? { "display": "initial" } : { "display": "none" }} + onPointerDown={this.onPointerDown} > + {length} +
+
; + } } \ No newline at end of file -- cgit v1.2.3-70-g09d2 From bd85fc12e1d424c270c0873ca3d39786a3865125 Mon Sep 17 00:00:00 2001 From: bobzel Date: Thu, 13 Aug 2020 09:33:29 -0400 Subject: changes for menus to be functional wherever they are placed --- src/client/util/CurrentUserUtils.ts | 18 +++++++++--------- src/client/views/MainView.tsx | 10 ++++++---- src/fields/ScriptField.ts | 4 ++++ 3 files changed, 19 insertions(+), 13 deletions(-) (limited to 'src') diff --git a/src/client/util/CurrentUserUtils.ts b/src/client/util/CurrentUserUtils.ts index 95aebbe4a..c967457a7 100644 --- a/src/client/util/CurrentUserUtils.ts +++ b/src/client/util/CurrentUserUtils.ts @@ -506,15 +506,15 @@ export class CurrentUserUtils { title: string, icon: string, click: string, }[] { return [ - { title: "Sharing", icon: "users", click: 'scriptContext.selectMenu(self, "Sharing")' }, - { title: "Workspace", icon: "desktop", click: 'scriptContext.selectMenu(self, "Workspace")' }, - { title: "Catalog", icon: "file", click: 'scriptContext.selectMenu(self, "Catalog")' }, - { title: "Archive", icon: "archive", click: 'scriptContext.selectMenu(self, "Archive")' }, - { title: "Import", icon: "upload", click: 'scriptContext.selectMenu(self, "Import")' }, - { title: "Tools", icon: "wrench", click: 'scriptContext.selectMenu(self, "Tools")' }, - { title: "Help", icon: "question-circle", click: 'scriptContext.selectMenu(self, "Help")' }, - { title: "Settings", icon: "cog", click: 'scriptContext.selectMenu(self, "Settings")' }, - { title: "User Doc", icon: "address-card", click: 'scriptContext.selectMenu(self, "UserDoc")' }, + { title: "Sharing", icon: "users", click: 'selectMainMenu(self)' }, + { title: "Workspace", icon: "desktop", click: 'selectMainMenu(self)' }, + { title: "Catalog", icon: "file", click: 'selectMainMenu(self)' }, + { title: "Archive", icon: "archive", click: 'selectMainMenu(self)' }, + { title: "Import", icon: "upload", click: 'selectMainMenu(self)' }, + { title: "Tools", icon: "wrench", click: 'selectMainMenu(self)' }, + { title: "Help", icon: "question-circle", click: 'selectMainMenu(self)' }, + { title: "Settings", icon: "cog", click: 'selectMainMenu(self)' }, + { title: "User Doc", icon: "address-card", click: 'selectMainMenu(self)' }, ]; } diff --git a/src/client/views/MainView.tsx b/src/client/views/MainView.tsx index be8807336..2e2eb7465 100644 --- a/src/client/views/MainView.tsx +++ b/src/client/views/MainView.tsx @@ -532,15 +532,16 @@ export class MainView extends React.Component { _lastButton: Doc | undefined; @action - selectMenu = (button: Doc, str: string) => { + selectMenu = (button: Doc) => { + const title = StrCast(Doc.GetProto(button).title); this._lastButton && (this._lastButton.color = "white"); this._lastButton && (this._lastButton._backgroundColor = ""); - if (this.panelContent === str && this.flyoutWidth !== 0) { + if (this.panelContent === title && this.flyoutWidth !== 0) { this.panelContent = "none"; this.flyoutWidth = 0; } else { let panelDoc: Doc | undefined; - switch (this.panelContent = str) { + switch (this.panelContent = title) { case "Tools": panelDoc = Doc.UserDoc()["sidebar-tools"] as Doc ?? undefined; break; case "Workspace": panelDoc = Doc.UserDoc()["sidebar-workspaces"] as Doc ?? undefined; break; case "Catalog": panelDoc = Doc.UserDoc()["sidebar-catalog"] as Doc ?? undefined; break; @@ -548,7 +549,7 @@ export class MainView extends React.Component { case "Settings": SettingsManager.Instance.open(); break; case "Import": panelDoc = Doc.UserDoc()["sidebar-import"] as Doc ?? undefined; break; case "Sharing": panelDoc = Doc.UserDoc()["sidebar-sharing"] as Doc ?? undefined; break; - case "UserDoc": panelDoc = Doc.UserDoc()["sidebar-userDoc"] as Doc ?? undefined; break; + case "User Doc": panelDoc = Doc.UserDoc()["sidebar-userDoc"] as Doc ?? undefined; break; } this.sidebarContent.proto = panelDoc; if (panelDoc) { @@ -973,6 +974,7 @@ export class MainView extends React.Component { input.click(); } } +Scripting.addGlobal(function selectMainMenu(doc: Doc, title: string) { MainView.Instance.selectMenu(doc); }); Scripting.addGlobal(function freezeSidebar() { MainView.expandFlyout(); }); Scripting.addGlobal(function toggleComicMode() { Doc.UserDoc().fontFamily = "Comic Sans MS"; Doc.UserDoc().renderStyle = Doc.UserDoc().renderStyle === "comic" ? undefined : "comic"; }); Scripting.addGlobal(function copyWorkspace() { diff --git a/src/fields/ScriptField.ts b/src/fields/ScriptField.ts index 4cc3a7cc7..9391f56ac 100644 --- a/src/fields/ScriptField.ts +++ b/src/fields/ScriptField.ts @@ -56,6 +56,9 @@ async function deserializeScript(script: ScriptField) { if (script.script.originalScript === 'self.userDoc.noviceMode') { return (script as any).script = (ScriptField.NoviceMode ?? (ScriptField.NoviceMode = ComputedField.MakeFunction('self.userDoc.noviceMode')))?.script; } + if (script.script.originalScript === `selectMainMenu(self)`) { + return (script as any).script = (ScriptField.SelectMenu ?? (ScriptField.SelectMenu = ComputedField.MakeFunction('selectMainMenu(self)')))?.script; + } const captures: ProxyField = (script as any).captures; if (captures) { const doc = (await captures.value())!; @@ -89,6 +92,7 @@ export class ScriptField extends ObjectField { public static DeiconifyView: Opt; public static ConvertToButtons: Opt; public static NoviceMode: Opt; + public static SelectMenu: Opt; constructor(script: CompiledScript, setterscript?: CompiledScript) { super(); -- cgit v1.2.3-70-g09d2 From 8460f4e5c3a409a095e87a0b841b097d20a4e466 Mon Sep 17 00:00:00 2001 From: bobzel Date: Thu, 13 Aug 2020 09:41:56 -0400 Subject: made stayInCollection a layout property --- src/client/documents/Documents.ts | 2 +- src/client/util/CurrentUserUtils.ts | 6 +++--- src/client/views/InkingStroke.tsx | 2 +- src/client/views/PropertiesButtons.tsx | 2 +- src/client/views/collections/CollectionView.tsx | 2 +- src/fields/documentSchemas.ts | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/client/documents/Documents.ts b/src/client/documents/Documents.ts index fe50ed0b3..42ba4d2c4 100644 --- a/src/client/documents/Documents.ts +++ b/src/client/documents/Documents.ts @@ -185,7 +185,7 @@ export interface DocumentOptions { targetContainer?: Doc; // document whose proto will be set to 'panel' as the result of a onClick click script searchFileTypes?: List; // file types allowed in a search query strokeWidth?: number; - stayInCollection?: boolean;// whether the document should remain in its collection when someone tries to drag and drop it elsewhere + _stayInCollection?: boolean;// whether the document should remain in its collection when someone tries to drag and drop it elsewhere treeViewPreventOpen?: boolean; // ignores the treeViewOpen Doc flag which allows a treeViewItem's expand/collapse state to be independent of other views of the same document in the tree view treeViewHideTitle?: boolean; // whether to hide the title of a tree view treeViewHideHeaderFields?: boolean; // whether to hide the drop down options for tree view items. diff --git a/src/client/util/CurrentUserUtils.ts b/src/client/util/CurrentUserUtils.ts index a73a13858..536baadd4 100644 --- a/src/client/util/CurrentUserUtils.ts +++ b/src/client/util/CurrentUserUtils.ts @@ -536,7 +536,7 @@ export class CurrentUserUtils { iconShape: "square", title, _backgroundColor: "black", - stayInCollection: true, + _stayInCollection: true, childDropAction: "same", _width: 60, _height: 60, @@ -727,7 +727,7 @@ export class CurrentUserUtils { if (doc.myCatalog === undefined) { doc.myCatalog = new PrefetchProxy(Docs.Create.SchemaDocument([], [], { title: "CATALOG", _height: 1000, _fitWidth: true, forceActive: true, boxShadow: "0 0", treeViewPreventOpen: false, - childDropAction: "alias", targetDropAction: "same", stayInCollection: true, treeViewOpen: true, system: true + childDropAction: "alias", targetDropAction: "same", _stayInCollection: true, treeViewOpen: true, system: true })); } @@ -747,7 +747,7 @@ export class CurrentUserUtils { doc.myRecentlyClosed === undefined; if (doc.myRecentlyClosed === undefined) { doc.myRecentlyClosed = new PrefetchProxy(Docs.Create.TreeDocument([], { - title: "RECENTLY CLOSED", _height: 75, forceActive: true, boxShadow: "0 0", treeViewPreventOpen: false, treeViewOpen: true, stayInCollection: true, system: true + title: "RECENTLY CLOSED", _height: 75, forceActive: true, boxShadow: "0 0", treeViewPreventOpen: false, treeViewOpen: true, _stayInCollection: true, system: true })); } // this is equivalent to using PrefetchProxies to make sure the recentlyClosed doc is ready diff --git a/src/client/views/InkingStroke.tsx b/src/client/views/InkingStroke.tsx index e3390426b..41311ed86 100644 --- a/src/client/views/InkingStroke.tsx +++ b/src/client/views/InkingStroke.tsx @@ -43,7 +43,7 @@ export class InkingStroke extends ViewBoxBaseComponent { this.selectedDoc._backgroundColor = "rgba(0,0,0,0.7)"; this.selectedDoc.mixBlendMode = "hard-light"; this.selectedDoc.color = "#9b9b9bff"; - this.selectedDoc.stayInCollection = true; + this.selectedDoc._stayInCollection = true; this.selectedDoc.isInkMask = true; } } diff --git a/src/client/views/collections/CollectionView.tsx b/src/client/views/collections/CollectionView.tsx index 7562d7e9c..6dd21ef7f 100644 --- a/src/client/views/collections/CollectionView.tsx +++ b/src/client/views/collections/CollectionView.tsx @@ -222,7 +222,7 @@ export class CollectionView extends Touchable this.removeDocument(doc))) { const added = addDocument(doc); if (!added) UndoManager.UndoTempBatch(); diff --git a/src/fields/documentSchemas.ts b/src/fields/documentSchemas.ts index ada13226e..848a648e1 100644 --- a/src/fields/documentSchemas.ts +++ b/src/fields/documentSchemas.ts @@ -102,7 +102,7 @@ export const documentSchema = createSchema({ _lockedTransform: "boolean",// whether a freeformview can pan/zoom // drag drop properties - stayInCollection: "boolean",// whether document can be dropped into a different collection + _stayInCollection: "boolean",// whether document can be dropped into a different collection dragFactory: Doc, // the document that serves as the "template" for the onDragStart script. ie, to drag out copies of the dragFactory document. dropAction: "string", // override specifying what should happen when this document is dropped (can be "alias", "copy", "move") targetDropAction: "string", // allows the target of a drop event to specify the dropAction ("alias", "copy", "move") NOTE: if the document is dropped within the same collection, the dropAction is coerced to 'move' -- cgit v1.2.3-70-g09d2 From 24d337dabcd1a84c9fd9aa0a8b17924c99f3e122 Mon Sep 17 00:00:00 2001 From: bobzel Date: Thu, 13 Aug 2020 11:35:11 -0400 Subject: sent make Background images to back --- src/client/views/nodes/ImageBox.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/client/views/nodes/ImageBox.tsx b/src/client/views/nodes/ImageBox.tsx index d668d332b..d1d9df083 100644 --- a/src/client/views/nodes/ImageBox.tsx +++ b/src/client/views/nodes/ImageBox.tsx @@ -158,7 +158,7 @@ export class ImageBox extends ViewBoxAnnotatableComponent this.layoutDoc.isBackground = true, icon: "expand-arrows-alt" }); + funcs.push({ description: "Make Background", event: () => { this.layoutDoc.isBackground = true; this.props.bringToFront?.(this.rootDoc); }, icon: "expand-arrows-alt" }); if (!Doc.UserDoc().noviceMode) { funcs.push({ description: "Export to Google Photos", event: () => GooglePhotos.Transactions.UploadImages([this.props.Document]), icon: "caret-square-right" }); funcs.push({ description: "Copy path", event: () => Utils.CopyText(field.url.href), icon: "expand-arrows-alt" }); -- cgit v1.2.3-70-g09d2 From bb0bb3e1b0c38d5eff31e346745ef620b4302698 Mon Sep 17 00:00:00 2001 From: usodhi <61431818+usodhi@users.noreply.github.com> Date: Thu, 13 Aug 2020 21:25:11 +0530 Subject: import documents changes --- src/client/documents/Documents.ts | 1 + src/client/util/CurrentUserUtils.ts | 4 ++-- src/client/views/collections/CollectionStackingViewFieldColumn.tsx | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/client/documents/Documents.ts b/src/client/documents/Documents.ts index 42ba4d2c4..3f0fe4626 100644 --- a/src/client/documents/Documents.ts +++ b/src/client/documents/Documents.ts @@ -209,6 +209,7 @@ export interface DocumentOptions { audioEnd?: number; // the time frame where the audio should stop playing border?: string; //for searchbox hovercolor?: string; + showNewButton?: boolean; // used in stacking view to not display the "+ NEW" button } class EmptyBox { diff --git a/src/client/util/CurrentUserUtils.ts b/src/client/util/CurrentUserUtils.ts index 536baadd4..64515622f 100644 --- a/src/client/util/CurrentUserUtils.ts +++ b/src/client/util/CurrentUserUtils.ts @@ -853,12 +853,12 @@ export class CurrentUserUtils { // Import sidebar is where shared documents are contained static setupImportSidebar(doc: Doc) { if (doc["sidebar-import-documents"] === undefined) { - doc["sidebar-import-documents"] = new PrefetchProxy(Docs.Create.StackingDocument([], { title: "Imported Documents", _showTitle: "title", _height: 300, _yMargin: 30, childDropAction: "alias" })); + doc["sidebar-import-documents"] = new PrefetchProxy(Docs.Create.StackingDocument([], { title: "Imported Documents", _showTitle: "title", _height: 300, _yMargin: 30, childDropAction: "copy", lockedPosition: true, showNewButton: false })); } if (doc["sidebar-import"] === undefined) { const uploads = Cast(doc["sidebar-import-documents"], Doc, null) as Doc; const newUpload = CurrentUserUtils.ficon({ onClick: ScriptField.MakeScript("importDocument()"), toolTip: "Import external document", _backgroundColor: "black", title: "Import", icon: "upload", system: true }); - doc["sidebar-import"] = new PrefetchProxy(Docs.Create.StackingDocument([newUpload, uploads], { title: "Imported Documents", _yMargin: 30, childDropAction: "alias" })); + doc["sidebar-import"] = new PrefetchProxy(Docs.Create.StackingDocument([newUpload, uploads], { title: "Imported Documents", _yMargin: 30, childDropAction: "copy", ignoreClick: true, lockedPosition: true })); } } diff --git a/src/client/views/collections/CollectionStackingViewFieldColumn.tsx b/src/client/views/collections/CollectionStackingViewFieldColumn.tsx index f193a9787..cbfb1c36f 100644 --- a/src/client/views/collections/CollectionStackingViewFieldColumn.tsx +++ b/src/client/views/collections/CollectionStackingViewFieldColumn.tsx @@ -367,7 +367,7 @@ export class CollectionStackingViewFieldColumn extends React.Component - {(chromeStatus !== 'view-mode' && chromeStatus !== 'disabled' && type !== DocumentType.PRES) ? + {(chromeStatus !== 'view-mode' && chromeStatus !== 'disabled' && type !== DocumentType.PRES && this.props.parent.props.Document.showNewButton !== false) ?
-- cgit v1.2.3-70-g09d2 From 5ff1c779fc1caad98c27b64f4cf8731b4e35e316 Mon Sep 17 00:00:00 2001 From: bobzel Date: Thu, 13 Aug 2020 12:07:05 -0400 Subject: fixed border-rounding of docs --- src/client/views/nodes/DocumentView.tsx | 2 +- src/client/views/nodes/ImageBox.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/client/views/nodes/DocumentView.tsx b/src/client/views/nodes/DocumentView.tsx index 820ee2752..0088e265e 100644 --- a/src/client/views/nodes/DocumentView.tsx +++ b/src/client/views/nodes/DocumentView.tsx @@ -815,7 +815,7 @@ export class DocumentView extends DocComponent(Docu @computed get contents() { const pos = this.props.relative ? "relative " : "absolute"; TraceMobx(); - return (
+ return (
Date: Fri, 14 Aug 2020 02:31:24 +0900 Subject: vertical and horizontal --- src/client/views/GestureOverlay.tsx | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/client/views/GestureOverlay.tsx b/src/client/views/GestureOverlay.tsx index 81bb542dd..76e786257 100644 --- a/src/client/views/GestureOverlay.tsx +++ b/src/client/views/GestureOverlay.tsx @@ -678,8 +678,8 @@ export default class GestureOverlay extends Touchable { var top = Math.min(...ys); const firstx = this._points[0].X; const firsty = this._points[0].Y; - const lastx = this._points[this._points.length - 2].X; - const lasty = this._points[this._points.length - 2].Y; + var lastx = this._points[this._points.length - 2].X; + var lasty = this._points[this._points.length - 2].Y; var fourth = (lastx - firstx) / 4; if (isNaN(fourth) || fourth === 0) { fourth = 0.01; } var m = (lasty - firsty) / (lastx - firstx); @@ -771,11 +771,17 @@ export default class GestureOverlay extends Touchable { break; case "line": + if (Math.abs(firstx - lastx) < 20) { + lastx = firstx; + } + if (Math.abs(firsty - lasty) < 20) { + lasty = firsty; + } this._points.push({ X: firstx, Y: firsty }); this._points.push({ X: firstx, Y: firsty }); - this._points.push({ X: firstx + 4 * fourth, Y: m * (firstx + 4 * fourth) + b }); - this._points.push({ X: firstx + 4 * fourth, Y: m * (firstx + 4 * fourth) + b }); + this._points.push({ X: lastx, Y: lasty }); + this._points.push({ X: lastx, Y: lasty }); break; case "arrow": const x1 = left; -- cgit v1.2.3-70-g09d2 From 71b813b51f8e5d4e566eee5cac195f94c02f9ee1 Mon Sep 17 00:00:00 2001 From: Geireann Lindfield Roberts <60007097+geireann@users.noreply.github.com> Date: Fri, 14 Aug 2020 03:04:10 +0800 Subject: minimize + import multiple --- src/client/views/MainView.tsx | 1 + src/client/views/OverlayView.scss | 2 +- src/client/views/OverlayView.tsx | 2 +- .../views/collections/CollectionDockingView.scss | 76 ----------- .../views/collections/CollectionDockingView.tsx | 73 ++++------- src/client/views/nodes/AudioBox.tsx | 1 - src/client/views/nodes/PresBox.scss | 96 ++++++++++++-- src/client/views/nodes/PresBox.tsx | 142 +++++++++++++-------- 8 files changed, 209 insertions(+), 184 deletions(-) (limited to 'src') diff --git a/src/client/views/MainView.tsx b/src/client/views/MainView.tsx index be8807336..816de55ca 100644 --- a/src/client/views/MainView.tsx +++ b/src/client/views/MainView.tsx @@ -903,6 +903,7 @@ export class MainView extends React.Component { const sidebarDocView = DocumentManager.Instance.getDocumentView(sidebar); const input = document.createElement("input"); input.type = "file"; + input.multiple = true; input.accept = ".zip, application/pdf, video/*, image/*, audio/*"; input.onchange = async _e => { const upload = Utils.prepend("/uploadDoc"); diff --git a/src/client/views/OverlayView.scss b/src/client/views/OverlayView.scss index 09a349012..555f4298d 100644 --- a/src/client/views/OverlayView.scss +++ b/src/client/views/OverlayView.scss @@ -44,6 +44,6 @@ } .overlayView-doc { - z-index: 1; + z-index: 9002; //so that it appears above chroma position: absolute; } \ No newline at end of file diff --git a/src/client/views/OverlayView.tsx b/src/client/views/OverlayView.tsx index 5c3a8185c..49580cde4 100644 --- a/src/client/views/OverlayView.tsx +++ b/src/client/views/OverlayView.tsx @@ -182,7 +182,7 @@ export class OverlayView extends React.Component { offsetx = NumCast(d.x) - e.clientX; offsety = NumCast(d.y) - e.clientY; }; - return
+ return
{ - if (!CollectionDockingView.Instance) return undefined; - const instance = CollectionDockingView.Instance; - const replaceTab = (doc: Doc, child: any): Opt => { - for (const contentItem of child.contentItems) { - const { config, isStack, isRow, isColumn } = contentItem; - if (isRow || isColumn || isStack) { - const val = replaceTab(doc, contentItem); - if (val) return val; - } else if (config.component === "DocumentFrameRenderer" && - config.props.documentId === doc[Id]) { - const alias = Doc.MakeAlias(doc); - config.props.documentId = alias[Id]; - config.title = alias.title; - instance.stateChanged(); - return alias; - } - } - return undefined; - }; - return replaceTab(document, instance._goldenLayout.root); - } - // // Creates a vertical split on the right side of the docking view, and then adds the Document to the right of that split // @@ -358,6 +333,32 @@ export class CollectionDockingView extends React.Component { + Doc.GetProto(document).lastOpened = new DateField; + const docContentConfig = CollectionDockingView.makeDocumentConfig(document, undefined, libraryPath); + if (stack === undefined) { + let stack: any = this._goldenLayout.root; + while (!stack.isStack) { + if (stack.contentItems.length) { + stack = stack.contentItems[0]; + } else { + stack.addChild({ type: 'stack', content: [docContentConfig] }); + stack = undefined; + break; + } + } + if (stack) { + stack.addChild(docContentConfig); + } + } else { + stack.addChild(docContentConfig, undefined); + } + this.layoutChanged(); + return true; + } + setupGoldenLayout() { const config = StrCast(this.props.Document.dockingConfig); if (config) { @@ -871,26 +872,7 @@ export class DockedFrameRenderer extends React.Component { const currentFrame = Cast(presTargetDoc.currentFrame, "number", null); return currentFrame; } - renderMiniPres() { - return ( -
- {
-
-
PresBox.Instance.startAutoPres(PresBox.Instance.itemIndex)}>
-
-
-
- Slide {PresBox.Instance.itemIndex + 1} / {PresBox.Instance.childDocs.length} - {PresBox.Instance.playButtonFrames} -
-
-
EXIT
-
} -
- ); - } + renderMiniMap() { return
{ ContainingCollectionView={undefined} ContainingCollectionDoc={undefined} /> {document._viewType === CollectionViewType.Freeform && !this._document?.hideMinimap ? this.renderMiniMap() : (null)} - {document._viewType === CollectionViewType.Freeform && this._document?.miniPres ? this.renderMiniPres() : (null)} ; } diff --git a/src/client/views/nodes/AudioBox.tsx b/src/client/views/nodes/AudioBox.tsx index 011b6ff87..900963eb0 100644 --- a/src/client/views/nodes/AudioBox.tsx +++ b/src/client/views/nodes/AudioBox.tsx @@ -510,7 +510,6 @@ export class AudioBox extends ViewBoxAnnotatableComponent AudioBox.LabelScript; render() { - AudioBox.Instance = this; const interactive = SnappingManager.GetIsDragging() || this.active() ? "-interactive" : ""; this._first = true; // for indicating the first marker that is rendered this.path && this._buckets.length !== 100 ? this.peaks : null; // render waveform if audio is done recording diff --git a/src/client/views/nodes/PresBox.scss b/src/client/views/nodes/PresBox.scss index 54accb012..c4d8f1a4f 100644 --- a/src/client/views/nodes/PresBox.scss +++ b/src/client/views/nodes/PresBox.scss @@ -13,7 +13,7 @@ $light-background: #ececec; width: 100%; min-width: 20px; height: 100%; - min-height: 41px; + min-height: 35px; letter-spacing: 2px; overflow: hidden; transition: 0.7s opacity ease; @@ -801,7 +801,7 @@ $light-background: #ececec; } - .miniPresOverlay { + .presPanelOverlay { background-color: #323232; color: white; border-radius: 5px; @@ -816,7 +816,7 @@ $light-background: #ececec; right: 10px; transition: all 0.2s; - .miniPres-button-text { + .presPanel-button-text { display: flex; height: 20; width: max-content; @@ -833,13 +833,13 @@ $light-background: #ececec; transition: all 0.3s; } - .miniPres-divider { + .presPanel-divider { width: 0.5px; height: 80%; border-right: solid 1px #5a5a5a; } - .miniPres-button-frame { + .presPanel-button-frame { justify-self: center; align-self: center; align-items: center; @@ -854,7 +854,7 @@ $light-background: #ececec; border-radius: 5px; } - .miniPres-button { + .presPanel-button { cursor: pointer; display: flex; height: 20; @@ -867,11 +867,11 @@ $light-background: #ececec; transition: all 0.3s; } - .miniPres-button:hover { + .presPanel-button:hover { background-color: #5a5a5a; } - .miniPres-button-text:hover { + .presPanel-button-text:hover { background-color: #5a5a5a; } } @@ -950,4 +950,82 @@ $light-background: #ececec; .select { font-size: 100%; } -} \ No newline at end of file +} + +.miniPres:hover { + opacity: 1; +} + +.miniPres { + cursor: grab; + position: absolute; + overflow: hidden; + right: 10; + top: 10; + opacity: 0.1; + transition: all 0.4s; + /* border: solid 1px; */ + color: white; + /* box-shadow: black 0.4vw 0.4vw 0.8vw; */ + + .miniPresOverlay { + display: grid; + grid-template-columns: auto auto auto auto auto auto auto auto; + grid-template-rows: 100%; + height: 100%; + justify-items: center; + align-items: center; + + .miniPres-button-text { + cursor: pointer; + display: flex; + height: 20; + font-weight: 400; + min-width: 100%; + border-radius: 5px; + align-items: center; + justify-content: center; + transition: all 0.3s; + } + + .miniPres-button-frame { + justify-self: center; + align-self: center; + align-items: center; + display: grid; + grid-template-columns: auto auto auto; + justify-content: space-around; + font-size: 11; + margin-left: 7; + width: 30; + height: 85%; + background-color: rgba(91, 157, 221, 0.4); + border-radius: 5px; + } + + .miniPres-divider { + width: 0.5px; + height: 80%; + border-right: solid 2px #5a5a5a; + } + + .miniPres-button { + cursor: pointer; + display: flex; + height: 20; + min-width: 20; + border-radius: 100%; + align-items: center; + justify-content: center; + transition: all 0.3s; + } + + .miniPres-button:hover { + background-color: #5a5a5a; + } + + .miniPres-button-text:hover { + background-color: #5a5a5a; + } + } +} diff --git a/src/client/views/nodes/PresBox.tsx b/src/client/views/nodes/PresBox.tsx index cada3bc83..c9303f153 100644 --- a/src/client/views/nodes/PresBox.tsx +++ b/src/client/views/nodes/PresBox.tsx @@ -147,9 +147,12 @@ export class PresBox extends ViewBoxBaseComponent // Case 3: No more frames in current doc and next slide is defined, therefore move to next slide } else if (this.childDocs[this.itemIndex + 1] !== undefined) { const nextSelected = this.itemIndex + 1; + if (presTargetDoc.type === DocumentType.AUDIO) AudioBox.Instance.pause(); this.gotoDocument(nextSelected, this.itemIndex); const targetNext = Cast(activeNext.presentationTargetDoc, Doc, null); if (activeNext && targetNext.type === DocumentType.AUDIO && activeNext.playAuto) { + AudioBox.Instance.playFrom(0); + this._moveOnFromAudio = true; } else this._moveOnFromAudio = false; } } @@ -353,9 +356,8 @@ export class PresBox extends ViewBoxBaseComponent for (var i = startSlide; i < this.childDocs.length; i++) { activeItem = Cast(this.childDocs[this.itemIndex], Doc, null); targetDoc = Cast(activeItem.presentationTargetDoc, Doc, null); - if (targetDoc.presDuration && targetDoc.presTransition) { - duration = NumCast(targetDoc.presDuration) + NumCast(targetDoc.presTransition); - } else duration = 2500; + duration = NumCast(targetDoc.presDuration) + NumCast(targetDoc.presTransition); + if (duration <= 100) { duration = 2500; } if (NumCast(targetDoc.lastFrame) > 0) { for (var f = 0; f < NumCast(targetDoc.lastFrame); f++) { await timer(duration / NumCast(targetDoc.lastFrame)); @@ -415,18 +417,36 @@ export class PresBox extends ViewBoxBaseComponent * The method called to open the presentation as a minimized view * TODO: Look at old updateMinimize and compare... */ - updateMinimize = () => { - const srcContext = Cast(this.rootDoc.presCollection, Doc, null); - this.turnOffEdit(); - if (srcContext) { - if (srcContext.miniPres) { - srcContext.miniPres = false; - CollectionDockingView.AddRightSplit(this.rootDoc); - } else { - srcContext.miniPres = true; - this.props.addDocTab?.(this.rootDoc, "close"); - } + @undoBatch + @action + updateMinimize = (e: React.MouseEvent) => { + if (this.layoutDoc.inOverlay) { + this.layoutDoc.presStatus = 'edit'; + Doc.RemoveDocFromList((Doc.UserDoc().myOverlayDocuments as Doc), undefined, this.rootDoc); + CollectionDockingView.AddRightSplit(this.rootDoc); + this.layoutDoc.inOverlay = false; + } else { + this.layoutDoc.presStatus = 'manual'; + console.log('test'); + const pt = this.props.ScreenToLocalTransform().inverse().transformPoint(0, 0); + this.rootDoc.x = pt[0] + (this.props.PanelWidth() - 250); + this.rootDoc.y = pt[1] + 10; + this.rootDoc._height = 35; + this.rootDoc._width = 250; + this.props.addDocTab?.(this.rootDoc, "close"); + Doc.AddDocToList((Doc.UserDoc().myOverlayDocuments as Doc), undefined, this.rootDoc); } + // const srcContext = Cast(this.rootDoc.presCollection, Doc, null); + // this.turnOffEdit(); + // if (srcContext) { + // if (srcContext.miniPres) { + // srcContext.miniPres = false; + // CollectionDockingView.AddRightSplit(this.rootDoc); + // } else { + // srcContext.miniPres = true; + // this.props.addDocTab?.(this.rootDoc, "close"); + // } + // } } /** @@ -465,6 +485,7 @@ export class PresBox extends ViewBoxBaseComponent break; case 'jump': //Jump Cut targetDoc.presTransition = 0; + activeItem.presZoomButton = true; activeItem.presSwitchButton = !activeItem.presSwitchButton; if (activeItem.presSwitchButton) activeItem.presMovement = 'Jump cut'; else activeItem.presMovement = 'None'; @@ -574,8 +595,10 @@ export class PresBox extends ViewBoxBaseComponent const anchorNode = document.activeElement as HTMLDivElement; if (anchorNode && anchorNode.className?.includes("lm_title")) return; if (e.keyCode === 27) { // Escape key - if (this.layoutDoc.presStatus === "edit") { this._selectedArray = []; this._eleArray = []; this._dragArray = []; } - else this.layoutDoc.presStatus = "edit"; if (this._presTimer) clearTimeout(this._presTimer); + if (this.layoutDoc.inOverlay) this.updateMinimize; + else if (this.layoutDoc.presStatus === "edit") { this._selectedArray = []; this._eleArray = []; this._dragArray = []; } + else this.layoutDoc.presStatus = "edit"; + if (this._presTimer) clearTimeout(this._presTimer); handled = true; } if ((e.metaKey || e.altKey) && e.keyCode === 65) { // Ctrl-A to select all if (this.layoutDoc.presStatus === "edit") { @@ -862,6 +885,8 @@ export class PresBox extends ViewBoxBaseComponent return effect; } + @undoBatch + @action applyTo = (array: Doc[]) => { const activeItem = Cast(this.childDocs[this.itemIndex], Doc, null); const targetDoc = Cast(activeItem?.presentationTargetDoc, Doc, null); @@ -1096,7 +1121,7 @@ export class PresBox extends ViewBoxBaseComponent @computed get presentDropdown() { return (
e.stopPropagation()} onPointerUp={e => e.stopPropagation()} onPointerDown={e => e.stopPropagation()}> -
this.updateMinimize()}> +
Minimize
{ this.layoutDoc.presStatus = "manual"; this.turnOffEdit(); }))}> @@ -1287,9 +1312,10 @@ export class PresBox extends ViewBoxBaseComponent doc.editZoomProgressivize = false; doc.editScrollProgressivize = false; const targetDoc = Cast(doc.presentationTargetDoc, Doc, null); - targetDoc.editSnapZoomProgressivize = false; - targetDoc.editZoomProgressivize = false; - targetDoc.editScrollProgressivize = false; + if (targetDoc) { + targetDoc.editZoomProgressivize = false; + targetDoc.editScrollProgressivize = false; + } }); } @@ -1607,18 +1633,18 @@ export class PresBox extends ViewBoxBaseComponent @computed get playButtons() { // Case 1: There are still other frames and should go through all frames before going to next slide - return (
-
-
this.startAutoPres(this.itemIndex)}>
-
-
-
250 ? "inline-flex" : "none" }}> + return (
+
+
this.startAutoPres(this.itemIndex)}>
+
+
+
250 ? "inline-flex" : "none" }}> Slide {this.itemIndex + 1} / {this.childDocs.length} {this.playButtonFrames}
-
- {this.props.PanelWidth() > 250 ?
this.layoutDoc.presStatus = "edit"}>EXIT
- :
this.layoutDoc.presStatus = "edit"}> +
+ {this.props.PanelWidth() > 250 ?
this.layoutDoc.presStatus = "edit"}>EXIT
+ :
this.layoutDoc.presStatus = "edit"}>
}
); @@ -1630,28 +1656,44 @@ export class PresBox extends ViewBoxBaseComponent // needed to ensure that the childDocs are loaded for looking up fields this.childDocs.slice(); const mode = StrCast(this.rootDoc._viewType) as CollectionViewType; - return
- {this.topPanel} - {this.toolbar} - {this.newDocumentToolbarDropdown} -
- {mode !== CollectionViewType.Invalid ? - - : (null) - } + return this.layoutDoc.inOverlay ? +
+ {
+
+
this.startAutoPres(this.itemIndex)}>
+
+
+
+ Slide {this.itemIndex + 1} / {this.childDocs.length} + {this.playButtonFrames} +
+
+
EXIT
+
}
-
; + : +
+ {this.topPanel} + {this.toolbar} + {this.newDocumentToolbarDropdown} +
+ {mode !== CollectionViewType.Invalid ? + + : (null) + } +
+
; } } Scripting.addGlobal(function lookupPresBoxField(container: Doc, field: string, data: Doc) { -- cgit v1.2.3-70-g09d2 From 0dcb703ae6417d6012c63654b596e0c3177c847e Mon Sep 17 00:00:00 2001 From: Geireann Lindfield Roberts <60007097+geireann@users.noreply.github.com> Date: Fri, 14 Aug 2020 03:30:23 +0800 Subject: minimize final changes --- src/client/views/nodes/PresBox.tsx | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) (limited to 'src') diff --git a/src/client/views/nodes/PresBox.tsx b/src/client/views/nodes/PresBox.tsx index c9303f153..dd4c103c4 100644 --- a/src/client/views/nodes/PresBox.tsx +++ b/src/client/views/nodes/PresBox.tsx @@ -419,7 +419,7 @@ export class PresBox extends ViewBoxBaseComponent */ @undoBatch @action - updateMinimize = (e: React.MouseEvent) => { + updateMinimize = () => { if (this.layoutDoc.inOverlay) { this.layoutDoc.presStatus = 'edit'; Doc.RemoveDocFromList((Doc.UserDoc().myOverlayDocuments as Doc), undefined, this.rootDoc); @@ -427,7 +427,6 @@ export class PresBox extends ViewBoxBaseComponent this.layoutDoc.inOverlay = false; } else { this.layoutDoc.presStatus = 'manual'; - console.log('test'); const pt = this.props.ScreenToLocalTransform().inverse().transformPoint(0, 0); this.rootDoc.x = pt[0] + (this.props.PanelWidth() - 250); this.rootDoc.y = pt[1] + 10; @@ -436,17 +435,6 @@ export class PresBox extends ViewBoxBaseComponent this.props.addDocTab?.(this.rootDoc, "close"); Doc.AddDocToList((Doc.UserDoc().myOverlayDocuments as Doc), undefined, this.rootDoc); } - // const srcContext = Cast(this.rootDoc.presCollection, Doc, null); - // this.turnOffEdit(); - // if (srcContext) { - // if (srcContext.miniPres) { - // srcContext.miniPres = false; - // CollectionDockingView.AddRightSplit(this.rootDoc); - // } else { - // srcContext.miniPres = true; - // this.props.addDocTab?.(this.rootDoc, "close"); - // } - // } } /** @@ -595,7 +583,7 @@ export class PresBox extends ViewBoxBaseComponent const anchorNode = document.activeElement as HTMLDivElement; if (anchorNode && anchorNode.className?.includes("lm_title")) return; if (e.keyCode === 27) { // Escape key - if (this.layoutDoc.inOverlay) this.updateMinimize; + if (this.layoutDoc.inOverlay) { this.updateMinimize(); } else if (this.layoutDoc.presStatus === "edit") { this._selectedArray = []; this._eleArray = []; this._dragArray = []; } else this.layoutDoc.presStatus = "edit"; if (this._presTimer) clearTimeout(this._presTimer); -- cgit v1.2.3-70-g09d2 From 79ecb86980d67ea2c57be4e38d396a5b19484bfe Mon Sep 17 00:00:00 2001 From: bobzel Date: Thu, 13 Aug 2020 16:28:30 -0400 Subject: changed solr schema so that text and date fields are sortable. fixed one line text not to show scrollbars. fixed scriptingRepl to allow document ids to be entered. --- solr-8.3.1/server/solr/dash/conf/schema.xml | 14 +++++++++----- src/client/util/SearchUtil.ts | 2 +- src/client/views/ScriptingRepl.tsx | 2 +- src/client/views/nodes/formattedText/FormattedTextBox.tsx | 3 ++- src/server/ApiManagers/SearchManager.ts | 5 ++++- 5 files changed, 17 insertions(+), 9 deletions(-) (limited to 'src') diff --git a/solr-8.3.1/server/solr/dash/conf/schema.xml b/solr-8.3.1/server/solr/dash/conf/schema.xml index 36e803d83..47aa56787 100644 --- a/solr-8.3.1/server/solr/dash/conf/schema.xml +++ b/solr-8.3.1/server/solr/dash/conf/schema.xml @@ -1,7 +1,9 @@ id - + + + @@ -41,23 +43,25 @@ + - + - + - - + + + diff --git a/src/client/util/SearchUtil.ts b/src/client/util/SearchUtil.ts index 3073da954..a66cce6a5 100644 --- a/src/client/util/SearchUtil.ts +++ b/src/client/util/SearchUtil.ts @@ -38,7 +38,7 @@ export namespace SearchUtil { query = query || "*"; //If we just have a filter query, search for * as the query const rpquery = Utils.prepend("/dashsearch"); const replacedQuery = query.replace(/type_t:([^ )])/, (substring, arg) => `{!join from=id to=proto_i}type_t:${arg}`); - const gotten = await rp.get(rpquery, { qs: { ...options, q: replacedQuery } }); + const gotten = await rp.get(rpquery, { qs: { ...options, /* sort: "lastModified_d desc", */ q: replacedQuery } }); const result: IdSearchResult = gotten.startsWith("<") ? { ids: [], docs: [], numFound: 0, lines: [] } : JSON.parse(gotten); if (!returnDocs) { return result; diff --git a/src/client/views/ScriptingRepl.tsx b/src/client/views/ScriptingRepl.tsx index 1eb380e0b..db087fb23 100644 --- a/src/client/views/ScriptingRepl.tsx +++ b/src/client/views/ScriptingRepl.tsx @@ -104,7 +104,7 @@ export class ScriptingRepl extends React.Component { if (ts.isParameter(node.parent)) { // delete knownVars[node.text]; } else if (isntPropAccess && isntPropAssign && !(node.text in knownVars) && !(node.text in globalThis)) { - const match = node.text.match(/\d([0-9]+)/); + const match = node.text.match(/d([0-9]+)/); if (match) { const m = parseInt(match[1]); usedDocuments.push(m); diff --git a/src/client/views/nodes/formattedText/FormattedTextBox.tsx b/src/client/views/nodes/formattedText/FormattedTextBox.tsx index f1eb5ef09..8c05d3603 100644 --- a/src/client/views/nodes/formattedText/FormattedTextBox.tsx +++ b/src/client/views/nodes/formattedText/FormattedTextBox.tsx @@ -648,7 +648,7 @@ export class FormattedTextBox extends ViewBoxAnnotatableComponent<(FieldViewProp const options = cm.findByDescription("Options..."); const optionItems = options && "subitems" in options ? options.subitems : []; - !Doc.UserDoc().noviceMode && optionItems.push({ description: this.Document._singleLine ? "Make Single Line" : "Make Multi Line", event: () => this.layoutDoc._singleLine = !this.layoutDoc._singleLine, icon: "expand-arrows-alt" }); + !Doc.UserDoc().noviceMode && optionItems.push({ description: !this.Document._singleLine ? "Make Single Line" : "Make Multi Line", event: () => this.layoutDoc._singleLine = !this.layoutDoc._singleLine, icon: "expand-arrows-alt" }); optionItems.push({ description: `${this.Document._autoHeight ? "Lock" : "Auto"} Height`, event: () => this.layoutDoc._autoHeight = !this.layoutDoc._autoHeight, icon: "plus" }); optionItems.push({ description: `${!this.layoutDoc._nativeWidth || !this.layoutDoc._nativeHeight ? "Lock" : "Unlock"} Aspect`, event: this.toggleNativeDimensions, icon: "snowflake" }); !options && cm.addItem({ description: "Options...", subitems: optionItems, icon: "eye" }); @@ -1580,6 +1580,7 @@ export class FormattedTextBox extends ViewBoxAnnotatableComponent<(FieldViewProp onScroll={this.onscrolled} onDrop={this.ondrop} >
{ const solrQuery: any = {}; - ["q", "fq", "start", "rows", "hl", "hl.fl"].forEach(key => solrQuery[key] = req.query[key]); + ["q", "fq", "start", "rows", "sort", "hl", "hl.fl"].forEach(key => solrQuery[key] = req.query[key]); if (solrQuery.q === undefined) { res.send([]); return; @@ -136,6 +136,9 @@ export namespace SolrManager { const term = ToSearchTerm(value); if (term !== undefined) { const { suffix, value } = term; + if (key.endsWith('lastModified')) { + update["lastModified" + suffix] = value; + } update[key + suffix] = value; dynfield = true; } -- cgit v1.2.3-70-g09d2 From bf057a899766527b11094d93503d4a94981bd301 Mon Sep 17 00:00:00 2001 From: bobzel Date: Thu, 13 Aug 2020 17:10:16 -0400 Subject: fixed import to use _chromeStatus and fixed drag behavior not to make a delegate. --- src/client/documents/Documents.ts | 1 - src/client/util/CurrentUserUtils.ts | 8 ++++---- src/client/util/DragManager.ts | 2 +- .../views/collections/CollectionStackingViewFieldColumn.tsx | 2 +- 4 files changed, 6 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/client/documents/Documents.ts b/src/client/documents/Documents.ts index 3f0fe4626..42ba4d2c4 100644 --- a/src/client/documents/Documents.ts +++ b/src/client/documents/Documents.ts @@ -209,7 +209,6 @@ export interface DocumentOptions { audioEnd?: number; // the time frame where the audio should stop playing border?: string; //for searchbox hovercolor?: string; - showNewButton?: boolean; // used in stacking view to not display the "+ NEW" button } class EmptyBox { diff --git a/src/client/util/CurrentUserUtils.ts b/src/client/util/CurrentUserUtils.ts index 64515622f..2d988d322 100644 --- a/src/client/util/CurrentUserUtils.ts +++ b/src/client/util/CurrentUserUtils.ts @@ -478,7 +478,7 @@ export class CurrentUserUtils { title, toolTip, ignoreClick, - dropAction: "copy", + dropAction: "alias", onDragStart: drag ? ScriptField.MakeFunction(drag) : undefined, onClick: click ? ScriptField.MakeScript(click) : undefined, ischecked: ischecked ? ComputedField.MakeFunction(ischecked) : undefined, @@ -853,12 +853,12 @@ export class CurrentUserUtils { // Import sidebar is where shared documents are contained static setupImportSidebar(doc: Doc) { if (doc["sidebar-import-documents"] === undefined) { - doc["sidebar-import-documents"] = new PrefetchProxy(Docs.Create.StackingDocument([], { title: "Imported Documents", _showTitle: "title", _height: 300, _yMargin: 30, childDropAction: "copy", lockedPosition: true, showNewButton: false })); + doc["sidebar-import-documents"] = new PrefetchProxy(Docs.Create.StackingDocument([], { title: "Imported Documents", forceActive: true, _showTitle: "title", childDropAction: "alias", _autoHeight: true, _yMargin: 30, lockedPosition: true, _chromeStatus: "disabled" })); } if (doc["sidebar-import"] === undefined) { const uploads = Cast(doc["sidebar-import-documents"], Doc, null) as Doc; - const newUpload = CurrentUserUtils.ficon({ onClick: ScriptField.MakeScript("importDocument()"), toolTip: "Import external document", _backgroundColor: "black", title: "Import", icon: "upload", system: true }); - doc["sidebar-import"] = new PrefetchProxy(Docs.Create.StackingDocument([newUpload, uploads], { title: "Imported Documents", _yMargin: 30, childDropAction: "copy", ignoreClick: true, lockedPosition: true })); + const newUpload = CurrentUserUtils.ficon({ onClick: ScriptField.MakeScript("importDocument()"), toolTip: "Import External document", _backgroundColor: "black", title: "Import", icon: "upload", system: true }); + doc["sidebar-import"] = new PrefetchProxy(Docs.Create.StackingDocument([newUpload, uploads], { title: "Imported Documents", _yMargin: 20, ignoreClick: true, lockedPosition: true })); } } diff --git a/src/client/util/DragManager.ts b/src/client/util/DragManager.ts index 4b1860b5c..0cca61841 100644 --- a/src/client/util/DragManager.ts +++ b/src/client/util/DragManager.ts @@ -210,7 +210,7 @@ export namespace DragManager { docDragData.droppedDocuments = dragData.draggedDocuments.map(d => !dragData.isSelectionMove && !dragData.userDropAction && ScriptCast(d.onDragStart) ? addAudioTag(ScriptCast(d.onDragStart).script.run({ this: d }).result) : docDragData.dropAction === "alias" ? Doc.MakeAlias(d) : - docDragData.dropAction === "copy" ? Doc.MakeDelegate(d) : d); + docDragData.dropAction === "copy" ? Doc.MakeClone(d) : d); docDragData.dropAction !== "same" && docDragData.droppedDocuments.forEach((drop: Doc, i: number) => { const dragProps = Cast(dragData.draggedDocuments[i].removeDropProperties, listSpec("string"), []); const remProps = (dragData?.removeDropProperties || []).concat(Array.from(dragProps)); diff --git a/src/client/views/collections/CollectionStackingViewFieldColumn.tsx b/src/client/views/collections/CollectionStackingViewFieldColumn.tsx index cbfb1c36f..f193a9787 100644 --- a/src/client/views/collections/CollectionStackingViewFieldColumn.tsx +++ b/src/client/views/collections/CollectionStackingViewFieldColumn.tsx @@ -367,7 +367,7 @@ export class CollectionStackingViewFieldColumn extends React.Component - {(chromeStatus !== 'view-mode' && chromeStatus !== 'disabled' && type !== DocumentType.PRES && this.props.parent.props.Document.showNewButton !== false) ? + {(chromeStatus !== 'view-mode' && chromeStatus !== 'disabled' && type !== DocumentType.PRES) ?
-- cgit v1.2.3-70-g09d2