From 0945dc55ede24654e0d4bf3b8ddc2aab2000de88 Mon Sep 17 00:00:00 2001 From: Maxim Kadushkin Date: Sun, 12 Dec 2021 10:12:41 +0300 Subject: [PATCH 01/11] [mobile] for bug 53182 --- apps/common/mobile/lib/view/Search.jsx | 71 ++++++++++++-------------- 1 file changed, 32 insertions(+), 39 deletions(-) diff --git a/apps/common/mobile/lib/view/Search.jsx b/apps/common/mobile/lib/view/Search.jsx index 6860c45cf..f66e9025b 100644 --- a/apps/common/mobile/lib/view/Search.jsx +++ b/apps/common/mobile/lib/view/Search.jsx @@ -92,52 +92,44 @@ class SearchView extends Component { const $$ = Dom7; - $$(document).on('page:init', (e, page) => { - if ( page.name == 'home' ) { - this.searchbar = f7.searchbar.create({ - el: '.searchbar', - customSearch: true, - expandable: true, - backdrop: false, - on: { - search: (bar, curval, prevval) => { - }, - enable: this.onSearchbarShow.bind(this, true), - disable: this.onSearchbarShow.bind(this, false) - } - }); - - // function iOSVersion() { - // var ua = navigator.userAgent; - // var m; - // return (m = /(iPad|iPhone|iphone).*?(OS |os |OS\_)(\d+((_|\.)\d)?((_|\.)\d)?)/.exec(ua)) ? parseFloat(m[3]) : 0; - // } - - const $editor = $$('#editor_sdk'); - // const $replaceLink = $$('#replace-link'); - - if (false /* iOSVersion < 13 */) { - // $editor.on('mousedown touchstart', this.onEditorTouchStart.bind(this)); - // $editor.on('mouseup touchend', this.onEditorTouchEnd.bind(this)); - } else { - // $editor.on('pointerdown', this.onEditorTouchStart.bind(this)); - // $editor.on('pointerup', this.onEditorTouchEnd.bind(this)); - } - - $editor.on('pointerdown', this.onEditorTouchStart.bind(this)); - $editor.on('pointerup', this.onEditorTouchEnd.bind(this)); - // $replaceLink.on('click', this.onReplaceHold.bind(this)); - } - }); - this.onSettingsClick = this.onSettingsClick.bind(this); this.onSearchClick = this.onSearchClick.bind(this); this.onReplaceClick = this.onReplaceClick.bind(this); } componentDidMount(){ - const $$ = Dom7; this.$replace = $$('#idx-replace-val'); + const $editor = $$('#editor_sdk'); + + this.onEditorTouchStart = this.onEditorTouchStart.bind(this); + this.onEditorTouchEnd = this.onEditorTouchEnd.bind(this); + + $editor.on('pointerdown', this.onEditorTouchStart); + $editor.on('pointerup', this.onEditorTouchEnd); + + if( !this.searchbar ) { + this.searchbar = f7.searchbar.get('.searchbar'); + } + + if( !this.searchbar ) { + this.searchbar = f7.searchbar.create({ + el: '.searchbar', + customSearch: true, + expandable: true, + backdrop: false, + on: { + search: (bar, curval, prevval) => { + }, + enable: this.onSearchbarShow.bind(this, true), + disable: this.onSearchbarShow.bind(this, false) + } + }); + } + } + + componentWillUnmount() { + $$('#editor_sdk').off('pointerdown', this.onEditorTouchStart) + .off('pointerup', this.onEditorTouchEnd); } onSettingsClick(e) { @@ -202,6 +194,7 @@ class SearchView extends Component { } onEditorTouchStart(e) { + console.log('taouch start'); this.startPoint = this.pointerPosition(e); } From 83d0296511107b6362f81d7974b3949aba90927e Mon Sep 17 00:00:00 2001 From: Maxim Kadushkin Date: Sun, 12 Dec 2021 10:43:59 +0300 Subject: [PATCH 02/11] [DE] for bug 53181 --- .../documenteditor/mobile/src/controller/Toolbar.jsx | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/apps/documenteditor/mobile/src/controller/Toolbar.jsx b/apps/documenteditor/mobile/src/controller/Toolbar.jsx index 6fcbbbf64..f6f0ff7d1 100644 --- a/apps/documenteditor/mobile/src/controller/Toolbar.jsx +++ b/apps/documenteditor/mobile/src/controller/Toolbar.jsx @@ -4,7 +4,7 @@ import { f7 } from 'framework7-react'; import { useTranslation } from 'react-i18next'; import ToolbarView from "../view/Toolbar"; -const ToolbarController = inject('storeAppOptions', 'users', 'storeReview', 'storeFocusObjects', 'storeToolbarSettings')(observer(props => { +const ToolbarController = inject('storeAppOptions', 'users', 'storeReview', 'storeFocusObjects', 'storeToolbarSettings','storeDocumentInfo')(observer(props => { const {t} = useTranslation(); const _t = t("Toolbar", { returnObjects: true }); @@ -37,24 +37,26 @@ const ToolbarController = inject('storeAppOptions', 'users', 'storeReview', 'sto } return () => { - Common.Notifications.off('setdoctitle', setDocTitle); + // Common.Notifications.off('setdoctitle', setDocTitle); Common.Notifications.off('toolbar:activatecontrols', activateControls); Common.Notifications.off('toolbar:deactivateeditcontrols', deactivateEditControls); Common.Notifications.off('goback', goBack); } }); - const [docTitle, resetDocTitle] = useState(''); + const docInfo = props.storeDocumentInfo; + const [docTitle, resetDocTitle] = useState(docInfo.dataDoc ? docInfo.dataDoc.title : ''); const setDocTitle = (title) => { resetDocTitle(title); } // Back button - const [isShowBack, setShowBack] = useState(false); + const [isShowBack, setShowBack] = useState(appOptions.canBackToFolder); const loadConfig = (data) => { if (data && data.config && data.config.canBackToFolder !== false && data.config.customization && data.config.customization.goback && - (data.config.customization.goback.url || data.config.customization.goback.requestClose && data.config.canRequestClose)) { + (data.config.customization.goback.url || data.config.customization.goback.requestClose && data.config.canRequestClose)) + { setShowBack(true); } }; From bba242344ba32bf9cfaa5e8d57cb83f344ea7eff Mon Sep 17 00:00:00 2001 From: Maxim Kadushkin Date: Sun, 12 Dec 2021 15:27:37 +0300 Subject: [PATCH 03/11] [SSE PE] for bug 53181 --- .../mobile/src/controller/Toolbar.jsx | 12 +++++++----- .../mobile/src/controller/Toolbar.jsx | 7 ++++--- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/apps/presentationeditor/mobile/src/controller/Toolbar.jsx b/apps/presentationeditor/mobile/src/controller/Toolbar.jsx index a1ba3d10d..61b4daa84 100644 --- a/apps/presentationeditor/mobile/src/controller/Toolbar.jsx +++ b/apps/presentationeditor/mobile/src/controller/Toolbar.jsx @@ -4,7 +4,7 @@ import { f7 } from 'framework7-react'; import { useTranslation } from 'react-i18next'; import ToolbarView from "../view/Toolbar"; -const ToolbarController = inject('storeAppOptions', 'users', 'storeFocusObjects', 'storeToolbarSettings')(observer(props => { +const ToolbarController = inject('storeAppOptions', 'users', 'storeFocusObjects', 'storeToolbarSettings', 'storePresentationInfo')(observer(props => { const {t} = useTranslation(); const _t = t("Toolbar", { returnObjects: true }); @@ -42,17 +42,19 @@ const ToolbarController = inject('storeAppOptions', 'users', 'storeFocusObjects' } }); - const [docTitle, resetDocTitle] = useState(''); + const docInfo = props.storePresentationInfo; + const [docTitle, resetDocTitle] = useState(docInfo.dataDoc ? docInfo.dataDoc.title : ''); const setDocTitle = (title) => { resetDocTitle(title); } // Back button - const [isShowBack, setShowBack] = useState(false); + const [isShowBack, setShowBack] = useState(appOptions.canBackToFolder); const loadConfig = (data) => { if (data && data.config && data.config.canBackToFolder !== false && data.config.customization && data.config.customization.goback && - (data.config.customization.goback.url || data.config.customization.goback.requestClose && data.config.canRequestClose)) { + (data.config.customization.goback.url || data.config.customization.goback.requestClose && data.config.canRequestClose)) + { setShowBack(true); } }; @@ -120,7 +122,7 @@ const ToolbarController = inject('storeAppOptions', 'users', 'storeFocusObjects' }; - const [disabledControls, setDisabledControls] = useState(true); + const [disabledControls, setDisabledControls] = useState(/*true*/false); const activateControls = () => { setDisabledControls(false); }; diff --git a/apps/spreadsheeteditor/mobile/src/controller/Toolbar.jsx b/apps/spreadsheeteditor/mobile/src/controller/Toolbar.jsx index 45c2c5964..7954202fe 100644 --- a/apps/spreadsheeteditor/mobile/src/controller/Toolbar.jsx +++ b/apps/spreadsheeteditor/mobile/src/controller/Toolbar.jsx @@ -48,11 +48,12 @@ const ToolbarController = inject('storeAppOptions', 'users', 'storeSpreadsheetIn }); // Back button - const [isShowBack, setShowBack] = useState(false); + const [isShowBack, setShowBack] = useState(appOptions.canBackToFolder); const loadConfig = (data) => { if (data && data.config && data.config.canBackToFolder !== false && data.config.customization && data.config.customization.goback && - (data.config.customization.goback.url || data.config.customization.goback.requestClose && data.config.canRequestClose)) { + (data.config.customization.goback.url || data.config.customization.goback.requestClose && data.config.canRequestClose)) + { setShowBack(true); } }; @@ -125,7 +126,7 @@ const ToolbarController = inject('storeAppOptions', 'users', 'storeSpreadsheetIn }; - const [disabledControls, setDisabledControls] = useState(true); + const [disabledControls, setDisabledControls] = useState(/*true*/false); const activateControls = () => { setDisabledControls(false); }; From 46099dc36f4ca1033d7485dce92aaab0acc24d97 Mon Sep 17 00:00:00 2001 From: SergeyEzhin Date: Fri, 3 Dec 2021 14:52:07 +0400 Subject: [PATCH 04/11] Fix Bug 53671 --- apps/common/mobile/resources/less/about.less | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/apps/common/mobile/resources/less/about.less b/apps/common/mobile/resources/less/about.less index 3072fb575..b1a021b47 100644 --- a/apps/common/mobile/resources/less/about.less +++ b/apps/common/mobile/resources/less/about.less @@ -18,6 +18,15 @@ } } + .settings-about-logo { + display: flex; + justify-content: center; + img { + max-width: 100%; + height: auto; + } + } + h3 { font-weight: normal; margin: 0; From dc77d400ccceea6399928c5d88a933a35d2db77d Mon Sep 17 00:00:00 2001 From: SergeyEzhin Date: Wed, 15 Dec 2021 19:02:22 +0400 Subject: [PATCH 05/11] Correct toolbar title --- .../documenteditor/mobile/src/controller/Toolbar.jsx | 12 +++--------- .../mobile/src/controller/Toolbar.jsx | 11 +++-------- .../mobile/src/controller/Toolbar.jsx | 1 - 3 files changed, 6 insertions(+), 18 deletions(-) diff --git a/apps/documenteditor/mobile/src/controller/Toolbar.jsx b/apps/documenteditor/mobile/src/controller/Toolbar.jsx index f6f0ff7d1..0f6741c59 100644 --- a/apps/documenteditor/mobile/src/controller/Toolbar.jsx +++ b/apps/documenteditor/mobile/src/controller/Toolbar.jsx @@ -7,7 +7,6 @@ import ToolbarView from "../view/Toolbar"; const ToolbarController = inject('storeAppOptions', 'users', 'storeReview', 'storeFocusObjects', 'storeToolbarSettings','storeDocumentInfo')(observer(props => { const {t} = useTranslation(); const _t = t("Toolbar", { returnObjects: true }); - const appOptions = props.storeAppOptions; const isDisconnected = props.users.isDisconnected; const displayMode = props.storeReview.displayMode; @@ -23,8 +22,10 @@ const ToolbarController = inject('storeAppOptions', 'users', 'storeReview', 'sto const showEditDocument = !appOptions.isEdit && appOptions.canEdit && appOptions.canRequestEditRights; + const docInfo = props.storeDocumentInfo; + const docTitle = docInfo.dataDoc ? docInfo.dataDoc.title : ''; + useEffect(() => { - Common.Notifications.on('setdoctitle', setDocTitle); Common.Gateway.on('init', loadConfig); Common.Notifications.on('toolbar:activatecontrols', activateControls); Common.Notifications.on('toolbar:deactivateeditcontrols', deactivateEditControls); @@ -37,19 +38,12 @@ const ToolbarController = inject('storeAppOptions', 'users', 'storeReview', 'sto } return () => { - // Common.Notifications.off('setdoctitle', setDocTitle); Common.Notifications.off('toolbar:activatecontrols', activateControls); Common.Notifications.off('toolbar:deactivateeditcontrols', deactivateEditControls); Common.Notifications.off('goback', goBack); } }); - const docInfo = props.storeDocumentInfo; - const [docTitle, resetDocTitle] = useState(docInfo.dataDoc ? docInfo.dataDoc.title : ''); - const setDocTitle = (title) => { - resetDocTitle(title); - } - // Back button const [isShowBack, setShowBack] = useState(appOptions.canBackToFolder); const loadConfig = (data) => { diff --git a/apps/presentationeditor/mobile/src/controller/Toolbar.jsx b/apps/presentationeditor/mobile/src/controller/Toolbar.jsx index 61b4daa84..3c50fe015 100644 --- a/apps/presentationeditor/mobile/src/controller/Toolbar.jsx +++ b/apps/presentationeditor/mobile/src/controller/Toolbar.jsx @@ -21,8 +21,10 @@ const ToolbarController = inject('storeAppOptions', 'users', 'storeFocusObjects' const isCanRedo = storeToolbarSettings.isCanRedo; const disabledPreview = storeToolbarSettings.countPages <= 0; + const docInfo = props.storePresentationInfo; + const docTitle = docInfo.dataDoc ? docInfo.dataDoc.title : ''; + useEffect(() => { - Common.Notifications.on('setdoctitle', setDocTitle); Common.Gateway.on('init', loadConfig); Common.Notifications.on('toolbar:activatecontrols', activateControls); Common.Notifications.on('toolbar:deactivateeditcontrols', deactivateEditControls); @@ -35,19 +37,12 @@ const ToolbarController = inject('storeAppOptions', 'users', 'storeFocusObjects' } return () => { - Common.Notifications.off('setdoctitle', setDocTitle); Common.Notifications.off('toolbar:activatecontrols', activateControls); Common.Notifications.off('toolbar:deactivateeditcontrols', deactivateEditControls); Common.Notifications.off('goback', goBack); } }); - const docInfo = props.storePresentationInfo; - const [docTitle, resetDocTitle] = useState(docInfo.dataDoc ? docInfo.dataDoc.title : ''); - const setDocTitle = (title) => { - resetDocTitle(title); - } - // Back button const [isShowBack, setShowBack] = useState(appOptions.canBackToFolder); const loadConfig = (data) => { diff --git a/apps/spreadsheeteditor/mobile/src/controller/Toolbar.jsx b/apps/spreadsheeteditor/mobile/src/controller/Toolbar.jsx index 7954202fe..7614a08fd 100644 --- a/apps/spreadsheeteditor/mobile/src/controller/Toolbar.jsx +++ b/apps/spreadsheeteditor/mobile/src/controller/Toolbar.jsx @@ -27,7 +27,6 @@ const ToolbarController = inject('storeAppOptions', 'users', 'storeSpreadsheetIn useEffect(() => { Common.Gateway.on('init', loadConfig); - Common.Notifications.on('toolbar:activatecontrols', activateControls); Common.Notifications.on('toolbar:deactivateeditcontrols', deactivateEditControls); Common.Notifications.on('goback', goBack); From 9fa762146e46dee97d4db39b2f8e347e4934719b Mon Sep 17 00:00:00 2001 From: SergeyEzhin Date: Fri, 17 Dec 2021 02:01:12 +0400 Subject: [PATCH 06/11] [SSE mobile] Bug 54574 --- .../mobile/src/controller/Toolbar.jsx | 19 ++++++++------ .../mobile/src/store/toolbar.js | 26 ++++++++++++++++++- 2 files changed, 36 insertions(+), 9 deletions(-) diff --git a/apps/spreadsheeteditor/mobile/src/controller/Toolbar.jsx b/apps/spreadsheeteditor/mobile/src/controller/Toolbar.jsx index 7614a08fd..5a3df4cb2 100644 --- a/apps/spreadsheeteditor/mobile/src/controller/Toolbar.jsx +++ b/apps/spreadsheeteditor/mobile/src/controller/Toolbar.jsx @@ -24,6 +24,9 @@ const ToolbarController = inject('storeAppOptions', 'users', 'storeSpreadsheetIn const storeToolbarSettings = props.storeToolbarSettings; const isCanUndo = storeToolbarSettings.isCanUndo; const isCanRedo = storeToolbarSettings.isCanRedo; + const disabledControls = storeToolbarSettings.disabledControls; + const disabledEditControls = storeToolbarSettings.disabledEditControls; + const disabledSettings = storeToolbarSettings.disabledSettings; useEffect(() => { Common.Gateway.on('init', loadConfig); @@ -108,26 +111,26 @@ const ToolbarController = inject('storeAppOptions', 'users', 'storeSpreadsheetIn } } - const [disabledEditControls, setDisabledEditControls] = useState(false); + // const [disabledEditControls, setDisabledEditControls] = useState(false); const onApiActiveSheetChanged = (index) => { Common.Notifications.trigger('comments:filterchange', ['doc', 'sheet' + Common.EditorApi.get().asc_getWorksheetId(index)], false ); }; - const [disabledSettings, setDisabledSettings] = useState(false); + // const [disabledSettings, setDisabledSettings] = useState(false); const deactivateEditControls = (enableDownload) => { - setDisabledEditControls(true); + storeToolbarSettings.setDisabledEditControls(true); if (enableDownload) { //DE.getController('Settings').setMode({isDisconnected: true, enableDownload: enableDownload}); } else { - setDisabledSettings(true); + storeToolbarSettings.setDisabledSettings(true); } }; - - - const [disabledControls, setDisabledControls] = useState(/*true*/false); + + // const [disabledControls, setDisabledControls] = useState(/*true*/false); const activateControls = () => { - setDisabledControls(false); + // setDisabledControls(false); + storeToolbarSettings.setDisabledControls(false); }; const onEditDocument = () => { diff --git a/apps/spreadsheeteditor/mobile/src/store/toolbar.js b/apps/spreadsheeteditor/mobile/src/store/toolbar.js index ff0d1764a..97923348f 100644 --- a/apps/spreadsheeteditor/mobile/src/store/toolbar.js +++ b/apps/spreadsheeteditor/mobile/src/store/toolbar.js @@ -6,10 +6,34 @@ export class storeToolbarSettings { isCanUndo: observable, setCanUndo: action, isCanRedo: observable, - setCanRedo: action + setCanRedo: action, + disabledControls: observable, + setDisabledControls: action, + disabledEditControls: observable, + setDisabledEditControls: action, + disabledSettings: observable, + setDisabledSettings: action }) } + disabledControls = true; + + setDisabledControls(value) { + this.disabledControls = value; + } + + disabledEditControls = false; + + setDisabledEditControls(value) { + this.disabledEditControls = value; + } + + disabledSettings = false; + + setDisabledSettings(value) { + this.disabledSettings = value; + } + isCanUndo = false; setCanUndo(can) { From 58d0e413ae15808cbf99ec6719fe208f0db21a6c Mon Sep 17 00:00:00 2001 From: SergeyEzhin Date: Fri, 17 Dec 2021 13:54:54 +0400 Subject: [PATCH 07/11] [DE PE SSE mobile] Fix Bug 54574 --- .../mobile/src/controller/Toolbar.jsx | 12 ++++----- .../mobile/src/store/toolbar.js | 26 ++++++++++++++++++- .../mobile/src/controller/Toolbar.jsx | 13 +++++----- .../mobile/src/store/toolbar.js | 26 ++++++++++++++++++- .../mobile/src/controller/Toolbar.jsx | 5 ---- 5 files changed, 62 insertions(+), 20 deletions(-) diff --git a/apps/documenteditor/mobile/src/controller/Toolbar.jsx b/apps/documenteditor/mobile/src/controller/Toolbar.jsx index 0f6741c59..136f040ca 100644 --- a/apps/documenteditor/mobile/src/controller/Toolbar.jsx +++ b/apps/documenteditor/mobile/src/controller/Toolbar.jsx @@ -19,6 +19,9 @@ const ToolbarController = inject('storeAppOptions', 'users', 'storeReview', 'sto const storeToolbarSettings = props.storeToolbarSettings; const isCanUndo = storeToolbarSettings.isCanUndo; const isCanRedo = storeToolbarSettings.isCanRedo; + const disabledControls = storeToolbarSettings.disabledControls; + const disabledEditControls = storeToolbarSettings.disabledEditControls; + const disabledSettings = storeToolbarSettings.disabledSettings; const showEditDocument = !appOptions.isEdit && appOptions.canEdit && appOptions.canRequestEditRights; @@ -104,20 +107,17 @@ const ToolbarController = inject('storeAppOptions', 'users', 'storeReview', 'sto } } - const [disabledEditControls, setDisabledEditControls] = useState(false); - const [disabledSettings, setDisabledSettings] = useState(false); const deactivateEditControls = (enableDownload) => { - setDisabledEditControls(true); + storeToolbarSettings.setDisabledEditControls(true); if (enableDownload) { //DE.getController('Settings').setMode({isDisconnected: true, enableDownload: enableDownload}); } else { - setDisabledSettings(true); + storeToolbarSettings.setDisabledSettings(true); } }; - const [disabledControls, setDisabledControls] = useState(true); const activateControls = () => { - setDisabledControls(false); + storeToolbarSettings.setDisabledControls(false); }; const onEditDocument = () => { diff --git a/apps/documenteditor/mobile/src/store/toolbar.js b/apps/documenteditor/mobile/src/store/toolbar.js index ff0d1764a..97923348f 100644 --- a/apps/documenteditor/mobile/src/store/toolbar.js +++ b/apps/documenteditor/mobile/src/store/toolbar.js @@ -6,10 +6,34 @@ export class storeToolbarSettings { isCanUndo: observable, setCanUndo: action, isCanRedo: observable, - setCanRedo: action + setCanRedo: action, + disabledControls: observable, + setDisabledControls: action, + disabledEditControls: observable, + setDisabledEditControls: action, + disabledSettings: observable, + setDisabledSettings: action }) } + disabledControls = true; + + setDisabledControls(value) { + this.disabledControls = value; + } + + disabledEditControls = false; + + setDisabledEditControls(value) { + this.disabledEditControls = value; + } + + disabledSettings = false; + + setDisabledSettings(value) { + this.disabledSettings = value; + } + isCanUndo = false; setCanUndo(can) { diff --git a/apps/presentationeditor/mobile/src/controller/Toolbar.jsx b/apps/presentationeditor/mobile/src/controller/Toolbar.jsx index 3c50fe015..d699ae362 100644 --- a/apps/presentationeditor/mobile/src/controller/Toolbar.jsx +++ b/apps/presentationeditor/mobile/src/controller/Toolbar.jsx @@ -20,6 +20,9 @@ const ToolbarController = inject('storeAppOptions', 'users', 'storeFocusObjects' const isCanUndo = storeToolbarSettings.isCanUndo; const isCanRedo = storeToolbarSettings.isCanRedo; const disabledPreview = storeToolbarSettings.countPages <= 0; + const disabledControls = storeToolbarSettings.disabledControls; + const disabledEditControls = storeToolbarSettings.disabledEditControls; + const disabledSettings = storeToolbarSettings.disabledSettings; const docInfo = props.storePresentationInfo; const docTitle = docInfo.dataDoc ? docInfo.dataDoc.title : ''; @@ -105,21 +108,17 @@ const ToolbarController = inject('storeAppOptions', 'users', 'storeFocusObjects' } } - const [disabledEditControls, setDisabledEditControls] = useState(false); - const [disabledSettings, setDisabledSettings] = useState(false); const deactivateEditControls = (enableDownload) => { - setDisabledEditControls(true); + storeToolbarSettings.setDisabledEditControls(true); if (enableDownload) { //DE.getController('Settings').setMode({isDisconnected: true, enableDownload: enableDownload}); } else { - setDisabledSettings(true); + storeToolbarSettings.setDisabledSettings(true); } }; - - const [disabledControls, setDisabledControls] = useState(/*true*/false); const activateControls = () => { - setDisabledControls(false); + storeToolbarSettings.setDisabledControls(false); }; const onEditDocument = () => { diff --git a/apps/presentationeditor/mobile/src/store/toolbar.js b/apps/presentationeditor/mobile/src/store/toolbar.js index db3a9e87d..3b62e71fe 100644 --- a/apps/presentationeditor/mobile/src/store/toolbar.js +++ b/apps/presentationeditor/mobile/src/store/toolbar.js @@ -8,10 +8,34 @@ export class storeToolbarSettings { isCanRedo: observable, setCanRedo: action, countPages: observable, - setCountPages: action + setCountPages: action, + disabledControls: observable, + setDisabledControls: action, + disabledEditControls: observable, + setDisabledEditControls: action, + disabledSettings: observable, + setDisabledSettings: action }) } + disabledControls = true; + + setDisabledControls(value) { + this.disabledControls = value; + } + + disabledEditControls = false; + + setDisabledEditControls(value) { + this.disabledEditControls = value; + } + + disabledSettings = false; + + setDisabledSettings(value) { + this.disabledSettings = value; + } + isCanUndo = false; setCanUndo(can) { diff --git a/apps/spreadsheeteditor/mobile/src/controller/Toolbar.jsx b/apps/spreadsheeteditor/mobile/src/controller/Toolbar.jsx index 5a3df4cb2..cf0f917c3 100644 --- a/apps/spreadsheeteditor/mobile/src/controller/Toolbar.jsx +++ b/apps/spreadsheeteditor/mobile/src/controller/Toolbar.jsx @@ -111,13 +111,10 @@ const ToolbarController = inject('storeAppOptions', 'users', 'storeSpreadsheetIn } } - // const [disabledEditControls, setDisabledEditControls] = useState(false); - const onApiActiveSheetChanged = (index) => { Common.Notifications.trigger('comments:filterchange', ['doc', 'sheet' + Common.EditorApi.get().asc_getWorksheetId(index)], false ); }; - // const [disabledSettings, setDisabledSettings] = useState(false); const deactivateEditControls = (enableDownload) => { storeToolbarSettings.setDisabledEditControls(true); if (enableDownload) { @@ -127,9 +124,7 @@ const ToolbarController = inject('storeAppOptions', 'users', 'storeSpreadsheetIn } }; - // const [disabledControls, setDisabledControls] = useState(/*true*/false); const activateControls = () => { - // setDisabledControls(false); storeToolbarSettings.setDisabledControls(false); }; From 521ac275e222ae17a6cca220eadb64a11cd72c64 Mon Sep 17 00:00:00 2001 From: Maxim Kadushkin Date: Sat, 18 Dec 2021 13:40:59 +0300 Subject: [PATCH 08/11] [all] for bug 53110 --- apps/documenteditor/mobile/src/page/main.jsx | 2 +- apps/presentationeditor/mobile/src/page/main.jsx | 2 +- apps/presentationeditor/mobile/src/store/appOptions.js | 2 ++ apps/spreadsheeteditor/mobile/src/page/main.jsx | 2 +- apps/spreadsheeteditor/mobile/src/store/appOptions.js | 4 ++-- 5 files changed, 7 insertions(+), 5 deletions(-) diff --git a/apps/documenteditor/mobile/src/page/main.jsx b/apps/documenteditor/mobile/src/page/main.jsx index 5f117d818..8bb495264 100644 --- a/apps/documenteditor/mobile/src/page/main.jsx +++ b/apps/documenteditor/mobile/src/page/main.jsx @@ -97,7 +97,7 @@ class MainPage extends Component { {/* Top Navbar */} - {showLogo &&
} + {showLogo && appOptions.canBranding !== undefined &&
} diff --git a/apps/presentationeditor/mobile/src/page/main.jsx b/apps/presentationeditor/mobile/src/page/main.jsx index d891958a5..fede37b37 100644 --- a/apps/presentationeditor/mobile/src/page/main.jsx +++ b/apps/presentationeditor/mobile/src/page/main.jsx @@ -105,7 +105,7 @@ class MainPage extends Component { {/* Top Navbar */} - {showLogo &&
} + {showLogo && appOptions.canBranding &&
} diff --git a/apps/presentationeditor/mobile/src/store/appOptions.js b/apps/presentationeditor/mobile/src/store/appOptions.js index 4ab711617..e51ebd13e 100644 --- a/apps/presentationeditor/mobile/src/store/appOptions.js +++ b/apps/presentationeditor/mobile/src/store/appOptions.js @@ -11,6 +11,7 @@ export class storeAppOptions { lostEditingRights: observable, changeEditingRights: action, + canBrandingExt: observable, isDocReady: observable, changeDocReady: action @@ -19,6 +20,7 @@ export class storeAppOptions { isEdit = false; canViewComments = false; + canBrandingExt = false; config = {}; lostEditingRights = false; diff --git a/apps/spreadsheeteditor/mobile/src/page/main.jsx b/apps/spreadsheeteditor/mobile/src/page/main.jsx index 01048e601..1ccb5a602 100644 --- a/apps/spreadsheeteditor/mobile/src/page/main.jsx +++ b/apps/spreadsheeteditor/mobile/src/page/main.jsx @@ -100,7 +100,7 @@ class MainPage extends Component { {/* Top Navbar */} - {showLogo &&
} + {showLogo && appOptions.canBranding !== undefined &&
} diff --git a/apps/spreadsheeteditor/mobile/src/store/appOptions.js b/apps/spreadsheeteditor/mobile/src/store/appOptions.js index 4d405549b..42c12d5b2 100644 --- a/apps/spreadsheeteditor/mobile/src/store/appOptions.js +++ b/apps/spreadsheeteditor/mobile/src/store/appOptions.js @@ -11,6 +11,7 @@ export class storeAppOptions { lostEditingRights: observable, changeEditingRights: action, + canBranding: observable, isDocReady: observable, changeDocReady: action @@ -25,6 +26,7 @@ export class storeAppOptions { this.canViewComments = value; } + canBranding = undefined; lostEditingRights = false; changeEditingRights (value) { this.lostEditingRights = value; @@ -98,8 +100,6 @@ export class storeAppOptions { this.trialMode = params.asc_getLicenseMode(); this.canDownloadOrigin = permissions.download !== false; this.canDownload = permissions.download !== false; - this.canBranding = params.asc_getCustomization(); - this.canBrandingExt = params.asc_getCanBranding() && (typeof this.customization == 'object'); this.canUseReviewPermissions = this.canLicense && (!!permissions.reviewGroups || this.customization && this.customization.reviewPermissions && (typeof (this.customization.reviewPermissions) == 'object')); this.canUseCommentPermissions = this.canLicense && !!permissions.commentGroups; From 95ffddb860948f5a28318810eb268c936b38208d Mon Sep 17 00:00:00 2001 From: Maxim Kadushkin Date: Mon, 20 Dec 2021 12:17:16 +0300 Subject: [PATCH 09/11] [SSE] fix bug 54618 --- apps/spreadsheeteditor/mobile/src/store/appOptions.js | 2 ++ vendor/framework7-react/build/webpack.config.js | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/apps/spreadsheeteditor/mobile/src/store/appOptions.js b/apps/spreadsheeteditor/mobile/src/store/appOptions.js index 42c12d5b2..c97af127b 100644 --- a/apps/spreadsheeteditor/mobile/src/store/appOptions.js +++ b/apps/spreadsheeteditor/mobile/src/store/appOptions.js @@ -78,6 +78,8 @@ export class storeAppOptions { setPermissionOptions (document, licType, params, permissions, isSupportEditFeature) { if (params.asc_getRights() !== Asc.c_oRights.Edit) permissions.edit = false; + this.canBranding = params.asc_getCustomization(); + this.canBrandingExt = params.asc_getCanBranding() && (typeof this.customization == 'object'); this.canAutosave = true; this.canAnalytics = params.asc_getIsAnalyticsEnable(); this.canLicense = (licType === Asc.c_oLicenseResult.Success || licType === Asc.c_oLicenseResult.SuccessLimit); diff --git a/vendor/framework7-react/build/webpack.config.js b/vendor/framework7-react/build/webpack.config.js index 75e255341..d5008df0d 100644 --- a/vendor/framework7-react/build/webpack.config.js +++ b/vendor/framework7-react/build/webpack.config.js @@ -172,7 +172,8 @@ module.exports = { __PUBLISHER_NAME__: JSON.stringify(process.env.PUBLISHER_NAME || 'Ascensio System SIA'), __APP_TITLE_TEXT__: JSON.stringify(process.env.APP_TITLE_TEXT ? process.env.APP_TITLE_TEXT : 'ONLYOFFICE'), __COMPANY_NAME__: JSON.stringify(process.env.COMPANY_NAME ? process.env.COMPANY_NAME : 'ONLYOFFICE'), - __HELP_URL__: JSON.stringify(process.env.HELP_URL || 'https://helpcenter.onlyoffice.com') + __HELP_URL__: JSON.stringify(process.env.HELP_URL || 'https://helpcenter.onlyoffice.com'), + __SALES_EMAIL__: JSON.stringify(process.env.__SALES_EMAIL__ || 'sales@onlyoffice.com'), }), new webpack.BannerPlugin(`\n* Version: ${process.env.PRODUCT_VERSION} (build: ${process.env.BUILD_NUMBER})\n`), From e638c321e7a20aa9364afe29dd52efd9519daf9d Mon Sep 17 00:00:00 2001 From: Maxim Kadushkin Date: Wed, 10 Nov 2021 00:56:44 +0300 Subject: [PATCH 10/11] [SSE] fix bug 53558 --- .../mobile/src/less/icons-common.less | 52 +++++++++---------- .../framework7-react/build/webpack.config.js | 1 + 2 files changed, 27 insertions(+), 26 deletions(-) diff --git a/apps/spreadsheeteditor/mobile/src/less/icons-common.less b/apps/spreadsheeteditor/mobile/src/less/icons-common.less index c4c4f0dd9..a1992c022 100644 --- a/apps/spreadsheeteditor/mobile/src/less/icons-common.less +++ b/apps/spreadsheeteditor/mobile/src/less/icons-common.less @@ -1,79 +1,79 @@ .chart-types .thumb { - @relativepath: '../../resources/img'; + //@relativepath: '../../resources/img'; &.bar-normal { - background-image: url('@{relativepath}/charts/chart-03.png'); + background-image: url('@{app-image-path}/charts/chart-03.png'); } &.bar-stacked { - background-image: url('@{relativepath}/charts/chart-02.png'); + background-image: url('@{app-image-path}/charts/chart-02.png'); } &.bar-pstacked { - background-image: url('@{relativepath}/charts/chart-01.png'); + background-image: url('@{app-image-path}/charts/chart-01.png'); } &.line-normal { - background-image: url('@{relativepath}/charts/chart-06.png'); + background-image: url('@{app-image-path}/charts/chart-06.png'); } &.line-stacked { - background-image: url('@{relativepath}/charts/chart-05.png'); + background-image: url('@{app-image-path}/charts/chart-05.png'); } &.line-pstacked { - background-image: url('@{relativepath}/charts/chart-04.png'); + background-image: url('@{app-image-path}/charts/chart-04.png'); } &.hbar-normal { - background-image: url('@{relativepath}/charts/chart-09.png'); + background-image: url('@{app-image-path}/charts/chart-09.png'); } &.hbar-stacked { - background-image: url('@{relativepath}/charts/chart-08.png'); + background-image: url('@{app-image-path}/charts/chart-08.png'); } &.hbar-pstacked { - background-image: url('@{relativepath}/charts/chart-07.png'); + background-image: url('@{app-image-path}/charts/chart-07.png'); } &.area-normal { - background-image: url('@{relativepath}/charts/chart-12.png'); + background-image: url('@{app-image-path}/charts/chart-12.png'); } &.area-stacked { - background-image: url('@{relativepath}/charts/chart-11.png'); + background-image: url('@{app-image-path}/charts/chart-11.png'); } &.area-pstacked { - background-image: url('@{relativepath}/charts/chart-10.png'); + background-image: url('@{app-image-path}/charts/chart-10.png'); } &.pie { - background-image: url('@{relativepath}/charts/chart-13.png'); + background-image: url('@{app-image-path}/charts/chart-13.png'); } &.doughnut { - background-image: url('@{relativepath}/charts/chart-14.png'); + background-image: url('@{app-image-path}/charts/chart-14.png'); } &.pie3d { - background-image: url('@{relativepath}/charts/chart-22.png'); + background-image: url('@{app-image-path}/charts/chart-22.png'); } &.scatter { - background-image: url('@{relativepath}/charts/chart-15.png'); + background-image: url('@{app-image-path}/charts/chart-15.png'); } &.stock { - background-image: url('@{relativepath}/charts/chart-16.png'); + background-image: url('@{app-image-path}/charts/chart-16.png'); } &.line3d { - background-image: url('@{relativepath}/charts/chart-21.png'); + background-image: url('@{app-image-path}/charts/chart-21.png'); } &.bar3dnormal { - background-image: url('@{relativepath}/charts/chart-17.png'); + background-image: url('@{app-image-path}/charts/chart-17.png'); } &.bar3dstack { - background-image: url('@{relativepath}/charts/chart-18.png'); + background-image: url('@{app-image-path}/charts/chart-18.png'); } &.bar3dpstack { - background-image: url('@{relativepath}/charts/chart-19.png'); + background-image: url('@{app-image-path}/charts/chart-19.png'); } &.hbar3dnormal { - background-image: url('@{relativepath}/charts/chart-25.png'); + background-image: url('@{app-image-path}/charts/chart-25.png'); } &.hbar3dstack { - background-image: url('@{relativepath}/charts/chart-24.png'); + background-image: url('@{app-image-path}/charts/chart-24.png'); } &.hbar3dpstack { - background-image: url('@{relativepath}/charts/chart-23.png'); + background-image: url('@{app-image-path}/charts/chart-23.png'); } &.bar3dpsnormal { - background-image: url('@{relativepath}/charts/chart-20.png'); + background-image: url('@{app-image-path}/charts/chart-20.png'); } } diff --git a/vendor/framework7-react/build/webpack.config.js b/vendor/framework7-react/build/webpack.config.js index d5008df0d..528bba64b 100644 --- a/vendor/framework7-react/build/webpack.config.js +++ b/vendor/framework7-react/build/webpack.config.js @@ -133,6 +133,7 @@ module.exports = { globalVars: { "common-image-header-path": env === 'production' ? `../../../${editor}/mobile/resources/img/header` : '../../common/mobile/resources/img/header', "common-image-about-path": env === 'production' ? `../../../${editor}/mobile/resources/img/about` : '../../common/main/resources/img/about', + "app-image-path": env === 'production' ? '../resources/img' : './resources/img', } } } From 2c70526032e57b52f779c8d5c7fe0ccc1718efbb Mon Sep 17 00:00:00 2001 From: Maxim Kadushkin Date: Mon, 20 Dec 2021 18:19:40 +0300 Subject: [PATCH 11/11] [PE] for bug 53999 --- apps/common/mobile/resources/less/common.less | 41 ----------------- .../mobile/resources/img/themes/themes.png | Bin .../mobile/src/less/app.less | 42 ++++++++++++++++++ 3 files changed, 42 insertions(+), 41 deletions(-) rename apps/{common => presentationeditor}/mobile/resources/img/themes/themes.png (100%) diff --git a/apps/common/mobile/resources/less/common.less b/apps/common/mobile/resources/less/common.less index cc473cd9e..e68d7c09d 100644 --- a/apps/common/mobile/resources/less/common.less +++ b/apps/common/mobile/resources/less/common.less @@ -231,47 +231,6 @@ } } -// Theme - -.slide-theme { - &__list { - margin: auto; - ul { - display: flex; - justify-content: space-between; - flex-wrap: wrap; - padding-left: 18px; - padding-right: 18px; - padding-bottom: 14px; - } - } - .item-inner:after { - display: none; - } - .item-theme { - position: relative; - margin: 0; - box-shadow: 0 0 0 1px rgba(0,0,0,.15); - width: 88px; - height: 40px; - margin-top: 14px; - background-image: url(../img/themes/themes.png); - display: block; - background-repeat: no-repeat; - background-size: cover; - } - .item-theme.active:before { - content: ''; - position: absolute; - width: 22px; - height: 22px; - right: -5px; - bottom: -5px; - z-index: 1; - .encoded-svg-background(''); - } -} - // Transition .slide-transition { diff --git a/apps/common/mobile/resources/img/themes/themes.png b/apps/presentationeditor/mobile/resources/img/themes/themes.png similarity index 100% rename from apps/common/mobile/resources/img/themes/themes.png rename to apps/presentationeditor/mobile/resources/img/themes/themes.png diff --git a/apps/presentationeditor/mobile/src/less/app.less b/apps/presentationeditor/mobile/src/less/app.less index cc4000288..953417bb7 100644 --- a/apps/presentationeditor/mobile/src/less/app.less +++ b/apps/presentationeditor/mobile/src/less/app.less @@ -83,3 +83,45 @@ } } } + + +// Theme + +.slide-theme { + &__list { + margin: auto; + ul { + display: flex; + justify-content: space-between; + flex-wrap: wrap; + padding-left: 18px; + padding-right: 18px; + padding-bottom: 14px; + } + } + .item-inner:after { + display: none; + } + .item-theme { + position: relative; + margin: 0; + box-shadow: 0 0 0 1px rgba(0,0,0,.15); + width: 88px; + height: 40px; + margin-top: 14px; + background-image: ~"url(@{app-image-path}/themes/themes.png)"; + display: block; + background-repeat: no-repeat; + background-size: cover; + } + .item-theme.active:before { + content: ''; + position: absolute; + width: 22px; + height: 22px; + right: -5px; + bottom: -5px; + z-index: 1; + .encoded-svg-background(''); + } +} \ No newline at end of file