diff --git a/apps/common/main/lib/util/htmlutils.js b/apps/common/main/lib/util/htmlutils.js index 28ba18fc7..518c01c1a 100644 --- a/apps/common/main/lib/util/htmlutils.js +++ b/apps/common/main/lib/util/htmlutils.js @@ -52,6 +52,9 @@ var checkLocalStorage = (function () { } })(); +!window.desktop && !!window.AscDesktopEditor && + (window.desktop = window.AscDesktopEditor); + if ( window.desktop && !!window.RendererProcessVariable ) { var theme = window.RendererProcessVariable.theme diff --git a/apps/documenteditor/forms/app/controller/ApplicationController.js b/apps/documenteditor/forms/app/controller/ApplicationController.js index aaba75fe6..d1e3ea34e 100644 --- a/apps/documenteditor/forms/app/controller/ApplicationController.js +++ b/apps/documenteditor/forms/app/controller/ApplicationController.js @@ -1531,4 +1531,40 @@ define([ uploadImageExtMessage: 'Unknown image format.' }, DE.Controllers.ApplicationController)); + + var Desktop = function () { + var features = { + version: '{{PRODUCT_VERSION}}', + // eventloading: true, + uithemes: true + }; + + var native = window.desktop || window.AscDesktopEditor; + !!native && native.execCommand('webapps:features', JSON.stringify(features)); + + if ( !!native ) { + $('#header-logo, .brand-logo').hide(); + + window.on_native_message = function (cmd, param) { + if (/theme:changed/.test(cmd)) { + Common.UI.Themes.setTheme(param); + } + }; + + Common.NotificationCenter.on({ + 'uitheme:changed' : function (name) { + var theme = Common.UI.Themes.get(name); + if ( theme ) + native.execCommand("uitheme:changed", JSON.stringify({name:name, type:theme.type})); + }, + }); + } + + return { + isActive: function () { + return !!native; + }, + } + }; + DE.Controllers.Desktop = new Desktop(); }); diff --git a/apps/documenteditor/forms/index.html b/apps/documenteditor/forms/index.html index f15c50e3b..7ca00b29b 100644 --- a/apps/documenteditor/forms/index.html +++ b/apps/documenteditor/forms/index.html @@ -152,6 +152,16 @@ + +
diff --git a/apps/documenteditor/forms/index.html.deploy b/apps/documenteditor/forms/index.html.deploy index 4687998d7..f48b20e1d 100644 --- a/apps/documenteditor/forms/index.html.deploy +++ b/apps/documenteditor/forms/index.html.deploy @@ -134,6 +134,16 @@ + +