From 10754a14c8d0dda68f2484e523f6901b3e7daee3 Mon Sep 17 00:00:00 2001
From: geireann <60007097+geireann@users.noreply.github.com>
Date: Fri, 19 Jun 2020 14:14:28 +0800
Subject: css changes and bug fixes
Presentation
Undo / Redo
Image upload
Record Audio
---
src/mobile/AudioUpload.scss | 119 ++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 119 insertions(+)
create mode 100644 src/mobile/AudioUpload.scss
(limited to 'src/mobile/AudioUpload.scss')
diff --git a/src/mobile/AudioUpload.scss b/src/mobile/AudioUpload.scss
new file mode 100644
index 000000000..5f0ba465a
--- /dev/null
+++ b/src/mobile/AudioUpload.scss
@@ -0,0 +1,119 @@
+@import "../client/views/globalCssVariables.scss";
+
+.audioUpload_cont {
+ display: flex;
+ justify-content: center;
+ flex-direction: column;
+ align-items: center;
+ max-width: 400px;
+ min-width: 400px;
+
+ .upload_label {
+ font-size: 3em;
+ font-weight: 700;
+ color: white;
+ background-color: black;
+ display: inline-block;
+ margin: 10;
+ width: 100%;
+ border-radius: 10px;
+ }
+
+ .file {
+ white-space: nowrap;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ direction: ltr;
+ }
+
+ .upload_label:hover {
+ background-color: darkred;
+ }
+
+ .button_file {
+ text-align: center;
+ height: 50%;
+ width: 50%;
+ background-color: paleturquoise;
+ color: grey;
+ font-size: 3em;
+ }
+
+ .inputfile {
+ width: 0.1px;
+ height: 0.1px;
+ opacity: 0;
+ overflow: hidden;
+ position: absolute;
+ z-index: -1;
+ }
+
+ .inputfile+label {
+ font-size: 3em;
+ font-weight: 700;
+ color: white;
+ background-color: black;
+ display: inline-block;
+ margin: 10px;
+ width: 100%;
+ border-radius: 10px;
+ }
+
+ .inputfile:focus+label,
+ .inputfile+label:hover {
+ background-color: darkred;
+ }
+
+ .status {
+ font-size: 2em;
+ }
+
+}
+
+.backgroundUpload {
+ height: 100vh;
+ top: 0;
+ z-index: 999;
+ width: 100vw;
+ position: absolute;
+ background-color: lightgrey;
+ opacity: 0.4;
+}
+
+.audio-upload {
+ top: 100%;
+ opacity: 0;
+}
+
+.audio-upload.active {
+ top: 0;
+ position: absolute;
+ z-index: 999;
+ height: 100vh;
+ width: 100vw;
+ opacity: 1;
+}
+
+.uploadContainer {
+ top: 40;
+ position: absolute;
+ z-index: 1000;
+ height: 20vh;
+ width: 80vw;
+ opacity: 1;
+}
+
+.loadingImage {
+ display: inline-flex;
+ width: max-content;
+}
+
+.loadingSlab {
+ position: relative;
+ width: 30px;
+ height: 30px;
+ margin: 10;
+ border-radius: 20px;
+ opacity: 0.3;
+ background-color: black;
+}
\ No newline at end of file
--
cgit v1.2.3-70-g09d2
From 790d41009a678f560cd3b78e86069251e494cfd1 Mon Sep 17 00:00:00 2001
From: geireann <60007097+geireann@users.noreply.github.com>
Date: Mon, 22 Jun 2020 14:55:00 +0800
Subject: updated css width property for mobile
---
src/client/util/CurrentUserUtils.ts | 2 +-
src/client/util/SettingsManager.scss | 2 +-
src/client/views/AntimodeMenu.scss | 16 ++--
.../views/collections/CollectionStackingView.scss | 2 +-
.../views/collections/CollectionViewChromes.scss | 2 +-
.../collectionFreeForm/InkOptionsMenu.scss | 18 ++--
src/client/views/nodes/AudioBox.scss | 2 +-
src/client/views/nodes/PDFBox.scss | 2 +-
src/client/views/nodes/PresBox.scss | 2 +-
.../views/presentationview/PresElementBox.scss | 2 +-
src/mobile/AudioUpload.scss | 95 ----------------------
src/mobile/MobileInterface.tsx | 10 +--
src/mobile/MobileMenu.scss | 24 ++++--
13 files changed, 45 insertions(+), 134 deletions(-)
(limited to 'src/mobile/AudioUpload.scss')
diff --git a/src/client/util/CurrentUserUtils.ts b/src/client/util/CurrentUserUtils.ts
index b7da4ae2f..5edb2225f 100644
--- a/src/client/util/CurrentUserUtils.ts
+++ b/src/client/util/CurrentUserUtils.ts
@@ -465,7 +465,7 @@ export class CurrentUserUtils {
static setupMobileButtons(doc?: Doc, buttons?: string[]) {
const docProtoData: { title: string, icon: string, drag?: string, ignoreClick?: boolean, click?: string, ischecked?: string, activePen?: Doc, backgroundColor?: string, info: string, dragFactory?: Doc }[] = [
- { title: "LIBRARY", icon: "bars", click: 'switchToLibrary()', backgroundColor: "#ffd6d6", info: "Navigate and access all of your documents within their respective collections." },
+ { title: "WORKSPACES", icon: "folder-open", click: 'openWorkspaces()', backgroundColor: "#ffd6d6", info: "Access your Workspaces from your mobile, and navigate through all of your documents. " },
{ title: "RECORD", icon: "microphone", click: 'openMobileAudio()', backgroundColor: "#ffbfbf", info: "Use your phone to record and upload audio onto Dash Web." },
{ title: "UPLOAD", icon: "upload", click: 'uploadImageMobile()', backgroundColor: "#ff9e9e", info: "Upload images or videos from your mobile device so they can be accessed on Dash Web." },
{ title: "PRESENTATION", icon: "desktop", click: 'openMobilePresentation()', backgroundColor: "#ff8080", info: "Use your phone as a remote for you presentation." },
diff --git a/src/client/util/SettingsManager.scss b/src/client/util/SettingsManager.scss
index 1eac9303b..0116c5294 100644
--- a/src/client/util/SettingsManager.scss
+++ b/src/client/util/SettingsManager.scss
@@ -135,7 +135,7 @@
}
}
-@media only screen and (max-width: 1000px) {
+@media only screen and (max-device-width: 480px) {
.settings-interface {
background-color: whitesmoke !important;
color: grey;
diff --git a/src/client/views/AntimodeMenu.scss b/src/client/views/AntimodeMenu.scss
index 170631422..43f45fb1c 100644
--- a/src/client/views/AntimodeMenu.scss
+++ b/src/client/views/AntimodeMenu.scss
@@ -41,7 +41,7 @@
}
}
-@media only screen and (max-width: 1000px) {
+@media only screen and (max-device-width: 480px) {
.antimodeMenu-cont {
position: absolute;
z-index: 10000;
@@ -51,31 +51,31 @@
border-radius: 0px 6px 6px 6px;
// overflow: hidden;
display: flex;
-
+
&.with-rows {
flex-direction: column-reverse;
}
-
+
.antimodeMenu-row {
display: flex;
height: 100%;
- width:100%;
+ width: 100%;
}
-
+
.antimodeMenu-button {
background-color: transparent;
width: 100px;
height: 100px;
-
+
&.active {
background-color: #121212;
}
}
-
+
.antimodeMenu-button:hover {
background-color: #121212;
}
-
+
.antimodeMenu-dragger {
height: 100%;
transition: width .2s;
diff --git a/src/client/views/collections/CollectionStackingView.scss b/src/client/views/collections/CollectionStackingView.scss
index 98efdfd23..342773db8 100644
--- a/src/client/views/collections/CollectionStackingView.scss
+++ b/src/client/views/collections/CollectionStackingView.scss
@@ -424,7 +424,7 @@
}
}
-@media only screen and (max-width: 1000px) {
+@media only screen and (max-device-width: 480px) {
.collectionStackingView .collectionStackingView-columnDragger,
.collectionMasonryView .collectionStackingView-columnDragger {
diff --git a/src/client/views/collections/CollectionViewChromes.scss b/src/client/views/collections/CollectionViewChromes.scss
index 54ee4ab3b..ec2d78735 100644
--- a/src/client/views/collections/CollectionViewChromes.scss
+++ b/src/client/views/collections/CollectionViewChromes.scss
@@ -80,7 +80,7 @@
// margin-top: 10px;
}
- @media only screen and (max-width: 1000) {
+ @media only screen and (max-device-width: 480px) {
.collectionViewBaseChrome-collapse {
display: none;
}
diff --git a/src/client/views/collections/collectionFreeForm/InkOptionsMenu.scss b/src/client/views/collections/collectionFreeForm/InkOptionsMenu.scss
index 72fdf5af9..4855dfea8 100644
--- a/src/client/views/collections/collectionFreeForm/InkOptionsMenu.scss
+++ b/src/client/views/collections/collectionFreeForm/InkOptionsMenu.scss
@@ -33,39 +33,39 @@
}
}
-@media only screen and (max-width: 1000px) {
+@media only screen and (max-device-width: 480px) {
.antimodeMenu-button {
.color-preview {
width: 100%;
height: 100%;
}
-
+
}
-
+
.sketch-picker {
background: #323232;
-
+
.flexbox-fit {
background: #323232;
}
}
-
+
.btn-group {
display: grid;
grid-template-columns: auto auto;
/* Make the buttons appear below each other */
}
-
+
.btn2-group {
display: block;
background: #323232;
grid-template-columns: auto;
-
+
/* Make the buttons appear below each other */
.antimodeMenu-button {
background: #323232;
display: block;
-
+
}
}
-}
+}
\ No newline at end of file
diff --git a/src/client/views/nodes/AudioBox.scss b/src/client/views/nodes/AudioBox.scss
index 61ce4bd13..43dd698ad 100644
--- a/src/client/views/nodes/AudioBox.scss
+++ b/src/client/views/nodes/AudioBox.scss
@@ -174,7 +174,7 @@
}
-@media only screen and (max-width: 1000px) {
+@media only screen and (max-device-width: 480px) {
.audiobox-container,
.audiobox-container-interactive {
diff --git a/src/client/views/nodes/PDFBox.scss b/src/client/views/nodes/PDFBox.scss
index 1a31d2916..b19ddf1f5 100644
--- a/src/client/views/nodes/PDFBox.scss
+++ b/src/client/views/nodes/PDFBox.scss
@@ -224,7 +224,7 @@
}
}
-@media only screen and (max-width: 600px) {
+@media only screen and (max-device-width: 480px) {
.pdfBox .pdfBox-ui .pdfBox-settingsCont .pdfBox-settingsButton,
.pdfBox-interactive .pdfBox-ui .pdfBox-settingsCont .pdfBox-settingsButton {
diff --git a/src/client/views/nodes/PresBox.scss b/src/client/views/nodes/PresBox.scss
index e62aa48fb..1261cbfdd 100644
--- a/src/client/views/nodes/PresBox.scss
+++ b/src/client/views/nodes/PresBox.scss
@@ -81,7 +81,7 @@
}
}
-@media only screen and (max-width: 1000px) {
+@media only screen and (max-device-width: 480px) {
.presBox-cont .presBox-buttons {
position: absolute;
top: 70%;
diff --git a/src/client/views/presentationview/PresElementBox.scss b/src/client/views/presentationview/PresElementBox.scss
index 99fe2a3ba..79532995e 100644
--- a/src/client/views/presentationview/PresElementBox.scss
+++ b/src/client/views/presentationview/PresElementBox.scss
@@ -106,7 +106,7 @@
z-index: 2;
}
-@media only screen and (max-width: 1000px) {
+@media only screen and (max-device-width: 480px) {
.presElementBox-buttons {
display: inline-flex;
position: relative;
diff --git a/src/mobile/AudioUpload.scss b/src/mobile/AudioUpload.scss
index 5f0ba465a..9fe442e55 100644
--- a/src/mobile/AudioUpload.scss
+++ b/src/mobile/AudioUpload.scss
@@ -7,77 +7,6 @@
align-items: center;
max-width: 400px;
min-width: 400px;
-
- .upload_label {
- font-size: 3em;
- font-weight: 700;
- color: white;
- background-color: black;
- display: inline-block;
- margin: 10;
- width: 100%;
- border-radius: 10px;
- }
-
- .file {
- white-space: nowrap;
- overflow: hidden;
- text-overflow: ellipsis;
- direction: ltr;
- }
-
- .upload_label:hover {
- background-color: darkred;
- }
-
- .button_file {
- text-align: center;
- height: 50%;
- width: 50%;
- background-color: paleturquoise;
- color: grey;
- font-size: 3em;
- }
-
- .inputfile {
- width: 0.1px;
- height: 0.1px;
- opacity: 0;
- overflow: hidden;
- position: absolute;
- z-index: -1;
- }
-
- .inputfile+label {
- font-size: 3em;
- font-weight: 700;
- color: white;
- background-color: black;
- display: inline-block;
- margin: 10px;
- width: 100%;
- border-radius: 10px;
- }
-
- .inputfile:focus+label,
- .inputfile+label:hover {
- background-color: darkred;
- }
-
- .status {
- font-size: 2em;
- }
-
-}
-
-.backgroundUpload {
- height: 100vh;
- top: 0;
- z-index: 999;
- width: 100vw;
- position: absolute;
- background-color: lightgrey;
- opacity: 0.4;
}
.audio-upload {
@@ -92,28 +21,4 @@
height: 100vh;
width: 100vw;
opacity: 1;
-}
-
-.uploadContainer {
- top: 40;
- position: absolute;
- z-index: 1000;
- height: 20vh;
- width: 80vw;
- opacity: 1;
-}
-
-.loadingImage {
- display: inline-flex;
- width: max-content;
-}
-
-.loadingSlab {
- position: relative;
- width: 30px;
- height: 30px;
- margin: 10;
- border-radius: 20px;
- opacity: 0.3;
- background-color: black;
}
\ No newline at end of file
diff --git a/src/mobile/MobileInterface.tsx b/src/mobile/MobileInterface.tsx
index 84a5975cb..ceda74da2 100644
--- a/src/mobile/MobileInterface.tsx
+++ b/src/mobile/MobileInterface.tsx
@@ -415,7 +415,7 @@ export class MobileInterface extends React.Component {
onClick={this.returnMain}
style={{ opacity: 0.7 }}>
-
{
- if (this._activeDoc.type === "collection" && this._activeDoc !== this._homeDoc) {
+ if (this._activeDoc.type === "collection" && this._activeDoc !== this._homeDoc && this._activeDoc.title !== "WORKSPACES") {
return (<>
{this.displayWorkspaces()}
diff --git a/src/mobile/MobileMenu.scss b/src/mobile/MobileMenu.scss
index 87731655a..53bc48034 100644
--- a/src/mobile/MobileMenu.scss
+++ b/src/mobile/MobileMenu.scss
@@ -19,7 +19,6 @@ body {
width: 100vw;
height: $navbar-height;
background-color: whitesmoke;
- border-bottom: 5px solid black;
z-index: 150;
}
@@ -221,14 +220,17 @@ body {
.back {
position: absolute;
- top: 44%;
left: 42px;
- background-color: black;
+ top: 0;
+ background: #1a1a1a;
width: 50px;
- height: 50px;
+ height: 100%;
+ display: flex;
+ justify-content: center;
text-align: center;
+ flex-direction: column;
+ align-items: center;
border-radius: 10px;
- transform: translate(0, -50%);
font-size: 25px;
user-select: none;
z-index: 100;
@@ -243,7 +245,7 @@ body {
border-radius: 0px;
width: 100%;
height: 80px;
- transition: all 400ms ease 50ms;
+ overflow: hidden;
}
.pathname {
@@ -291,14 +293,19 @@ body {
.scrollmenu {
overflow: auto;
+ width: 100%;
+ height: 100%;
white-space: nowrap;
+ display: inline-flex;
}
.pathbarItem {
position: relative;
- display: inline-flex;
+ display: flex;
+ align-items: center;
color: whitesmoke;
text-align: center;
+ justify-content: center;
user-select: none;
transform: translate(100px, 0px);
font-size: 30px;
@@ -311,7 +318,6 @@ body {
text-align: center;
height: 50px;
padding: 10px;
- background-color: rgb(48, 40, 40);
font-size: 30px;
border-radius: 10px;
text-transform: uppercase;
@@ -321,7 +327,7 @@ body {
.pathIcon {
- transform: translate(0px, 8px);
+ transform: translate(0px, 0px);
position: relative;
}
--
cgit v1.2.3-70-g09d2
From e7372931b9d28c141aaec9552041b5644c2f415a Mon Sep 17 00:00:00 2001
From: geireann <60007097+geireann@users.noreply.github.com>
Date: Fri, 26 Jun 2020 03:37:08 +0800
Subject: Merge branch 'master' into mobile_revision_direct
And changes to UI of record and image upload
---
src/client/util/CurrentUserUtils.ts | 12 +-
src/client/util/DragManager.ts | 2 +-
src/client/views/DocumentButtonBar.tsx | 63 +-----
src/client/views/DocumentDecorations.tsx | 2 +-
src/client/views/GlobalKeyHandler.ts | 2 +
src/client/views/MainView.tsx | 11 +-
.../collectionFreeForm/CollectionFreeFormView.tsx | 4 +-
src/client/views/globalCssVariables.scss | 1 +
src/client/views/linking/LinkMenu.scss | 4 +
src/client/views/linking/LinkMenu.tsx | 37 +--
src/client/views/nodes/AudioBox.scss | 71 +-----
src/client/views/nodes/AudioBox.tsx | 2 +-
src/client/views/nodes/DocumentLinksButton.scss | 38 ++++
src/client/views/nodes/DocumentLinksButton.tsx | 104 +++++++++
src/client/views/nodes/DocumentView.tsx | 28 ++-
src/client/views/nodes/LinkAnchorBox.tsx | 8 +
src/client/views/nodes/LinkDocPreview.tsx | 107 +++++++++
.../views/nodes/formattedText/RichTextMenu.tsx | 9 +-
src/mobile/AudioUpload.scss | 41 +++-
src/mobile/AudioUpload.tsx | 249 +++++++--------------
src/mobile/ImageUpload.scss | 61 ++---
src/mobile/ImageUpload.tsx | 66 +++---
src/mobile/MobileInterface.tsx | 29 ++-
src/mobile/MobileMenu.scss | 1 +
24 files changed, 549 insertions(+), 403 deletions(-)
create mode 100644 src/client/views/nodes/DocumentLinksButton.scss
create mode 100644 src/client/views/nodes/DocumentLinksButton.tsx
create mode 100644 src/client/views/nodes/LinkDocPreview.tsx
(limited to 'src/mobile/AudioUpload.scss')
diff --git a/src/client/util/CurrentUserUtils.ts b/src/client/util/CurrentUserUtils.ts
index efdc943fa..823a99436 100644
--- a/src/client/util/CurrentUserUtils.ts
+++ b/src/client/util/CurrentUserUtils.ts
@@ -474,12 +474,12 @@ export class CurrentUserUtils {
static setupMobileButtons(doc?: Doc, buttons?: string[]) {
const docProtoData: { title: string, icon: string, drag?: string, ignoreClick?: boolean, click?: string, ischecked?: string, activePen?: Doc, backgroundColor?: string, info: string, dragFactory?: Doc }[] = [
- { title: "WORKSPACES", icon: "folder-open", click: 'openWorkspaces()', backgroundColor: "#ffd6d6", info: "Access your Workspaces from your mobile, and navigate through all of your documents. " },
- { title: "RECORD", icon: "microphone", click: 'openMobileAudio()', backgroundColor: "#ffbfbf", info: "Use your phone to record and upload audio onto Dash Web." },
- { title: "UPLOAD", icon: "upload", click: 'uploadImageMobile()', backgroundColor: "#ff9e9e", info: "Upload images or videos from your mobile device so they can be accessed on Dash Web." },
- { title: "PRESENTATION", icon: "desktop", click: 'openMobilePresentation()', backgroundColor: "#ff8080", info: "Use your phone as a remote for you presentation." },
- { title: "MOBILE UPLOAD", icon: "mobile", click: 'switchToMobileUploads()', backgroundColor: "#ff7373", info: "Access the collection of your mobile uploads." },
- { title: "SETTINGS", icon: "cog", click: 'openMobileSettings()', backgroundColor: "#ff5e5e", info: "Change your password, log out, or manage your account security." }
+ { title: "WORKSPACES", icon: "bars", click: 'openMobileWorkspaces()', backgroundColor: "lightgrey", info: "Access your Workspaces from your mobile, and navigate through all of your documents. " },
+ { title: "UPLOAD", icon: "upload", click: 'uploadImageMobile()', backgroundColor: "lightgrey", info: "Upload files from your mobile device so they can be accessed on Dash Web." },
+ { title: "MOBILE UPLOAD", icon: "mobile", click: 'switchToMobileUploads()', backgroundColor: "lightgrey", info: "Access the collection of your mobile uploads." },
+ { title: "RECORD", icon: "microphone", click: 'openMobileAudio()', backgroundColor: "lightgrey", info: "Use your phone to record, dictate and then upload audio onto Dash Web." },
+ { title: "PRESENTATION", icon: "desktop", click: 'openMobilePresentation()', backgroundColor: "lightgrey", info: "Use your phone as a remote for you presentation." },
+ { title: "SETTINGS", icon: "cog", click: 'openMobileSettings()', backgroundColor: "lightgrey", info: "Change your password, log out, or manage your account security." }
];
return docProtoData.filter(d => !buttons || !buttons.includes(d.title)).map(data =>
this.mobileButton({
diff --git a/src/client/util/DragManager.ts b/src/client/util/DragManager.ts
index 91bc51101..417ddf989 100644
--- a/src/client/util/DragManager.ts
+++ b/src/client/util/DragManager.ts
@@ -353,7 +353,7 @@ export namespace DragManager {
const dragElement = ele.parentNode === dragDiv ? ele : ele.cloneNode(true) as HTMLElement;
const rect = ele.getBoundingClientRect();
const scaleX = rect.width / ele.offsetWidth,
- scaleY = rect.height / ele.offsetHeight;
+ scaleY = ele.offsetHeight ? rect.height / ele.offsetHeight : scaleX;
elesCont.left = Math.min(rect.left, elesCont.left);
elesCont.top = Math.min(rect.top, elesCont.top);
elesCont.right = Math.max(rect.right, elesCont.right);
diff --git a/src/client/views/DocumentButtonBar.tsx b/src/client/views/DocumentButtonBar.tsx
index 62a95116f..fcaea0f0b 100644
--- a/src/client/views/DocumentButtonBar.tsx
+++ b/src/client/views/DocumentButtonBar.tsx
@@ -1,28 +1,28 @@
import { IconProp, library } from '@fortawesome/fontawesome-svg-core';
-import { faArrowAltCircleDown, faPhotoVideo, faArrowAltCircleUp, faArrowAltCircleRight, faCheckCircle, faCloudUploadAlt, faLink, faShare, faStopCircle, faSyncAlt, faTag, faTimes } from '@fortawesome/free-solid-svg-icons';
+import { faArrowAltCircleDown, faArrowAltCircleRight, faArrowAltCircleUp, faCheckCircle, faCloudUploadAlt, faLink, faPhotoVideo, faShare, faStopCircle, faSyncAlt, faTag, faTimes } from '@fortawesome/free-solid-svg-icons';
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { action, computed, observable, runInAction } from "mobx";
import { observer } from "mobx-react";
import { Doc, DocListCast } from "../../fields/Doc";
import { RichTextField } from '../../fields/RichTextField';
-import { NumCast, StrCast, Cast } from "../../fields/Types";
+import { Cast, NumCast } from "../../fields/Types";
import { emptyFunction, setupMoveUpEvents } from "../../Utils";
+import GoogleAuthenticationManager from '../apis/GoogleAuthenticationManager';
import { Pulls, Pushes } from '../apis/google_docs/GoogleApiClientUtils';
+import { Docs, DocUtils } from '../documents/Documents';
+import { DragManager } from '../util/DragManager';
import { UndoManager } from "../util/UndoManager";
import { CollectionDockingView, DockedFrameRenderer } from './collections/CollectionDockingView';
import { ParentDocSelector } from './collections/ParentDocumentSelector';
import './collections/ParentDocumentSelector.scss';
import './DocumentButtonBar.scss';
-import { LinkMenu } from "./linking/LinkMenu";
+import { MetadataEntryMenu } from './MetadataEntryMenu';
import { DocumentView } from './nodes/DocumentView';
import { GoogleRef } from "./nodes/formattedText/FormattedTextBox";
import { TemplateMenu } from "./TemplateMenu";
import { Template, Templates } from "./Templates";
import React = require("react");
-import { DragManager } from '../util/DragManager';
-import { MetadataEntryMenu } from './MetadataEntryMenu';
-import GoogleAuthenticationManager from '../apis/GoogleAuthenticationManager';
-import { Docs } from '../documents/Documents';
+import { DocumentLinksButton } from './nodes/DocumentLinksButton';
const higflyout = require("@hig/flyout");
export const { anchorPoints } = higflyout;
export const Flyout = higflyout.default;
@@ -113,39 +113,6 @@ export class DocumentButtonBar extends React.Component<{ views: () => (DocumentV
get view0() { return this.props.views()?.[0]; }
- @action
- onLinkButtonMoved = (e: PointerEvent) => {
- if (this._linkButton.current !== null) {
- const linkDrag = UndoManager.StartBatch("Drag Link");
- this.view0 && DragManager.StartLinkDrag(this._linkButton.current, this.view0.props.Document, e.pageX, e.pageY, {
- dragComplete: dropEv => {
- const linkDoc = dropEv.linkDragData?.linkDocument as Doc; // equivalent to !dropEve.aborted since linkDocument is only assigned on a completed drop
- if (this.view0 && linkDoc) {
- !linkDoc.linkRelationship && (Doc.GetProto(linkDoc).linkRelationship = "hyperlink");
-
- // we want to allow specific views to handle the link creation in their own way (e.g., rich text makes text hyperlinks)
- // the dragged view can regiser a linkDropCallback to be notified that the link was made and to update their data structures
- // however, the dropped document isn't so accessible. What we do is set the newly created link document on the documentView
- // The documentView passes a function prop returning this link doc to its descendants who can react to changes to it.
- dropEv.linkDragData?.linkDropCallback?.(dropEv.linkDragData);
- runInAction(() => this.view0!._link = linkDoc);
- setTimeout(action(() => this.view0!._link = undefined), 0);
- }
- linkDrag?.end();
- },
- hideSource: false
- });
- return true;
- }
- return false;
- }
-
-
- onLinkButtonDown = (e: React.PointerEvent): void => {
- setupMoveUpEvents(this, e, this.onLinkButtonMoved, emptyFunction, emptyFunction);
- }
-
-
@computed
get considerGoogleDocsPush() {
const targetDoc = this.view0?.props.Document;
@@ -235,20 +202,6 @@ export class DocumentButtonBar extends React.Component<{ views: () => (DocumentV
;
}
- @computed
- get linkButton() {
- const view0 = this.view0;
- const linkCount = view0 && DocListCast(view0.props.Document.links).length;
- return !view0 ? (null) :
-
}>
-
- {linkCount ? linkCount : }
-
-
-
;
- }
-
@computed
get metadataButton() {
const view0 = this.view0;
@@ -318,7 +271,7 @@ export class DocumentButtonBar extends React.Component<{ views: () => (DocumentV
const considerPush = isText && this.considerGoogleDocsPush;
return
- {this.linkButton}
+
{this.templateButton}
diff --git a/src/client/views/DocumentDecorations.tsx b/src/client/views/DocumentDecorations.tsx
index beb6155ca..d7b0ab7a9 100644
--- a/src/client/views/DocumentDecorations.tsx
+++ b/src/client/views/DocumentDecorations.tsx
@@ -552,7 +552,7 @@ export class DocumentDecorations extends React.Component<{}, { value: string }>
onPointerDown={this.onRadiusDown} onContextMenu={(e) => e.preventDefault()}>
-
diff --git a/src/client/views/GlobalKeyHandler.ts b/src/client/views/GlobalKeyHandler.ts
index 27755737e..7bc8cf6a7 100644
--- a/src/client/views/GlobalKeyHandler.ts
+++ b/src/client/views/GlobalKeyHandler.ts
@@ -19,6 +19,7 @@ import { MarqueeView } from "./collections/collectionFreeForm/MarqueeView";
import { DocumentDecorations } from "./DocumentDecorations";
import { MainView } from "./MainView";
import { DocumentView } from "./nodes/DocumentView";
+import { DocumentLinksButton } from "./nodes/DocumentLinksButton";
const modifiers = ["control", "meta", "shift", "alt"];
type KeyHandler = (keycode: string, e: KeyboardEvent) => KeyControlInfo | Promise
;
@@ -77,6 +78,7 @@ export default class KeyManager {
// MarqueeView.DragMarquee = !MarqueeView.DragMarquee; // bcz: this needs a better disclosure UI
break;
case "escape":
+ DocumentLinksButton.StartLink = undefined;
const main = MainView.Instance;
Doc.SetSelectedTool(InkTool.None);
if (main.isPointerDown) {
diff --git a/src/client/views/MainView.tsx b/src/client/views/MainView.tsx
index 97953452d..4e2c067ac 100644
--- a/src/client/views/MainView.tsx
+++ b/src/client/views/MainView.tsx
@@ -5,7 +5,7 @@ import {
faQuestionCircle, faArrowLeft, faArrowRight, faArrowDown, faArrowUp, faBolt, faBullseye, faCaretUp, faCat, faCheck, faChevronRight, faClipboard, faClone, faCloudUploadAlt,
faCommentAlt, faCompressArrowsAlt, faCut, faEllipsisV, faEraser, faExclamation, faFileAlt, faFileAudio, faFilePdf, faFilm, faFilter, faFont, faGlobeAsia, faHighlighter,
faLongArrowAltRight, faMicrophone, faMousePointer, faMusic, faObjectGroup, faPause, faPen, faPenNib, faPhone, faPlay, faPortrait, faRedoAlt, faStamp, faStickyNote,
- faThumbtack, faTree, faTv, faUndoAlt, faVideo, faAsterisk, faBrain, faImage, faPaintBrush, faTimes, faEye, faQuoteLeft
+ faThumbtack, faTree, faTv, faUndoAlt, faVideo, faAsterisk, faBrain, faImage, faPaintBrush, faTimes, faEye, faQuoteLeft, faSortAmountDown
} from '@fortawesome/free-solid-svg-icons';
import { ANTIMODEMENU_HEIGHT } from './globalCssVariables.scss';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
@@ -55,6 +55,9 @@ import { TimelineMenu } from './animationtimeline/TimelineMenu';
import { SnappingManager } from '../util/SnappingManager';
import { FormattedTextBox } from './nodes/formattedText/FormattedTextBox';
import { DocumentManager } from '../util/DocumentManager';
+import { DocumentLinksButton } from './nodes/DocumentLinksButton';
+import { LinkMenu } from './linking/LinkMenu';
+import { LinkDocPreview } from './nodes/LinkDocPreview';
@observer
export class MainView extends React.Component {
@@ -135,7 +138,7 @@ export class MainView extends React.Component {
faQuestionCircle, faArrowLeft, faArrowRight, faArrowDown, faArrowUp, faBolt, faBullseye, faCaretUp, faCat, faCheck, faChevronRight, faClipboard, faClone, faCloudUploadAlt,
faCommentAlt, faCompressArrowsAlt, faCut, faEllipsisV, faEraser, faExclamation, faFileAlt, faFileAudio, faFilePdf, faFilm, faFilter, faFont, faGlobeAsia, faHighlighter,
faLongArrowAltRight, faMicrophone, faMousePointer, faMusic, faObjectGroup, faPause, faPen, faPenNib, faPhone, faPlay, faPortrait, faRedoAlt, faStamp, faStickyNote, faTrashAlt, faAngleRight, faBell,
- faThumbtack, faTree, faTv, faUndoAlt, faVideo, faAsterisk, faBrain, faImage, faPaintBrush, faTimes, faEye, faQuoteLeft);
+ faThumbtack, faTree, faTv, faUndoAlt, faVideo, faAsterisk, faBrain, faImage, faPaintBrush, faTimes, faEye, faQuoteLeft, faSortAmountDown);
this.initEventListeners();
this.initAuthenticationRouters();
}
@@ -578,6 +581,10 @@ export class MainView extends React.Component {
{this.mainContent}
+ {DocumentLinksButton.EditLink ? : (null)}
+ {LinkDocPreview.LinkInfo ? : (null)}
diff --git a/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx b/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx
index dc62c48b7..42aa0f58e 100644
--- a/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx
+++ b/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx
@@ -47,6 +47,7 @@ import { Timeline } from "../../animationtimeline/Timeline";
import { SnappingManager } from "../../../util/SnappingManager";
import { ActiveInkColor, ActiveInkWidth, ActiveInkBezierApprox } from "../../InkingStroke";
import { DocumentType } from "../../../documents/DocumentTypes";
+import { DocumentLinksButton } from "../../nodes/DocumentLinksButton";
library.add(faEye as any, faTable, faPaintBrush, faExpandArrowsAlt, faCompressArrowsAlt, faCompass, faUpload, faBraille, faChalkboard, faFileUpload);
@@ -245,7 +246,7 @@ export class CollectionFreeFormView extends CollectionSubView {
if (this.layoutDoc.targetScale && (Math.abs(e.pageX - this._downX) < 3 && Math.abs(e.pageY - this._downY) < 3)) {
if (Date.now() - this._lastTap < 300) {
+ runInAction(() => DocumentLinksButton.StartLink = undefined);
const docpt = this.getTransform().transformPoint(e.clientX, e.clientY);
this.scaleAtPt(docpt, 1);
e.stopPropagation();
diff --git a/src/client/views/globalCssVariables.scss b/src/client/views/globalCssVariables.scss
index 4e85fe0ca..3e54d001b 100644
--- a/src/client/views/globalCssVariables.scss
+++ b/src/client/views/globalCssVariables.scss
@@ -12,6 +12,7 @@ $lighter-alt-accent: rgb(207, 220, 240);
$darker-alt-accent: rgb(178, 206, 248);
$intermediate-color: #9c9396;
$dark-color: #121721;
+$link-color: lightBlue;
$antimodemenu-height: 35px;
// fonts
$sans-serif: "Noto Sans",
diff --git a/src/client/views/linking/LinkMenu.scss b/src/client/views/linking/LinkMenu.scss
index 7dee22f66..c372e7098 100644
--- a/src/client/views/linking/LinkMenu.scss
+++ b/src/client/views/linking/LinkMenu.scss
@@ -8,6 +8,10 @@
.linkMenu-list {
max-height: 200px;
overflow-y: scroll;
+ position: absolute;
+ z-index: 10;
+ background: $link-color;
+ min-width: 150px
}
.linkMenu-group {
diff --git a/src/client/views/linking/LinkMenu.tsx b/src/client/views/linking/LinkMenu.tsx
index 56f40ad69..0fcc0f0b9 100644
--- a/src/client/views/linking/LinkMenu.tsx
+++ b/src/client/views/linking/LinkMenu.tsx
@@ -4,11 +4,12 @@ import { DocumentView } from "../nodes/DocumentView";
import { LinkEditor } from "./LinkEditor";
import './LinkMenu.scss';
import React = require("react");
-import { Doc } from "../../../fields/Doc";
+import { Doc, Opt } from "../../../fields/Doc";
import { LinkManager } from "../../util/LinkManager";
import { LinkMenuGroup } from "./LinkMenuGroup";
import { faTrash } from '@fortawesome/free-solid-svg-icons';
import { library } from "@fortawesome/fontawesome-svg-core";
+import { DocumentLinksButton } from "../nodes/DocumentLinksButton";
library.add(faTrash);
@@ -16,16 +17,29 @@ interface Props {
docView: DocumentView;
changeFlyout: () => void;
addDocTab: (document: Doc, where: string) => boolean;
+ location: number[];
}
@observer
export class LinkMenu extends React.Component {
@observable private _editingLink?: Doc;
+ @observable private _linkMenuRef: Opt;
+ @action
+ onClick = (e: PointerEvent) => {
+ if (!Array.from(this._linkMenuRef?.getElementsByTagName((e.target as HTMLElement).tagName) || []).includes(e.target as any)) {
+ DocumentLinksButton.EditLink = undefined;
+ }
+ }
@action
componentDidMount() {
this._editingLink = undefined;
+ document.addEventListener("pointerdown", this.onClick);
+ }
+
+ componentWillUnmount() {
+ document.removeEventListener("pointerdown", this.onClick);
}
clearAllLinks = () => {
@@ -56,20 +70,11 @@ export class LinkMenu extends React.Component {
render() {
const sourceDoc = this.props.docView.props.Document;
const groups: Map = LinkManager.Instance.getRelatedGroupedLinks(sourceDoc);
- if (this._editingLink === undefined) {
- return (
-
- {/*
*/}
- {/* */}
-
- {this.renderAllGroups(groups)}
-
-
- );
- } else {
- return (
- this._editingLink = undefined)}>
- );
- }
+ return this._linkMenuRef = r} style={{ left: this.props.location[0], top: this.props.location[1] }}>
+ {!this._editingLink ?
+ this.renderAllGroups(groups) :
+ this._editingLink = undefined)} />
+ }
+
;
}
}
\ No newline at end of file
diff --git a/src/client/views/nodes/AudioBox.scss b/src/client/views/nodes/AudioBox.scss
index 43dd698ad..b5d113ca0 100644
--- a/src/client/views/nodes/AudioBox.scss
+++ b/src/client/views/nodes/AudioBox.scss
@@ -175,76 +175,29 @@
@media only screen and (max-device-width: 480px) {
-
- .audiobox-container,
- .audiobox-container-interactive {
- width: max-content;
- /* align-self: center; */
- left: 50%;
- top: 40%;
- transform: translate(-50%, 0);
- height: 100px;
- position: absolute;
- display: flex;
- pointer-events: all;
- /* cursor: default; */
- }
-
- .audiobox-container .audiobox-buttons,
- .audiobox-container-interactive .audiobox-buttons {
- display: flex;
- width: 500px;
- /* left: 50%; */
- /* transform: translate(-50%,0); */
- align-items: center;
- }
-
.audiobox-dictation {
+ font-size: 5em;
+ display: flex;
width: 100;
- height: 100;
- font-size: 50;
- /* background-color: white; */
+ justify-content: center;
+ flex-direction: column;
+ align-items: center;
}
- .audiobox-container .audiobox-record-interactive,
- .audiobox-container-interactive .audiobox-record-interactive {
- width: 95%;
- user-select: none;
- font-size: 50px;
- font-weight: 100;
- left: 5%;
+ .audiobox-container .audiobox-record,
+ .audiobox-container-interactive .audiobox-record {
+ pointer-events: all;
+ font-size: 3em;
+ width: 100%;
height: 100%;
position: relative;
+ pointer-events: none;
}
.audiobox-container .audiobox-controls .audiobox-player .audiobox-playhead,
.audiobox-container .audiobox-controls .audiobox-player .audiobox-dictation,
.audiobox-container-interactive .audiobox-controls .audiobox-player .audiobox-playhead,
.audiobox-container-interactive .audiobox-controls .audiobox-player .audiobox-dictation {
- position: relative;
- align-self: center;
- width: 50px;
- height: max-content;
- padding: 0;
- }
-
- .audiobox-container .audiobox-controls .audiobox-player,
- .audiobox-container-interactive .audiobox-controls .audiobox-player {
- margin-top: auto;
- margin-bottom: auto;
- width: 100%;
- height: 100%;
- position: relative;
- padding-right: 5px;
- display: flex;
- }
-
- .audiobox-container .audiobox-controls,
- .audiobox-container-interactive .audiobox-controls {
- width: 500px;
- height: 100%;
- position: relative;
- display: flex;
- padding-left: 2px;
+ width: 70px;
}
}
\ No newline at end of file
diff --git a/src/client/views/nodes/AudioBox.tsx b/src/client/views/nodes/AudioBox.tsx
index cb0582d87..d5288fff6 100644
--- a/src/client/views/nodes/AudioBox.tsx
+++ b/src/client/views/nodes/AudioBox.tsx
@@ -193,7 +193,7 @@ export class AudioBox extends ViewBoxBaseComponent {
+ private _linkButton = React.createRef();
+
+ @action
+ onLinkButtonMoved = (e: PointerEvent) => {
+ if (this._linkButton.current !== null) {
+ const linkDrag = UndoManager.StartBatch("Drag Link");
+ this.props.View && DragManager.StartLinkDrag(this._linkButton.current, this.props.View.props.Document, e.pageX, e.pageY, {
+ dragComplete: dropEv => {
+ const linkDoc = dropEv.linkDragData?.linkDocument as Doc; // equivalent to !dropEve.aborted since linkDocument is only assigned on a completed drop
+ if (this.props.View && linkDoc) {
+ !linkDoc.linkRelationship && (Doc.GetProto(linkDoc).linkRelationship = "hyperlink");
+
+ // we want to allow specific views to handle the link creation in their own way (e.g., rich text makes text hyperlinks)
+ // the dragged view can regiser a linkDropCallback to be notified that the link was made and to update their data structures
+ // however, the dropped document isn't so accessible. What we do is set the newly created link document on the documentView
+ // The documentView passes a function prop returning this link doc to its descendants who can react to changes to it.
+ dropEv.linkDragData?.linkDropCallback?.(dropEv.linkDragData);
+ runInAction(() => this.props.View._link = linkDoc);
+ setTimeout(action(() => this.props.View._link = undefined), 0);
+ }
+ linkDrag?.end();
+ },
+ hideSource: false
+ });
+ return true;
+ }
+ return false;
+ }
+
+ @observable static StartLink: DocumentView | undefined;
+ onLinkButtonDown = (e: React.PointerEvent): void => {
+ setupMoveUpEvents(this, e, this.onLinkButtonMoved, emptyFunction, action((e, doubleTap) => {
+ if (doubleTap) {
+ DocumentLinksButton.StartLink = this.props.View;
+ } else {
+ DocumentLinksButton.EditLink = this.props.View;
+ DocumentLinksButton.EditLinkLoc = [e.clientX + 10, e.clientY];
+ }
+ }));
+ }
+ completeLink = (e: React.PointerEvent): void => {
+ setupMoveUpEvents(this, e, returnFalse, emptyFunction, action((e, doubleTap) => {
+ if (doubleTap) {
+ if (DocumentLinksButton.StartLink === this.props.View) {
+ DocumentLinksButton.StartLink = undefined;
+ } else {
+ DocumentLinksButton.StartLink && DocumentLinksButton.StartLink !== this.props.View &&
+ DocUtils.MakeLink({ doc: DocumentLinksButton.StartLink.props.Document }, { doc: this.props.View.props.Document }, "long drag");
+ }
+ }
+ }));
+ }
+
+ @observable
+ public static EditLink: DocumentView | undefined;
+ public static EditLinkLoc: number[] = [0, 0];
+
+ @computed
+ get linkButton() {
+ const links = DocListCast(this.props.View.props.Document.links);
+ return (!links.length || links[0].hidden) && !this.props.AlwaysOn ? (null) :
+
+
LinkDocPreview.LinkInfo = undefined)}
+ onPointerEnter={action(e => LinkDocPreview.LinkInfo = {
+ addDocTab: this.props.View.props.addDocTab,
+ linkSrc: this.props.View.props.Document,
+ linkDoc: links[0],
+ Location: [e.clientX, e.clientY + 20]
+ })} >
+ {links.length ? links.length : }
+
+ {DocumentLinksButton.StartLink && DocumentLinksButton.StartLink !== this.props.View ?
: (null)}
+ {DocumentLinksButton.StartLink === this.props.View ?
: (null)}
+
;
+ }
+ render() {
+ return this.linkButton;
+ }
+}
\ No newline at end of file
diff --git a/src/client/views/nodes/DocumentView.tsx b/src/client/views/nodes/DocumentView.tsx
index d31ec8c1a..afd28534e 100644
--- a/src/client/views/nodes/DocumentView.tsx
+++ b/src/client/views/nodes/DocumentView.tsx
@@ -42,6 +42,7 @@ import { LinkAnchorBox } from './LinkAnchorBox';
import { RadialMenu } from './RadialMenu';
import React = require("react");
import { MobileInterface } from '../../../mobile/MobileInterface';
+import { DocumentLinksButton } from './DocumentLinksButton';
library.add(fa.faEdit, fa.faTrash, fa.faShare, fa.faDownload, fa.faExpandArrowsAlt, fa.faCompressArrowsAlt, fa.faLayerGroup, fa.faExternalLinkAlt, fa.faAlignCenter, fa.faCaretSquareRight,
fa.faSquare, fa.faConciergeBell, fa.faWindowRestore, fa.faFolder, fa.faMapPin, fa.faLink, fa.faFingerprint, fa.faCrosshairs, fa.faDesktop, fa.faUnlock, fa.faLock, fa.faLaptopCode, fa.faMale,
@@ -585,10 +586,14 @@ export class DocumentView extends DocComponent(Docu
toggleLinkButtonBehavior = (): void => {
if (this.Document.isLinkButton || this.layoutDoc.onClick || this.Document.ignoreClick) {
this.Document.isLinkButton = false;
+ const first = DocListCast(this.Document.links).find(d => d instanceof Doc);
+ first && (first.hidden = false);
this.Document.ignoreClick = false;
this.layoutDoc.onClick = undefined;
} else {
this.Document.isLinkButton = true;
+ const first = DocListCast(this.Document.links).find(d => d instanceof Doc);
+ first && (first.hidden = true);
this.Document.followLinkZoom = false;
this.Document.followLinkLocation = undefined;
}
@@ -598,8 +603,12 @@ export class DocumentView extends DocComponent(Docu
toggleFollowInPlace = (): void => {
if (this.Document.isLinkButton) {
this.Document.isLinkButton = false;
+ const first = DocListCast(this.Document.links).find(d => d instanceof Doc);
+ first && (first.hidden = false);
} else {
this.Document.isLinkButton = true;
+ const first = DocListCast(this.Document.links).find(d => d instanceof Doc);
+ first && (first.hidden = true);
this.Document.followLinkZoom = true;
this.Document.followLinkLocation = "inPlace";
}
@@ -609,6 +618,8 @@ export class DocumentView extends DocComponent(Docu
toggleFollowOnRight = (): void => {
if (this.Document.isLinkButton) {
this.Document.isLinkButton = false;
+ const first = DocListCast(this.Document.links).find(d => d instanceof Doc);
+ first && (first.hidden = false);
} else {
this.Document.isLinkButton = true;
this.Document.followLinkZoom = false;
@@ -737,10 +748,8 @@ export class DocumentView extends DocComponent(Docu
const optionItems: ContextMenuProps[] = options && "subitems" in options ? options.subitems : [];
const templateDoc = Cast(this.props.Document[StrCast(this.props.Document.layoutKey)], Doc, null);
templateDoc && optionItems.push({ description: "Open Template ", event: () => this.props.addDocTab(templateDoc, "onRight"), icon: "eye" });
- if (!options) {
- options = { description: "Options...", subitems: optionItems, icon: "compass" };
- cm?.addItem(options);
- }
+ optionItems.push({ description: "Toggle Show Each Link Dot", event: () => this.layoutDoc.showLinks = !this.layoutDoc.showLinks, icon: "eye" });
+ !options && cm.addItem({ description: "Options...", subitems: optionItems, icon: "compass" });
const existingOnClick = cm?.findByDescription("OnClick...");
const onClicks: ContextMenuProps[] = existingOnClick && "subitems" in existingOnClick ? existingOnClick.subitems : [];
@@ -1039,7 +1048,8 @@ export class DocumentView extends DocComponent(Docu
select={this.select}
onClick={this.onClickHandler}
layoutKey={this.finalLayoutKey} />
- {this.anchors}
+ {this.layoutDoc.showLinks ? this.anchors : (null)}
+ {this.props.forcedBackgroundColor?.(this.Document) === "transparent" || this.props.dontRegisterView ? (null) : }
);
}
@@ -1063,7 +1073,7 @@ export class DocumentView extends DocComponent