diff --git a/apps/api/documents/api.js b/apps/api/documents/api.js index adcdac87a..9742962d3 100644 --- a/apps/api/documents/api.js +++ b/apps/api/documents/api.js @@ -105,7 +105,7 @@ customization: { logo: { image: url, - imageEmbedded: url, + imageEmbedded: url, // deprecated, use image instead url: http://... }, customer: { @@ -933,8 +933,8 @@ if ( (typeof(config.editorConfig.customization) == 'object') && config.editorConfig.customization.loaderLogo) { if (config.editorConfig.customization.loaderLogo !== '') params += "&logo=" + encodeURIComponent(config.editorConfig.customization.loaderLogo); } else if ( (typeof(config.editorConfig.customization) == 'object') && config.editorConfig.customization.logo) { - if (config.type=='embedded' && config.editorConfig.customization.logo.imageEmbedded) - params += "&headerlogo=" + encodeURIComponent(config.editorConfig.customization.logo.imageEmbedded); + if (config.type=='embedded' && (config.editorConfig.customization.logo.image || config.editorConfig.customization.logo.imageEmbedded)) + params += "&headerlogo=" + encodeURIComponent(config.editorConfig.customization.logo.image || config.editorConfig.customization.logo.imageEmbedded); else if (config.type!='embedded' && config.editorConfig.customization.logo.image) params += "&headerlogo=" + encodeURIComponent(config.editorConfig.customization.logo.image); } diff --git a/apps/common/embed/resources/img/logo.svg b/apps/common/embed/resources/img/logo.svg index 0d3cb18e7..4de1b67a5 100644 --- a/apps/common/embed/resources/img/logo.svg +++ b/apps/common/embed/resources/img/logo.svg @@ -1 +1,4 @@ - \ No newline at end of file + + + + \ No newline at end of file diff --git a/apps/common/embed/resources/less/common.less b/apps/common/embed/resources/less/common.less index 9b525cacd..1f0d4e378 100644 --- a/apps/common/embed/resources/less/common.less +++ b/apps/common/embed/resources/less/common.less @@ -99,13 +99,13 @@ right: 0; &.top { - top: 48px; + top: 40px; bottom: 0; } &.bottom { top: 0; - bottom: 46px; + bottom: 38px; } } @@ -126,7 +126,7 @@ top: 0; left: 0; width: 100%; - height: 48px; + height: 40px; -webkit-box-shadow: inset 0 -1px 0 @toolbarBorderColor, inset 0 1px 0 @toolbarBorderShadowColor; //-moz-box-shadow: inset 0 -1px 0 @toolbarBorderColor, inset 0 1px 0 @toolbarBorderShadowColor; @@ -137,7 +137,7 @@ bottom: 0; left: 0; width: 100%; - height: 46px; + height: 38px; -webkit-box-shadow: inset 0 1px 0 @toolbarBorderColor, inset 0 2px 0 @toolbarBorderShadowColor; //-moz-box-shadow: inset 0 1px 0 @toolbarBorderColor, inset 0 2px 0 @toolbarBorderShadowColor; @@ -238,7 +238,7 @@ .brand-logo { display: block; width: 100px; - height: 24px; + height: 20px; background: data-uri('../../../../common/embed/resources/img/logo.svg') no-repeat; } diff --git a/apps/common/forms/resources/less/common.less b/apps/common/forms/resources/less/common.less index 3ff2c1ecb..b892097e0 100644 --- a/apps/common/forms/resources/less/common.less +++ b/apps/common/forms/resources/less/common.less @@ -78,13 +78,11 @@ @import "../../../../common/main/resources/less/calendar.less"; @import "../../../../common/main/resources/less/spinner.less"; -@toolbarBorderColor: #dbdbdb; -@toolbarBorderShadowColor: #FAFAFA; -@toolbarTopColor: #F7F7F7; +@toolbarBorderColor: @border-toolbar-ie; +@toolbarBorderColor: @border-toolbar; +@toolbarTopColor: @background-toolbar-ie; +@toolbarTopColor: @background-toolbar; @toolbarFontSize: 12px; -@btnColored: #446995; -@btnActiveColored: #293F59; -@btnHoverColored: #375478; @iconSpriteCommonPath: "../../../../common/forms/resources/img/glyphicons.png"; @icon-socnet-size: 40px; @@ -115,7 +113,7 @@ right: 0; &.top { - top: 48px; + top: 40px; bottom: 0; } @@ -142,22 +140,9 @@ top: 0; left: 0; width: 100%; - height: 48px; + height: 40px; - -webkit-box-shadow: inset 0 -1px 0 @toolbarBorderColor, inset 0 1px 0 @toolbarBorderShadowColor; - //-moz-box-shadow: inset 0 -1px 0 @toolbarBorderColor, inset 0 1px 0 @toolbarBorderShadowColor; - box-shadow: inset 0 -1px 0 @toolbarBorderColor, inset 0 1px 0 @toolbarBorderShadowColor; - } - - &.bottom { - bottom: 0; - left: 0; - width: 100%; - height: 46px; - - -webkit-box-shadow: inset 0 1px 0 @toolbarBorderColor, inset 0 2px 0 @toolbarBorderShadowColor; - //-moz-box-shadow: inset 0 1px 0 @toolbarBorderColor, inset 0 2px 0 @toolbarBorderShadowColor; - box-shadow: inset 0 1px 0 @toolbarBorderColor, inset 0 2px 0 @toolbarBorderShadowColor; + .box-inner-shadow(0 -1px 0 @toolbarBorderColor); } .group { @@ -211,27 +196,6 @@ text-overflow: ellipsis; } } - - .separator { - height: 22px; - margin: 0 9px; - border-right: 1px solid @toolbarBorderShadowColor; - border-left: 1px solid @toolbarBorderColor; - } - } - - .close { - font-size: 28px; - font-family: Arial, sans-serif; - color: #666666; - opacity: 0.8; - display: block; - line-height: 22px; - - &:hover { - opacity: 1; - color: #666666; - } } .margin-right-small { @@ -253,28 +217,34 @@ .brand-logo { display: block; width: 100px; - height: 24px; - background: data-uri('../../../../common/forms/resources/img/logo.svg') no-repeat; + height: 20px; + background: data-uri('../../../../common/main/resources/img/header/dark-logo_s.svg') no-repeat; +} + +.theme-dark { + .brand-logo { + background: data-uri('../../../../common/main/resources/img/header/header-logo_s.svg') no-repeat; + } } .btn-text-default { &.colored { padding: 0 16px; height: 28px; - background-color: @btnColored; + background-color: @background-accent-button; border: 1px solid transparent; border-radius: 3px; - color: #ffffff; + color: @text-contrast-background !important; font-weight: 700; &:hover:not(.disabled), .over:not(.disabled) { - background-color: @btnHoverColored !important; + background-color: @highlight-accent-button-hover !important; } &:active:not(.disabled), &.active:not(.disabled) { - background-color: @btnActiveColored !important;; + background-color: @highlight-accent-button-pressed !important; } } } @@ -320,9 +290,7 @@ background-origin: content-box; padding: 1px 0 0 1px; - -webkit-box-shadow: 0 0 0 2px rgba(255,255,255,0.3); - -moz-box-shadow: 0 0 0 2px rgba(255,255,255,0.3); - box-shadow: 0 0 0 2px rgba(255,255,255,0.3); + .box-shadow(0 0 0 2px rgba(255,255,255,0.3)); &:hover { opacity: .6; @@ -453,21 +421,32 @@ @icon-width: 20px; @icon-height: 20px; + +.theme-dark { + @neg-value: -@icon-height; + --icon-normal-top: @neg-value; +} +@icon-normal-top: var(--icon-normal-top, 0); + .svg-icon { background: data-uri('../../../../common/forms/resources/img/icon-menu-sprite.svg') no-repeat; background-size: @icon-width*19 @icon-height*2; &.download { background-position: -@icon-width 0; + background-position: -@icon-width @icon-normal-top; } &.share { background-position: -@icon-width*2 0; + background-position: -@icon-width*2 @icon-normal-top; } &.embed { background-position: -@icon-width*3 0; + background-position: -@icon-width*3 @icon-normal-top; } &.fullscr { background-position: -@icon-width*4 0; + background-position: -@icon-width*4 @icon-normal-top; } &.zoom-up { background-position: -@icon-width*5 -@icon-height; @@ -492,22 +471,28 @@ &.print { background-position: -@icon-width*11 0; + background-position: -@icon-width*11 @icon-normal-top; } &.arrow-up { background-position: -@icon-width*17 0; + background-position: -@icon-width*17 @icon-normal-top; } &.arrow-down { background-position: -@icon-width*16 0; + background-position: -@icon-width*16 @icon-normal-top; } &.clear-style { background-position: -@icon-width*12 0; + background-position: -@icon-width*12 @icon-normal-top; } &.go-to-location { background-position: -@icon-width*15 0; + background-position: -@icon-width*15 @icon-normal-top; } &.more-vertical { background-position: -@icon-width*14 0; + background-position: -@icon-width*14 @icon-normal-top; } } @@ -579,8 +564,7 @@ .masked { background-color: transparent; border-color: transparent; - -webkit-box-shadow: none; - box-shadow: none; + .box-shadow(none); } #pages { @@ -604,9 +588,9 @@ padding: 7px 15px; border-radius: 5px; + background-color: @background-notification-popover-ie; background-color: @background-notification-popover; - -webkit-box-shadow: 0 4px 15px -2px rgba(0, 0, 0, 0.5); - box-shadow: 0 4px 15px -2px rgba(0, 0, 0, 0.5); + .box-shadow(0 4px 15px -2px rgba(0, 0, 0, 0.5)); font-size: 11px; } @@ -619,22 +603,23 @@ } .asc-synchronizetip { - background-color: @btnColored; - color: @text-toolbar-header; + background-color: @background-contrast-popover; + color: @text-contrast-background; .close { &:before, &:after { - background-color: @text-toolbar-header; + background-color: @text-contrast-background; } } } .tip-arrow:after { - background-color: @btnColored; + background-color: @background-contrast-popover; } .btn-div { display: inline-block; - border: 1px solid #fff; + border: 1px solid @border-regular-control-ie; + border: 1px solid @border-regular-control; border-radius: 2px; padding: 3px 12px; margin-top: 10px; diff --git a/apps/common/main/lib/component/HSBColorPicker.js b/apps/common/main/lib/component/HSBColorPicker.js index 316d862c9..c832bf4cb 100644 --- a/apps/common/main/lib/component/HSBColorPicker.js +++ b/apps/common/main/lib/component/HSBColorPicker.js @@ -55,7 +55,7 @@ define([ '<% } %>'+ '
'+ '
'+ - '
'+ + '
'+ '
'+ '<% if (this.changeSaturation) { %>'+ '
'+ @@ -106,6 +106,7 @@ define([ refreshUI(); me.trigger('changecolor', me, me.color); + }; var refreshUI = function(){ @@ -125,8 +126,7 @@ define([ previewColorText[0].innerHTML = (me.color == 'transparent') ? me.textNoColor : me.color.toUpperCase(); if (arrowSatBrightness.length>0 && arrowHue.length>0) { - arrowSatBrightness.css('left', saturationVal + '%'); - arrowSatBrightness.css('top', 100 - brightnessVal + '%'); + arrowSatBrightness.css({'left': saturationVal + '%', 'top': 100 - brightnessVal + '%', 'background-color' : me.color}); arrowHue.css('top', parseInt(hueVal * 100 / 360.0) + '%'); } }; diff --git a/apps/common/main/lib/controller/Themes.js b/apps/common/main/lib/controller/Themes.js index 586de4750..39a854755 100644 --- a/apps/common/main/lib/controller/Themes.js +++ b/apps/common/main/lib/controller/Themes.js @@ -82,6 +82,7 @@ define([ "text-inverse", "text-toolbar-header", "text-contrast-background", + "text-alt-key-hint", "icon-normal", "icon-normal-pressed", @@ -117,6 +118,8 @@ define([ "canvas-dark-cell-title-border", "canvas-dark-cell-title-border-hover", "canvas-dark-cell-title-border-selected", + "canvas-dark-content-background", + "canvas-dark-page-border", "canvas-scroll-thumb", "canvas-scroll-thumb-hover", diff --git a/apps/common/main/resources/img/hsbcolorpicker/hsb-colorpicker.png b/apps/common/main/resources/img/hsbcolorpicker/hsb-colorpicker.png index 7f1ed4130..e178f5d2f 100644 Binary files a/apps/common/main/resources/img/hsbcolorpicker/hsb-colorpicker.png and b/apps/common/main/resources/img/hsbcolorpicker/hsb-colorpicker.png differ diff --git a/apps/common/main/resources/img/hsbcolorpicker/hsb-colorpicker@1.25x.png b/apps/common/main/resources/img/hsbcolorpicker/hsb-colorpicker@1.25x.png new file mode 100644 index 000000000..1e51931d6 Binary files /dev/null and b/apps/common/main/resources/img/hsbcolorpicker/hsb-colorpicker@1.25x.png differ diff --git a/apps/common/main/resources/img/hsbcolorpicker/hsb-colorpicker@1.5x.png b/apps/common/main/resources/img/hsbcolorpicker/hsb-colorpicker@1.5x.png index 09e7704a5..f0abef52e 100644 Binary files a/apps/common/main/resources/img/hsbcolorpicker/hsb-colorpicker@1.5x.png and b/apps/common/main/resources/img/hsbcolorpicker/hsb-colorpicker@1.5x.png differ diff --git a/apps/common/main/resources/img/hsbcolorpicker/hsb-colorpicker@1.75x.png b/apps/common/main/resources/img/hsbcolorpicker/hsb-colorpicker@1.75x.png new file mode 100644 index 000000000..5a5d5d3d2 Binary files /dev/null and b/apps/common/main/resources/img/hsbcolorpicker/hsb-colorpicker@1.75x.png differ diff --git a/apps/common/main/resources/img/hsbcolorpicker/hsb-colorpicker@2x.png b/apps/common/main/resources/img/hsbcolorpicker/hsb-colorpicker@2x.png index efc182356..9a7a3a2c1 100644 Binary files a/apps/common/main/resources/img/hsbcolorpicker/hsb-colorpicker@2x.png and b/apps/common/main/resources/img/hsbcolorpicker/hsb-colorpicker@2x.png differ diff --git a/apps/common/main/resources/less/asc-mixins.less b/apps/common/main/resources/less/asc-mixins.less index 44f8f6593..980503c55 100644 --- a/apps/common/main/resources/less/asc-mixins.less +++ b/apps/common/main/resources/less/asc-mixins.less @@ -327,11 +327,12 @@ } } -@img-colorpicker-width: 205px; +@img-colorpicker-width: 208px; .img-colorpicker, .hsb-colorpicker .empty-color:before { background-image: if(@icon-src-base64, data-uri(%("%s",'@{common-image-path}/hsbcolorpicker/hsb-colorpicker.png')), ~"url(@{common-image-const-path}/hsbcolorpicker/hsb-colorpicker.png)"); background-repeat: no-repeat; + background-size: @img-colorpicker-width auto; @media only screen { @media (-webkit-min-device-pixel-ratio: 1.5) and (-webkit-max-device-pixel-ratio: 1.9), @@ -350,6 +351,14 @@ background-size: @img-colorpicker-width auto; } } + + .pixel-ratio__1_25 & { + background-image: ~"url(@{common-image-const-path}/hsbcolorpicker/hsb-colorpicker@1.25x.png)"; + } + + .pixel-ratio__1_75 & { + background-image: ~"url(@{common-image-const-path}/hsbcolorpicker/hsb-colorpicker@1.75x.png)"; + } } .icon.lang-flag { diff --git a/apps/common/main/resources/less/buttons.less b/apps/common/main/resources/less/buttons.less index 8d6164e5d..a2fd1811a 100644 --- a/apps/common/main/resources/less/buttons.less +++ b/apps/common/main/resources/less/buttons.less @@ -758,6 +758,10 @@ box-shadow: inset 0 0 0 @scaled-one-px-value-ie @border-control-focus-ie; box-shadow: inset 0 0 0 @scaled-one-px-value @border-control-focus; } + + &.border-off { + box-shadow: none; + } } .btn-text-default { diff --git a/apps/common/main/resources/less/colors-table-classic.less b/apps/common/main/resources/less/colors-table-classic.less index 50b2dc03a..bde3c12e6 100644 --- a/apps/common/main/resources/less/colors-table-classic.less +++ b/apps/common/main/resources/less/colors-table-classic.less @@ -14,6 +14,7 @@ --background-notification-badge: #ffd112; --background-scrim: fade(#000, 20%); --background-loader: fade(#000, 65%); + --background-contrast-popover: #444444; --highlight-button-hover: #d8dadc; --highlight-button-pressed: #7d858c; diff --git a/apps/common/main/resources/less/colors-table-dark.less b/apps/common/main/resources/less/colors-table-dark.less index 1772e0277..bdf52de7d 100644 --- a/apps/common/main/resources/less/colors-table-dark.less +++ b/apps/common/main/resources/less/colors-table-dark.less @@ -15,6 +15,7 @@ --background-scrim: fade(black, 60%); --background-loader: fade(#181818, 90%); --background-alt-key-hint: #FFD938; + --background-contrast-popover: #363636; --highlight-button-hover: #555; --highlight-button-pressed: #707070; diff --git a/apps/common/main/resources/less/colors-table.less b/apps/common/main/resources/less/colors-table.less index 177ab6b13..c4f62364c 100644 --- a/apps/common/main/resources/less/colors-table.less +++ b/apps/common/main/resources/less/colors-table.less @@ -25,6 +25,8 @@ --background-scrim: fade(#000, 20%); --background-loader: fade(#181818, 90%); --background-alt-key-hint: #FFD938; + --background-accent-button: #446995; + --background-contrast-popover: #444444; --highlight-button-hover: #e0e0e0; --highlight-button-pressed: #cbcbcb; @@ -34,6 +36,8 @@ --highlight-header-button-pressed: fade(#fff, 25%); --highlight-toolbar-tab-underline: #444; --highlight-text-select: #3494fb; + --highlight-accent-button-hover: #375478; + --highlight-accent-button-pressed: #293F59; --border-toolbar: #cbcbcb; --border-divider: #dfdfdf; @@ -56,6 +60,7 @@ --text-inverse: #fff; --text-toolbar-header: #fff; --text-contrast-background: #fff; + --text-alt-key-hint: fade(#000, 80%); --icon-normal: #444; --icon-normal-pressed: #444; @@ -93,6 +98,8 @@ --canvas-dark-cell-title-border: #3d3d3d; --canvas-dark-cell-title-border-hover: #5c5c5c; --canvas-dark-cell-title-border-selected: #0f0f0f; + --canvas-dark-content-background: #3a3a3a; + --canvas-dark-page-border: #2a2a2a; --canvas-scroll-thumb: #f7f7f7; --canvas-scroll-thumb-hover: #c0c0c0; @@ -151,6 +158,8 @@ @background-scrim: var(--background-scrim); @background-loader: var(--background-loader); @background-alt-key-hint: var(--background-alt-key-hint); +@background-accent-button: var(--background-accent-button); +@background-contrast-popover: var(--background-contrast-popover); // Highlight // ------------------------- @@ -162,6 +171,8 @@ @highlight-header-button-pressed: var(--highlight-header-button-pressed); @highlight-toolbar-tab-underline: var(--highlight-toolbar-tab-underline); @highlight-text-select: var(--highlight-text-select); +@highlight-accent-button-hover: var(--highlight-accent-button-hover); +@highlight-accent-button-pressed: var(--highlight-accent-button-pressed); // Border // ------------------------- diff --git a/apps/common/main/resources/less/extended-color-picker.less b/apps/common/main/resources/less/extended-color-picker.less index 823fd17c1..92b809b6e 100644 --- a/apps/common/main/resources/less/extended-color-picker.less +++ b/apps/common/main/resources/less/extended-color-picker.less @@ -38,9 +38,8 @@ width: 63px; height: 20px; background-color: transparent; - border: @scaled-one-px-value-ie solid @border-regular-control-ie; - border: @scaled-one-px-value solid @border-regular-control; - + border: @scaled-one-px-value-ie solid @border-color-shading-ie; + border: @scaled-one-px-value solid @border-color-shading; &.top { border-bottom: none; } diff --git a/apps/common/main/resources/less/hsb-colorpicker.less b/apps/common/main/resources/less/hsb-colorpicker.less index dfefc37c0..526418eec 100644 --- a/apps/common/main/resources/less/hsb-colorpicker.less +++ b/apps/common/main/resources/less/hsb-colorpicker.less @@ -32,12 +32,9 @@ .cnt-hb { display: inline-block; - overflow: hidden; width: 195px; height: 196px; position: relative; - border: @scaled-one-px-value-ie solid @border-regular-control-ie; - border: @scaled-one-px-value solid @border-regular-control; background-position: 0 0; } @@ -49,7 +46,7 @@ } .cnt-sat { - width: 10px; + width: 12px; height: 100%; position: relative; border: @scaled-one-px-value-ie solid @border-regular-control-ie; @@ -58,21 +55,33 @@ } .cnt-hb-arrow { - width: 9px; - height: 9px; - margin: -4px; + display: block; + width: 12px; + height: 12px; + margin: -6px; position: absolute; - background-position: 0 -196px; + border: @scaled-one-px-value-ie solid #000; + border: @scaled-one-px-value solid #000; + .border-radius(50%); + &:after{ + content: ' '; + position: absolute; + width: 100%; + height: 100%; + border: @scaled-one-px-value-ie solid #fff; + border: @scaled-one-px-value solid #fff; + .border-radius(50%); + } } .cnt-sat-arrow { - width: 14px; - height: 9px; - margin-top: -4px; - margin-left: -3px; - margin-left: calc(-2px - @scaled-one-px-value); + width: 20px; + height: 12px; + margin-top: -6px; + margin-left: -4px; + margin-left: calc(-3px - @scaled-one-px-value); position: absolute; - background-position: -11px -196px; + background-position: -12px -196px; } .empty-color { diff --git a/apps/documenteditor/embed/index.html b/apps/documenteditor/embed/index.html index 396977aa8..7355d87dd 100644 --- a/apps/documenteditor/embed/index.html +++ b/apps/documenteditor/embed/index.html @@ -29,7 +29,7 @@ .loadmask > .brendpanel { width: 100%; position: absolute; - height: 48px; + height: 40px; background-color: #F7F7F7; -webkit-box-shadow: inset 0 -1px 0 #dbdbdb, inset 0 1px 0 #FAFAFA; box-shadow: inset 0 -1px 0 #dbdbdb, inset 0 1px 0 #FAFAFA; @@ -43,14 +43,14 @@ .loadmask > .brendpanel .loading-logo { max-width: 200px; - height: 24px; + height: 20px; margin-left: 10px; text-align: center; } .loadmask > .brendpanel .loading-logo > img { display: inline-block; - max-width: 124px; + max-width: 100px; max-height: 20px; opacity: 0; } diff --git a/apps/documenteditor/embed/index.html.deploy b/apps/documenteditor/embed/index.html.deploy index 22746b462..527732ad9 100644 --- a/apps/documenteditor/embed/index.html.deploy +++ b/apps/documenteditor/embed/index.html.deploy @@ -27,7 +27,7 @@ .loadmask > .brendpanel { width: 100%; position: absolute; - height: 48px; + height: 40px; background-color: #F7F7F7; -webkit-box-shadow: inset 0 -1px 0 #dbdbdb, inset 0 1px 0 #FAFAFA; box-shadow: inset 0 -1px 0 #dbdbdb, inset 0 1px 0 #FAFAFA; @@ -41,14 +41,14 @@ .loadmask > .brendpanel .loading-logo { max-width: 200px; - height: 24px; + height: 20px; margin-left: 10px; text-align: center; } .loadmask > .brendpanel .loading-logo > img { display: inline-block; - max-width: 124px; + max-width: 100px; max-height: 20px; opacity: 0; } diff --git a/apps/documenteditor/embed/js/ApplicationController.js b/apps/documenteditor/embed/js/ApplicationController.js index 74d19c922..2de63310e 100644 --- a/apps/documenteditor/embed/js/ApplicationController.js +++ b/apps/documenteditor/embed/js/ApplicationController.js @@ -403,7 +403,7 @@ DE.ApplicationController = new(function(){ itemsCount--; } - if ( !embedConfig.saveUrl && permissions.print === false || appOptions.canFillForms) { + if ( !embedConfig.saveUrl || permissions.download === false || appOptions.canFillForms) { $('#idt-download').hide(); itemsCount--; } @@ -439,7 +439,6 @@ DE.ApplicationController = new(function(){ itemsCount--; } - // if ( !embedConfig.saveUrl && permissions.print === false && (!embedConfig.shareUrl || appOptions.canFillForms) && (!embedConfig.embedUrl || appOptions.canFillForms) && !embedConfig.fullscreenUrl && !config.canBackToFolder) if (itemsCount<1) $('#box-tools').addClass('hidden'); else if ((!embedConfig.embedUrl || appOptions.canFillForms) && !embedConfig.fullscreenUrl) @@ -477,11 +476,8 @@ DE.ApplicationController = new(function(){ DE.ApplicationView.tools.get('#idt-download') .on('click', function(){ - if ( !!embedConfig.saveUrl ){ + if ( !!embedConfig.saveUrl && permissions.download !== false){ common.utils.openLink(embedConfig.saveUrl); - } else - if (api && permissions.print!==false){ - api.asc_Print(new Asc.asc_CDownloadOptions(null, $.browser.chrome || $.browser.safari || $.browser.opera || $.browser.mozilla && $.browser.versionNumber>86)); } Common.Analytics.trackEvent('Save'); @@ -605,9 +601,11 @@ DE.ApplicationController = new(function(){ config.customization && config.customization.logo ) { var logo = $('#header-logo'); - if (config.customization.logo.imageEmbedded) { - logo.html(''); + if (config.customization.logo.image || config.customization.logo.imageEmbedded) { + logo.html(''); logo.css({'background-image': 'none', width: 'auto', height: 'auto'}); + + config.customization.logo.imageEmbedded && console.log("Obsolete: The 'imageEmbedded' parameter of the 'customization.logo' section is deprecated. Please use 'image' parameter instead."); } if (config.customization.logo.url) { diff --git a/apps/documenteditor/forms/app.js b/apps/documenteditor/forms/app.js index 39125c57e..6ac4557d2 100644 --- a/apps/documenteditor/forms/app.js +++ b/apps/documenteditor/forms/app.js @@ -150,6 +150,7 @@ require([ 'documenteditor/forms/app/view/ApplicationView', 'common/main/lib/util/utils', 'common/main/lib/util/LocalStorage', + 'common/main/lib/controller/Themes', 'common/forms/lib/view/modals' ], function() { app.start(); diff --git a/apps/documenteditor/forms/app/controller/ApplicationController.js b/apps/documenteditor/forms/app/controller/ApplicationController.js index 9f3ca8c68..06aa0aad6 100644 --- a/apps/documenteditor/forms/app/controller/ApplicationController.js +++ b/apps/documenteditor/forms/app/controller/ApplicationController.js @@ -58,6 +58,8 @@ define([ 'embedded' : true }); + Common.UI.Themes.init(this.api); + $(window).on('resize', this.onDocumentResize.bind(this)); this.boxSdk = $('#editor_sdk'); @@ -456,9 +458,7 @@ define([ this.appOptions.canFillForms = this.appOptions.canLicense && (this.permissions.fillForms===true) && (this.editorConfig.mode !== 'view'); this.api.asc_setViewMode(!this.appOptions.canFillForms); - var type = /^(?:(pdf|djvu|xps))$/.exec(this.document.fileType); - this.appOptions.canDownloadOrigin = this.permissions.download !== false && (type && typeof type[1] === 'string'); - this.appOptions.canDownload = this.permissions.download !== false && (!type || typeof type[1] !== 'string'); + this.appOptions.canDownload = this.permissions.download !== false; this.appOptions.canPrint = (this.permissions.print !== false); this.appOptions.fileKey = this.document.key; @@ -776,11 +776,11 @@ define([ }, onDownloadAs: function() { - if ( !this.appOptions.canDownload && !this.appOptions.canDownloadOrigin ) { + if ( !this.appOptions.canDownload ) { Common.Gateway.reportError(Asc.c_oAscError.ID.AccessDeny, this.errorAccessDeny); return; } - var type = /^(?:(pdf|djvu|xps))$/.exec(this.document.fileType); + var type = /^(?:(pdf|djvu|xps|oxps))$/.exec(this.document.fileType); if (type && typeof type[1] === 'string') this.api.asc_DownloadOrigin(true); else @@ -1063,28 +1063,49 @@ define([ } }, + onThemeClick: function(menu, item) { + Common.UI.Themes.setTheme(item.value); + }, + + onThemeChange: function() { + var current = Common.UI.Themes.currentThemeId(); + _.each(this.view.mnuThemes.items, function(item){ + item.setChecked(current===item.value, true); + }); + }, + createDelayedElements: function() { var me = this, menuItems = this.view.btnOptions.menu.items, - itemsCount = menuItems.length-3; + itemsCount = menuItems.length-4; var initMenu = function(menu) { var last; + // print if (!menuItems[0].isVisible()) menuItems[1].setVisible(false); else last = menuItems[1]; + // download 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); + // theme + if (!menuItems[6].isVisible()) + menuItems[7].setVisible(false); else - last = menuItems[8]; + last = menuItems[7]; - if (!menuItems[9].isVisible() && !menuItems[10].isVisible()) + // share, location + if (!menuItems[8].isVisible() && !menuItems[9].isVisible()) + menuItems[10].setVisible(false); + else + last = menuItems[10]; + + // embed, fullscreen + if (!menuItems[11].isVisible() && !menuItems[12].isVisible()) last && last.setVisible(false); menu.off('show:after', initMenu); @@ -1095,7 +1116,7 @@ define([ itemsCount--; } - if ( !this.embedConfig.saveUrl && !this.appOptions.canPrint || this.appOptions.canFillForms) { + if ( !this.embedConfig.saveUrl || !this.appOptions.canDownload || this.appOptions.canFillForms) { menuItems[2].setVisible(false); itemsCount--; } @@ -1106,23 +1127,43 @@ define([ itemsCount -= 2; } - if ( !this.embedConfig.shareUrl || this.appOptions.canFillForms) { + if (Common.UI.Themes.available()) { + var current = Common.UI.Themes.currentThemeId(); + for (var t in Common.UI.Themes.map()) { + this.view.mnuThemes.addItem(new Common.UI.MenuItem({ + caption : Common.UI.Themes.get(t).text, + value : t, + toggleGroup : 'themes', + checkable : true, + checked : t===current + })); + } + } + if (this.view.mnuThemes.items.length<1) { menuItems[6].setVisible(false); itemsCount--; + } else { + this.view.mnuThemes.on('item:click', _.bind(this.onThemeClick, this)); + Common.NotificationCenter.on('uitheme:changed', this.onThemeChange.bind(this)); + } + + if ( !this.embedConfig.shareUrl || this.appOptions.canFillForms) { + menuItems[8].setVisible(false); + itemsCount--; } if (!this.appOptions.canBackToFolder) { - menuItems[7].setVisible(false); - itemsCount--; - } - - if ( !this.embedConfig.embedUrl || this.appOptions.canFillForms) { menuItems[9].setVisible(false); itemsCount--; } + if ( !this.embedConfig.embedUrl || this.appOptions.canFillForms) { + menuItems[11].setVisible(false); + itemsCount--; + } + if ( !this.embedConfig.fullscreenUrl ) { - menuItems[10].setVisible(false); + menuItems[12].setVisible(false); itemsCount--; } if (itemsCount<1) diff --git a/apps/documenteditor/forms/app/view/ApplicationView.js b/apps/documenteditor/forms/app/view/ApplicationView.js index 87a0eb765..b25dfde59 100644 --- a/apps/documenteditor/forms/app/view/ApplicationView.js +++ b/apps/documenteditor/forms/app/view/ApplicationView.js @@ -23,6 +23,15 @@ define([ {caption: this.txtDownloadDocx, value: 'download-docx', iconCls: 'mi-icon svg-icon download'}, {caption: this.txtDownloadPdf, value: 'download-pdf', iconCls: 'mi-icon'}, {caption: '--'}, + {caption: this.txtTheme, value: 'theme', iconCls: 'mi-icon', + menu : this.mnuThemes = new Common.UI.Menu({ + cls: 'shifted-right', + menuAlign: 'tl-tr', + restoreHeight: true, + items: [] + }) + }, + {caption: '--'}, {caption: this.txtShare, value: 'share', iconCls: 'mi-icon svg-icon share'}, {caption: this.txtFileLocation, value: 'close', iconCls: 'mi-icon svg-icon go-to-location'}, {caption: '--'}, @@ -81,6 +90,7 @@ define([ txtDownloadPdf: 'Download as pdf', textNext: 'Next Field', textClear: 'Clear All Fields', - textSubmit: 'Submit' + textSubmit: 'Submit', + txtTheme: 'Interface theme' }); }); \ No newline at end of file diff --git a/apps/documenteditor/forms/app_dev.js b/apps/documenteditor/forms/app_dev.js index 82741e502..33aa736fc 100644 --- a/apps/documenteditor/forms/app_dev.js +++ b/apps/documenteditor/forms/app_dev.js @@ -140,6 +140,7 @@ require([ 'documenteditor/forms/app/view/ApplicationView', 'common/main/lib/util/utils', 'common/main/lib/util/LocalStorage', + 'common/main/lib/controller/Themes', 'common/forms/lib/view/modals' ], function() { window.compareVersions = true; diff --git a/apps/documenteditor/forms/index.html b/apps/documenteditor/forms/index.html index dd12004df..4fb826105 100644 --- a/apps/documenteditor/forms/index.html +++ b/apps/documenteditor/forms/index.html @@ -14,6 +14,23 @@