diff --git a/apps/api/documents/api.js b/apps/api/documents/api.js index af24a55f2..55caed959 100644 --- a/apps/api/documents/api.js +++ b/apps/api/documents/api.js @@ -419,7 +419,7 @@ if (typeof _config.document.fileType === 'string' && _config.document.fileType != '') { _config.document.fileType = _config.document.fileType.toLowerCase(); - var type = /^(?:(xls|xlsx|ods|csv|xlst|xlsy|gsheet|xlsm|xlt|xltm|xltx|fods|ots)|(pps|ppsx|ppt|pptx|odp|pptt|ppty|gslides|pot|potm|potx|ppsm|pptm|fodp|otp)|(doc|docx|doct|odt|gdoc|txt|rtf|pdf|mht|htm|html|epub|djvu|xps|docm|dot|dotm|dotx|fodt|ott|fb2|xml))$/ + var type = /^(?:(xls|xlsx|ods|csv|xlst|xlsy|gsheet|xlsm|xlt|xltm|xltx|fods|ots)|(pps|ppsx|ppt|pptx|odp|pptt|ppty|gslides|pot|potm|potx|ppsm|pptm|fodp|otp)|(doc|docx|doct|odt|gdoc|txt|rtf|pdf|mht|htm|html|epub|djvu|xps|docm|dot|dotm|dotx|fodt|ott|fb2|xml|oform))$/ .exec(_config.document.fileType); if (!type) { window.alert("The \"document.fileType\" parameter for the config object is invalid. Please correct it."); @@ -870,15 +870,24 @@ isIE = !check(/opera/) && (check(/msie/) || check(/trident/) || check(/edge/)), isChrome = !isIE && check(/\bchrome\b/), isSafari_mobile = !isIE && !isChrome && check(/safari/) && (navigator.maxTouchPoints>0), - path_type = "main"; + path_type; path += app + "/"; - path_type = (config.type === "mobile" || isSafari_mobile) - ? "mobile" - : ((app=='documenteditor') && config.document && config.document.permissions && (config.document.permissions.fillForms===true) && - (config.document.permissions.edit === false) && (config.document.permissions.review !== true) && (config.editorConfig.mode !== 'view')) - ? "forms" : (config.type === "embedded") ? "embed" - : "main"; + if (config.document && typeof config.document.fileType === 'string' && config.document.fileType.toLowerCase() === 'oform') { + if (config.document.permissions) { + (config.document.permissions.fillForms===undefined) && (config.document.permissions.fillForms = (config.document.permissions.edit !== false)); + config.document.permissions.edit = config.document.permissions.review = config.document.permissions.comment = false; + } + path_type = (config.type === "mobile" || isSafari_mobile) + ? "mobile" : config.document.permissions && (config.document.permissions.fillForms === true) && (config.editorConfig.mode !== 'view') + ? "forms" : "embed"; + } else { + path_type = (config.type === "mobile" || isSafari_mobile) + ? "mobile" : ((app==='documenteditor') && config.document && config.document.permissions && (config.document.permissions.fillForms===true) && + (config.document.permissions.edit === false) && (config.document.permissions.review !== true) && (config.editorConfig.mode !== 'view')) + ? "forms" : (config.type === "embedded") + ? "embed" : "main"; + } path += path_type; var index = "/index.html"; @@ -887,7 +896,7 @@ if ( typeof(customization) == 'object' && ( customization.toolbarNoTabs || (config.editorConfig.targetApp!=='desktop') && (customization.loaderName || customization.loaderLogo))) { index = "/index_loader.html"; - } else if (config.editorConfig.mode == 'editdiagram' || config.editorConfig.mode == 'editmerge') + } else if (config.editorConfig.mode === 'editdiagram' || config.editorConfig.mode === 'editmerge') index = "/index_internal.html"; } diff --git a/apps/documenteditor/forms/app/controller/ApplicationController.js b/apps/documenteditor/forms/app/controller/ApplicationController.js index 499254f07..cc8d62a24 100644 --- a/apps/documenteditor/forms/app/controller/ApplicationController.js +++ b/apps/documenteditor/forms/app/controller/ApplicationController.js @@ -431,8 +431,8 @@ define([ this.appOptions.customization && this.appOptions.customization.logo ) { var logo = $('#header-logo'); - if (this.appOptions.customization.logo.imageEmbedded) { - logo.html(''); + if (this.appOptions.customization.logo.image) { + logo.html(''); logo.css({'background-image': 'none', width: 'auto', height: 'auto'}); } @@ -1062,12 +1062,34 @@ define([ }, createDelayedElements: function() { - var menuItems = this.view.btnOptions.menu.items; - var itemsCount = menuItems.length-3; + var me = this, + menuItems = this.view.btnOptions.menu.items, + itemsCount = menuItems.length-3; + var initMenu = function(menu) { + var last; + if (!menuItems[0].isVisible()) + menuItems[1].setVisible(false); + else + last = menuItems[1]; + + if (!menuItems[2].isVisible() && !menuItems[3].isVisible() && !menuItems[4].isVisible()) + menuItems[5].setVisible(false); + else + last = menuItems[5]; + + if (!menuItems[6].isVisible() && !menuItems[7].isVisible()) + menuItems[8].setVisible(false); + else + last = menuItems[8]; + + if (!menuItems[9].isVisible() && !menuItems[10].isVisible()) + last && last.setVisible(false); + + menu.off('show:after', initMenu); + }; if (!this.appOptions.canPrint) { menuItems[0].setVisible(false); - menuItems[1].setVisible(false); itemsCount--; } @@ -1079,8 +1101,6 @@ define([ if ( !this.appOptions.canFillForms || !this.appOptions.canDownload) { menuItems[3].setVisible(false); menuItems[4].setVisible(false); - menuItems[1].setVisible(false); - menuItems[5].setVisible(false); itemsCount -= 2; } @@ -1094,9 +1114,6 @@ define([ itemsCount--; } - if (itemsCount<3) - menuItems[8].setVisible(false); - if ( !this.embedConfig.embedUrl || this.appOptions.canFillForms) { menuItems[9].setVisible(false); itemsCount--; @@ -1106,11 +1123,10 @@ define([ menuItems[10].setVisible(false); itemsCount--; } - if (itemsCount<1) this.view.btnOptions.setVisible(false); - else if ((!this.embedConfig.embedUrl || this.appOptions.canFillForms) && !this.embedConfig.fullscreenUrl) - menuItems[8].setVisible(false); + + this.view.btnOptions.menu.on('show:after', initMenu); screenTip = { toolTip: new Common.UI.Tooltip({ diff --git a/apps/documenteditor/forms/index.html b/apps/documenteditor/forms/index.html index e1bd0cc0e..dd12004df 100644 --- a/apps/documenteditor/forms/index.html +++ b/apps/documenteditor/forms/index.html @@ -52,7 +52,6 @@ display: inline-block; max-width: 100px; max-height: 20px; - margin-top: 2px; opacity: 0; } .loadmask > .brendpanel .doc-title { @@ -189,6 +188,8 @@ var elem = document.querySelector('.loading-logo'); if (elem && logo) { elem.style.backgroundImage= 'none'; + elem.style.width = 'auto'; + elem.style.height = 'auto'; var img = document.querySelector('.loading-logo img'); img && img.setAttribute('src', logo); img.style.opacity = 1; diff --git a/apps/documenteditor/forms/index.html.deploy b/apps/documenteditor/forms/index.html.deploy index 3894cbdcd..d03fc8244 100644 --- a/apps/documenteditor/forms/index.html.deploy +++ b/apps/documenteditor/forms/index.html.deploy @@ -50,7 +50,6 @@ display: inline-block; max-width: 100px; max-height: 20px; - margin-top: 2px; opacity: 0; } .loadmask > .brendpanel .doc-title { @@ -174,6 +173,8 @@ var elem = document.querySelector('.loading-logo'); if (elem && logo) { elem.style.backgroundImage= 'none'; + elem.style.width = 'auto'; + elem.style.height = 'auto'; var img = document.querySelector('.loading-logo img'); img && img.setAttribute('src', logo); img.style.opacity = 1;