diff --git a/apps/documenteditor/mobile/locale/en.json b/apps/documenteditor/mobile/locale/en.json index 56df9e3cc..82d750102 100644 --- a/apps/documenteditor/mobile/locale/en.json +++ b/apps/documenteditor/mobile/locale/en.json @@ -2,7 +2,9 @@ "Settings": { "textSettings": "Settings", "textDone": "Done", + "textFind": "Find", "textFindAndReplace": "Find and Replace", + "textReaderMode": "Reader Mode", "textDocumentSettings": "Document Settings", "textApplicationSettings": "Application Settings", "textDownload": "Download", diff --git a/apps/documenteditor/mobile/src/css/icons-ios.less b/apps/documenteditor/mobile/src/css/icons-ios.less index 362af679a..b2c93d134 100644 --- a/apps/documenteditor/mobile/src/css/icons-ios.less +++ b/apps/documenteditor/mobile/src/css/icons-ios.less @@ -36,6 +36,11 @@ height: 22px; .encoded-svg-background(''); } + &.icon-reader { + width: 22px; + height: 22px; + .encoded-svg-background(''); + } &.icon-doc-setup { width: 22px; height: 22px; diff --git a/apps/documenteditor/mobile/src/css/icons-material.less b/apps/documenteditor/mobile/src/css/icons-material.less index 3ec8dfe54..b95725361 100644 --- a/apps/documenteditor/mobile/src/css/icons-material.less +++ b/apps/documenteditor/mobile/src/css/icons-material.less @@ -50,6 +50,11 @@ height: 22px; .encoded-svg-background(''); } + &.icon-reader { + width: 22px; + height: 22px; + .encoded-svg-background(''); + } &.icon-doc-setup { width: 22px; height: 22px; diff --git a/apps/documenteditor/mobile/src/view/settings/Settings.jsx b/apps/documenteditor/mobile/src/view/settings/Settings.jsx index 827d3f5ce..733d7b90b 100644 --- a/apps/documenteditor/mobile/src/view/settings/Settings.jsx +++ b/apps/documenteditor/mobile/src/view/settings/Settings.jsx @@ -2,6 +2,7 @@ import React, {Component, useEffect} from 'react'; import {View,Page,Navbar,NavRight,Link,Popup,Popover,Icon,ListItem,List} from 'framework7-react'; import { withTranslation } from 'react-i18next'; import {f7} from 'framework7-react'; +import { observer, inject } from "mobx-react"; import {Device} from '../../../../../common/mobile/utils/device'; import DocumentSettingsController from "../../controller/settings/DocumentSettings"; @@ -47,7 +48,7 @@ const routes = [ ]; -const SettingsList = withTranslation()(props => { +const SettingsList = inject("storeAppOptions")( observer( withTranslation()( props => { const {t} = props; const _t = t('Settings', {returnObjects: true}); const navbar = @@ -62,42 +63,91 @@ const SettingsList = withTranslation()(props => { useEffect(() => { }); + // set mode + const appOptions = props.storeAppOptions; + let _isEdit = false, + _canDownload = false, + _canDownloadOrigin = false, + _canReader = false, + _canAbout = true, + _canHelp = true, + _canPrint = false; + if (appOptions.isDisconnected) { + _isEdit = false; + if (!appOptions.enableDownload) + _canPrint = _canDownload = _canDownloadOrigin = false; + } else { + _isEdit = appOptions.isEdit; + _canReader = !appOptions.isEdit && !appOptions.isRestrictedEdit && appOptions.canReader; + _canDownload = appOptions.canDownload; + _canDownloadOrigin = appOptions.canDownloadOrigin; + _canPrint = appOptions.canPrint; + if (appOptions.customization && appOptions.canBrandingExt) { + _canAbout = (appOptions.customization.about!==false); + } + if (appOptions.customization) { + _canHelp = (appOptions.customization.help!==false); + } + } + return ( {navbar} {!props.inPopover && - + } - - - + {_canReader && + {/*ToDo*/} + + {}}/> + + } + {/*ToDo: settings-orthography*/} + {_isEdit && + + + + } - + {_canDownload && + + + + } + {_canDownloadOrigin && + {}}> {/*ToDo*/} - - - + } + {_canPrint && + + + + } - - - - - - + {_canHelp && + + + + } + {_canAbout && + + + + } ) -}); +}))); class SettingsView extends Component { constructor(props) {