diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index be84732cb..2379dab9f 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -12,4 +12,7 @@ jobs: - name: Build using grunt run: | npm install --prefix build + cd .. + git clone --branch=develop --depth=1 https://github.com/ONLYOFFICE/sdkjs.git + cd web-apps grunt --level=ADVANCED --base build --gruntfile build/Gruntfile.js diff --git a/apps/api/documents/index.html.desktop b/apps/api/documents/index.html.desktop index 881868143..8661e9b25 100644 --- a/apps/api/documents/index.html.desktop +++ b/apps/api/documents/index.html.desktop @@ -105,6 +105,7 @@ , feedback: { url: "https://helpdesk.onlyoffice.com/?desktop=true" } + , uiTheme: urlParams["uitheme"] }, mode : urlParams["mode"] || 'edit', lang : urlParams["lang"] || 'en', diff --git a/apps/common/main/lib/controller/Desktop.js b/apps/common/main/lib/controller/Desktop.js index 8b7e84641..745ba5079 100644 --- a/apps/common/main/lib/controller/Desktop.js +++ b/apps/common/main/lib/controller/Desktop.js @@ -41,12 +41,15 @@ define([ ], function () { 'use strict'; - var native = window.AscDesktopEditor; - !!native && native.execCommand('webapps:features', JSON.stringify({ + var features = { version: '{{PRODUCT_VERSION}}', eventloading: true, - titlebuttons: true - })); + titlebuttons: true, + uithemes: true + }; + + var native = window.AscDesktopEditor; + !!native && native.execCommand('webapps:features', JSON.stringify(features)); var Desktop = function () { var config = {version:'{{PRODUCT_VERSION}}'}; @@ -115,6 +118,9 @@ define([ titlebuttons[obj.action].btn.click(); } } else + if (/theme:changed/.test(cmd)) { + Common.UI.Themes.setTheme(param); + } else if (/element:show/.test(cmd)) { var _mr = /title:(?:(true|show)|(false|hide))/.exec(param); if ( _mr ) { @@ -131,7 +137,7 @@ define([ } } - native.execCommand('webapps:features', JSON.stringify({version: config.version, eventloading:true, titlebuttons:true})); + native.execCommand('webapps:features', JSON.stringify(features)); // hide mask for modal window var style = document.createElement('style'); @@ -193,8 +199,9 @@ define([ }); Common.NotificationCenter.on('app:face', function (mode) { - native.execCommand('webapps:features', JSON.stringify( - {version: config.version, eventloading:true, titlebuttons:true, viewmode:!mode.isEdit, crypted:mode.isCrypted} )); + features.viewmode = !mode.isEdit; + features.crypted = mode.isCrypted; + native.execCommand('webapps:features', JSON.stringify(features)); titlebuttons = {}; if ( mode.isEdit ) { @@ -235,6 +242,9 @@ define([ Common.NotificationCenter.on({ 'modal:show': _onModalDialog.bind(this, 'open'), 'modal:close': _onModalDialog.bind(this, 'close') + , 'uitheme:changed' : function (name) { + native.execCommand("uitheme:changed", name); + } }); } }, diff --git a/apps/common/main/lib/controller/ReviewChanges.js b/apps/common/main/lib/controller/ReviewChanges.js index a1139e63e..a9227d93b 100644 --- a/apps/common/main/lib/controller/ReviewChanges.js +++ b/apps/common/main/lib/controller/ReviewChanges.js @@ -562,24 +562,27 @@ define([ this.view.turnChanges(true); } else if ( this.appConfig.canReview ) { - var sendMessage = !fromApi; - var saveToFile = !!global; // save track changes flag (state) to file - this.api.asc_SetTrackRevisions(!!state, saveToFile, sendMessage); - Common.Utils.InternalSettings.set(this.view.appPrefix + "track-changes", (state ? 0 : 1) + (global ? 2 : 0)); - this.view.turnChanges(state, global); + if (!!global) { + this.api.asc_SetLocalTrackRevisions(null); + this.api.asc_SetGlobalTrackRevisions(!!state); + } else + this.api.asc_SetLocalTrackRevisions(!!state); } }, - onApiTrackRevisionsChange: function(state, global, userId) { - // change local or global state - if (userId && this.getUserName(userId)) { - if (state) - this.showTips(Common.Utils.String.format(global ? this.textOnGlobal : this.textOn, this.getUserName(userId))); - else - this.showTips(Common.Utils.String.format(global ? this.textOffGlobal : this.textOff, this.getUserName(userId))); - } - if (global && Common.Utils.InternalSettings.get(this.view.appPrefix + "track-changes")>1) { - Common.NotificationCenter.trigger('reviewchanges:turn', state, global, true); + onApiTrackRevisionsChange: function(localFlag, globalFlag, userId) { + if ( this.appConfig.isReviewOnly ) { + this.view.turnChanges(true); + } else + if ( this.appConfig.canReview ) { + var global = (localFlag===null), + state = global ? globalFlag : localFlag; + Common.Utils.InternalSettings.set(this.view.appPrefix + "track-changes", (state ? 0 : 1) + (global ? 2 : 0)); + this.view.turnChanges(state, global); + if (userId && this.userCollection) { + var rec = this.userCollection.findOriginalUser(userId); + rec && this.showTips(Common.Utils.String.format(globalFlag ? this.textOnGlobal : this.textOffGlobal, Common.Utils.UserInfoParser.getParsedName(rec.get('username')))); + } } }, @@ -778,18 +781,20 @@ define([ (new Promise(function (resolve) { resolve(); })).then(function () { - function _setReviewStatus(state, global) { - me.view.turnChanges(state, global); - me.api.asc_SetTrackRevisions(state); - Common.Utils.InternalSettings.set(me.view.appPrefix + "track-changes", (state ? 0 : 1) + (global ? 2 : 0)); - }; - - var trackChanges = typeof (me.appConfig.customization) == 'object' ? me.appConfig.customization.trackChanges : undefined, - state = config.isReviewOnly || trackChanges===true || (trackChanges!==false) && me.api.asc_IsTrackRevisions(), - global = !config.isReviewOnly && (trackChanges===undefined); + // function _setReviewStatus(state, global) { + // me.view.turnChanges(state, global); + // !global && me.api.asc_SetLocalTrackRevisions(state); + // Common.Utils.InternalSettings.set(me.view.appPrefix + "track-changes", (state ? 0 : 1) + (global ? 2 : 0)); + // }; + var trackChanges = typeof (me.appConfig.customization) == 'object' ? me.appConfig.customization.trackChanges : undefined; + if (config.isReviewOnly || trackChanges!==undefined) + me.api.asc_SetLocalTrackRevisions(config.isReviewOnly || trackChanges===true); + else + me.onApiTrackRevisionsChange(me.api.asc_GetLocalTrackRevisions(), me.api.asc_GetGlobalTrackRevisions()); me.api.asc_HaveRevisionsChanges() && me.view.markChanges(true); - _setReviewStatus(state, global); + + // _setReviewStatus(state, global); if ( typeof (me.appConfig.customization) == 'object' && (me.appConfig.customization.showReviewChanges==true) ) { me.dlgChanges = (new Common.Views.ReviewChangesDialog({ @@ -848,8 +853,10 @@ define([ offset: 30 }); this.tooltip.on('tooltip:hide', function(cmp){ - clearTimeout(me.tipTimeout); - (cmp==me.tooltip) && setTimeout(showNextTip, 300); + if (cmp==me.tooltip) { + clearTimeout(me.tipTimeout); + setTimeout(showNextTip, 300); + } }); } diff --git a/apps/common/main/lib/controller/Themes.js b/apps/common/main/lib/controller/Themes.js index 1856441a6..3dfdcec9b 100644 --- a/apps/common/main/lib/controller/Themes.js +++ b/apps/common/main/lib/controller/Themes.js @@ -76,7 +76,7 @@ define([ } Common.localStorage.setItem('ui-theme', name); - Common.NotificationCenter.trigger('uitheme:change', name); + Common.NotificationCenter.trigger('uitheme:changed', name); } }, diff --git a/apps/common/main/lib/util/htmlutils.js b/apps/common/main/lib/util/htmlutils.js index f6e5384c3..bbd155a77 100644 --- a/apps/common/main/lib/util/htmlutils.js +++ b/apps/common/main/lib/util/htmlutils.js @@ -32,7 +32,10 @@ var params = (function() { return urlParams; })(); -var ui_theme_name = params.uitheme || localStorage.getItem("ui-theme"); +if ( !!params.uitheme && localStorage.getItem("ui-theme") != params.uitheme) + localStorage.setItem("ui-theme", params.uitheme); + +var ui_theme_name = localStorage.getItem("ui-theme"); if ( !!ui_theme_name ) { document.body.classList.add(ui_theme_name); } diff --git a/apps/common/main/lib/view/OpenDialog.js b/apps/common/main/lib/view/OpenDialog.js index 6123d15f5..8b5dca3b5 100644 --- a/apps/common/main/lib/view/OpenDialog.js +++ b/apps/common/main/lib/view/OpenDialog.js @@ -59,7 +59,7 @@ define([ width = 414; height = 277; } else { - width = (options.type !== Common.Utils.importTextType.DRM) ? 340 : (options.warning ? 420 : 262); + width = (options.type !== Common.Utils.importTextType.DRM) ? 340 : (options.warning ? 420 : 280); height = (options.type == Common.Utils.importTextType.CSV || options.type == Common.Utils.importTextType.Paste || options.type == Common.Utils.importTextType.Columns) ? 190 : (options.warning ? 187 : 147); } @@ -92,7 +92,7 @@ define([ '', '<% } else { %>', '
', - '', + '', '
', '
', '<% } %>', @@ -507,7 +507,8 @@ define([ txtColon: 'Colon', txtSemicolon: 'Semicolon', txtProtected: 'Once you enter the password and open the file, the current password to the file will be reset.', - txtAdvanced: 'Advanced' + txtAdvanced: 'Advanced', + txtOpenFile: "Enter a password to open the file" }, Common.Views.OpenDialog || {})); }); \ No newline at end of file diff --git a/apps/common/main/lib/view/PasswordDialog.js b/apps/common/main/lib/view/PasswordDialog.js index 8ef59c485..c552b5801 100644 --- a/apps/common/main/lib/view/PasswordDialog.js +++ b/apps/common/main/lib/view/PasswordDialog.js @@ -54,8 +54,8 @@ define([ _options = {}; _.extend(_options, { - width : 350, - height : 238, + width : 395, + height : 270, header : true, cls : 'modal-dlg', contentTemplate : '', @@ -77,6 +77,7 @@ define([ '', '', '
', + '', '' ].join(''); @@ -154,7 +155,8 @@ define([ txtPassword : "Password", txtDescription : "A Password is required to open this document", txtRepeat: 'Repeat password', - txtIncorrectPwd: 'Confirmation password is not identical' + txtIncorrectPwd: 'Confirmation password is not identical', + txtWarning: 'Warning: If you lose or forget the password, it cannot be recovered. Please keep it in a safe place.' }, Common.Views.PasswordDialog || {})); }); \ No newline at end of file diff --git a/apps/common/main/lib/view/SignDialog.js b/apps/common/main/lib/view/SignDialog.js index 44524278a..261496c9c 100644 --- a/apps/common/main/lib/view/SignDialog.js +++ b/apps/common/main/lib/view/SignDialog.js @@ -74,6 +74,8 @@ define([ bold: false, italic: false }; + var filter = Common.localStorage.getKeysFilter(); + this.appPrefix = (filter && filter.length) ? filter.split(',')[0] : ''; this.template = [ '
', @@ -145,6 +147,7 @@ define([ menuStyle : 'min-width: 234px;max-height: 270px;', store : new Common.Collections.Fonts(), recent : 0, + takeFocusOnClose: true, hint : me.tipFontName }).on('selected', function(combo, record) { if (me.signObject) { @@ -160,6 +163,7 @@ define([ menuCls : 'scrollable-menu', menuStyle: 'min-width: 55px;max-height: 270px;', hint: this.tipFontSize, + takeFocusOnClose: true, data: [ { value: 8, displayValue: "8" }, { value: 9, displayValue: "9" }, @@ -186,11 +190,13 @@ define([ me.font.size = record.value; }); this.cmbFontSize.setValue(this.font.size); + this.cmbFontSize.on('changed:before', _.bind(this.onFontSizeChanged, this, true)); + this.cmbFontSize.on('changed:after', _.bind(this.onFontSizeChanged, this, false)); me.btnBold = new Common.UI.Button({ parentEl: $('#id-dlg-sign-bold'), cls: 'btn-toolbar', - iconCls: 'btn-bold', + iconCls: 'toolbar__icon btn-bold', enableToggle: true, hint: me.textBold }); @@ -204,7 +210,7 @@ define([ me.btnItalic = new Common.UI.Button({ parentEl: $('#id-dlg-sign-italic'), cls: 'btn-toolbar', - iconCls: 'btn-italic', + iconCls: 'toolbar__icon btn-italic', enableToggle: true, hint: me.textItalic }); @@ -241,6 +247,10 @@ define([ me.afterRender(); }, + getFocusedComponents: function() { + return [this.inputPurpose, this.inputName, this.cmbFonts, this.cmbFontSize]; + }, + show: function() { Common.UI.Window.prototype.show.apply(this, arguments); @@ -301,8 +311,14 @@ define([ _handleInput: function(state) { if (this.options.handler) { - if (state == 'ok' && (this.btnOk.isDisabled() || this.signObject && !this.signObject.isValid())) - return; + if (state == 'ok' && (this.btnOk.isDisabled() || this.signObject && !this.signObject.isValid())) { + if (!this.btnOk.isDisabled()) { + this.inputName.showError([this.textNameError]); + this.inputName.focus(); + } + return; + } + this.options.handler.call(this, this, state); } @@ -334,6 +350,39 @@ define([ this.signObject.setText(value, this.font.name, this.font.size, this.font.italic, this.font.bold); }, + onFontSizeChanged: function(before, combo, record, e) { + var value, + me = this; + + if (before) { + var item = combo.store.findWhere({ + displayValue: record.value + }); + + if (!item) { + value = /^\+?(\d*(\.|,)?\d+)$|^\+?(\d+(\.|,)?\d*)$/.exec(record.value); + + if (!value) { + value = combo.getValue(); + combo.setRawValue(value); + e.preventDefault(); + return false; + } + } + } else { + var maxvalue = (this.appPrefix=='sse-') ? 409 : 300; + value = Common.Utils.String.parseFloat(record.value); + value = value > maxvalue ? maxvalue : + value < 1 ? 1 : Math.floor((value+0.4)*2)/2; + + combo.setRawValue(value); + if (this.signObject) { + this.signObject.setText(this.inputName.getValue(), this.font.name, value, this.font.italic, this.font.bold); + } + this.font.size = value; + } + }, + textTitle: 'Sign Document', textPurpose: 'Purpose for signing this document', textCertificate: 'Certificate', @@ -347,7 +396,8 @@ define([ tipFontSize: 'Font Size', textBold: 'Bold', textItalic: 'Italic', - textSelect: 'Select' + textSelect: 'Select', + textNameError: 'Signer name must not be empty.' }, Common.Views.SignDialog || {})) }); \ No newline at end of file diff --git a/apps/common/main/lib/view/SignSettingsDialog.js b/apps/common/main/lib/view/SignSettingsDialog.js index d402926ac..74d649b94 100644 --- a/apps/common/main/lib/view/SignSettingsDialog.js +++ b/apps/common/main/lib/view/SignSettingsDialog.js @@ -142,13 +142,12 @@ define([ $window.find('.dlg-btn').on('click', _.bind(this.onBtnClick, this)); }, - show: function() { - Common.UI.Window.prototype.show.apply(this, arguments); + getFocusedComponents: function() { + return [this.inputName, this.inputTitle, this.inputEmail, this.textareaInstructions]; + }, - var me = this; - _.delay(function(){ - me.inputName.cmpEl.find('input').focus(); - },500); + getDefaultFocusableComponent: function () { + return this.inputName; }, setSettings: function (props) { @@ -164,6 +163,8 @@ define([ value = props.asc_getInstructions(); me.textareaInstructions.val(value ? value : ''); me.chDate.setValue(props.asc_getShowDate()); + + me._currentGuid = props.asc_getGuid(); } }, @@ -176,6 +177,7 @@ define([ props.asc_setEmail(me.inputEmail.getValue()); props.asc_setInstructions(me.textareaInstructions.val()); props.asc_setShowDate(me.chDate.getValue()=='checked'); + (me._currentGuid!==undefined) && props.asc_setGuid(me._currentGuid); return props; }, diff --git a/apps/common/main/resources/less/buttons.less b/apps/common/main/resources/less/buttons.less index a6579d6fd..b513eba07 100644 --- a/apps/common/main/resources/less/buttons.less +++ b/apps/common/main/resources/less/buttons.less @@ -1,5 +1,4 @@ @x-huge-btn-height: 46px; -@btn-disabled-opacity: .4; @x-huge-btn-icon-size: 28px; .btn { @@ -40,7 +39,7 @@ } &[disabled] { - opacity: @btn-disabled-opacity; + opacity: @component-disabled-opacity; } &:focus { @@ -432,7 +431,7 @@ &[disabled], &.disabled { //color: #000; btn-category has no text - opacity: @btn-disabled-opacity; + opacity: @component-disabled-opacity; } } @@ -502,7 +501,7 @@ } &[disabled], &.disabled { - opacity: 0.65; + opacity: @component-disabled-opacity; } } @@ -519,7 +518,7 @@ .dropdown-menu { &.scale-menu { li.disabled { - opacity: 0.65; + opacity: @component-disabled-opacity; } } } @@ -614,7 +613,7 @@ &[disabled], &.disabled { - opacity: 0.35; + opacity: @component-disabled-opacity; } .color-transparent { @@ -721,7 +720,7 @@ &[disabled], &.disabled { - opacity: 0.65; + opacity: @component-disabled-opacity; } } @@ -759,7 +758,7 @@ &[disabled], &.disabled { - opacity: 0.65; + opacity: @component-disabled-opacity; } } @@ -798,7 +797,7 @@ &[disabled], &.disabled { - opacity: 0.65; + opacity: @component-disabled-opacity; } } @@ -838,7 +837,7 @@ &[disabled], &.disabled { - opacity: 0.65; + opacity: @component-disabled-opacity; } } @@ -905,7 +904,7 @@ &[disabled], &.disabled { - opacity: 0.65; + opacity: @component-disabled-opacity; } } @@ -943,7 +942,7 @@ } &[disabled] { - opacity: 0.65; + opacity: @component-disabled-opacity; } &.custom { diff --git a/apps/common/main/resources/less/checkbox.less b/apps/common/main/resources/less/checkbox.less index 9b8b8e320..d74abea46 100644 --- a/apps/common/main/resources/less/checkbox.less +++ b/apps/common/main/resources/less/checkbox.less @@ -58,11 +58,9 @@ &.disabled, &:disabled { - opacity: .4; + label { &::before { - opacity: .4; } } } diff --git a/apps/common/main/resources/less/colors-table-dark.less b/apps/common/main/resources/less/colors-table-dark.less index c6d00ad0a..15159908d 100644 --- a/apps/common/main/resources/less/colors-table-dark.less +++ b/apps/common/main/resources/less/colors-table-dark.less @@ -106,6 +106,7 @@ --image-border-types-filter: invert(100%) brightness(4); --image-border-types-filter-selected: invert(100%) brightness(4); --component-normal-icon-filter: invert(100%); + --component-disabled-opacity: .3; --menu-icon-item-checked-offset-x: -20px; } diff --git a/apps/common/main/resources/less/colors-table.less b/apps/common/main/resources/less/colors-table.less index 6d6cca53b..dd743c5cd 100644 --- a/apps/common/main/resources/less/colors-table.less +++ b/apps/common/main/resources/less/colors-table.less @@ -120,6 +120,7 @@ --image-border-types-filter: none; --image-border-types-filter-selected: none; --component-normal-icon-filter: none; + --component-disabled-opacity: .4; } // Background @@ -188,6 +189,7 @@ @button-header-active-icon-offset-x: var(--button-header-active-icon-offset-x, -20px); @component-normal-icon-filer: var(--component-normal-icon-filter); +@component-disabled-opacity: var(--component-disabled-opacity, .4); @menu-icon-item-checked-offset-x: var(--menu-icon-item-checked-offset-x, 0); diff --git a/apps/common/main/resources/less/combo-dataview.less b/apps/common/main/resources/less/combo-dataview.less index 63ce7c2df..d3cc6d36a 100644 --- a/apps/common/main/resources/less/combo-dataview.less +++ b/apps/common/main/resources/less/combo-dataview.less @@ -62,7 +62,7 @@ } &.disabled { - opacity: 0.65; + opacity: @component-disabled-opacity; .dataview.inner { > .item { diff --git a/apps/common/main/resources/less/common.less b/apps/common/main/resources/less/common.less index 44b6a116a..50d8faee9 100644 --- a/apps/common/main/resources/less/common.less +++ b/apps/common/main/resources/less/common.less @@ -20,7 +20,7 @@ label { } &.disabled { - opacity: 0.5; + opacity: @component-disabled-opacity; } } @@ -200,7 +200,7 @@ label { height: 100%; &.disabled { - opacity: 0.65; + opacity: @component-disabled-opacity; cursor: default !important; } } diff --git a/apps/common/main/resources/less/dataview.less b/apps/common/main/resources/less/dataview.less index 3696c10f5..1c4c53fee 100644 --- a/apps/common/main/resources/less/dataview.less +++ b/apps/common/main/resources/less/dataview.less @@ -58,7 +58,7 @@ } &.disabled { - opacity: 0.5; + opacity: @component-disabled-opacity; } .box-shadow(0 0 0 @scaled-one-px-value-ie @border-regular-control-ie); diff --git a/apps/common/main/resources/less/dropdown-menu.less b/apps/common/main/resources/less/dropdown-menu.less index 3222f9618..325b28de9 100644 --- a/apps/common/main/resources/less/dropdown-menu.less +++ b/apps/common/main/resources/less/dropdown-menu.less @@ -1,5 +1,10 @@ .dropdown-menu > .disabled > a { cursor: default; + + color: @text-normal-ie; + color: @text-normal; + + opacity: @component-disabled-opacity; } .dropdown-menu { @@ -89,7 +94,6 @@ &.disabled { .menu-item-icon { - opacity: .4; } } diff --git a/apps/common/main/resources/less/header.less b/apps/common/main/resources/less/header.less index 8e57409a1..a7995b8a8 100644 --- a/apps/common/main/resources/less/header.less +++ b/apps/common/main/resources/less/header.less @@ -197,7 +197,7 @@ } &.disabled { - opacity: 0.65; + opacity: @component-disabled-opacity; pointer-events: none; } } @@ -359,7 +359,7 @@ .btn&[disabled], &.disabled { - opacity: 0.65; + opacity: @component-disabled-opacity; } &:hover { diff --git a/apps/common/main/resources/less/input.less b/apps/common/main/resources/less/input.less index c3ab2aaf7..d1a6da47a 100644 --- a/apps/common/main/resources/less/input.less +++ b/apps/common/main/resources/less/input.less @@ -95,7 +95,7 @@ input.error { } .disabled .form-control { - opacity: 0.65; + opacity: @component-disabled-opacity; cursor: default !important; } diff --git a/apps/common/main/resources/less/listview.less b/apps/common/main/resources/less/listview.less index 6110d76a7..8757d2a25 100644 --- a/apps/common/main/resources/less/listview.less +++ b/apps/common/main/resources/less/listview.less @@ -76,7 +76,7 @@ &.disabled { > .item { cursor: default; - opacity: 0.5; + opacity: @component-disabled-opacity; } } } diff --git a/apps/common/main/resources/less/radiobox.less b/apps/common/main/resources/less/radiobox.less index 980de206d..1c5355ccf 100644 --- a/apps/common/main/resources/less/radiobox.less +++ b/apps/common/main/resources/less/radiobox.less @@ -42,11 +42,9 @@ } &.disabled, &:disabled { - opacity: .4; + label { &::before { - opacity: .4; } } } diff --git a/apps/common/main/resources/less/scroller.less b/apps/common/main/resources/less/scroller.less index 18cb1de15..8f345eef8 100644 --- a/apps/common/main/resources/less/scroller.less +++ b/apps/common/main/resources/less/scroller.less @@ -35,10 +35,10 @@ .border-radius(2px); border: @scaled-one-px-value-ie solid @border-regular-control-ie; border: @scaled-one-px-value solid @border-regular-control; - -o-transition: background-color .5s 0 linear; - -webkit-transition: background-color .5s 0 linear; - -moz-transition: background-color .5s 0 linear; - transition: background-color .5s 0 linear; + -o-transition: background-color .2s linear; + -webkit-transition: background-color .2s linear; + -moz-transition: background-color .2s linear; + transition: background-color .2s linear; } } @@ -95,10 +95,10 @@ .border-radius(2px); border: @scaled-one-px-value-ie solid @border-regular-control-ie; border: @scaled-one-px-value solid @border-regular-control; - -o-transition: background-color .5s 0 linear; - -webkit-transition: background-color .5s 0 linear; - -moz-transition: background-color .5s 0 linear; - transition: background-color .5s 0 linear; + -o-transition: background-color .2s linear; + -webkit-transition: background-color .2s linear; + -moz-transition: background-color .2s linear; + transition: background-color .2s linear; } } diff --git a/apps/common/main/resources/less/slider.less b/apps/common/main/resources/less/slider.less index fefd2dfe1..ed156501b 100644 --- a/apps/common/main/resources/less/slider.less +++ b/apps/common/main/resources/less/slider.less @@ -39,6 +39,6 @@ } &.disabled { - opacity: 0.35; + opacity: @component-disabled-opacity; } } \ No newline at end of file diff --git a/apps/common/main/resources/less/spinner.less b/apps/common/main/resources/less/spinner.less index 62b2e0e28..73cb0cf4a 100644 --- a/apps/common/main/resources/less/spinner.less +++ b/apps/common/main/resources/less/spinner.less @@ -58,7 +58,7 @@ button { &.disabled { - opacity: .35; + opacity: @component-disabled-opacity; } &:hover { diff --git a/apps/common/main/resources/less/window.less b/apps/common/main/resources/less/window.less index b612a5e26..87745f2ce 100644 --- a/apps/common/main/resources/less/window.less +++ b/apps/common/main/resources/less/window.less @@ -134,7 +134,7 @@ } &.disabled { - opacity: 0.3; + opacity: @component-disabled-opacity; cursor: default; } } diff --git a/apps/documenteditor/main/app/controller/Main.js b/apps/documenteditor/main/app/controller/Main.js index e2a67324f..f4e20e493 100644 --- a/apps/documenteditor/main/app/controller/Main.js +++ b/apps/documenteditor/main/app/controller/Main.js @@ -2364,7 +2364,7 @@ define([ var _disable_ui = function (disable) { me.disableEditing(disable); var app = me.getApplication(); - app.getController('DocumentHolder').getView().SetDisabled(disable, true); + app.getController('DocumentHolder').getView().SetDisabled(disable); app.getController('Navigation') && app.getController('Navigation').SetDisabled(disable); var leftMenu = app.getController('LeftMenu'); diff --git a/apps/documenteditor/main/app/controller/Statusbar.js b/apps/documenteditor/main/app/controller/Statusbar.js index e57649a4f..b48ee0e7f 100644 --- a/apps/documenteditor/main/app/controller/Statusbar.js +++ b/apps/documenteditor/main/app/controller/Statusbar.js @@ -70,7 +70,7 @@ define([ Common.localStorage.setBool('de-hidden-status', status); Common.NotificationCenter.trigger('layout:changed', 'status'); - Common.NotificationCenter.trigger('edit:complete', this.statusbar); + Common.NotificationCenter.trigger('edit:complete', me.statusbar); } } }); @@ -117,7 +117,6 @@ define([ }); Common.NotificationCenter.on('app:ready', me.onAppReady.bind(me)); - Common.NotificationCenter.on('reviewchanges:turn', me.onTurnPreview.bind(me)); }, onAppReady: function (config) { @@ -137,6 +136,7 @@ define([ if (me.changesTooltip === undefined) me.changesTooltip = me.createChangesTip(me.textTrackChanges, 'de-track-changes-tip'); + me.hideTips(); me.changesTooltip.show(); } else { me.btnTurnReview.updateHint(me.tipReview); @@ -155,6 +155,7 @@ define([ if (me.newChangesTooltip === undefined) me.newChangesTooltip = me.createChangesTip(me.textHasChanges, 'de-new-changes'); + me.hideTips(); me.newChangesTooltip.show(); } else me.btnTurnReview.updateHint(me.tipReview); @@ -163,14 +164,21 @@ define([ }); }, - onTurnPreview: function(state, global, fromApi) { - if (!state && this.changesTooltip && this.changesTooltip.isVisible()) { - this.changesTooltip.hide(); - this.btnTurnReview.updateHint(this.tipReview); - } else if (fromApi && state && global ) { - if (this.globalChangesTooltip === undefined) - this.globalChangesTooltip = this.createChangesTip(this.textSetTrackChanges); - !this.globalChangesTooltip.isVisible() && this.globalChangesTooltip.show(); + onApiTrackRevisionsChange: function(localFlag, globalFlag, userId) { + var global = (localFlag===null), + state = global ? globalFlag : localFlag; + if (this.btnTurnReview) { + if (!state) { + this.hideTips(); + this.btnTurnReview.updateHint(this.tipReview); + } else if (userId && state && global ) { + if (this.globalChangesTooltip === undefined) + this.globalChangesTooltip = this.createChangesTip(this.textSetTrackChanges); + if (!this.globalChangesTooltip.isVisible()) { + this.hideTips(); + this.globalChangesTooltip.show(); + } + } } }, @@ -178,6 +186,7 @@ define([ this.api = api; this.api.asc_registerCallback('asc_onZoomChange', _.bind(this._onZoomChange, this)); this.api.asc_registerCallback('asc_onTextLanguage', _.bind(this._onTextLanguage, this)); + this.api.asc_registerCallback('asc_onOnTrackRevisionsChange', _.bind(this.onApiTrackRevisionsChange, this)); this.statusbar.setApi(api); }, @@ -257,6 +266,12 @@ define([ this.setStatusCaption(''); }, + hideTips: function () { + this.changesTooltip && this.changesTooltip.isVisible() && this.changesTooltip.hide(); + this.newChangesTooltip && this.newChangesTooltip.isVisible() && this.newChangesTooltip.hide(); + this.globalChangesTooltip && this.globalChangesTooltip.isVisible() && this.globalChangesTooltip.hide(); + }, + createChangesTip: function (text, storage) { var me = this; var tip = new Common.UI.SynchronizeTip({ diff --git a/apps/documenteditor/main/app/controller/Toolbar.js b/apps/documenteditor/main/app/controller/Toolbar.js index 9c3919608..2cb52ded2 100644 --- a/apps/documenteditor/main/app/controller/Toolbar.js +++ b/apps/documenteditor/main/app/controller/Toolbar.js @@ -295,6 +295,12 @@ define([ toolbar.mnuMarkerSettings.on('click', _.bind(this.onMarkerSettingsClick, this, 0)); toolbar.mnuNumberSettings.on('click', _.bind(this.onMarkerSettingsClick, this, 1)); toolbar.mnuMultilevelSettings.on('click', _.bind(this.onMarkerSettingsClick, this, 2)); + toolbar.mnuMarkerChangeLevel && toolbar.mnuMarkerChangeLevel.menu && + toolbar.mnuMarkerChangeLevel.menu.on('show:after', _.bind(this.onChangeLevelShowAfter, this, 0)); + toolbar.mnuMarkerChangeLevel.menu.on('item:click', _.bind(this.onChangeLevelClick, this, 0)); + toolbar.mnuNumberChangeLevel && toolbar.mnuNumberChangeLevel.menu && + toolbar.mnuNumberChangeLevel.menu.on('show:after', _.bind(this.onChangeLevelShowAfter, this, 1)); + toolbar.mnuNumberChangeLevel.menu.on('item:click', _.bind(this.onChangeLevelClick, this, 1)); toolbar.btnHighlightColor.on('click', _.bind(this.onBtnHighlightColor, this)); toolbar.btnFontColor.on('click', _.bind(this.onBtnFontColor, this)); toolbar.btnParagraphColor.on('click', _.bind(this.onBtnParagraphColor, this)); @@ -518,6 +524,7 @@ define([ this.toolbar.mnuMarkersPicker.deselectAll(true); this.toolbar.mnuMultilevelPicker.deselectAll(true); this.toolbar.mnuMarkerSettings && this.toolbar.mnuMarkerSettings.setDisabled(this._state.bullets.subtype<0); + this.toolbar.mnuMarkerChangeLevel && this.toolbar.mnuMarkerChangeLevel.setDisabled(this._state.bullets.subtype<0); this.toolbar.mnuMultilevelSettings && this.toolbar.mnuMultilevelSettings.setDisabled(this._state.bullets.subtype<0); break; case 1: @@ -552,6 +559,7 @@ define([ this.toolbar.mnuNumbersPicker.deselectAll(true); this.toolbar.mnuMultilevelPicker.deselectAll(true); this.toolbar.mnuNumberSettings && this.toolbar.mnuNumberSettings.setDisabled(idx==0); + this.toolbar.mnuNumberChangeLevel && this.toolbar.mnuNumberChangeLevel.setDisabled(idx==0); this.toolbar.mnuMultilevelSettings && this.toolbar.mnuMultilevelSettings.setDisabled(idx==0); break; case 2: @@ -1398,6 +1406,24 @@ define([ } }, + onChangeLevelShowAfter: function(type, menu) { + var me = this; + var listId = me.api.asc_GetCurrentNumberingId(), + level = me.api.asc_GetCurrentNumberingLvl(), + props = (listId !== null) ? me.api.asc_GetNumberingPr(listId) : null; + if (props) { + this.api.SetDrawImagePreviewBulletChangeListLevel(menu.options.previewIds, props); + } + }, + + onChangeLevelClick: function(type, menu, item) { + if (this.api) { + this.api.asc_SetNumberingLvl(item.options.level); + } + + Common.NotificationCenter.trigger('edit:complete', this.toolbar); + }, + onLineSpaceToggle: function(menu, item, state, e) { if (!!state) { this._state.linespace = undefined; @@ -2359,6 +2385,8 @@ define([ this.toolbar.mnuMarkerSettings && this.toolbar.mnuMarkerSettings.setDisabled(true); this.toolbar.mnuNumberSettings && this.toolbar.mnuNumberSettings.setDisabled(true); this.toolbar.mnuMultilevelSettings && this.toolbar.mnuMultilevelSettings.setDisabled(true); + this.toolbar.mnuMarkerChangeLevel && this.toolbar.mnuMarkerChangeLevel.setDisabled(true); + this.toolbar.mnuNumberChangeLevel && this.toolbar.mnuNumberChangeLevel.setDisabled(true); }, _getApiTextSize: function () { @@ -3193,7 +3221,7 @@ define([ textEmptyImgUrl : 'You need to specify image URL.', textWarning : 'Warning', - textFontSizeErr : 'The entered value is incorrect.
Please enter a numeric value between 1 and 100', + textFontSizeErr : 'The entered value is incorrect.
Please enter a numeric value between 1 and 300', textSymbols : 'Symbols', textFraction : 'Fraction', textScript : 'Script', diff --git a/apps/documenteditor/main/app/controller/Viewport.js b/apps/documenteditor/main/app/controller/Viewport.js index 156f3f8a9..3597aaee3 100644 --- a/apps/documenteditor/main/app/controller/Viewport.js +++ b/apps/documenteditor/main/app/controller/Viewport.js @@ -313,21 +313,6 @@ define([ cls : 'btn-toolbar' })).on('click', _on_btn_zoom.bind(me, 'up')); - if ( Common.UI.Themes.available() ) { - var mnuitemDarkTheme = new Common.UI.MenuItem({ - caption: me.header.textDarkTheme, - checked: Common.UI.Themes.isDarkTheme(), - checkable: true, - value: 'theme:dark' - }); - - - me.header.btnOptions.menu.insertItem(7, mnuitemDarkTheme); - me.header.btnOptions.menu.insertItem(7, {caption:'--'}); - Common.NotificationCenter.on('uitheme:change', function (name) { - mnuitemDarkTheme.setChecked(Common.UI.Themes.isDarkTheme()); - }); - } me.header.btnOptions.menu.on('item:click', me.onOptionsItemClick.bind(this)); } }, @@ -415,10 +400,6 @@ define([ Common.NotificationCenter.trigger('edit:complete', me.header); break; case 'advanced': me.header.fireEvent('file:settings', me.header); break; - case 'theme:dark': - if ( item.isChecked() != Common.UI.Themes.isDarkTheme() ) - Common.UI.Themes.toggleTheme(); - break; } }, diff --git a/apps/documenteditor/main/app/template/ParagraphSettingsAdvanced.template b/apps/documenteditor/main/app/template/ParagraphSettingsAdvanced.template index b46c630d3..915b1a382 100644 --- a/apps/documenteditor/main/app/template/ParagraphSettingsAdvanced.template +++ b/apps/documenteditor/main/app/template/ParagraphSettingsAdvanced.template @@ -20,7 +20,7 @@
+ -->
@@ -40,7 +40,7 @@
+ -->
diff --git a/apps/documenteditor/main/app/view/ControlSettingsDialog.js b/apps/documenteditor/main/app/view/ControlSettingsDialog.js index 8717bdfe5..b8c0b4b02 100644 --- a/apps/documenteditor/main/app/view/ControlSettingsDialog.js +++ b/apps/documenteditor/main/app/view/ControlSettingsDialog.js @@ -139,7 +139,7 @@ define([ 'text!documenteditor/main/app/template/ControlSettingsDialog.template', colors: ['000000', '993300', '333300', '003300', '003366', '000080', '333399', '333333', '800000', 'FF6600', '808000', '00FF00', '008080', '0000FF', '666699', '808080', 'FF0000', 'FF9900', '99CC00', '339966', '33CCCC', '3366FF', '800080', '999999', 'FF00FF', 'FFCC00', 'FFFF00', '00FF00', '00FFFF', '00CCFF', - '993366', 'C0C0C0', 'FF99CC', 'FFCC99', 'FFFF99', 'CCFFCC', 'CCFFFF', '99CCFF', 'CC99FF', 'FFFFFF' + '993366', 'C0C0C0', 'FF99CC', 'FFCC99', 'FFFF99', 'CCFFCC', 'CCFFFF', 'C9C8FF', 'CC99FF', 'FFFFFF' ], paletteHeight: 94 }); diff --git a/apps/documenteditor/main/app/view/FormSettings.js b/apps/documenteditor/main/app/view/FormSettings.js index 5665a36ea..57d504f9b 100644 --- a/apps/documenteditor/main/app/view/FormSettings.js +++ b/apps/documenteditor/main/app/view/FormSettings.js @@ -809,7 +809,7 @@ define([ colors: ['000000', '993300', '333300', '003300', '003366', '000080', '333399', '333333', '800000', 'FF6600', '808000', '00FF00', '008080', '0000FF', '666699', '808080', 'FF0000', 'FF9900', '99CC00', '339966', '33CCCC', '3366FF', '800080', '999999', 'FF00FF', 'FFCC00', 'FFFF00', '00FF00', '00FFFF', '00CCFF', - '993366', 'C0C0C0', 'FF99CC', 'FFCC99', 'FFFF99', 'CCFFCC', 'CCFFFF', '99CCFF', 'CC99FF', 'FFFFFF' + '993366', 'C0C0C0', 'FF99CC', 'FFCC99', 'FFFF99', 'CCFFCC', 'CCFFFF', 'C9C8FF', 'CC99FF', 'FFFFFF' ], paletteHeight: 94 }); diff --git a/apps/documenteditor/main/app/view/LeftMenu.js b/apps/documenteditor/main/app/view/LeftMenu.js index d21790d10..5fa9eb4dc 100644 --- a/apps/documenteditor/main/app/view/LeftMenu.js +++ b/apps/documenteditor/main/app/view/LeftMenu.js @@ -408,7 +408,7 @@ define([ arr = (version || '').split('.'), ver = ''; (arr.length>0) && (ver += ('v. ' + arr[0])); - (arr.length>1) && (ver += ('.' + arr[0])); + (arr.length>1) && (ver += ('.' + arr[1])); this.betaHint = $('
' + (ver + ' (beta)' ) + '
').appendTo(this.$el); this.betaHeight = this.betaHint.outerHeight(); !this.devHintInited && $(window).on('resize', _.bind(this.onWindowResize, this)); diff --git a/apps/documenteditor/main/app/view/LineNumbersDialog.js b/apps/documenteditor/main/app/view/LineNumbersDialog.js index 39713eaf2..8c1b857a6 100644 --- a/apps/documenteditor/main/app/view/LineNumbersDialog.js +++ b/apps/documenteditor/main/app/view/LineNumbersDialog.js @@ -118,6 +118,7 @@ define([ width: 80, defaultUnit : 'cm', value: 'Auto', + autoText : this.txtAutoText, maxValue: 55.87, minValue: 0.1, allowAuto: true, @@ -253,6 +254,7 @@ define([ textApplyTo: 'Apply changes to', textDocument: 'Whole document', textSection: 'Current section', - textForward: 'This point forward' + textForward: 'This point forward', + txtAutoText: 'Auto' }, DE.Views.LineNumbersDialog || {})) }); \ No newline at end of file diff --git a/apps/documenteditor/main/app/view/SignatureSettings.js b/apps/documenteditor/main/app/view/SignatureSettings.js index 1a62fd30e..39b6124e5 100644 --- a/apps/documenteditor/main/app/view/SignatureSettings.js +++ b/apps/documenteditor/main/app/view/SignatureSettings.js @@ -256,6 +256,8 @@ define([ }, showSignatureMenu: function(record, showPoint) { + this.api.asc_gotoSignature(record.get('guid')); + var menu = this.signatureMenu, parent = $(this.el), menuContainer = parent.find('#menu-signature-container'); diff --git a/apps/documenteditor/main/app/view/TableOfContentsSettings.js b/apps/documenteditor/main/app/view/TableOfContentsSettings.js index 2d043de1e..1641780b6 100644 --- a/apps/documenteditor/main/app/view/TableOfContentsSettings.js +++ b/apps/documenteditor/main/app/view/TableOfContentsSettings.js @@ -224,7 +224,7 @@ define([ this.chLinks = new Common.UI.CheckBox({ el: $('#tableofcontents-chb-links'), - labelText: this.strLinks, + labelText: (this.type==1) ? this.strLinksOF : this.strLinks, value: 'checked' }); this.chLinks.on('change', _.bind(function(field, newValue, oldValue, eOpts){ @@ -376,7 +376,7 @@ define([ template: _.template(['
'].join('')), itemTemplate: _.template([ '
', - '
<%= name %>
', + '
<%= displayValue %>
', '
', '
', '
', @@ -519,6 +519,7 @@ define([ if (style.get_QFormat() || level>=0) { styles.push({ name: name, + displayValue: style.get_TranslatedName(), allowSelected: false, checked: false, value: '', @@ -553,6 +554,7 @@ define([ } else { styles.push({ name: style, + displayValue: style, allowSelected: false, checked: true, value: level, @@ -609,8 +611,8 @@ define([ } } styles.sort(function(a, b){ - var aname = a.name.toLocaleLowerCase(), - bname = b.name.toLocaleLowerCase(); + var aname = a.displayValue.toLocaleLowerCase(), + bname = b.displayValue.toLocaleLowerCase(); if (aname < bname) return -1; if (aname > bname) return 1; return 0; @@ -657,18 +659,25 @@ define([ arr = []; _.each(this.api.asc_getAllUsedParagraphStyles(), function (style, index) { - var name = style.get_Name(); arr.push({ - displayValue: name, + displayValue: style.get_TranslatedName(), + styleName: style.get_Name(), value: index }); }); + arr.sort(function(a, b){ + var aname = a.displayValue.toLocaleLowerCase(), + bname = b.displayValue.toLocaleLowerCase(); + if (aname < bname) return -1; + if (aname > bname) return 1; + return 0; + }); this.cmbTOFStyles.setData(arr); value = undefined; if (props) { var count = props.get_StylesCount(); if (count>0) { - var rec = this.cmbTOFStyles.store.findWhere({displayValue: props.get_StyleName(0)}); + var rec = this.cmbTOFStyles.store.findWhere({styleName: props.get_StyleName(0)}); rec && (value = rec.get('value')); } } @@ -759,7 +768,7 @@ define([ } else { props.put_Caption(null); var rec = this.cmbTOFStyles.getSelectedRecord(); - rec && props.add_Style(rec.displayValue); + rec && props.add_Style(rec.styleName); } } else { if (this._needUpdateOutlineLevels) { @@ -837,7 +846,7 @@ define([ var properties = (this._originalProps) ? this._originalProps : new Asc.CTableOfContentsPr(); properties.put_Caption(null); properties.clear_Styles(); - properties.add_Style(record.displayValue); + properties.add_Style(record.styleName); this.api.SetDrawImagePlaceTableOfFigures('tableofcontents-img', properties); this.scrollerY.update(); } @@ -896,7 +905,8 @@ define([ textTable: 'Table', txtDistinctive: 'Distinctive', txtCentered: 'Centered', - txtFormal: 'Formal' + txtFormal: 'Formal', + strLinksOF: 'Format table of figures as links' }, DE.Views.TableOfContentsSettings || {})) }); \ No newline at end of file diff --git a/apps/documenteditor/main/app/view/Toolbar.js b/apps/documenteditor/main/app/view/Toolbar.js index c9a908189..06544cbde 100644 --- a/apps/documenteditor/main/app/view/Toolbar.js +++ b/apps/documenteditor/main/app/view/Toolbar.js @@ -1694,13 +1694,28 @@ define([ // set menus var me = this; - + var levelTemplate = _.template(''); + var items = [], ids = []; + for (var i=0; i<9; i++) { + ids.push('id-toolbar-menu-markers-level-' + i); + items.push({template: levelTemplate, previewId: ids[i], level: i }); + } this.btnMarkers.setMenu( new Common.UI.Menu({ cls: 'shifted-left', style: 'min-width: 139px', items: [ {template: _.template('')}, + this.mnuMarkerChangeLevel = new Common.UI.MenuItem({ + caption: this.textChangeLevel, + style: 'padding-right:20px;', + menu: new Common.UI.Menu({ + cls: 'list-settings-level', + menuAlign: 'tl-tr', + items: items, + previewIds: ids + }) + }), this.mnuMarkerSettings = new Common.UI.MenuItem({ caption: this.textListSettings, disabled: (this.mnuMarkersPicker.conf.index || 0)==0, @@ -1710,11 +1725,26 @@ define([ }) ); + items = [], ids = []; + for (var i=0; i<9; i++) { + ids.push('id-toolbar-menu-numbering-level-' + i); + items.push({template: levelTemplate, previewId: ids[i], level: i }); + } this.btnNumbers.setMenu( new Common.UI.Menu({ cls: 'shifted-left', items: [ {template: _.template('')}, + this.mnuNumberChangeLevel = new Common.UI.MenuItem({ + caption: this.textChangeLevel, + style: 'padding-right:20px;', + menu: new Common.UI.Menu({ + cls: 'list-settings-level', + menuAlign: 'tl-tr', + items: items, + previewIds: ids + }) + }), this.mnuNumberSettings = new Common.UI.MenuItem({ caption: this.textListSettings, disabled: (this.mnuNumbersPicker.conf.index || 0)==0, @@ -1981,7 +2011,7 @@ define([ colors: ['000000', '993300', '333300', '003300', '003366', '000080', '333399', '333333', '800000', 'FF6600', '808000', '00FF00', '008080', '0000FF', '666699', '808080', 'FF0000', 'FF9900', '99CC00', '339966', '33CCCC', '3366FF', '800080', '999999', 'FF00FF', 'FFCC00', 'FFFF00', '00FF00', '00FFFF', '00CCFF', - '993366', 'C0C0C0', 'FF99CC', 'FFCC99', 'FFFF99', 'CCFFCC', 'CCFFFF', '99CCFF', 'CC99FF', 'FFFFFF' + '993366', 'C0C0C0', 'FF99CC', 'FFCC99', 'FFFF99', 'CCFFCC', 'CCFFFF', 'C9C8FF', 'CC99FF', 'FFFFFF' ] }); } @@ -2417,7 +2447,8 @@ define([ mniLowerCase: 'lowercase', mniUpperCase: 'UPPERCASE', mniCapitalizeWords: 'Capitalize Each Word', - mniToggleCase: 'tOGGLE cASE' + mniToggleCase: 'tOGGLE cASE', + textChangeLevel: 'Change List Level' } })(), DE.Views.Toolbar || {})); }); diff --git a/apps/documenteditor/main/index.html b/apps/documenteditor/main/index.html index 1c2ab5ebe..14003c631 100644 --- a/apps/documenteditor/main/index.html +++ b/apps/documenteditor/main/index.html @@ -10,6 +10,16 @@