diff --git a/apps/common/mobile/lib/controller/ContextMenu.jsx b/apps/common/mobile/lib/controller/ContextMenu.jsx index 73af1007a..5bfbf9205 100644 --- a/apps/common/mobile/lib/controller/ContextMenu.jsx +++ b/apps/common/mobile/lib/controller/ContextMenu.jsx @@ -206,10 +206,12 @@ class ContextMenuController extends Component { Common.Notifications.off('document:ready', this.onDocumentReady); const api = Common.EditorApi.get(); - api.asc_unregisterCallback('asc_onShowPopMenu', this.onApiOpenContextMenu); - api.asc_unregisterCallback('asc_onHidePopMenu', this.onApiHideContextMenu); - api.asc_unregisterCallback('asc_onShowForeignCursorLabel', this.onApiShowForeignCursorLabel); - api.asc_unregisterCallback('asc_onHideForeignCursorLabel', this.onApiHideForeignCursorLabel); + if ( api ) { + api.asc_unregisterCallback('asc_onShowPopMenu', this.onApiOpenContextMenu); + api.asc_unregisterCallback('asc_onHidePopMenu', this.onApiHideContextMenu); + api.asc_unregisterCallback('asc_onShowForeignCursorLabel', this.onApiShowForeignCursorLabel); + api.asc_unregisterCallback('asc_onHideForeignCursorLabel', this.onApiHideForeignCursorLabel); + } } componentDidMount() { diff --git a/apps/common/mobile/lib/controller/Plugins.jsx b/apps/common/mobile/lib/controller/Plugins.jsx index 8c7d5394f..c4ceb3ded 100644 --- a/apps/common/mobile/lib/controller/Plugins.jsx +++ b/apps/common/mobile/lib/controller/Plugins.jsx @@ -31,10 +31,12 @@ const PluginsController = inject('storeAppOptions')(observer(props => { return () => { const api = Common.EditorApi.get(); - api.asc_unregisterCallback("asc_onPluginShow", showPluginModal); - api.asc_unregisterCallback("asc_onPluginClose", pluginClose); - api.asc_unregisterCallback("asc_onPluginResize", pluginResize); - api.asc_unregisterCallback('asc_onPluginsInit', onPluginsInit); + if ( api ) { + api.asc_unregisterCallback("asc_onPluginShow", showPluginModal); + api.asc_unregisterCallback("asc_onPluginClose", pluginClose); + api.asc_unregisterCallback("asc_onPluginResize", pluginResize); + api.asc_unregisterCallback('asc_onPluginsInit', onPluginsInit); + } }; }); diff --git a/apps/common/mobile/resources/css/skeleton.css b/apps/common/mobile/resources/css/skeleton.css new file mode 100644 index 000000000..ec4a8adb6 --- /dev/null +++ b/apps/common/mobile/resources/css/skeleton.css @@ -0,0 +1,107 @@ +body { + margin: 0; +} + +.skl-navbar { + --box-logo-height: 26px; + --skl-navbar-height: 44px; + --skl-pixel-ratio: 1; +} + +.skl-navbar--md { + --skl-navbar-height: 56px; +} + +.skl-pixel-ratio--2 { + --skl-pixel-ratio: 2; +} + +.skl-navbar { + height: calc(var(--skl-navbar-height) + var(--box-logo-height)); + width: 100%; + position: relative; +} + +.skl-navbar.skl-navbar--md { + /*height: calc(56px + 26px);*/ +} + +.skl-navbar.skl-navbar--ios { + background-color: #f7f7f8; +} + +.skl-navbar.skl-navbar--word.skl-navbar--md { + background-color: #446995; +} + +.skl-navbar.skl-navbar--cell.skl-navbar--md { + background-color: #40865c; +} + +.skl-navbar.skl-navbar--slide.skl-navbar--md { + background-color: #aa5252; +} + +.skl-navbar::before { + content: ''; + position: absolute; + width: 100%; +} + +.skl-navbar:not(.skl-navbar--md)::before { + background-color: rgba(0,0,0,0.25); + display: block; + z-index: 15; + top: auto; + right: auto; + bottom: 0; + left: 0; + height: 1px; + transform-origin: 50% 100%; + transform: scaleY(calc(1 / var(--skl-pixel-ratio))); +} + +.skl-navbar.skl-navbar--md::before { + right: 0; + width: 100%; + top: 100%; + bottom: auto; + height: 8px; + pointer-events: none; + background-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.25) 0%, rgba(0, 0, 0, 0.08) 40%, rgba(0, 0, 0, 0.04) 50%, rgba(0, 0, 0, 0) 90%, rgba(0, 0, 0, 0) 100%) +} + +.skl-lines { + display: none; +} + +.skl-line { + height: 15px; + margin: 30px; + background: #e2e2e2; + overflow: hidden; + position: relative; + -webkit-animation: flickerAnimation 2s infinite ease-in-out; + animation: flickerAnimation 2s infinite ease-in-out; +} + +@keyframes flickerAnimation { + 0% { opacity:0.1; } + 50% { opacity:1; } + 100% { opacity:0.1; } +} +@-o-keyframes flickerAnimation{ + 0% { opacity:0.1; } + 50% { opacity:1; } + 100% { opacity:0.1; } +} +@-moz-keyframes flickerAnimation{ + 0% { opacity:0.1; } + 50% { opacity:1; } + 100% { opacity:0.1; } +} +@-webkit-keyframes flickerAnimation{ + 0% { opacity:0.1; } + 50% { opacity:1; } + 100% { opacity:0.1; } +} diff --git a/apps/documenteditor/mobile/src/app.js b/apps/documenteditor/mobile/src/app.js index dc39d91b6..cc9445153 100644 --- a/apps/documenteditor/mobile/src/app.js +++ b/apps/documenteditor/mobile/src/app.js @@ -36,9 +36,9 @@ Framework7.use(Framework7React) ReactDOM.render( - + {/**/} - + {/**/} , document.getElementById('app'), diff --git a/apps/documenteditor/mobile/src/controller/Error.jsx b/apps/documenteditor/mobile/src/controller/Error.jsx index 6910f56b6..7a9f49a26 100644 --- a/apps/documenteditor/mobile/src/controller/Error.jsx +++ b/apps/documenteditor/mobile/src/controller/Error.jsx @@ -13,7 +13,7 @@ const ErrorController = inject('storeAppOptions')(({storeAppOptions, LoadingDocu }); return () => { const api = Common.EditorApi.get(); - api.asc_unregisterCallback('asc_onError', onError); + if ( api ) api.asc_unregisterCallback('asc_onError', onError); } }); diff --git a/apps/documenteditor/mobile/src/controller/LongActions.jsx b/apps/documenteditor/mobile/src/controller/LongActions.jsx index f6e31b73d..28343acc5 100644 --- a/apps/documenteditor/mobile/src/controller/LongActions.jsx +++ b/apps/documenteditor/mobile/src/controller/LongActions.jsx @@ -35,9 +35,11 @@ const LongActionsController = () => { return ( () => { const api = Common.EditorApi.get(); - api.asc_unregisterCallback('asc_onStartAction', onLongActionBegin); - api.asc_unregisterCallback('asc_onEndAction', onLongActionEnd); - api.asc_unregisterCallback('asc_onOpenDocumentProgress', onOpenDocument); + if ( api ) { + api.asc_unregisterCallback('asc_onStartAction', onLongActionBegin); + api.asc_unregisterCallback('asc_onEndAction', onLongActionEnd); + api.asc_unregisterCallback('asc_onOpenDocumentProgress', onOpenDocument); + } Common.Notifications.off('preloader:endAction', onLongActionEnd); Common.Notifications.off('preloader:beginAction', onLongActionBegin); diff --git a/apps/documenteditor/mobile/src/controller/Main.jsx b/apps/documenteditor/mobile/src/controller/Main.jsx index 75c2a335b..0e73c0956 100644 --- a/apps/documenteditor/mobile/src/controller/Main.jsx +++ b/apps/documenteditor/mobile/src/controller/Main.jsx @@ -282,7 +282,7 @@ class MainController extends Component { }); Common.Notifications.trigger('engineCreated', this.api); - Common.EditorApi = {get: () => this.api}; + // Common.EditorApi = {get: () => this.api}; // Set font rendering mode let value = LocalStorage.getItem("de-settings-fontrender"); @@ -408,7 +408,9 @@ class MainController extends Component { } applyLicense () { - const _t = this._t; + const { t } = this.props; + const _t = t('Main', {returnObjects:true}); + const warnNoLicense = _t.warnNoLicense.replace(/%1/g, __COMPANY_NAME__); const warnNoLicenseUsers = _t.warnNoLicenseUsers.replace(/%1/g, __COMPANY_NAME__); const textNoLicenseTitle = _t.textNoLicenseTitle.replace(/%1/g, __COMPANY_NAME__); @@ -941,6 +943,7 @@ class MainController extends Component { } componentDidMount() { + Common.EditorApi = {get: () => this.api}; this.initSdk(); } } diff --git a/apps/documenteditor/mobile/src/index_dev.html b/apps/documenteditor/mobile/src/index_dev.html index a0ead6c1a..b04484be7 100644 --- a/apps/documenteditor/mobile/src/index_dev.html +++ b/apps/documenteditor/mobile/src/index_dev.html @@ -22,17 +22,37 @@ - - + + <% if (!htmlWebpackPlugin.options.skeleton.stylesheet) { %> + + <% } else { %> + + <% } %> + +
+
+
+
+
+
+
+