From 2f1714f0175f8fc766ba030848f5469e429307f4 Mon Sep 17 00:00:00 2001 From: geireann <60007097+geireann@users.noreply.github.com> Date: Fri, 12 Jun 2020 11:17:40 +0800 Subject: menu bug fix --- src/client/views/GestureOverlay.tsx | 2 +- src/client/views/nodes/AudioBox.scss | 206 +++++-- src/client/views/nodes/ColorBox.tsx | 4 +- src/mobile/MobileInterface.tsx | 1012 ++-------------------------------- src/mobile/MobileMenu.scss | 5 +- 5 files changed, 192 insertions(+), 1037 deletions(-) (limited to 'src') diff --git a/src/client/views/GestureOverlay.tsx b/src/client/views/GestureOverlay.tsx index 1879f3096..3bb80abd0 100644 --- a/src/client/views/GestureOverlay.tsx +++ b/src/client/views/GestureOverlay.tsx @@ -107,7 +107,7 @@ export default class GestureOverlay extends Touchable { onReactTouchStart = (te: React.TouchEvent) => { document.removeEventListener("touchmove", this.onReactHoldTouchMove); document.removeEventListener("touchend", this.onReactHoldTouchEnd); - if (RadialMenu.Instance._display === true) { + if (RadialMenu.Instance?._display === true) { te.preventDefault(); te.stopPropagation(); RadialMenu.Instance.closeMenu(); diff --git a/src/client/views/nodes/AudioBox.scss b/src/client/views/nodes/AudioBox.scss index 53b54d7e4..61ce4bd13 100644 --- a/src/client/views/nodes/AudioBox.scss +++ b/src/client/views/nodes/AudioBox.scss @@ -1,141 +1,169 @@ -.audiobox-container, .audiobox-container-interactive { +.audiobox-container, +.audiobox-container-interactive { width: 100%; height: 100%; position: inherit; - display:flex; + display: flex; pointer-events: all; - cursor:default; + cursor: default; + .audiobox-buttons { display: flex; width: 100%; align-items: center; } + .audiobox-handle { - width:20px; - height:100%; - display:inline-block; + width: 20px; + height: 100%; + display: inline-block; } - .audiobox-control, .audiobox-control-interactive { - top:0; + + .audiobox-control, + .audiobox-control-interactive { + top: 0; max-height: 32px; width: 100%; - display:inline-block; + display: inline-block; pointer-events: none; } + .audiobox-control-interactive { pointer-events: all; } + .audiobox-record { pointer-events: all; - width:100%; - height:100%; + width: 100%; + height: 100%; position: relative; pointer-events: none; } + .audiobox-record-interactive { pointer-events: all; - width:100%; - height:100%; + width: 100%; + height: 100%; position: relative; } + .audiobox-controls { - width:100%; - height:100%; + width: 100%; + height: 100%; position: relative; display: flex; padding-left: 2px; + .audiobox-player { - margin-top:auto; - margin-bottom:auto; - width:100%; + margin-top: auto; + margin-bottom: auto; + width: 100%; height: 80%; position: relative; padding-right: 5px; display: flex; - .audiobox-playhead, .audiobox-dictation { + + .audiobox-playhead, + .audiobox-dictation { position: relative; margin-top: auto; margin-bottom: auto; width: 25px; padding: 2px; } + .audiobox-dictation { align-items: center; display: inherit; background: dimgray; } + .audiobox-timeline { - position:relative; - height:100%; - width:100%; + position: relative; + height: 100%; + width: 100%; background: white; border: gray solid 1px; border-radius: 3px; + .audiobox-current { width: 1px; - height:100%; + height: 100%; background-color: red; position: absolute; } - .audiobox-linker, .audiobox-linker-mini { - position:absolute; - width:15px; - min-height:10px; - height:15px; - margin-left:-2.55px; - background:gray; + + .audiobox-linker, + .audiobox-linker-mini { + position: absolute; + width: 15px; + min-height: 10px; + height: 15px; + margin-left: -2.55px; + background: gray; border-radius: 100%; - opacity:0.9; + opacity: 0.9; background-color: transparent; box-shadow: black 2px 2px 1px; + .linkAnchorBox-cont { position: relative !important; - height: 100% !important; + height: 100% !important; width: 100% !important; - left:unset !important; - top:unset !important; + left: unset !important; + top: unset !important; } } + .audiobox-linker-mini { - width:8px; - min-height:8px; - height:8px; + width: 8px; + min-height: 8px; + height: 8px; box-shadow: black 1px 1px 1px; margin-left: -1; margin-top: -2; + .linkAnchorBox-cont { position: relative !important; - height: 100% !important; + height: 100% !important; width: 100% !important; - left:unset !important; - top:unset !important; + left: unset !important; + top: unset !important; } } - .audiobox-linker:hover, .audiobox-linker-mini:hover { - opacity:1; + + .audiobox-linker:hover, + .audiobox-linker-mini:hover { + opacity: 1; } - .audiobox-marker-container, .audiobox-marker-minicontainer { - position:absolute; - width:10px; - height:90%; - top:2.5%; - background:gray; + + .audiobox-marker-container, + .audiobox-marker-minicontainer { + position: absolute; + width: 10px; + height: 90%; + top: 2.5%; + background: gray; border-radius: 5px; box-shadow: black 2px 2px 1px; + .audiobox-marker { - position:relative; + position: relative; height: calc(100% - 15px); margin-top: 15px; } + .audio-marker:hover { border: orange 2px solid; } } + .audiobox-marker-minicontainer { - width:5px; + width: 5px; border-radius: 1px; + .audiobox-marker { - position:relative; + position: relative; height: calc(100% - 8px); margin-top: 8px; } @@ -143,4 +171,80 @@ } } } +} + + +@media only screen and (max-width: 1000px) { + + .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 { + width: 100; + height: 100; + font-size: 50; + /* background-color: white; */ + } + + .audiobox-container .audiobox-record-interactive, + .audiobox-container-interactive .audiobox-record-interactive { + width: 95%; + user-select: none; + font-size: 50px; + font-weight: 100; + left: 5%; + height: 100%; + position: relative; + } + + .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; + } } \ No newline at end of file diff --git a/src/client/views/nodes/ColorBox.tsx b/src/client/views/nodes/ColorBox.tsx index 0d6258cf3..f49b1f763 100644 --- a/src/client/views/nodes/ColorBox.tsx +++ b/src/client/views/nodes/ColorBox.tsx @@ -60,9 +60,9 @@ export class ColorBox extends ViewBoxBaseComponent
{ActiveInkWidth() ?? 2}
- ) => SetActiveInkWidth(e.target.value)} /> + ) => SetActiveInkWidth(e.target.value)} />
{ActiveInkBezierApprox() ?? 2}
- ) => SetActiveBezierApprox(e.target.value)} /> + ) => SetActiveBezierApprox(e.target.value)} />

diff --git a/src/mobile/MobileInterface.tsx b/src/mobile/MobileInterface.tsx index d9399d549..687422cf2 100644 --- a/src/mobile/MobileInterface.tsx +++ b/src/mobile/MobileInterface.tsx @@ -46,903 +46,6 @@ library.add(faTasks, faMobile, faThLarge, faWindowClose, faEdit, faTrashAlt, faP faLongArrowAltRight, faMicrophone, faMousePointer, faMusic, faObjectGroup, faPause, faPen, faPenNib, faPhone, faPlay, faPortrait, faRedoAlt, faStamp, faStickyNote, faThumbtack, faTree, faTv, faUndoAlt, faBook, faVideo, faAsterisk, faBrain, faImage, faPaintBrush, faTimes, faEye, faHome, faLongArrowAltLeft, faBars, faTh, faChevronLeft); -// @observer -// export class MobileInterface extends React.Component { -// @observable static Instance: MobileInterface; -// @computed private get userDoc() { return Doc.UserDoc(); } -// @computed private get mainContainer() { return this.userDoc ? FieldValue(Cast(this.userDoc.activeMobile, Doc)) : CurrentUserUtils.GuestMobile; } -// @computed private get activeContainer() { return this.userDoc ? FieldValue(Cast(this.userDoc.activeMobile, Doc)) : CurrentUserUtils.GuestMobile; } -// // @observable private currentView: "main" | "ink" | "upload" = "main"; -// @observable private mainDoc: any = CurrentUserUtils.setupMobileDoc(this.userDoc); -// @observable private renderView?: () => JSX.Element; -// @observable private sidebarActive = true; - -// public _activeDoc: Doc = this.mainDoc; -// public _homeDoc: Doc = this.mainDoc; -// private _homeMenu: boolean = true; - -// // private inkDoc?: Doc; -// public drawingInk: boolean = false; -// private _ink: boolean = false; - -// // private _uploadDoc: Doc = this.userDoc; -// private _child: Doc | null = null; -// private _parents: Array = []; -// private _library: Doc = CurrentUserUtils.setupLibrary(this.userDoc); -// private _open: boolean = false; - -// constructor(props: Readonly<{}>) { -// super(props); -// MobileInterface.Instance = this; -// } - -// @action -// componentDidMount = () => { -// library.add(...[faPenNib, faHighlighter, faEraser, faMousePointer, faThumbtack]); - -// if (this.userDoc && !this.mainContainer) { -// this.userDoc.activeMobile = this._homeDoc; -// } - -// InkingControl.Instance.switchTool(InkTool.None); -// MobileInterface.Instance.drawingInk = false; -// InkingControl.Instance.updateSelectedColor("#FF0000"); -// InkingControl.Instance.switchWidth("2"); -// this.switchCurrentView((userDoc: Doc) => this._homeDoc); -// } - -// @action -// switchCurrentView = (doc: (userDoc: Doc) => Doc, renderView?: () => JSX.Element, onSwitch?: () => void) => { -// if (!this.userDoc) return; - -// this.userDoc.activeMobile = doc(this.userDoc); -// onSwitch && onSwitch(); - -// this.renderView = renderView; -// } - -// onSwitchInking = () => { -// const button = document.getElementById("inkButton") as HTMLElement; -// const color = InkingControl.Instance.selectedColor; -// button.style.backgroundColor = this._ink ? "white" : color; -// button.style.color = this._ink ? "black" : "white"; - -// if (!this._ink) { -// console.log("INK IS ACTIVE"); -// InkingControl.Instance.switchTool(InkTool.Pen); -// MobileInterface.Instance.drawingInk = true; -// this._ink = true; -// } else { -// console.log("INK IS INACTIVE"); -// InkingControl.Instance.switchTool(InkTool.None); -// MobileInterface.Instance.drawingInk = false; -// this._ink = false; -// } -// } - -// onSwitchUpload = async () => { -// let width = 300; -// let height = 300; -// const res = await rp.get(Utils.prepend("/getUserDocumentId")); - -// // get width and height of the collection doc -// if (this.mainContainer) { -// const data = Cast(this.mainContainer.data, listSpec(Doc)); -// if (data) { -// const collectionDoc = await data[1]; // this should be the collection doc since the positions should be locked -// const docView = DocumentManager.Instance.getDocumentView(collectionDoc); -// if (docView) { -// width = docView.nativeWidth ? docView.nativeWidth : 300; -// height = docView.nativeHeight ? docView.nativeHeight : 300; -// } -// } -// } -// DocServer.Mobile.dispatchOverlayTrigger({ -// enableOverlay: true, -// width: width, -// height: height, -// text: "Documents uploaded from mobile will show here", -// }); -// } - -// back = () => { -// let header = document.getElementById("header") as HTMLElement; -// let doc = Cast(this._parents.pop(), Doc) as Doc; -// if (doc === Cast(this._library, Doc) as Doc) { -// this._child = null; -// this.userDoc.activeMobile = this._library; -// } else if (doc === Cast(this._homeDoc, Doc) as Doc) { -// this._homeMenu = true; -// this._parents = []; -// this._activeDoc = this._homeDoc; -// this._child = null; -// this.switchCurrentView((userDoc: Doc) => this._homeDoc); -// } else { -// if (doc) { -// this._child = doc; -// this.switchCurrentView((userDoc: Doc) => doc); -// this._homeMenu = false; -// header.textContent = String(doc.title); -// } -// } -// if (doc) { -// this._activeDoc = doc; -// } -// this._ink = false; -// } - -// returnHome = () => { -// if (this._homeMenu === false || this._open === true) { -// this._homeMenu = true; -// this._parents = []; -// this._activeDoc = this._homeDoc; -// this._child = null; -// this.switchCurrentView((userDoc: Doc) => this._homeDoc); -// } -// if (this._open) { -// this.toggleSidebar(); -// } -// } - -// returnMain = () => { -// this._parents = []; -// // this.toggleSidebar(); -// this._activeDoc = this._library; -// this.switchCurrentView((userDoc: Doc) => this._library); -// this._homeMenu = false; -// this._child = null; -// } - -// displayWorkspaces = () => { -// if (this.mainContainer) { -// const backgroundColor = () => "white"; -// if (this._activeDoc.title === "mobile audio") { -// return ( -//
-// window.screen.width} -// PanelHeight={() => window.screen.height} -// renderDepth={0} -// focus={emptyFunction} -// backgroundColor={backgroundColor} -// parentActive={returnTrue} -// whenActiveChanged={emptyFunction} -// bringToFront={emptyFunction} -// ContainingCollectionView={undefined} -// ContainingCollectionDoc={undefined} -// /> -//
-// ); -// } else { -// return ( -//
-// -//
-// ); -// } -// } -// } - -// returnWidth = () => 2000; -// returnHeight = () => 2000; - -// handleClick(doc: Doc) { -// let children = DocListCast(doc.data); -// if (doc.type !== "collection") { -// this._parents.push(this._activeDoc); -// this._activeDoc = doc; -// this.switchCurrentView((userDoc: Doc) => doc); -// this._homeMenu = false; -// this.toggleSidebar(); -// } else if (doc.type === "collection" && children.length === 0) { -// console.log("This collection has no children"); -// } else { -// this._parents.push(this._activeDoc); -// this._activeDoc = doc; -// this.switchCurrentView((userDoc: Doc) => doc); -// this._homeMenu = false; -// this._child = doc; -// } - -// // let sidebar = document.getElementById("sidebar") as HTMLElement; -// // sidebar.classList.toggle('active'); -// } - -// createPathname = () => { -// let docArray = []; -// this._parents.map((doc: Doc, index: any) => { -// // if (doc === this.mainDoc) { -// // pathname = pathname; -// // } else if (doc.type === "audio" || doc.type === "presentation") { -// // pathname = pathname; -// // } else if (doc.type !== "collection") { -// // pathname = pathname; -// // } else { -// // pathname = pathname + " > " + doc.title; -// // titleArray.push(doc.title); -// // docArray.push(doc); -// // } -// docArray.push(doc); -// }); -// docArray.push(this._activeDoc); -// // if (this._activeDoc.title === "mobile audio") { -// // pathname = this._activeDoc.title; -// // } else if (this._activeDoc.title === "Presentation") { -// // pathname = this._activeDoc.title; -// // } else if (this._activeDoc === this.mainDoc) { -// // pathname = pathname; -// // } else { -// // pathname = pathname + " > " + this._activeDoc.title; -// // docArray.push(this._activeDoc); -// // titleArray.push(this._activeDoc.title); -// // } - -// return docArray; -// } - -// renderPathbar = () => { -// // if (this._homeMenu == false) { -// let docArray = this.createPathname(); -// let items = docArray.map((doc: Doc, index: any) => { -// if (index == 0) { -// return ( -//
-//
this.handlePathClick(doc, index)}>{doc.title} -//
-//
); -// } else if (doc === this._activeDoc) { -// return ( -//
-// -//
this.handlePathClick(doc, index)}>{doc.title} -//
-//
); -// } else { -// return ( -//
-// -//
this.handlePathClick(doc, index)}>{doc.title} -//
-//
); -// } - -// }); -// if (this._parents.length !== 0) { -// return (
-//
-// {items} -//
-//
-// -//
-//
-//
); -// } else { -// return (
-//
-// {items} -//
-//
-//
); -// } -// // } -// // } else { - -// // return ( -// //
-// //
-// //
-// //
this.returnHome()}>Home -// //
-// //
-// //
-// //
-// //
-// // ); -// // } - -// // } -// } - -// handlePathClick = (doc: Doc, index: number) => { -// if (doc === this._library) { -// this._activeDoc = doc; -// this._child = null; -// this.switchCurrentView((userDoc: Doc) => doc); -// this._parents.length = index; -// } else if (doc === this._homeDoc) { -// this.returnHome(); -// } else { -// console.log(index); -// this._activeDoc = doc; -// this._child = doc; -// this.switchCurrentView((userDoc: Doc) => doc); -// this._parents.length = index; -// } -// } - -// @action -// toggleSidebar = () => this.sidebarActive = !this.sidebarActive - -// switchToLibrary = () => { -// this._parents.push(this._activeDoc); -// this.switchCurrentView((userDoc: Doc) => this._library); -// this._activeDoc = this._library; -// this._homeMenu = false; -// this.toggleSidebar(); -// } - -// // renderDefaultContent = () => { -// // let menuButtons = DocListCast(this._homeDoc.data).map((doc: Doc, index: any) => { -// // if (doc.type !== "ink") { -// // return ( -// //
doc.click}>{doc.title} -// //
); -// // } -// // }); - -// // if (this._homeMenu === true) { -// // return ( -// //
-// //
-// // -// // -// // -// //
-// // {this.renderPathbar()} -// // -// //
-// // ); -// // } - -// // const workspaces = Cast(this.userDoc.myWorkspaces, Doc) as Doc; -// // const buttons = DocListCast(this._child ? this._child.data : workspaces.data).map((doc: Doc, index: any) => { -// // return ( -// //
this.handleClick(doc)}>{doc.title} -// //
{doc.type}
-// // -// //
); -// // }); -// // return ( -// // <> -// //
-// //
{this.sidebarActive ? StrCast(this._activeDoc.title) : "Menu"}
-// //
-// //
-// //
-// //
{this.createPathname()}
-// //
-// //
-// // -// // {this._child ? -// // <> -// //
-// //
{buttons}
-// //
Home
-// // : -// // <> -// // {buttons} -// // {/*
-// // Library -// //
*/} -// // -// //
Record Audio
-// //
Presentation
-// //
SettingsManager.Instance.open()}>Settings
-// // -// // } -// //
-// // {this._child ? null :
{this.renderView}
} -// // -// // ); -// // } - -// recordAudio = async () => { -// // upload to server with known URL -// if (this._activeDoc.title !== "mobile audio") { -// this._parents.push(this._activeDoc); -// } -// const audioDoc = Cast(Docs.Create.AudioDocument(nullAudio, { _width: 200, _height: 100, title: "mobile audio" }), Doc) as Doc; -// console.log(audioDoc); -// if (audioDoc) { -// console.log("audioClicked: " + audioDoc.title); -// this._activeDoc = audioDoc; -// this.switchCurrentView((userDoc: Doc) => audioDoc); -// this._homeMenu = false; -// // this.toggleSidebar(); -// } -// // const audioRightSidebar = Cast(Doc.UserDoc().rightSidebarCollection, Doc) as Doc; -// // this.audioState = await audioDoc.getProto; -// // if (this.audioState) { -// // console.log(this.audioState); -// // const data = Cast(audioRightSidebar.data, listSpec(Doc)); -// // if (data) { -// // data.push(audioDoc); -// // } -// // } -// } - -// uploadAudio = () => { -// const audioRightSidebar = Cast(Doc.UserDoc().rightSidebarCollection, Doc) as Doc; -// const audioDoc = this._activeDoc; -// const data = Cast(audioRightSidebar.data, listSpec(Doc)); -// console.log(audioDoc.proto); -// if (data) { -// data.push(audioDoc); -// } -// // this.recordAudio(); -// } - -// uploadAudioButton = () => { -// if (this._activeDoc.type === "audio") { -// return
-// -//
; -// } -// } - -// toggleSelector = () => { -// console.log("toggle selector!"); -// let toolbar = document.getElementById("toolbar") as HTMLElement; -// toolbar.classList.toggle('active'); -// } - -// colorTool = () => { -// if (this._activeDoc._viewType === "docking") { -// const color = InkingControl.Instance.selectedColor; -// console.log(color); -// return ( -//
-//
-//
-//
{ -// InkingControl.Instance.updateSelectedColor("rgb(255,0,0)"); -// Doc.UserDoc().inkColor = "rgb(255,0,0)"; -// console.log(InkingControl.Instance.selectedColor); -// }}> -//
-//
{ -// InkingControl.Instance.updateSelectedColor("rgb(0,128,0)"); -// Doc.UserDoc().inkColor = "rgb(0,128,0)"; -// console.log(InkingControl.Instance.selectedColor); -// }}> -//
-//
{ -// InkingControl.Instance.updateSelectedColor("rgb(0,0,255)"); -// Doc.UserDoc().inkColor = "rgb(0,0,255)"; -// console.log(InkingControl.Instance.selectedColor); -// }}> -//
-//
-//
-// ) => InkingControl.Instance.switchWidth(e.target.value)} /> -//
-//
-//
-// ); -// } -// } - -// drawInk = () => { -// if (this._activeDoc._viewType === "docking") { -// const inkIsOn = this._ink; -// return
-// -//
; -// } -// } - -// downloadDocument = () => { -// if (this._activeDoc.type === "image") { -// const url = this._activeDoc["data-path"]?.toString(); -// return
{ -// window.open(url); -// console.log(url); -// }}> -// -//
; -// } -// } - -// pinToPresentation = () => { -// // Only making button available if it is an image -// if (this._activeDoc.type === "image") { -// const isPinned = this._activeDoc && Doc.isDocPinned(this._activeDoc); -// return
{ -// if (isPinned) { -// DockedFrameRenderer.UnpinDoc(this._activeDoc); -// } -// else { -// DockedFrameRenderer.PinDoc(this._activeDoc); -// } -// }}> -// -//
; -// } -// } - -// setupDefaultPresentation = () => { -// if (this._activeDoc.title !== "Presentation") { -// this._parents.push(this._activeDoc); -// } - -// const presentation = Cast(Doc.UserDoc().activePresentation, Doc) as Doc; - -// if (presentation) { -// console.log(this._activeDoc.mobile); -// console.log("presentation clicked: " + presentation.title); -// this._activeDoc = presentation; -// this.switchCurrentView((userDoc: Doc) => presentation); -// this._homeMenu = false; -// // this.toggleSidebar(); -// } -// } - -// // mobileHome = () => { -// // return ( -// //
-// //
- -// //
-// //
- -// //
-// //
- -// //
-// //
- -// //
-// //
- -// //
-// //
-// // ); -// // } - -// renderActiveCollection = (userDoc: Doc) => { -// if (this.activeContainer) { -// const active = Cast(this.activeContainer.data, listSpec(Doc)); -// if (active) { -// return ( -//
HELLO!
-// ); -// } -// } -// } - -// onBack = (e: React.MouseEvent) => { -// this.switchCurrentView((userDoc: Doc) => this.mainDoc); -// InkingControl.Instance.switchTool(InkTool.None); // TODO: switch to previous tool - -// DocServer.Mobile.dispatchOverlayTrigger({ -// enableOverlay: false, -// width: window.innerWidth, -// height: window.innerHeight -// }); - -// // this.inkDoc = undefined; -// this.drawingInk = false; -// } - -// shiftLeft = (e: React.MouseEvent) => { -// DocServer.Mobile.dispatchOverlayPositionUpdate({ -// dx: -10 -// }); -// e.preventDefault(); -// e.stopPropagation(); -// } - -// shiftRight = (e: React.MouseEvent) => { -// DocServer.Mobile.dispatchOverlayPositionUpdate({ -// dx: 10 -// }); -// e.preventDefault(); -// e.stopPropagation(); -// } - -// panelHeight = () => window.innerHeight; -// panelWidth = () => window.innerWidth; -// //WAS 3 - -// //WAS 1 - -// upload = async (e: React.MouseEvent) => { -// if (this.mainContainer) { -// const data = Cast(this.mainContainer.data, listSpec(Doc)); -// if (data) { -// const collectionDoc = await data[1]; //this should be the collection doc since the positions should be locked -// const children = DocListCast(collectionDoc.data); -// const uploadDoc = children.length === 1 ? children[0] : Docs.Create.StackingDocument(children, { -// title: "Mobile Upload Collection", backgroundColor: "white", lockedPosition: true, _width: 300, _height: 300 -// }); -// if (uploadDoc) { -// DocServer.Mobile.dispatchMobileDocumentUpload({ -// docId: uploadDoc[Id], -// }); -// } -// } -// } -// e.stopPropagation(); -// e.preventDefault(); -// } - -// addWebToCollection = async () => { -// let url = "https://en.wikipedia.org/wiki/Hedgehog"; -// if (this.mainContainer) { -// const data = Cast(this.mainContainer.data, listSpec(Doc)); -// if (data) { -// const webDoc = await data[0]; -// const urlField: FieldResult = Cast(webDoc.data, WebField); -// url = urlField ? urlField.url.toString() : "https://en.wikipedia.org/wiki/Hedgehog"; - -// } -// } -// Docs.Create.WebDocument(url, { _width: 300, _height: 300, title: "Mobile Upload Web Doc" }); -// } - -// clearUpload = async () => { -// if (this.mainContainer) { -// const data = Cast(this.mainContainer.data, listSpec(Doc)); -// if (data) { -// const collectionDoc = await data[1]; -// const children = DocListCast(collectionDoc.data); -// children.forEach(doc => { -// }); -// // collectionDoc[data] = new List(); -// } -// } -// } - -// onDragOver = (e: React.DragEvent) => { -// e.preventDefault(); -// e.stopPropagation(); -// } - -// render() { -// // const content = this.currentView === "main" ? this.mainContent : -// // this.currentView === "ink" ? this.inkContent : -// // this.currentView === "upload" ? this.uploadContent : <>; -// return ( -//
-// {/* -// -// {this.renderView ? this.renderView() : this.renderDefaultContent()} -// */} -// {/* */} -// -// {/* {this.menuOptions()} */} -// {/* {this.displayHome()} */} -//
-// {this.pinToPresentation()} -// {this.downloadDocument()} -// {this.drawInk()} -// {this.uploadAudioButton()} -// {this.colorTool()} -//
-// - -// -// {this.renderDefaultContent()} -// {this.displayWorkspaces()} -// {/*
*/} -// {/* -// -// */} -// {/* */} -// {/*
-// {this.renderDefaultContent()} -//
*/} -// {/* */} -// {/* */} -// {/* -// */} -// {/* -// -// */} -//
-// ); -// } -// } - -// Scripting.addGlobal(function switchMobileView(doc: (userDoc: Doc) => Doc, renderView?: () => JSX.Element, onSwitch?: () => void) { return MobileInterface.Instance.switchCurrentView(doc, renderView, onSwitch); }); -// Scripting.addGlobal(function openMobilePresentation() { return MobileInterface.Instance.setupDefaultPresentation(); }); -// Scripting.addGlobal(function toggleMobileSidebar() { return MobileInterface.Instance.toggleSidebar(); }); -// Scripting.addGlobal(function openMobileAudio() { return MobileInterface.Instance.recordAudio(); }); -// Scripting.addGlobal(function openMobileSettings() { return SettingsManager.Instance.open(); }); -// Scripting.addGlobal(function switchToLibrary() { return MobileInterface.Instance.switchToLibrary(); }); -// // WAS 2 - -// // 1 -// // renderUploadContent() { -// // if (this.mainContainer) { -// // return ( -// //
-// //
-// // -// // {/* */} -// // {/* */} -// // -// //
-// // window.screen.width} -// // PanelHeight={() => window.screen.height} -// // renderDepth={0} -// // focus={emptyFunction} -// // backgroundColor={returnEmptyString} -// // parentActive={returnTrue} -// // whenActiveChanged={emptyFunction} -// // bringToFront={emptyFunction} -// // ContainingCollectionView={undefined} -// // ContainingCollectionDoc={undefined} /> -// //
-// // ); -// // } -// // } - -// // 2 -// // Scripting.addGlobal(function onSwitchMobileInking() { return MobileInterface.Instance.onSwitchInking(); }); -// // Scripting.addGlobal(function renderMobileInking() { return MobileInterface.Instance.renderInkingContent(); }); -// // Scripting.addGlobal(function onSwitchMobileUpload() { return MobileInterface.Instance.onSwitchUpload(); }); -// // Scripting.addGlobal(function renderMobileUpload() { return MobileInterface.Instance.renderUploadContent(); }); -// // Scripting.addGlobal(function addWebToMobileUpload() { return MobileInterface.Instance.addWebToCollection(); }); - - -// // 3 -// // renderInkingContent = () => { -// // console.log("rendering inking content"); -// // // TODO: support panning and zooming -// // // TODO: handle moving of ink strokes -// // if (this.mainContainer) { -// // return ( -// //
-// //
-// //
-// // -// //
-// //
-// // -// //
-// //
-// // -// // -// //
-// //
-// // -// // -// //
-// // ); -// // } -// // } - @observer export class MobileInterface extends React.Component { @observable static Instance: MobileInterface; @@ -1035,28 +138,6 @@ export class MobileInterface extends React.Component { @action toggleSidebar = () => this.sidebarActive = !this.sidebarActive - // toggleSidebar = () => { - // if (this._open === false) { - // this._open = true; - // } else { - // this._open = false; - // } - // console.log("clicked"); - // let menuButton = document.getElementById("menuButton") as HTMLElement; - // //menuButton.classList.toggle('active'); - - // let sidebar = document.getElementById("sidebar") as HTMLElement; - // //sidebar.classList.toggle('active'); - - // let header = document.getElementById("header") as HTMLElement; - - // if (!sidebar.classList.contains('active')) { - // header.textContent = String(this._activeDoc.title); - // } else { - // header.textContent = "library"; - // } - // } - /** * Method called when 'Library' button is pressed */ @@ -1134,66 +215,35 @@ export class MobileInterface extends React.Component { displayWorkspaces = () => { if (this.mainContainer) { const backgroundColor = () => "white"; - if (this._activeDoc.title === "mobile audio") { - return ( -
- window.screen.width} - PanelHeight={() => window.screen.height} - renderDepth={0} - focus={emptyFunction} - backgroundColor={backgroundColor} - parentActive={returnTrue} - whenActiveChanged={emptyFunction} - bringToFront={emptyFunction} - ContainingCollectionView={undefined} - ContainingCollectionDoc={undefined} - /> -
- ); - } else { - return ( -
- -
- ); - } + return ( +
+ +
+ ); } } @@ -1451,9 +501,9 @@ export class MobileInterface extends React.Component { >
- {/* + StrCast(selDoc?._backgroundColor, StrCast(selDoc?.backgroundColor, "black")))} /> */}
{/* ) => InkingControl.Instance.switchWidth(e.target.value)} /> */} diff --git a/src/mobile/MobileMenu.scss b/src/mobile/MobileMenu.scss index 16eb035b3..f602b85a0 100644 --- a/src/mobile/MobileMenu.scss +++ b/src/mobile/MobileMenu.scss @@ -245,11 +245,12 @@ body { position: relative; width: 100px; height: 100px; - font-size: 90px; + font-size: 70px; + padding: 5px; text-align: center; border-style: solid; border-radius: 50px; - border-width: medium; + border-width: 5px; margin: 20px; z-index: 100; } -- cgit v1.2.3-70-g09d2