aboutsummaryrefslogtreecommitdiff
path: root/src/mobile/MobileInterface.tsx
diff options
context:
space:
mode:
authorSophie Zhang <sophie_zhang@brown.edu>2024-01-25 11:35:26 -0500
committerSophie Zhang <sophie_zhang@brown.edu>2024-01-25 11:35:26 -0500
commitf3dab2a56db5e4a6a3dca58185d94e1ff7d1dc32 (patch)
treea7bc895266b53bb620dbd2dd71bad2e83b555446 /src/mobile/MobileInterface.tsx
parentb5c5410b4af5d2c68d2107d3f064f6e3ec4ac3f2 (diff)
parent136f3d9f349d54e8bdd73b6380ea47c19e5edebf (diff)
Merge branch 'master' into sophie-ai-images
Diffstat (limited to 'src/mobile/MobileInterface.tsx')
-rw-r--r--src/mobile/MobileInterface.tsx134
1 files changed, 61 insertions, 73 deletions
diff --git a/src/mobile/MobileInterface.tsx b/src/mobile/MobileInterface.tsx
index 498bec6ed..c31e73b42 100644
--- a/src/mobile/MobileInterface.tsx
+++ b/src/mobile/MobileInterface.tsx
@@ -1,52 +1,33 @@
import { library } from '@fortawesome/fontawesome-svg-core';
import {
- faTasks,
- faReply,
- faQuoteLeft,
- faHandPointLeft,
- faFolderOpen,
+ faAddressCard,
+ faAlignLeft,
+ faAlignRight,
faAngleDoubleLeft,
- faExternalLinkSquareAlt,
- faMobile,
- faThLarge,
- faWindowClose,
- faEdit,
- faTrashAlt,
- faPalette,
faAngleRight,
+ faArrowDown,
+ faArrowLeft,
+ faArrowRight,
+ faArrowUp,
+ faArrowsAltH,
+ faAsterisk,
+ faBars,
faBell,
- faTrash,
+ faBolt,
+ faBook,
+ faBrain,
+ faBullseye,
+ faCalculator,
faCamera,
- faExpand,
faCaretDown,
faCaretLeft,
faCaretRight,
faCaretSquareDown,
faCaretSquareRight,
- faArrowsAltH,
- faPlus,
- faMinus,
- faTerminal,
- faToggleOn,
- faFile as fileSolid,
- faExternalLinkAlt,
- faLocationArrow,
- faSearch,
- faFileDownload,
- faStop,
- faCalculator,
- faWindowMaximize,
- faAddressCard,
- faQuestionCircle,
- faArrowLeft,
- faArrowRight,
- faArrowDown,
- faArrowUp,
- faBolt,
- faBullseye,
faCaretUp,
faCat,
faCheck,
+ faChevronLeft,
faChevronRight,
faClipboard,
faClone,
@@ -54,77 +35,95 @@ import {
faCommentAlt,
faCompressArrowsAlt,
faCut,
+ faEdit,
faEllipsisV,
faEraser,
faExclamation,
+ faExpand,
+ faExternalLinkAlt,
+ faExternalLinkSquareAlt,
+ faEye,
faFileAlt,
faFileAudio,
+ faFileDownload,
faFilePdf,
faFilm,
faFilter,
+ faFolderOpen,
faFont,
faGlobeAsia,
+ faHandPointLeft,
faHighlighter,
+ faHome,
+ faImage,
+ faLocationArrow,
+ faLongArrowAltLeft,
faLongArrowAltRight,
faMicrophone,
+ faMinus,
+ faMobile,
faMousePointer,
faMusic,
faObjectGroup,
+ faPaintBrush,
+ faPalette,
faPause,
faPen,
faPenNib,
faPhone,
faPlay,
+ faPlus,
faPortrait,
+ faQuestionCircle,
+ faQuoteLeft,
faRedoAlt,
+ faReply,
+ faSearch,
faStamp,
faStickyNote,
+ faStop,
+ faTasks,
+ faTerminal,
+ faTh,
+ faThLarge,
faThumbtack,
+ faTimes,
+ faToggleOn,
+ faTrash,
+ faTrashAlt,
faTree,
faTv,
- faBook,
faUndoAlt,
faVideo,
- faAsterisk,
- faBrain,
- faImage,
- faPaintBrush,
- faTimes,
- faEye,
- faHome,
- faLongArrowAltLeft,
- faBars,
- faTh,
- faChevronLeft,
- faAlignRight,
- faAlignLeft,
+ faWindowClose,
+ faWindowMaximize,
+ faFile as fileSolid,
} 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 * as React from 'react';
-import { Docs, DocumentOptions, DocUtils } from '../client/documents/Documents';
+import { emptyFunction, returnEmptyDoclist, returnEmptyFilter, returnFalse, returnTrue } from '../Utils';
import { CollectionViewType, DocumentType } from '../client/documents/DocumentTypes';
+import { Docs, DocumentOptions } from '../client/documents/Documents';
import { CurrentUserUtils } from '../client/util/CurrentUserUtils';
import { ScriptingGlobals } from '../client/util/ScriptingGlobals';
-import { SettingsManager, ColorScheme } from '../client/util/SettingsManager';
+import { SettingsManager } from '../client/util/SettingsManager';
import { Transform } from '../client/util/Transform';
import { UndoManager } from '../client/util/UndoManager';
-import { TabDocView } from '../client/views/collections/TabDocView';
import { GestureOverlay } from '../client/views/GestureOverlay';
+import { TabDocView } from '../client/views/collections/TabDocView';
import { AudioBox } from '../client/views/nodes/AudioBox';
import { DocumentView } from '../client/views/nodes/DocumentView';
-import { RichTextMenu } from '../client/views/nodes/formattedText/RichTextMenu';
import { RadialMenu } from '../client/views/nodes/RadialMenu';
+import { RichTextMenu } from '../client/views/nodes/formattedText/RichTextMenu';
import { Doc, DocListCast } from '../fields/Doc';
import { InkTool } from '../fields/InkField';
import { List } from '../fields/List';
import { ScriptField } from '../fields/ScriptField';
import { Cast, FieldValue, StrCast } from '../fields/Types';
-import { emptyFunction, emptyPath, returnEmptyDoclist, returnEmptyFilter, returnFalse, returnOne, returnTrue, returnZero } from '../Utils';
-import { AudioUpload } from './AudioUpload';
-import { Uploader } from './ImageUpload';
import './AudioUpload.scss';
+import { Uploader } from './ImageUpload';
import './ImageUpload.scss';
import './MobileInterface.scss';
@@ -258,7 +257,7 @@ export class MobileInterface extends React.Component {
}
@action
- componentDidMount = () => {
+ componentDidMount() {
// if the home menu is in list view -> adjust the menu toggle appropriately
this._menuListView = this._homeDoc._type_collection === 'stacking' ? true : false;
Doc.ActiveTool = InkTool.None; // ink should intially be set to none
@@ -268,7 +267,7 @@ export class MobileInterface extends React.Component {
// remove double click to avoid mobile zoom in
document.removeEventListener('dblclick', this.onReactDoubleClick);
document.addEventListener('dblclick', this.onReactDoubleClick);
- };
+ }
@action
componentWillUnmount = () => {
@@ -385,11 +384,9 @@ export class MobileInterface extends React.Component {
<div style={{ position: 'relative', top: '198px', height: `calc(100% - 350px)`, width: '100%', left: '0%' }}>
<DocumentView
Document={this.mainContainer}
- DataDoc={undefined}
addDocument={returnFalse}
addDocTab={returnFalse}
pinToPres={emptyFunction}
- rootSelected={returnFalse}
removeDocument={undefined}
ScreenToLocalTransform={Transform.Identity}
PanelWidth={this.returnWidth}
@@ -399,9 +396,8 @@ export class MobileInterface extends React.Component {
isContentActive={emptyFunction}
focus={emptyFunction}
styleProvider={this.whitebackground}
- docViewPath={returnEmptyDoclist}
+ containerViewPath={returnEmptyDoclist}
whenChildContentsActiveChanged={emptyFunction}
- bringToFront={emptyFunction}
childFilters={returnEmptyFilter}
childFiltersByRanges={returnEmptyFilter}
searchFilterDocs={returnEmptyDoclist}
@@ -658,7 +654,7 @@ export class MobileInterface extends React.Component {
// DocButton for switching into ink mode
@computed get drawInk() {
return !this.mainContainer || this._activeDoc._type_collection !== CollectionViewType.Docking ? null : (
- <div className="docButton" id="inkButton" title={Doc.isDocPinned(this._activeDoc) ? 'Pen on' : 'Pen off'} onClick={this.onSwitchInking}>
+ <div className="docButton" id="inkButton" onClick={this.onSwitchInking}>
<FontAwesomeIcon className="documentdecorations-icon" size="sm" icon="pen-nib" />
</div>
);
@@ -668,7 +664,7 @@ export class MobileInterface extends React.Component {
@computed get uploadImageButton() {
if (this._activeDoc.type === DocumentType.COL && this._activeDoc !== this._homeDoc && this._activeDoc._type_collection !== CollectionViewType.Docking && this._activeDoc.title !== 'WORKSPACES') {
return (
- <div className="docButton" id="imageButton" title={Doc.isDocPinned(this._activeDoc) ? 'Pen on' : 'Pen off'} onClick={this.toggleUpload}>
+ <div className="docButton" id="imageButton" onClick={this.toggleUpload}>
<FontAwesomeIcon className="documentdecorations-icon" size="sm" icon="upload" />
</div>
);
@@ -692,13 +688,8 @@ export class MobileInterface extends React.Component {
@computed get pinToPresentation() {
// Only making button available if it is an image
if (!(this._activeDoc.type === 'collection' || this._activeDoc.type === 'presentation')) {
- const isPinned = this._activeDoc && Doc.isDocPinned(this._activeDoc);
return (
- <div
- className="docButton"
- title={Doc.isDocPinned(this._activeDoc) ? 'Unpin from presentation' : 'Pin to presentation'}
- style={{ backgroundColor: isPinned ? 'black' : 'white', color: isPinned ? 'white' : 'black' }}
- onClick={e => TabDocView.PinDoc(this._activeDoc, {})}>
+ <div className="docButton" title={'Pin to presentation'} style={{ backgroundColor: 'white', color: 'black' }} onClick={e => TabDocView.PinDoc(this._activeDoc, {})}>
<FontAwesomeIcon className="documentdecorations-icon" size="sm" icon="map-pin" />
</div>
);
@@ -825,9 +816,6 @@ export class MobileInterface extends React.Component {
<div className="mobileInterface-container" onDragOver={this.onDragOver}>
<SettingsManager />
<div className={`image-upload ${this._imageUploadActive ? 'active' : ''}`}>{this.uploadImage}</div>
- <div className={`audio-upload ${this._audioUploadActive ? 'active' : ''}`}>
- <AudioUpload />
- </div>
{this.switchMenuView}
{this.inkMenu}
<GestureOverlay isActive={true}>