diff --git a/apps/api/documents/index.html.desktop b/apps/api/documents/index.html.desktop index 8661e9b25..c2c60dfaa 100644 --- a/apps/api/documents/index.html.desktop +++ b/apps/api/documents/index.html.desktop @@ -109,6 +109,7 @@ }, mode : urlParams["mode"] || 'edit', lang : urlParams["lang"] || 'en', + createUrl : 'desktop://create.new', user: { id: urlParams["userid"] || urlParams["username"] || 'uid-901', name: urlParams["username"] || 'Chuk.Gek' } diff --git a/apps/common/forms/resources/img/icon-menu-sprite.svg b/apps/common/forms/resources/img/icon-menu-sprite.svg index 97b51fd3e..bcb884c10 100644 --- a/apps/common/forms/resources/img/icon-menu-sprite.svg +++ b/apps/common/forms/resources/img/icon-menu-sprite.svg @@ -1,4 +1,4 @@ - + @@ -148,5 +148,29 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/apps/common/forms/resources/less/common.less b/apps/common/forms/resources/less/common.less index 58b92d28a..b6f40bd3b 100644 --- a/apps/common/forms/resources/less/common.less +++ b/apps/common/forms/resources/less/common.less @@ -77,6 +77,7 @@ @import "../../../../common/main/resources/less/winxp_fix.less"; @import "../../../../common/main/resources/less/calendar.less"; @import "../../../../common/main/resources/less/spinner.less"; +@import "../../../../common/main/resources/less/checkbox.less"; @toolbarBorderColor: @border-toolbar-ie; @toolbarBorderColor: @border-toolbar; @@ -232,19 +233,23 @@ &.colored { padding: 0 16px; height: 28px; + background-color: @background-accent-button-ie; background-color: @background-accent-button; border: 1px solid transparent; border-radius: 3px; + color: @text-contrast-background-ie !important; color: @text-contrast-background !important; font-weight: 700; &:hover:not(.disabled), .over:not(.disabled) { + background-color: @highlight-accent-button-hover-ie !important; background-color: @highlight-accent-button-hover !important; } &:active:not(.disabled), &.active:not(.disabled) { + background-color: @highlight-accent-button-pressed-ie !important; background-color: @highlight-accent-button-pressed !important; } } @@ -431,7 +436,7 @@ .svg-icon { background: data-uri('../../../../common/forms/resources/img/icon-menu-sprite.svg') no-repeat; - background-size: @icon-width*19 @icon-height*2; + background-size: @icon-width*22 @icon-height*2; &.download { background-position: -@icon-width 0; @@ -495,6 +500,18 @@ background-position: -@icon-width*14 0; background-position: -@icon-width*14 @icon-normal-top; } + &.cut { + background-position: -@icon-width*19 0; + background-position: -@icon-width*19 @icon-normal-top; + } + &.copy { + background-position: -@icon-width*20 0; + background-position: -@icon-width*20 @icon-normal-top; + } + &.paste { + background-position: -@icon-width*21 0; + background-position: -@icon-width*21 @icon-normal-top; + } } .btn { diff --git a/apps/common/locale.js b/apps/common/locale.js index abed04e94..fd34378c4 100644 --- a/apps/common/locale.js +++ b/apps/common/locale.js @@ -98,8 +98,8 @@ Common.Locale = new(function() { return results == null ? "" : decodeURIComponent(results[1].replace(/\+/g, " ")); }; - var _requireLang = function () { - var lang = (_getUrlParameterByName('lang') || defLang).split(/[\-_]/)[0]; + var _requireLang = function (l) { + var lang = (l || _getUrlParameterByName('lang') || defLang).split(/[\-_]/)[0]; currentLang = lang; fetch('locale/' + lang + '.json') .then(function(response) { @@ -127,6 +127,12 @@ Common.Locale = new(function() { l10n = json || {}; apply && _applyLocalization(); }).catch(function(e) { + if ( !/loaded/.test(e) && currentLang != defLang && defLang && defLang.length < 3 ) { + return setTimeout(function(){ + _requireLang(defLang) + }, 0); + } + l10n = l10n || {}; apply && _applyLocalization(); if ( e.message == 'loaded' ) { diff --git a/apps/common/main/lib/component/ComboBoxFonts.js b/apps/common/main/lib/component/ComboBoxFonts.js index 958b4026e..319d15f89 100644 --- a/apps/common/main/lib/component/ComboBoxFonts.js +++ b/apps/common/main/lib/component/ComboBoxFonts.js @@ -182,6 +182,7 @@ define([ }, onInputKeyUp: function(e) { + if (!this._isKeyDown) return; if (e.keyCode != Common.UI.Keys.RETURN && e.keyCode !== Common.UI.Keys.SHIFT && e.keyCode !== Common.UI.Keys.CTRL && e.keyCode !== Common.UI.Keys.ALT && e.keyCode !== Common.UI.Keys.LEFT && e.keyCode !== Common.UI.Keys.RIGHT && @@ -213,9 +214,11 @@ define([ }, 10); } } + this._isKeyDown = false; }, onInputKeyDown: function(e) { + this._isKeyDown = true; this._inInputKeyDown = (new Date()); var me = this; diff --git a/apps/common/main/lib/component/MenuItem.js b/apps/common/main/lib/component/MenuItem.js index 0609242c9..96c76d36c 100644 --- a/apps/common/main/lib/component/MenuItem.js +++ b/apps/common/main/lib/component/MenuItem.js @@ -98,6 +98,7 @@ define([ checked : false, allowDepress: false, disabled : false, + visible : true, value : null, toggleGroup : null, iconCls : '', @@ -105,13 +106,14 @@ define([ canFocused : true, dataHint : '', dataHintDirection: '', - dataHintOffset: '' + dataHintOffset: '', + dataHintTitle: '' }, tagName : 'li', template: _.template([ - ' tabindex="-1" type="menuitem" <% }; if(!_.isUndefined(options.stopPropagation)) { %> data-stopPropagation="true" <% }; if(!_.isUndefined(options.dataHint)) { %> data-hint="<%= options.dataHint %>" <% }; if(!_.isUndefined(options.dataHintDirection)) { %> data-hint-direction="<%= options.dataHintDirection %>" <% }; if(!_.isUndefined(options.dataHintOffset)) { %> data-hint-offset="<%= options.dataHintOffset %>" <% }; %> >', + ' tabindex="-1" type="menuitem" <% }; if(!_.isUndefined(options.stopPropagation)) { %> data-stopPropagation="true" <% }; if(!_.isUndefined(options.dataHint)) { %> data-hint="<%= options.dataHint %>" <% }; if(!_.isUndefined(options.dataHintDirection)) { %> data-hint-direction="<%= options.dataHintDirection %>" <% }; if(!_.isUndefined(options.dataHintOffset)) { %> data-hint-offset="<%= options.dataHintOffset %>" <% }; if(options.dataHintTitle) { %> data-hint-title="<%= options.dataHintTitle %>" <% }; %> >', '<% if (!_.isEmpty(iconCls)) { %>', '', '<% } %>', @@ -133,6 +135,7 @@ define([ this.checked = me.options.checked; me.allowDepress = me.options.allowDepress; this.disabled = me.options.disabled; + this.visible = me.options.visible; this.value = me.options.value; this.toggleGroup = me.options.toggleGroup; this.template = me.options.template || this.template; @@ -228,6 +231,8 @@ define([ Common.UI.ToggleManager.register(me); } } + if (!this.visible) + this.setVisible(this.visible); me.cmpEl = el; me.rendered = true; diff --git a/apps/common/main/lib/component/Mixtbar.js b/apps/common/main/lib/component/Mixtbar.js index 68ff16136..3997a41c3 100644 --- a/apps/common/main/lib/component/Mixtbar.js +++ b/apps/common/main/lib/component/Mixtbar.js @@ -101,7 +101,7 @@ define([ '<% if (items[i].haspanel===false) print(" x-lone") %>' + '<% if (items[i].extcls) print(\' \' + items[i].extcls) %>"' + '<% if (typeof items[i].layoutname == "string") print(" data-layout-name=" + \' \' + items[i].layoutname) + \' \' %>>' + - '<%= items[i].caption %>' + + ' data-hint-title="<%= items[i].dataHintTitle %>" <% } %>><%= items[i].caption %>' + '' + '<% } %>' + '<% } %>' + @@ -317,7 +317,7 @@ define([ return config.tabs[index].action; } - var _tabTemplate = _.template(''); + var _tabTemplate = _.template(''); config.tabs[after + 1] = tab; var _after_action = _get_tab_action(after); diff --git a/apps/common/main/lib/controller/Comments.js b/apps/common/main/lib/controller/Comments.js index 953ab394a..3ce2ccf3f 100644 --- a/apps/common/main/lib/controller/Comments.js +++ b/apps/common/main/lib/controller/Comments.js @@ -194,6 +194,7 @@ define([ this.api.asc_registerCallback('asc_onUpdateCommentPosition', _.bind(this.onApiUpdateCommentPosition, this)); this.api.asc_registerCallback('asc_onDocumentPlaceChanged', _.bind(this.onDocumentPlaceChanged, this)); this.api.asc_registerCallback('asc_onDeleteComment', _.bind(this.onDeleteComment, this)); // only for PE, when del or ctrl+x pressed + this.api.asc_registerCallback('asc_onChangeCommentLogicalPosition', _.bind(this.onApiChangeCommentLogicalPosition, this)); // change comments position in document } }, @@ -215,7 +216,11 @@ define([ Common.localStorage.setItem(this.appPrefix + "comments-sort", type); Common.Utils.InternalSettings.set(this.appPrefix + "comments-sort", type); - if (type=='position') { + if (type=='position-asc' || type=='position-desc') { + var direction = (type=='position-asc') ? 1 : -1; + this.collection.comparator = function (collection) { + return direction * collection.get('position'); + }; } else if (type=='author-asc' || type=='author-desc') { var direction = (type=='author-asc') ? 1 : -1; this.collection.comparator = function(item1, item2) { @@ -727,7 +732,7 @@ define([ } else this.collection.push(comment); - this.updateComments(true); + this.updateComments(true, this.getComparator() === 'position-asc' || this.getComparator() === 'position-desc'); // don't sort by position if (this.showPopover) { if (null !== data.asc_getQuoteText()) { @@ -747,7 +752,7 @@ define([ comment.get('groupName') ? this.addCommentToGroupCollection(comment) : this.collection.push(comment); } - this.updateComments(true); + this.updateComments(true, this.getComparator() === 'position-asc' || this.getComparator() === 'position-desc'); }, onApiRemoveComment: function (id, silentUpdate) { for (var name in this.groupCollection) { @@ -1100,17 +1105,28 @@ define([ } }, + onApiChangeCommentLogicalPosition: function (comments) { + for (var uid in comments) { + if (comments.hasOwnProperty(uid)) { + var comment = this.findComment(uid) || this.findCommentInGroup(uid); + comment && comment.set('position', comments[uid]); + } + } + (this.getComparator() === 'position-asc' || this.getComparator() === 'position-desc') && this.updateComments(true); + }, + // internal updateComments: function (needRender, disableSort, loadText) { var me = this; me.updateCommentsTime = new Date(); + me.disableSort = !!disableSort; if (me.timerUpdateComments===undefined) me.timerUpdateComments = setInterval(function(){ if ((new Date()) - me.updateCommentsTime>100) { clearInterval(me.timerUpdateComments); me.timerUpdateComments = undefined; - me.updateCommentsView(needRender, disableSort, loadText); + me.updateCommentsView(needRender, me.disableSort, loadText); } }, 25); }, diff --git a/apps/common/main/lib/controller/Desktop.js b/apps/common/main/lib/controller/Desktop.js index 15367696b..5a4c6a9ef 100644 --- a/apps/common/main/lib/controller/Desktop.js +++ b/apps/common/main/lib/controller/Desktop.js @@ -251,6 +251,17 @@ define([ native.execCommand("uitheme:changed", JSON.stringify({name:name, type:theme.type})); } }); + + webapp.addListeners({ + 'FileMenu': { + 'item:click': function (menu, action, isopts) { + if ( action == 'app:exit' ) { + native.execCommand('editor:event', JSON.stringify({action: 'close'})); + menu.hide(); + } + }, + }, + }, {id: 'desktop'}); } }, process: function (opts) { @@ -278,7 +289,14 @@ define([ if ( config.isDesktopApp && !!native ) { native.execCommand('editor:event', JSON.stringify({action:'close', url: config.customization.goback.url})); } - } + }, + isActive: function () { + return !!native; + }, + isOffline: function () { + // return webapp.getController('Main').api.asc_isOffline(); + return webapp.getController('Main').appOptions.isOffline; + }, }; }; diff --git a/apps/common/main/lib/controller/HintManager.js b/apps/common/main/lib/controller/HintManager.js index 0ff9b77be..1d51f6bd2 100644 --- a/apps/common/main/lib/controller/HintManager.js +++ b/apps/common/main/lib/controller/HintManager.js @@ -114,7 +114,8 @@ Common.UI.HintManager = new(function() { _inputLetters = '', _isComplete = false, _isLockedKeyEvents = false, - _inputTimer; + _inputTimer, + _isDocReady = false; var _api; @@ -370,6 +371,7 @@ Common.UI.HintManager = new(function() { 'app:ready': function (mode) { var lang = mode.lang ? mode.lang.toLowerCase() : 'en'; _getAlphabetLetters(lang); + _isDocReady = true; }, 'hints:clear': _clearHints, 'window:resize': _clearHints @@ -453,13 +455,16 @@ Common.UI.HintManager = new(function() { _resetToDefault(); return; } - if (!curr.attr('content-target') || (curr.attr('content-target') && !$('#' + curr.attr('content-target')).is(':visible'))) { // need to open panel + var needOpenPanel = (curr.attr('content-target') && !$('#' + curr.attr('content-target')).is(':visible')); + if (!curr.attr('content-target') || needOpenPanel) { // need to open panel if (!($('#file-menu-panel').is(':visible') && (curr.parent().prop('id') === 'fm-btn-info' && $('#panel-info').is(':visible') || curr.parent().prop('id') === 'fm-btn-settings' && $('#panel-settings').is(':visible')))) { if (curr.attr('for')) { // to trigger event in checkbox $('#' + curr.attr('for')).trigger(jQuery.Event('click', {which: 1})); } else { curr.trigger(jQuery.Event('click', {which: 1})); + if (needOpenPanel) + _isComplete = false; // to show next level of hints } } } @@ -490,12 +495,13 @@ Common.UI.HintManager = new(function() { } } - _needShow = (e.keyCode == Common.UI.Keys.ALT && !Common.Utils.ModalWindow.isVisible()); + _needShow = (e.keyCode == Common.UI.Keys.ALT && !Common.Utils.ModalWindow.isVisible() && _isDocReady); }); }; var _getAlphabetLetters = function (lng) { Common.Utils.loadConfig('../../common/main/resources/alphabetletters/alphabetletters.json', function (langsJson) { + _arrEnAlphabet = langsJson['en']; var _setAlphabet = function (lang) { _lang = lang; _arrAlphabet = langsJson[lang]; diff --git a/apps/common/main/lib/controller/Plugins.js b/apps/common/main/lib/controller/Plugins.js index d53ad2b73..ae74097bc 100644 --- a/apps/common/main/lib/controller/Plugins.js +++ b/apps/common/main/lib/controller/Plugins.js @@ -63,7 +63,7 @@ define([ var appOptions = me.getApplication().getController('Main').appOptions; if ( !appOptions.isEditMailMerge && !appOptions.isEditDiagram ) { - var tab = {action: 'plugins', caption: me.panelPlugins.groupCaption, layoutname: 'toolbar-plugins'}; + var tab = {action: 'plugins', caption: me.panelPlugins.groupCaption, dataHintTitle: 'E', layoutname: 'toolbar-plugins'}; me.$toolbarPanelPlugins = me.panelPlugins.getPanel(); toolbar.addTab(tab, me.$toolbarPanelPlugins, 10); // TODO: clear plugins list in left panel diff --git a/apps/common/main/lib/controller/Themes.js b/apps/common/main/lib/controller/Themes.js index a1b638f30..39f2b5a74 100644 --- a/apps/common/main/lib/controller/Themes.js +++ b/apps/common/main/lib/controller/Themes.js @@ -51,6 +51,8 @@ define([ "background-notification-badge", "background-scrim", "background-loader", + "background-accent-button", + "background-contrast-popover", "highlight-button-hover", "highlight-button-pressed", @@ -60,6 +62,8 @@ define([ "highlight-header-button-pressed", "highlight-toolbar-tab-underline", "highlight-text-select", + "highlight-accent-button-hover", + "highlight-accent-button-pressed", "border-toolbar", "border-divider", @@ -70,6 +74,7 @@ define([ "border-control-focus", "border-color-shading", "border-error", + "border-contrast-popover", "text-normal", "text-normal-pressed", @@ -222,7 +227,8 @@ define([ } var on_document_ready = function (el) { - get_themes_config('../../common/main/resources/themes/themes.json'); + // get_themes_config('../../common/main/resources/themes/themes.json'); + get_themes_config('../../../../themes.json'); } var get_ui_theme_name = function (objtheme) { diff --git a/apps/common/main/lib/model/Comment.js b/apps/common/main/lib/model/Comment.js index 1192e2bce..fbe266474 100644 --- a/apps/common/main/lib/model/Comment.js +++ b/apps/common/main/lib/model/Comment.js @@ -66,6 +66,7 @@ define([ lockuserid : '', unattached : false, userdata : '', + position : -1, id : Common.UI.getId(), // internal time : 0, diff --git a/apps/common/main/lib/util/htmlutils.js b/apps/common/main/lib/util/htmlutils.js index b7b9b730a..28ba18fc7 100644 --- a/apps/common/main/lib/util/htmlutils.js +++ b/apps/common/main/lib/util/htmlutils.js @@ -64,6 +64,7 @@ if ( window.desktop && !!window.RendererProcessVariable ) { if ( theme.id ) { // params.uitheme = undefined; localStorage.setItem("ui-theme-id", theme.id); + localStorage.removeItem("ui-theme"); } } } @@ -90,3 +91,13 @@ if ( !ui_theme_name ) { if ( !!ui_theme_name ) { document.body.classList.add(ui_theme_name); } + +if ( checkLocalStorage ) { + var content_theme = localStorage.getItem("content-theme"); + if ( content_theme == 'dark' ) { + var current_theme = localStorage.getItem("ui-theme"); + if ( !!current_theme && /type":\s*"dark/.test(current_theme) ) { + document.body.classList.add("content-theme-dark"); + } + } +} diff --git a/apps/common/main/lib/view/Comments.js b/apps/common/main/lib/view/Comments.js index 447514a32..99f8dd3f7 100644 --- a/apps/common/main/lib/view/Comments.js +++ b/apps/common/main/lib/view/Comments.js @@ -361,21 +361,23 @@ define([ checkable: true, checked: Common.localStorage.getItem(this.appPrefix + "comments-sort") === 'author-desc', toggleGroup: 'sortcomments' + }, + { + caption: this.mniPositionAsc, + value: 'position-asc', + checkable: true, + visible: this.appPrefix==='de-', + checked: Common.localStorage.getItem(this.appPrefix + "comments-sort") === 'position-asc', + toggleGroup: 'sortcomments' + }, + { + caption: this.mniPositionDesc, + value: 'position-desc', + checkable: true, + visible: this.appPrefix==='de-', + checked: Common.localStorage.getItem(this.appPrefix + "comments-sort") === 'position-desc', + toggleGroup: 'sortcomments' } - // { - // caption: this.mniPositionAsc, - // value: 'position-asc', - // checkable: true, - // checked: Common.localStorage.getItem(this.appPrefix + "comments-sort") === 'position-asc', - // toggleGroup: 'sortcomments' - // } - // { - // caption: this.mniPositionDesc, - // value: 'position-desc', - // checkable: true, - // checked: Common.localStorage.getItem(this.appPrefix + "comments-sort") === 'position-desc', - // toggleGroup: 'sortcomments' - // } ] }) }); diff --git a/apps/common/main/lib/view/CopyWarningDialog.js b/apps/common/main/lib/view/CopyWarningDialog.js index ead1126b3..a53ca2cb4 100644 --- a/apps/common/main/lib/view/CopyWarningDialog.js +++ b/apps/common/main/lib/view/CopyWarningDialog.js @@ -126,7 +126,7 @@ define([ }, textTitle : 'Copy, Cut and Paste Actions', - textMsg : 'Copy, cut and paste actions using the editor toolbar buttons and context menu actions will be performed within this editor tab only.

.To copy or paste to or from applications outside the editor tab use the following keyboard combinations:', + textMsg : 'Copy, cut and paste actions using the editor toolbar buttons and context menu actions will be performed within this editor tab only.

To copy or paste to or from applications outside the editor tab use the following keyboard combinations:', textToCopy : 'for Copy', textToPaste : 'for Paste', textToCut: 'for Cut', diff --git a/apps/common/main/lib/view/Header.js b/apps/common/main/lib/view/Header.js index bcacd43bc..79df1ab09 100644 --- a/apps/common/main/lib/view/Header.js +++ b/apps/common/main/lib/view/Header.js @@ -470,14 +470,15 @@ define([ getPanel: function (role, config) { var me = this; - function createTitleButton(iconid, slot, disabled, hintDirection, hintOffset) { + function createTitleButton(iconid, slot, disabled, hintDirection, hintOffset, hintTitle) { return (new Common.UI.Button({ cls: 'btn-header', iconCls: iconid, disabled: disabled === true, dataHint:'0', - dataHintDirection: hintDirection ? hintDirection : 'left', - dataHintOffset: hintOffset ? hintOffset : '10, 10' + dataHintDirection: hintDirection ? hintDirection : (config.isDesktopApp ? 'right' : 'left'), + dataHintOffset: hintOffset ? hintOffset : (config.isDesktopApp ? '10, -10' : '10, 10'), + dataHintTitle: hintTitle })).render(slot); } @@ -532,7 +533,7 @@ define([ this.btnDownload = createTitleButton('toolbar__icon icon--inverse btn-download', $html.findById('#slot-hbtn-download'), undefined, 'bottom', 'big'); if ( config.canPrint ) - this.btnPrint = createTitleButton('toolbar__icon icon--inverse btn-print', $html.findById('#slot-hbtn-print'), undefined, 'bottom', 'big'); + this.btnPrint = createTitleButton('toolbar__icon icon--inverse btn-print', $html.findById('#slot-hbtn-print'), undefined, 'bottom', 'big', 'P'); if ( config.canEdit && config.canRequestEditRights ) this.btnEdit = createTitleButton('toolbar__icon icon--inverse btn-edit', $html.findById('#slot-hbtn-edit'), undefined, 'bottom', 'big'); @@ -541,7 +542,7 @@ define([ if (!config.isEdit || config.customization && !!config.customization.compactHeader) { if (config.user.guest && config.canRenameAnonymous) - me.btnUserName = createTitleButton('toolbar__icon icon--inverse btn-user', $html.findById('#slot-btn-user-name'), undefined, 'bottom', 'big'); + me.btnUserName = createTitleButton('toolbar__icon icon--inverse btn-user', $html.findById('#slot-btn-user-name'), undefined, 'bottom', 'big' ); else { me.elUserName = $html.find('.btn-current-user'); me.elUserName.removeClass('hidden'); @@ -567,12 +568,12 @@ define([ me.setUserName(me.options.userName); if ( config.canPrint && config.isEdit ) { - me.btnPrint = createTitleButton('toolbar__icon icon--inverse btn-print', $html.findById('#slot-btn-dt-print'), true); + me.btnPrint = createTitleButton('toolbar__icon icon--inverse btn-print', $html.findById('#slot-btn-dt-print'), true, undefined, undefined, 'P'); } - me.btnSave = createTitleButton('toolbar__icon icon--inverse btn-save', $html.findById('#slot-btn-dt-save'), true); - me.btnUndo = createTitleButton('toolbar__icon icon--inverse btn-undo', $html.findById('#slot-btn-dt-undo'), true); - me.btnRedo = createTitleButton('toolbar__icon icon--inverse btn-redo', $html.findById('#slot-btn-dt-redo'), true); + me.btnSave = createTitleButton('toolbar__icon icon--inverse btn-save', $html.findById('#slot-btn-dt-save'), true, undefined, undefined, 'S'); + me.btnUndo = createTitleButton('toolbar__icon icon--inverse btn-undo', $html.findById('#slot-btn-dt-undo'), true, undefined, undefined, 'Z'); + me.btnRedo = createTitleButton('toolbar__icon icon--inverse btn-redo', $html.findById('#slot-btn-dt-redo'), true, undefined, undefined, 'Y'); if ( me.btnSave.$icon.is('svg') ) { me.btnSave.$icon.addClass('icon-save btn-save'); diff --git a/apps/common/main/lib/view/History.js b/apps/common/main/lib/view/History.js index 28f75ff4d..a8d0b5130 100644 --- a/apps/common/main/lib/view/History.js +++ b/apps/common/main/lib/view/History.js @@ -86,7 +86,7 @@ define([ '
' + this.textVer + '<%=version%>
', '<% } %>', '<% if (isRevision && hasChanges) { %>', - '
', + '
', '<% } %>', '
', '
', diff --git a/apps/common/main/resources/img/doc-formats/docxf.svg b/apps/common/main/resources/img/doc-formats/docxf.svg index e14823dae..248d8df47 100644 --- a/apps/common/main/resources/img/doc-formats/docxf.svg +++ b/apps/common/main/resources/img/doc-formats/docxf.svg @@ -1,16 +1,17 @@ - - - - - - - - - - + + + + + + + + + + + diff --git a/apps/common/main/resources/less/colors-table-classic.less b/apps/common/main/resources/less/colors-table-classic.less index bde3c12e6..20d3ec121 100644 --- a/apps/common/main/resources/less/colors-table-classic.less +++ b/apps/common/main/resources/less/colors-table-classic.less @@ -34,6 +34,7 @@ --border-control-focus: #848484; --border-color-shading: fade(#000, 20%); --border-error: #d9534f; + --border-contrast-popover: #444444; --text-normal: #444; --text-normal-pressed: #fff; diff --git a/apps/common/main/resources/less/colors-table-dark.less b/apps/common/main/resources/less/colors-table-dark.less index 5221a62b9..e42d28150 100644 --- a/apps/common/main/resources/less/colors-table-dark.less +++ b/apps/common/main/resources/less/colors-table-dark.less @@ -35,6 +35,7 @@ --border-control-focus: #ccc; --border-color-shading: fade(#fff, 10%); --border-error: #f62211; + --border-contrast-popover: #666; --text-normal: fade(#fff, 80%); --text-normal-pressed: fade(#fff, 80%); diff --git a/apps/common/main/resources/less/colors-table-ie-fix.less b/apps/common/main/resources/less/colors-table-ie-fix.less index 1ff99159a..f9917964e 100644 --- a/apps/common/main/resources/less/colors-table-ie-fix.less +++ b/apps/common/main/resources/less/colors-table-ie-fix.less @@ -13,6 +13,8 @@ @background-scrim-ie: fade(#000, 20%); @background-loader-ie: fade(#000, 65%); @background-alt-key-hint-ie: #FFD938; +@background-accent-button-ie: #446995; +@background-contrast-popover-ie: #444444; @highlight-button-hover-ie: #d8dadc; @highlight-button-pressed-ie: #7d858c; @@ -22,6 +24,8 @@ @highlight-header-button-pressed-ie: fade(#000, 20%); @highlight-toolbar-tab-underline-ie: #444; @highlight-text-select-ie: #3494fb; +@highlight-accent-button-hover-ie: #375478; +@highlight-accent-button-pressed-ie: #293F59; @border-toolbar-ie: #cbcbcb; @border-divider-ie: #cbcbcb; @@ -32,6 +36,7 @@ @border-control-focus-ie: #848484; @border-color-shading-ie: fade(#000, 20%); @border-error-ie: #d9534f; +@border-contrast-popover-ie: #444444; @text-normal-ie: #444; @text-normal-pressed-ie: #fff; diff --git a/apps/common/main/resources/less/colors-table.less b/apps/common/main/resources/less/colors-table.less index c4f62364c..2e159caf3 100644 --- a/apps/common/main/resources/less/colors-table.less +++ b/apps/common/main/resources/less/colors-table.less @@ -48,6 +48,7 @@ --border-control-focus: #848484; --border-color-shading: fade(#000, 15%); --border-error: #f62211; + --border-contrast-popover: #444444; --text-normal: fade(#000, 80%); --text-normal-pressed: fade(#000, 80%); @@ -185,6 +186,7 @@ @border-control-focus: var(--border-control-focus); @border-color-shading: var(--border-color-shading); @border-error: var(--border-error); +@border-contrast-popover: var(--border-contrast-popover); // Text // ------------------------- diff --git a/apps/common/main/resources/less/combo-dataview.less b/apps/common/main/resources/less/combo-dataview.less index 6a88348c8..0acc32dad 100644 --- a/apps/common/main/resources/less/combo-dataview.less +++ b/apps/common/main/resources/less/combo-dataview.less @@ -82,8 +82,10 @@ .combo-styles { @combo-dataview-button-width: 30px; @combo-dataview-height: 46px; + @combo-dataview-height-calc: calc(40px + 2 * @scaled-two-px-value + 2 * @scaled-one-px-value); height: @combo-dataview-height; + height: @combo-dataview-height-calc; .view { margin-right: -@combo-dataview-button-width; @@ -93,7 +95,8 @@ .dataview { @minus-px: calc(-1px / @pixel-ratio-factor); - height: 46px; + height: @combo-dataview-height; + height: @combo-dataview-height-calc; padding: 0; margin: -1 0 0 -1; margin: @minus-px 0 0 @minus-px; @@ -112,6 +115,7 @@ margin: 0 @minus-px-ie @minus-px-ie 0; margin: 0 @minus-px @minus-px 0; height: @combo-dataview-height; + height: @combo-dataview-height-calc; background-color: @background-normal-ie; background-color: @background-normal; display: flex; @@ -147,6 +151,7 @@ .dataview { margin-top: -1px; + margin-top: calc(-1 * @scaled-one-px-value); } } @@ -167,6 +172,7 @@ .button { width: @combo-dataview-button-width; height: @combo-dataview-height; + height: @combo-dataview-height-calc; .btn-group, button { width: 100%; diff --git a/apps/common/main/resources/less/history.less b/apps/common/main/resources/less/history.less index 4c44e95b3..0976d636f 100644 --- a/apps/common/main/resources/less/history.less +++ b/apps/common/main/resources/less/history.less @@ -84,7 +84,8 @@ } .revision-expand { - background-position: -70px -145px; + border-color: @icon-normal-pressed-ie; + border-color: @icon-normal-pressed; } } } @@ -143,16 +144,22 @@ } .revision-expand { - width: 23px; - height: 23px; - background-position: -43px -145px; - margin: 10px 10px; + width: 8px; + height: 8px; + border: solid 2px @icon-normal-ie; + border: solid 2px @icon-normal; + border-bottom: none; + border-right: none; + background-image: none; display: inline-block; position: absolute; - right: 0; + right: 2px; + margin: 15px; + //transition: transform 0.2s ease; + transform: rotate(-135deg) ; &.up { - transform: rotate(180deg); + transform: rotate(45deg); } } diff --git a/apps/common/main/resources/less/synchronize-tip.less b/apps/common/main/resources/less/synchronize-tip.less index 76b25504c..31d26e68c 100644 --- a/apps/common/main/resources/less/synchronize-tip.less +++ b/apps/common/main/resources/less/synchronize-tip.less @@ -40,6 +40,8 @@ background-color: @header-background-color; color: @text-toolbar-header-ie; color: @text-toolbar-header; + border-color: @header-background-color-ie; + border-color: @header-background-color; .close { &:before, &:after { @@ -49,9 +51,15 @@ } } - .tip-arrow:after { + .tip-arrow:before { background-color: @header-background-color-ie; background-color: @header-background-color; + border-color: @header-background-color-ie !important; + border-color: @header-background-color !important; + } + .tip-arrow:after { + border-color: @header-background-color-ie !important; + border-color: @header-background-color !important; } } @@ -59,11 +67,19 @@ .asc-synchronizetip { background-color: @background-toolbar-ie; background-color: @background-toolbar; + border-color: @background-toolbar-ie; + border-color: @background-toolbar; } - .tip-arrow:after { + .tip-arrow:before { background-color: @background-toolbar-ie; background-color: @background-toolbar; + border-color: @background-toolbar-ie !important; + border-color: @background-toolbar !important; + } + .tip-arrow:after { + border-color: @background-toolbar-ie !important; + border-color: @background-toolbar !important; } } @@ -75,17 +91,29 @@ } .asc-synchronizetip { + background-color: @background-contrast-popover-ie; background-color: @background-contrast-popover; + color: @text-contrast-background-ie; color: @text-contrast-background; + border-color: @border-contrast-popover-ie; + border-color: @border-contrast-popover; .close { &:before, &:after { + background-color: @text-contrast-background-ie; background-color: @text-contrast-background; } } } - .tip-arrow:after { + .tip-arrow:before { + background-color: @background-contrast-popover-ie; background-color: @background-contrast-popover; + border-color: @border-contrast-popover-ie !important; + border-color: @border-contrast-popover !important; + } + .tip-arrow:after { + border-color: @border-contrast-popover-ie !important; + border-color: @border-contrast-popover !important; } .btn-div { @@ -95,6 +123,15 @@ border-radius: 2px; padding: 3px 12px; margin-top: 10px; + &:hover { + background-color: @highlight-header-button-hover-ie; + background-color: @highlight-header-button-hover; + } + + &:active { + background-color: @highlight-header-button-pressed-ie; + background-color: @highlight-header-button-pressed; + } } .show-link label { @@ -156,14 +193,14 @@ &.right { .tip-arrow { - left: -13px; + left: -12px; top: 50%; margin-top: -7px; width: 16px; height: 15px; .box-shadow(0 0 8px -5px rgba(0, 0, 0, 0.2)); - &:after { + &:before { top: 0; left: 8px; width: 16px; @@ -177,10 +214,10 @@ top: 50%; margin-top: -7px; width: 16px; - height: 15px; + height: 16px; .box-shadow(0 0 8px -5px rgba(0, 0, 0, 0.2)); - &:after { + &:before { top: 0; left: -8px; width: 16px; @@ -197,7 +234,7 @@ height: 16px; .box-shadow(0 0 8px -5px rgba(0, 0, 0, 0.2)); - &:after { + &:before { top: -6px; left: 0; width: 16px; @@ -207,13 +244,13 @@ &.bottom { .tip-arrow { left: 50%; - top: -12px; + top: -11px; margin-left: -7px; - width: 16px; + width: 15px; height: 15px; .box-shadow(0 0 8px -5px rgba(0, 0, 0, 0.2)); - &:after { + &:before { top: 7px; left: 0; width: 16px; @@ -229,11 +266,17 @@ height: 15px; .box-shadow(0 -5px 8px -5px rgba(0, 0, 0, 0.2)); - &:after { + &:before { top: -7px; left: 7px; width: 16px; } + &:after { + top: 0px; + left: 4px; + border-top: @scaled-one-px-value-ie solid @background-notification-popover-ie; + border-top: @scaled-one-px-value solid @background-notification-popover; + } } } @@ -245,106 +288,148 @@ height: 15px; .box-shadow(0 -5px 8px -5px rgba(0, 0, 0, 0.2)); - &:after { + &:before { top: -7px; left: -7px; } + &:after { + top: 0px; + left: -4px; + border-top: @scaled-one-px-value-ie solid @background-notification-popover-ie; + border-top: @scaled-one-px-value solid @background-notification-popover; + } } } &.top-left { .tip-arrow { right: 0; - bottom: -15px; + bottom: -14px; width: 15px; height: 15px; .box-shadow(5px 0 8px -5px rgba(0, 0, 0, 0.2)); - &:after { + &:before { top: -8px; left: 8px; } + &:after { + top: -6px; + left: 0px; + border-right: @scaled-one-px-value-ie solid @background-notification-popover-ie; + border-right: @scaled-one-px-value solid @background-notification-popover; + } } } &.top-right { .tip-arrow { left: 0; - bottom: -15px; + bottom: -14px; width: 15px; height: 15px; .box-shadow(-5px 0 8px -5px rgba(0, 0, 0, 0.2)); - &:after { + &:before { top: -8px; left: -8px; .box-shadow(2px 2px 8px -1px rgba(0, 0, 0, 0.2)); } + &:after { + top: -6px; + left: 0px; + border-left: @scaled-one-px-value-ie solid @background-notification-popover-ie; + border-left: @scaled-one-px-value solid @background-notification-popover; + } } } &.bottom-left { .tip-arrow { right: 0; - top: -15px; + top: -14px; width: 15px; height: 15px; .box-shadow(8px 5px 8px -5px rgba(0, 0, 0, 0.2)); - &:after { + &:before { top: 8px; left: 8px; .box-shadow(0 0 8px -1px rgba(0, 0, 0, 0.2)); } + &:after { + top: 6px; + left: 0px; + border-right: @scaled-one-px-value-ie solid @background-notification-popover-ie; + border-right: @scaled-one-px-value solid @background-notification-popover; + } } } &.bottom-right { .tip-arrow { left: 0; - top: -15px; + top: -14px; width: 15px; height: 15px; .box-shadow(-8px 0 8px -5px rgba(0, 0, 0, 0.2)); - &:after { + &:before { top: 8px; left: -8px; .box-shadow(0 0 8px -1px rgba(0, 0, 0, 0.2)); } + &:after { + top: 6px; + left: 0px; + border-left: @scaled-one-px-value-ie solid @background-notification-popover-ie; + border-left: @scaled-one-px-value solid @background-notification-popover; + } } } &.right-top { .tip-arrow { - left: -15px; + left: -14px; bottom: 0; width: 15px; height: 15px; .box-shadow(0 5px 8px -5px rgba(0, 0, 0, 0.2)); - &:after { + &:before { top: 7px; left: 7px; width: 16px; } + &:after { + top: 0px; + left: 4px; + border-bottom: @scaled-one-px-value-ie solid @background-notification-popover-ie; + border-bottom: @scaled-one-px-value solid @background-notification-popover; + } } } &.left-top { .tip-arrow { - right: -15px; + right: -14px; bottom: 0; width: 15px; height: 13px; .box-shadow(-5px 8px 8px -5px rgba(0, 0, 0, 0.2)); - &:after { + &:before { bottom: -7px; left: -7px; //width: 15px; .box-shadow(0 0 8px -1px rgba(0, 0, 0, 0.2)); } + &:after { + top: -2px; + left: -4px; + border-bottom: @scaled-one-px-value-ie solid @background-notification-popover-ie; + border-bottom: @scaled-one-px-value solid @background-notification-popover; + } } } } @@ -356,6 +441,9 @@ background-color: @background-notification-popover; overflow: visible; + border: @scaled-one-px-value-ie solid @background-notification-popover-ie; + border: @scaled-one-px-value solid @background-notification-popover; + .bottom-right &, .right-bottom & { border-top-left-radius: 0; @@ -380,7 +468,7 @@ font-size: 11px; } -.asc-synchronizetip .tip-arrow:after { +.asc-synchronizetip .tip-arrow:before { content: ''; position: absolute; top: 5px; @@ -397,6 +485,15 @@ transform: rotate(45deg); .box-shadow(0 4px 8px -1px rgba(0, 0, 0, 0.2)); + border: @scaled-one-px-value-ie solid @background-notification-popover-ie; + border: @scaled-one-px-value solid @background-notification-popover; +} +.asc-synchronizetip .tip-arrow:after { + content: ''; + position: absolute; + background-color: transparent; + width: 15px; + height: 15px; } .asc-synchronizetip .show-link { diff --git a/apps/common/mobile/lib/view/ContextMenu.jsx b/apps/common/mobile/lib/view/ContextMenu.jsx index 264565226..50e5fc1a2 100644 --- a/apps/common/mobile/lib/view/ContextMenu.jsx +++ b/apps/common/mobile/lib/view/ContextMenu.jsx @@ -26,7 +26,7 @@ class ContextMenuView extends Component { onPopoverClosed={e => this.props.onMenuClosed()} > - {buttons.map((b, index) => + {buttons.length && buttons.map((b, index) => !b.icon ? this.props.onMenuItemClick(b.event)} /> : this.props.onMenuItemClick(b.event)}> diff --git a/apps/common/mobile/lib/view/collaboration/Review.jsx b/apps/common/mobile/lib/view/collaboration/Review.jsx index 06390f556..7e5bbdd69 100644 --- a/apps/common/mobile/lib/view/collaboration/Review.jsx +++ b/apps/common/mobile/lib/view/collaboration/Review.jsx @@ -26,11 +26,7 @@ const PageReview = props => { {canReview && - { - props.onTrackChanges(!prev); - } - }/> + props.onTrackChanges(!props.trackChanges)}/> } {!props.isRestrictedEdit && diff --git a/apps/documenteditor/embed/js/ApplicationController.js b/apps/documenteditor/embed/js/ApplicationController.js index 9f8ff942b..494d23651 100644 --- a/apps/documenteditor/embed/js/ApplicationController.js +++ b/apps/documenteditor/embed/js/ApplicationController.js @@ -733,6 +733,10 @@ DE.ApplicationController = new(function(){ message = me.errorLoadingFont; break; + case Asc.c_oAscError.ID.KeyExpire: + message = me.errorTokenExpire; + break; + default: message = me.errorDefaultMessage.replace('%1', id); break; @@ -937,6 +941,7 @@ DE.ApplicationController = new(function(){ errorForceSave: "An error occurred while saving the file. Please use the 'Download as' option to save the file to your computer hard drive or try again later.", txtEmpty: '(Empty)', txtPressLink: 'Press Ctrl and click link', - errorLoadingFont: 'Fonts are not loaded.
Please contact your Document Server administrator.' + errorLoadingFont: 'Fonts are not loaded.
Please contact your Document Server administrator.', + errorTokenExpire: 'The document security token has expired.
Please contact your Document Server administrator.' } })(); \ No newline at end of file diff --git a/apps/documenteditor/embed/locale/en.json b/apps/documenteditor/embed/locale/en.json index 87c407871..7053ca231 100644 --- a/apps/documenteditor/embed/locale/en.json +++ b/apps/documenteditor/embed/locale/en.json @@ -17,6 +17,7 @@ "DE.ApplicationController.errorForceSave": "An error occurred while saving the file. Please use the 'Download as' option to save the file to your computer hard drive or try again later.", "DE.ApplicationController.errorLoadingFont": "Fonts are not loaded.
Please contact your Document Server administrator.", "DE.ApplicationController.errorSubmit": "Submit failed.", + "DE.ApplicationController.errorTokenExpire": "The document security token has expired.
Please contact your Document Server administrator.", "DE.ApplicationController.errorUpdateVersionOnDisconnect": "Internet connection has been restored, and the file version has been changed.
Before you can continue working, you need to download the file or copy its content to make sure nothing is lost, and then reload this page.", "DE.ApplicationController.errorUserDrop": "The file cannot be accessed right now.", "DE.ApplicationController.notcriticalErrorTitle": "Warning", diff --git a/apps/documenteditor/embed/locale/fr.json b/apps/documenteditor/embed/locale/fr.json index c824ad31f..1adbdc714 100644 --- a/apps/documenteditor/embed/locale/fr.json +++ b/apps/documenteditor/embed/locale/fr.json @@ -17,6 +17,7 @@ "DE.ApplicationController.errorForceSave": "Une erreur est survenue lors de l'enregistrement du fichier. Veuillez utiliser l'option «Télécharger en tant que» pour enregistrer le fichier sur le disque dur de votre ordinateur ou réessayer plus tard.", "DE.ApplicationController.errorLoadingFont": "Les polices ne sont pas téléchargées.
Veuillez contacter l'administrateur de Document Server.", "DE.ApplicationController.errorSubmit": "Échec de soumission", + "DE.ApplicationController.errorTokenExpire": "Le jeton de sécurité du document a expiré.
Veuillez contactez l'administrateur de Document Server.", "DE.ApplicationController.errorUpdateVersionOnDisconnect": "La connexion internet a été rétablie, la version du fichier est modifiée.
Avant de continuer, téléchargez le fichier ou copiez le contenu pour vous assurer que tous les changements ont été enregistrés, et rechargez la page.", "DE.ApplicationController.errorUserDrop": "Impossible d'accéder au fichier.", "DE.ApplicationController.notcriticalErrorTitle": "Avertissement", diff --git a/apps/documenteditor/embed/locale/ro.json b/apps/documenteditor/embed/locale/ro.json index 24e4eccff..512dbd74b 100644 --- a/apps/documenteditor/embed/locale/ro.json +++ b/apps/documenteditor/embed/locale/ro.json @@ -17,6 +17,7 @@ "DE.ApplicationController.errorForceSave": "S-a produs o eroare în timpul salvării fișierului. Pentru copierea de rezervă pe PC utilizați opțiunea Descărcare ca... sau încercați din nou mai târziu.", "DE.ApplicationController.errorLoadingFont": "Fonturile nu sunt încărcate.
Contactați administratorul dvs de Server Documente.", "DE.ApplicationController.errorSubmit": "Remiterea eșuată.", + "DE.ApplicationController.errorTokenExpire": "Token de securitate din document a expirat.
Contactați administratorul dvs. de Server Documente.", "DE.ApplicationController.errorUpdateVersionOnDisconnect": "Conexiunea la Internet s-a restabilit și versiunea fișierului s-a schimbat.
Înainte de a continua, fișierul trebuie descărcat sau conținutul fișierului copiat ca să vă asigurați că nimic nu e pierdut, apoi reîmprospătați această pagină.", "DE.ApplicationController.errorUserDrop": "Fișierul nu poate fi accesat deocamdată.", "DE.ApplicationController.notcriticalErrorTitle": "Avertisment", diff --git a/apps/documenteditor/embed/locale/ru.json b/apps/documenteditor/embed/locale/ru.json index daab5337f..1973d2a91 100644 --- a/apps/documenteditor/embed/locale/ru.json +++ b/apps/documenteditor/embed/locale/ru.json @@ -17,6 +17,7 @@ "DE.ApplicationController.errorForceSave": "При сохранении файла произошла ошибка. Используйте опцию 'Скачать как', чтобы сохранить файл на жестком диске компьютера или повторите попытку позже.", "DE.ApplicationController.errorLoadingFont": "Шрифты не загружены.
Пожалуйста, обратитесь к администратору Сервера документов.", "DE.ApplicationController.errorSubmit": "Не удалось отправить.", + "DE.ApplicationController.errorTokenExpire": "Истек срок действия токена безопасности документа.
Пожалуйста, обратитесь к администратору Сервера документов.", "DE.ApplicationController.errorUpdateVersionOnDisconnect": "Подключение к Интернету было восстановлено, и версия файла изменилась.
Прежде чем продолжить работу, надо скачать файл или скопировать его содержимое, чтобы обеспечить сохранность данных, а затем перезагрузить страницу.", "DE.ApplicationController.errorUserDrop": "В настоящий момент файл недоступен.", "DE.ApplicationController.notcriticalErrorTitle": "Внимание", diff --git a/apps/documenteditor/forms/app/controller/ApplicationController.js b/apps/documenteditor/forms/app/controller/ApplicationController.js index e251cbc32..fc85a15b9 100644 --- a/apps/documenteditor/forms/app/controller/ApplicationController.js +++ b/apps/documenteditor/forms/app/controller/ApplicationController.js @@ -10,6 +10,7 @@ define([ 'common/main/lib/component/Calendar', 'common/main/lib/util/LocalStorage', 'common/main/lib/util/Shortcuts', + 'common/main/lib/view/CopyWarningDialog', 'common/forms/lib/view/modals', 'documenteditor/forms/app/view/ApplicationView' ], function (Viewport) { @@ -185,6 +186,14 @@ define([ config.msg = this.downloadErrorText; break; + case Asc.c_oAscError.ID.UplImageSize: + config.msg = this.uploadImageSizeMessage; + break; + + case Asc.c_oAscError.ID.UplImageExt: + config.msg = this.uploadImageExtMessage; + break; + case Asc.c_oAscError.ID.ConvertationPassword: config.msg = this.errorFilePassProtect; break; @@ -224,6 +233,19 @@ define([ config.msg = this.errorLoadingFont; break; + case Asc.c_oAscError.ID.Warning: + config.msg = this.errorConnectToServer; + config.closable = false; + break; + + case Asc.c_oAscError.ID.KeyExpire: + config.msg = this.errorTokenExpire; + break; + + case Asc.c_oAscError.ID.CoAuthoringDisconnect: + config.msg = this.errorViewerDisconnect; + break; + default: config.msg = (typeof id == 'string') ? id : this.errorDefaultMessage.replace('%1', id); break; @@ -253,7 +275,14 @@ define([ config.iconCls = 'warn'; config.buttons = ['ok']; config.callback = _.bind(function(btn){ - if (id == Asc.c_oAscError.ID.EditingError) { + if (id == Asc.c_oAscError.ID.Warning && btn == 'ok' && this.appOptions.canDownload) { + Common.UI.Menu.Manager.hideAll(); + var me = this; + setTimeout(function() { + $('button', me.view.btnOptions.cmpEl).click(); + }, 10); + + } else if (id == Asc.c_oAscError.ID.EditingError) { Common.NotificationCenter.trigger('api:disconnect', true); // enable download and print } }, this); @@ -398,6 +427,12 @@ define([ } } + labelDocName = $('#title-doc-name'); + if (data.doc) { + labelDocName.text(data.doc.title || ''); + this.embedConfig.docTitle = data.doc.title; + } + this.api.asc_registerCallback('asc_onGetEditorPermissions', _.bind(this.onEditorPermissions, this)); this.api.asc_registerCallback('asc_onRunAutostartMacroses', _.bind(this.onRunAutostartMacroses, this)); this.api.asc_setDocInfo(docInfo); @@ -405,12 +440,6 @@ define([ this.api.asc_enableKeyEvents(true); Common.Analytics.trackEvent('Load', 'Start'); - - labelDocName = $('#title-doc-name'); - if (data.doc) { - labelDocName.text(data.doc.title || ''); - this.embedConfig.docTitle = data.doc.title; - } }, onRunAutostartMacroses: function() { @@ -486,6 +515,7 @@ define([ this.api.asc_setRestriction(Asc.c_oAscRestrictionType.OnlyForms); this.api.asc_SetFastCollaborative(true); this.api.asc_setAutoSaveGap(1); + this.api.SetCollaborativeMarksShowType(Asc.c_oAscCollaborativeMarksShowType.None); } var $parent = labelDocName.parent(); @@ -1001,7 +1031,7 @@ define([ this.hidePreloader(); this.onLongActionEnd(Asc.c_oAscAsyncActionType['BlockInteraction'], LoadingDocument); - var zf = (this.appOptions.customization && this.appOptions.customization.zoom ? parseInt(this.appOptions.customization.zoom) : -2); + var zf = (this.appOptions.customization && this.appOptions.customization.zoom ? parseInt(this.appOptions.customization.zoom) : 100); (zf == -1) ? this.api.zoomFitToPage() : ((zf == -2) ? this.api.zoomFitToWidth() : this.api.zoom(zf>0 ? zf : 100)); this.createDelayedElements(); @@ -1016,6 +1046,7 @@ define([ this.api.asc_registerCallback('asc_onPrint', _.bind(this.onPrint, this)); this.api.asc_registerCallback('asc_onPrintUrl', _.bind(this.onPrintUrl, this)); this.api.asc_registerCallback('sync_onAllRequiredFormsFilled', _.bind(this.onFillRequiredFields, this)); + this.api.asc_registerCallback('asc_onContextMenu', _.bind(this.onContextMenu, this)); if (this.appOptions.canFillForms) { this.api.asc_registerCallback('asc_onShowContentControlsActions', _.bind(this.onShowContentControlsActions, this)); this.api.asc_registerCallback('asc_onHideContentControlsActions', _.bind(this.onHideContentControlsActions, this)); @@ -1306,6 +1337,128 @@ define([ }); }, + onContextMenu: function(event){ + var me = this; + _.delay(function(){ + if (event.get_Type() == 0) { + me.api && me.appOptions.canFillForms && me.fillMenuProps(me.api.getSelectedElements(), event); + } + },10); + }, + + showPopupMenu: function(menu, value, event){ + if (!_.isUndefined(menu) && menu !== null){ + Common.UI.Menu.Manager.hideAll(); + + var showPoint = [event.get_X(), event.get_Y()], + menuContainer = this.boxSdk.find(Common.Utils.String.format('#menu-container-{0}', menu.id)); + + if (!menu.rendered) { + // Prepare menu container + if (menuContainer.length < 1) { + menuContainer = $(Common.Utils.String.format('', menu.id)); + this.boxSdk.append(menuContainer); + } + + menu.render(menuContainer); + menu.cmpEl.attr({tabindex: "-1"}); + } + + menuContainer.css({ + left: showPoint[0], + top : showPoint[1] + }); + + menu.show(); + + if (_.isFunction(menu.options.initMenu)) { + menu.options.initMenu(value); + menu.alignPosition(); + } + _.delay(function() { + menu.cmpEl.focus(); + }, 10); + + this.currentMenu = menu; + } + }, + + fillMenuProps: function(selectedElements, event) { + if (!selectedElements || !_.isArray(selectedElements)) return; + + if (!this.textMenu) { + this.textMenu = this.view.getContextMenu(); + this.textMenu.on('item:click', _.bind(this.onContextMenuClick, this)); + } + + var menu_props = {}, + noobject = true; + for (var i = 0; i 86); // if isChrome or isSafari or isOpera == true use asc_onPrintUrl event + opts.asc_setAdvancedOptions(printopt); + this.api.asc_Print(opts); + break; + } + }, + errorDefaultMessage : 'Error code: %1', unknownErrorText : 'Unknown error.', convertationTimeoutText : 'Conversion timeout exceeded.', @@ -1349,7 +1502,12 @@ define([ textBuyNow: 'Visit website', textNoLicenseTitle: 'License limit reached', textContactUs: 'Contact sales', - errorLoadingFont: 'Fonts are not loaded.
Please contact your Document Server administrator.' + errorLoadingFont: 'Fonts are not loaded.
Please contact your Document Server administrator.', + errorConnectToServer: 'The document could not be saved. Please check connection settings or contact your administrator.
When you click the \'OK\' button, you will be prompted to download the document.', + errorTokenExpire: 'The document security token has expired.
Please contact your Document Server administrator.', + errorViewerDisconnect: 'Connection is lost. You can still view the document,
but will not be able to download or print until the connection is restored and page is reloaded.', + uploadImageSizeMessage: 'Maximum image size limit exceeded.', + uploadImageExtMessage: 'Unknown image format.' }, DE.Controllers.ApplicationController)); }); diff --git a/apps/documenteditor/forms/app/view/ApplicationView.js b/apps/documenteditor/forms/app/view/ApplicationView.js index 3d54a9979..1486a94d8 100644 --- a/apps/documenteditor/forms/app/view/ApplicationView.js +++ b/apps/documenteditor/forms/app/view/ApplicationView.js @@ -27,7 +27,6 @@ define([ menu : this.mnuThemes = new Common.UI.Menu({ cls: 'shifted-right', menuAlign: 'tl-tr', - restoreHeight: true, items: [] }) }, @@ -87,6 +86,18 @@ define([ return this; }, + getContextMenu: function() { + return new Common.UI.Menu({ + cls: 'shifted-right', + items: [ + { caption: this.textCut, value: 'cut', iconCls: 'mi-icon svg-icon cut' }, + { caption: this.textCopy, value: 'copy', iconCls: 'mi-icon svg-icon copy' }, + { caption: this.textPaste, value: 'paste', iconCls: 'mi-icon svg-icon paste' }, + { caption: this.textPrintSel, value: 'print', iconCls: 'mi-icon svg-icon print' } + ] + }); + }, + txtDownload: 'Download', txtPrint: 'Print', txtShare: 'Share', @@ -98,6 +109,11 @@ define([ textNext: 'Next Field', textClear: 'Clear All Fields', textSubmit: 'Submit', - txtTheme: 'Interface theme' + txtTheme: 'Interface theme', + textCut: 'Cut', + textCopy: 'Copy', + textPaste: 'Paste', + textPrintSel: 'Print Selection' + }, DE.Views.ApplicationView || {})); }); \ No newline at end of file diff --git a/apps/documenteditor/forms/index.html b/apps/documenteditor/forms/index.html index 43e5c43a8..f15c50e3b 100644 --- a/apps/documenteditor/forms/index.html +++ b/apps/documenteditor/forms/index.html @@ -21,6 +21,12 @@ --canvas-background: #555; } + .content-theme-dark { + --skeleton-canvas-content-background: #3a3a3a; + --skeleton-canvas-page-border: #2a2a2a; + --skeleton-canvas-line: rgba(255,255,255,.05); + } + .theme-classic-light { } @@ -88,17 +94,26 @@ background: rgba(255, 255, 255, 0.2); } - .loadmask > .placeholder { - background: #fbfbfb; + .loadmask .placeholder-outer { width: 100%; - height: 100%; - padding-top: 56px; + padding-right: 14px; } - .loadmask > .placeholder > .line { + .loadmask .placeholder { + background: #fff; + background: var(--skeleton-canvas-content-background, #fff); + width: 796px; + margin: 59px auto; + height: 100%; + border: 1px solid #bbbec2; + border: var(--scaled-one-px-value, 1px) solid var(--skeleton-canvas-page-border, #bbbec2); + padding-top: 50px; + } + + .loadmask .placeholder > .line { height: 15px; - margin: 30px; - background: rgba(0,0,0,.05); + margin: 30px 80px; + background: var(--skeleton-canvas-line, rgba(0,0,0,.05)); overflow: hidden; position: relative; @@ -137,7 +152,16 @@ -
+
+
+
+
+
+
+
+
+
+
-
+
+
+
+
+
+
+
+
+
+
@@ -214,17 +244,6 @@
-