diff --git a/apps/common/mobile/lib/view/collaboration/Comments.jsx b/apps/common/mobile/lib/view/collaboration/Comments.jsx index 4525329bc..4ccb89031 100644 --- a/apps/common/mobile/lib/view/collaboration/Comments.jsx +++ b/apps/common/mobile/lib/view/collaboration/Comments.jsx @@ -677,7 +677,7 @@ const ViewComments = inject("storeComments", "storeAppOptions", "storeReview")(o {isEdit && !viewMode &&
- {(comment.editable && displayMode === 'markup' && !wsProps?.Objects) &&
{!isViewer && onResolveComment(comment);}}>
} + {(comment.editable && displayMode === 'markup' && !wsProps?.Objects && !isViewer) &&
{onResolveComment(comment);}}>
} {(displayMode === 'markup' && !wsProps?.Objects && !isViewer) &&
{setComment(comment); openActionComment(true);}}> @@ -808,7 +808,7 @@ const CommentList = inject("storeComments", "storeAppOptions", "storeReview")(ob
{isEdit && !viewMode &&
- {(comment.editable && displayMode === 'markup' && !wsProps?.Objects) &&
{!isViewer && onResolveComment(comment);}}>
} + {(comment.editable && displayMode === 'markup' && !wsProps?.Objects && !isViewer) &&
{onResolveComment(comment);}}>
} {(displayMode === 'markup' && !wsProps?.Objects && !isViewer) &&
{openActionComment(true);}}> @@ -822,43 +822,43 @@ const CommentList = inject("storeComments", "storeAppOptions", "storeReview")(ob {comment.quote &&
{sliceQuote(comment.quote)}
}
{pickLink(comment.comment)}
{comment.replies.length > 0 && -
    - {comment.replies.map((reply, indexReply) => { - return ( -
  • -
    -
    -
    -
    -
    - {isAndroid &&
    {reply.userInitials}
    } -
    -
    {reply.parsedName}
    -
    {reply.date}
    -
    -
    - {isEdit && !viewMode && reply.editable && !isViewer && -
    -
    {setReply(reply); openActionReply(true);}} - > - +
      + {comment.replies.map((reply, indexReply) => { + return ( +
    • +
      +
      +
      +
      +
      + {isAndroid &&
      {reply.userInitials}
      } +
      +
      {reply.parsedName}
      +
      {reply.date}
      - } -
      -
      -
      {pickLink(reply.reply)}
      + {isEdit && !viewMode && reply.editable && !isViewer && +
      +
      {setReply(reply); openActionReply(true);}} + > + +
      +
      + } +
      +
      +
      {pickLink(reply.reply)}
      +
      -
    -
  • - ) - })} -
+ + ) + })} + }
diff --git a/apps/documenteditor/mobile/locale/en.json b/apps/documenteditor/mobile/locale/en.json index c88d8d898..695f8ec8c 100644 --- a/apps/documenteditor/mobile/locale/en.json +++ b/apps/documenteditor/mobile/locale/en.json @@ -677,6 +677,8 @@ "dlgLeaveTitleText": "You leave the application", "leaveButtonText": "Leave this Page", "stayButtonText": "Stay on this page", - "textOk": "OK" + "textOk": "OK", + "textSwitchedMobileView": "Switched to Mobile view", + "textSwitchedStandardView": "Switched to Standard view" } } \ No newline at end of file diff --git a/apps/documenteditor/mobile/src/components/Snackbar/Snackbar.jsx b/apps/documenteditor/mobile/src/components/Snackbar/Snackbar.jsx new file mode 100644 index 000000000..ae94a2109 --- /dev/null +++ b/apps/documenteditor/mobile/src/components/Snackbar/Snackbar.jsx @@ -0,0 +1,13 @@ +import React from 'react'; + +const Snackbar = props => { + return ( +
+
+

{props.text}

+
+
+ ) +} + +export default Snackbar; \ No newline at end of file diff --git a/apps/documenteditor/mobile/src/controller/Main.jsx b/apps/documenteditor/mobile/src/controller/Main.jsx index 74fd40e3e..de7abebe4 100644 --- a/apps/documenteditor/mobile/src/controller/Main.jsx +++ b/apps/documenteditor/mobile/src/controller/Main.jsx @@ -124,7 +124,7 @@ class MainController extends Component { docInfo = new Asc.asc_CDocInfo(); docInfo.put_Id(data.doc.key); docInfo.put_Url(data.doc.url); - // docInfo.put_DirectUrl(data.doc.directUrl); + docInfo.put_DirectUrl(data.doc.directUrl); docInfo.put_Title(data.doc.title); docInfo.put_Format(data.doc.fileType); docInfo.put_VKey(data.doc.vkey); @@ -273,7 +273,7 @@ class MainController extends Component { this.api.Resize(); this.api.zoomFitToWidth(); this.api.asc_GetDefaultTableStyles && setTimeout(() => {this.api.asc_GetDefaultTableStyles()}, 1); - + this.api.ChangeReaderMode(); this.applyLicense(); Common.Notifications.trigger('document:ready'); diff --git a/apps/documenteditor/mobile/src/controller/Toolbar.jsx b/apps/documenteditor/mobile/src/controller/Toolbar.jsx index f5f688d75..93e6a4dda 100644 --- a/apps/documenteditor/mobile/src/controller/Toolbar.jsx +++ b/apps/documenteditor/mobile/src/controller/Toolbar.jsx @@ -29,6 +29,7 @@ const ToolbarController = inject('storeAppOptions', 'users', 'storeReview', 'sto const showEditDocument = !appOptions.isEdit && appOptions.canEdit && appOptions.canRequestEditRights; const docInfo = props.storeDocumentInfo; + const docExt = docInfo.dataDoc ? docInfo.dataDoc.fileType : ''; const docTitle = docInfo.dataDoc ? docInfo.dataDoc.title : ''; useEffect(() => { @@ -151,8 +152,10 @@ const ToolbarController = inject('storeAppOptions', 'users', 'storeReview', 'sto return ( { appOptions.changeMobileView(); api.ChangeReaderMode(); - if (Device.phone) { + if(Device.phone) { closeModal(); } } return } + {/*onclosed={this.handleOptionsViewClosed.bind(this, 'settings')}*/} { !this.state.settingsVisible ? null : - + } { !this.state.collaborationVisible ? null : @@ -177,10 +186,21 @@ class MainPage extends Component { !this.state.navigationVisible ? null : } + { + + + + } {appOptions.isDocReady && } ) } } -export default inject("storeAppOptions")(observer(MainPage)); \ No newline at end of file +export default inject("storeAppOptions")(observer(withTranslation()(MainPage))); \ No newline at end of file diff --git a/apps/documenteditor/mobile/src/store/appOptions.js b/apps/documenteditor/mobile/src/store/appOptions.js index 096c60834..b71e1ccce 100644 --- a/apps/documenteditor/mobile/src/store/appOptions.js +++ b/apps/documenteditor/mobile/src/store/appOptions.js @@ -35,7 +35,7 @@ export class storeAppOptions { isEdit = false; - isMobileView = false; + isMobileView = true; changeMobileView() { this.isMobileView = !this.isMobileView; } diff --git a/apps/documenteditor/mobile/src/view/Toolbar.jsx b/apps/documenteditor/mobile/src/view/Toolbar.jsx index 2c35d3f64..fc5a4dc29 100644 --- a/apps/documenteditor/mobile/src/view/Toolbar.jsx +++ b/apps/documenteditor/mobile/src/view/Toolbar.jsx @@ -2,11 +2,13 @@ import React, {Fragment} from 'react'; import { useTranslation } from 'react-i18next'; import {NavLeft, NavRight, NavTitle, Link, Icon} from 'framework7-react'; import { Device } from '../../../../common/mobile/utils/device'; -import EditorUIController from '../lib/patch' +import EditorUIController from '../lib/patch'; const ToolbarView = props => { const { t } = useTranslation(); const isDisconnected = props.isDisconnected; + const docExt = props.docExt; + const isAvailableExt = docExt && docExt !== 'djvu' && docExt !== 'pdf' && docExt !== 'xps'; const disableEditBtn = props.isObjectLocked || props.stateDisplayMode || props.disabledEditControls || isDisconnected; const isViewer = props.isViewer; const isMobileView = props.isMobileView; @@ -44,16 +46,22 @@ const ToolbarView = props => { onUndoClick: props.onUndo, onRedoClick: props.onRedo })} - {(isViewer || !Device.phone) && props.changeMobileView()}>} + {(isViewer || !Device.phone) && isAvailableExt && { + props.changeMobileView(); + props.openOptions('snackbar'); + setTimeout(() => { + props.closeOptions('snackbar'); + }, 500); + }}>} {(props.showEditDocument && !isViewer) && } - {props.isEdit && !isViewer && EditorUIController.getToolbarOptions && EditorUIController.getToolbarOptions({ + {props.isEdit && isAvailableExt && !isViewer && EditorUIController.getToolbarOptions && EditorUIController.getToolbarOptions({ disabled: disableEditBtn || props.disabledControls, onEditClick: e => props.openOptions('edit'), onAddClick: e => props.openOptions('add') })} - {isViewer && props.turnOffViewerMode()}>} + {isViewer && isAvailableExt && props.turnOffViewerMode()}>} {Device.phone ? null : } {props.displayCollaboration && window.matchMedia("(min-width: 360px)").matches ? props.openOptions('coauth')}> : null} props.openOptions('settings')}> diff --git a/apps/documenteditor/mobile/src/view/settings/Settings.jsx b/apps/documenteditor/mobile/src/view/settings/Settings.jsx index 79d869d76..4b263f1e7 100644 --- a/apps/documenteditor/mobile/src/view/settings/Settings.jsx +++ b/apps/documenteditor/mobile/src/view/settings/Settings.jsx @@ -163,7 +163,13 @@ const SettingsList = inject("storeAppOptions", "storeReview")(observer(props => {!isViewer && Device.phone && - props.onChangeMobileView()} /> + { + props.onChangeMobileView(); + props.openOptions('snackbar'); + setTimeout( () => { + props.closeOptions('snackbar'); + }, 1000); + }} /> } {(_isEdit && !isViewer) && @@ -230,11 +236,11 @@ class SettingsView extends Component { const show_popover = this.props.usePopover; return ( show_popover ? - this.props.onclosed()}> - + this.props.closeOptions('settings')}> + : - this.props.onclosed()}> - + this.props.closeOptions('settings')}> + ) } diff --git a/vendor/framework7-react/package.json b/vendor/framework7-react/package.json index 960e46be6..f7ad68807 100644 --- a/vendor/framework7-react/package.json +++ b/vendor/framework7-react/package.json @@ -38,6 +38,7 @@ "react": "^18.1.0", "react-dom": "^18.1.0", "react-i18next": "^11.8.5", + "react-transition-group": "^4.4.5", "swiper": "^8.2.4", "template7": "^1.4.2" },