diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 000000000..3dfaa58df --- /dev/null +++ b/.travis.yml @@ -0,0 +1,10 @@ +dist: trusty +language: node_js +node_js: + - '6' +before_install: npm install -g grunt-cli +before_script: + - cd build +script: + - npm install + - grunt --level=ADVANCED diff --git a/apps/api/documents/api.js b/apps/api/documents/api.js index a7d9dfde2..1d42db418 100644 --- a/apps/api/documents/api.js +++ b/apps/api/documents/api.js @@ -50,7 +50,6 @@ lang: , location: , canCoAuthoring: , - canAutosave: , canBackToFolder: - deprecated. use "customization.goback" parameter, createUrl: 'create document url', sharingSettingsUrl: 'document sharing settings url', @@ -113,6 +112,7 @@ rightMenu: true, toolbar: true, header: true, + statusBar: true, autosave: true, forcesave: false, commentAuthorOnly: false @@ -131,8 +131,7 @@ events: { 'onReady': , 'onBack': , - 'onDocumentStateChange': , - 'onSave': + 'onDocumentStateChange': } } @@ -280,9 +279,6 @@ if (handler) { res = handler.call(_self, {target: _self, data: msg.data}); - if (msg.event === 'onSave' && res !== false) { - _processSaveResult(true); - } } } } diff --git a/apps/api/documents/index.html b/apps/api/documents/index.html index a3fb92ed1..82fbc7009 100644 --- a/apps/api/documents/index.html +++ b/apps/api/documents/index.html @@ -65,7 +65,6 @@ 'onRequestEmailAddresses': onRequestEmailAddresses, 'onRequestStartMailMerge': onRequestStartMailMerge, 'onRequestHistoryClose': onRequestHistoryClose, - 'onSave': onDocumentSave, 'onError': onError } }); @@ -195,12 +194,6 @@ docEditor.applyEditRights(true, "Someone is editing this document right now. Please try again later."); } - function onDocumentSave(event) { - var url = event.data; - // if you want to async save process return false - // and call api.processSaveResult when ready - } - function onError(event) { // critical error happened // examine event.data.errorCode and event.data.errorDescription for details diff --git a/apps/common/Gateway.js b/apps/common/Gateway.js index b7f700026..faeee7bb5 100644 --- a/apps/common/Gateway.js +++ b/apps/common/Gateway.js @@ -142,13 +142,6 @@ if (Common === undefined) { _postMessage({ event: 'onReady' }); }, - save: function(url) { - _postMessage({ - event: 'onSave', - data: url - }); - }, - requestEditRights: function() { _postMessage({ event: 'onRequestEditRights' }); }, diff --git a/apps/common/main/lib/component/Button.js b/apps/common/main/lib/component/Button.js index f70308a14..4fe884223 100644 --- a/apps/common/main/lib/component/Button.js +++ b/apps/common/main/lib/component/Button.js @@ -331,7 +331,7 @@ define([ $(document).off('mouseup', onMouseUp); }; - var onAfterHideMenu = function(e) { + var onAfterHideMenu = function(e, isFromInputControl) { me.cmpEl.find('.dropdown-toggle').blur(); if (me.cmpEl.hasClass('active') !== me.pressed) me.cmpEl.trigger('button.internal.active', [me.pressed]); @@ -416,14 +416,16 @@ define([ setDisabled: function(disabled) { if (this.rendered && this.disabled != disabled) { var el = this.cmpEl, - isGroup = el.hasClass('btn-group'); + isGroup = el.hasClass('btn-group'), + me = this; disabled = (disabled===true); if (disabled !== el.hasClass('disabled')) { var decorateBtn = function(button) { button.toggleClass('disabled', disabled); - (disabled) ? button.attr({disabled: disabled}) : button.removeAttr('disabled'); + if (!me.options.allowMouseEventsOnDisabled) + (disabled) ? button.attr({disabled: disabled}) : button.removeAttr('disabled'); }; decorateBtn(el); diff --git a/apps/common/main/lib/component/ComboBox.js b/apps/common/main/lib/component/ComboBox.js index f86049013..d45a3054c 100644 --- a/apps/common/main/lib/component/ComboBox.js +++ b/apps/common/main/lib/component/ComboBox.js @@ -294,10 +294,10 @@ define([ e.preventDefault(); }, - onAfterHideMenu: function(e) { + onAfterHideMenu: function(e, isFromInputControl) { this.cmpEl.find('.dropdown-toggle').blur(); - this.trigger('hide:after', this, e); - Common.NotificationCenter.trigger('menu:hide'); + this.trigger('hide:after', this, e, isFromInputControl); + Common.NotificationCenter.trigger('menu:hide', this, isFromInputControl); }, onAfterKeydownMenu: function(e) { diff --git a/apps/common/main/lib/component/ComboDataView.js b/apps/common/main/lib/component/ComboDataView.js index 5e13c8eff..e51f05f27 100644 --- a/apps/common/main/lib/component/ComboDataView.js +++ b/apps/common/main/lib/component/ComboDataView.js @@ -59,7 +59,8 @@ define([ enableKeyEvents : false, beforeOpenHandler : null, additionalMenuItems : null, - showLast: true + showLast: true, + minWidth: -1 }, template: _.template([ @@ -85,6 +86,8 @@ define([ this.rootWidth = 0; this.rootHeight = 0; this.rendered = false; + this.needFillComboView = false; + this.minWidth = this.options.minWidth; this.fieldPicker = new Common.UI.DataView({ cls: 'field-picker', @@ -209,11 +212,13 @@ define([ }, checkSize: function() { - if (this.cmpEl) { + if (this.cmpEl && this.cmpEl.is(':visible')) { var me = this, width = this.cmpEl.width(), height = this.cmpEl.height(); + if (width < this.minWidth) return; + if (this.rootWidth != width || this.rootHeight != height) { this.rootWidth = width; this.rootHeight = height; @@ -304,10 +309,10 @@ define([ } }, - onAfterHideMenu: function(e) { + onAfterHideMenu: function(e, isFromInputControl) { this.menuPicker.selectedBeforeHideRec = this.menuPicker.getSelectedRec()[0]; // for DataView - onKeyDown - Return key (this.showLast) ? this.menuPicker.showLastSelected() : this.menuPicker.deselectAll(); - this.trigger('hide:after', this, e); + this.trigger('hide:after', this, e, isFromInputControl); }, onFieldPickerSelect: function(picker, item, record) { @@ -315,6 +320,7 @@ define([ }, onMenuPickerSelect: function(picker, item, record, fromKeyDown) { + this.needFillComboView = this.disabled; if (this.disabled || fromKeyDown===true) return; this.fillComboView(record, false); @@ -375,6 +381,17 @@ define([ this.cmpEl.toggleClass('disabled', disabled); $('button', this.openButton.cmpEl).toggleClass('disabled', disabled); this.fieldPicker.setDisabled(disabled); + + if (this.needFillComboView && !disabled) { + var picker = this.menuPicker; + if (picker) { + var record = picker.getSelectedRec(); + if (record) { + record = record[0]; + this.fillComboView(record || picker.store.at(0), false); + } + } + } }, isDisabled: function() { @@ -383,6 +400,8 @@ define([ fillComboView: function(record, forceSelect, forceFill) { if (!_.isUndefined(record) && record instanceof Backbone.Model){ + this.needFillComboView = false; + var me = this, store = me.menuPicker.store, fieldPickerEl = $(me.fieldPicker.el); @@ -405,7 +424,7 @@ define([ var indexRec = store.indexOf(record), countRec = store.length, - maxViewCount = Math.floor((fieldPickerEl.width()) / (me.itemWidth + (me.itemMarginLeft || 0) + (me.itemMarginRight || 0) + (me.itemPaddingLeft || 0) + (me.itemPaddingRight || 0) + + maxViewCount = Math.floor(Math.max(fieldPickerEl.width(), me.minWidth) / (me.itemWidth + (me.itemMarginLeft || 0) + (me.itemMarginRight || 0) + (me.itemPaddingLeft || 0) + (me.itemPaddingRight || 0) + (me.itemBorderLeft || 0) + (me.itemBorderRight || 0))), newStyles = []; diff --git a/apps/common/main/lib/component/Menu.js b/apps/common/main/lib/component/Menu.js index 26238e205..5cbd8a087 100644 --- a/apps/common/main/lib/component/Menu.js +++ b/apps/common/main/lib/component/Menu.js @@ -439,9 +439,9 @@ define([ e.preventDefault(); }, - onAfterHideMenu: function(e) { - this.trigger('hide:after', this, e); - Common.NotificationCenter.trigger('menu:hide', this); + onAfterHideMenu: function(e, isFromInputControl) { + this.trigger('hide:after', this, e, isFromInputControl); + Common.NotificationCenter.trigger('menu:hide', this, isFromInputControl); }, onAfterKeydownMenu: function(e) { diff --git a/apps/common/main/lib/component/MultiSliderGradient.js b/apps/common/main/lib/component/MultiSliderGradient.js index 0b44be27e..86290981b 100644 --- a/apps/common/main/lib/component/MultiSliderGradient.js +++ b/apps/common/main/lib/component/MultiSliderGradient.js @@ -63,7 +63,10 @@ define([ '
', '
', '<% _.each(items, function(item) { %>', - '
', + '
', + '
', + '
', + '
', '<% }); %>', '
' ].join('')), @@ -98,6 +101,7 @@ define([ me.thumbs[i].thumb.on('dblclick', null, function() { me.trigger('thumbdblclick', me); }); + me.thumbs[i].thumbcolor = me.thumbs[i].thumb.find('> div'); } if (me.styleStr!=='') { @@ -118,6 +122,7 @@ define([ setColorValue: function(color, index) { var ind = (index!==undefined) ? index : this.currentThumb; this.colorValues[ind] = color; + this.thumbs[ind].thumbcolor.css('background-color', color); this.changeGradientStyle(); }, @@ -145,6 +150,18 @@ define([ } style = Common.Utils.String.format('linear-gradient(to right, {0} {1}%, {2} {3}%)', this.colorValues[0], this.getValue(0), this.colorValues[1], this.getValue(1)); this.trackEl.css('background', style); + }, + + sortThumbs: function() { + var recalc_indexes = Common.UI.MultiSlider.prototype.sortThumbs.call(this), + new_colors = [], + me = this; + _.each (recalc_indexes, function(recalc_index) { + new_colors.push(me.colorValues[recalc_index]); + }); + this.colorValues = new_colors; + this.trigger('sortthumbs', me, recalc_indexes); + return recalc_indexes; } }); }); diff --git a/apps/common/main/lib/component/Slider.js b/apps/common/main/lib/component/Slider.js index 2d34c85e0..67a86d2d2 100644 --- a/apps/common/main/lib/component/Slider.js +++ b/apps/common/main/lib/component/Slider.js @@ -338,16 +338,21 @@ define([ e.preventDefault(); e.stopPropagation(); - var index = e.data, + var index = e.data.index, lastValue = me.thumbs[index].value, minValue = (index-1<0) ? 0 : me.thumbs[index-1].position, maxValue = (index+1 maxValue, + pos = Math.max(0, Math.min(100, position)), value = pos/me.delta + me.minValue; me.setThumbPosition(index, pos); me.thumbs[index].value = value; + if (need_sort) + me.sortThumbs(); + $(document).off('mouseup', onMouseUp); $(document).off('mousemove', onMouseMove); @@ -362,16 +367,21 @@ define([ e.preventDefault(); e.stopPropagation(); - var index = e.data, + var index = e.data.index, lastValue = me.thumbs[index].value, minValue = (index-1<0) ? 0 : me.thumbs[index-1].position, maxValue = (index+1 maxValue, + pos = Math.max(0, Math.min(100, position)), value = pos/me.delta + me.minValue; me.setThumbPosition(index, pos); me.thumbs[index].value = value; + if (need_sort) + me.sortThumbs(); + if (Math.abs(value-lastValue)>0.001) me.trigger('change', me, value, lastValue); }; @@ -379,7 +389,7 @@ define([ var onMouseDown = function (e) { if ( me.disabled ) return; - var index = e.data, + var index = e.data.index, thumb = me.thumbs[index].thumb; me._dragstart = e.pageX*Common.Utils.zoom() - thumb.offset().left - thumb.width()/2; @@ -389,8 +399,8 @@ define([ (index == idx) ? item.thumb.css('z-index', 500) : item.thumb.css('z-index', ''); }); - $(document).on('mouseup', null, index, onMouseUp); - $(document).on('mousemove', null, index, onMouseMove); + $(document).on('mouseup', null, e.data, onMouseUp); + $(document).on('mousemove', null, e.data, onMouseMove); }; var onTrackMouseDown = function (e) { @@ -441,7 +451,7 @@ define([ index: index }); me.setValue(index, me.options.values[index]); - thumb.on('mousedown', null, index, onMouseDown); + thumb.on('mousedown', null, me.thumbs[index], onMouseDown); }); me.setActiveThumb(0, true); @@ -489,6 +499,18 @@ define([ if (disabled !== this.disabled) this.cmpEl.toggleClass('disabled', disabled); this.disabled = disabled; + }, + + sortThumbs: function() { + this.thumbs.sort(function(a, b) { + return (a.position - b.position); + }); + var recalc_indexes = []; + _.each (this.thumbs, function(thumb, index) { + recalc_indexes.push(thumb.index); + thumb.index = index; + }); + return recalc_indexes; } }); }); diff --git a/apps/common/main/lib/extend/Bootstrap.js b/apps/common/main/lib/extend/Bootstrap.js index aaa79c965..62ce6b868 100755 --- a/apps/common/main/lib/extend/Bootstrap.js +++ b/apps/common/main/lib/extend/Bootstrap.js @@ -186,13 +186,13 @@ function getParent($this) { return $parent && $parent.length ? $parent : $this.parent(); } -function clearMenus() { +function clearMenus(isFromInputControl) { $('.dropdown-toggle').each(function (e) { var $parent = ($(this)).parent(); if (!$parent.hasClass('open')) return; $parent.trigger(e = $.Event('hide.bs.dropdown')); if (e.isDefaultPrevented()) return; - $parent.removeClass('open').trigger('hidden.bs.dropdown'); + $parent.removeClass('open').trigger('hidden.bs.dropdown', isFromInputControl); }) } @@ -217,7 +217,7 @@ $(document) function onDropDownClick(e) { if (e.which == 1 || e.which == undefined) - clearMenus(); + clearMenus(/form-control/.test(e.target.className)); } if (!!clickDefHandler) { diff --git a/apps/common/main/lib/template/Header.template b/apps/common/main/lib/template/Header.template index fe5404283..a23dc0ddd 100644 --- a/apps/common/main/lib/template/Header.template +++ b/apps/common/main/lib/template/Header.template @@ -1,7 +1,6 @@
<%= headerCaption %>
-
<%= documentCaption %>
<%= textBack %>
\ No newline at end of file diff --git a/apps/common/main/lib/view/Header.js b/apps/common/main/lib/view/Header.js index 34ab149a1..eb1848b38 100644 --- a/apps/common/main/lib/view/Header.js +++ b/apps/common/main/lib/view/Header.js @@ -54,7 +54,6 @@ define([ options : { branding: {}, headerCaption: 'Default Caption', - headerDeveloper: 'DEVELOPER MODE', documentCaption: '', canBack: false }, @@ -79,16 +78,15 @@ define([ this.options = this.options ? _({}).extend(this.options, options) : options; this.headerCaption = this.options.headerCaption; - this.headerDeveloper = this.txtHeaderDeveloper; this.documentCaption = this.options.documentCaption; this.canBack = this.options.canBack; this.branding = this.options.customization; + this.isModified = false; }, render: function () { $(this.el).html(this.template({ headerCaption : this.headerCaption, - headerDeveloper : this.headerDeveloper, documentCaption : Common.Utils.String.htmlEncode(this.documentCaption), canBack : this.canBack, textBack : this.textBack @@ -158,14 +156,18 @@ define([ return this.headerCaption; }, - setDocumentCaption: function(value, applyOnly) { - if (_.isUndefined(applyOnly)) { - this.documentCaption = value; - } + setDocumentCaption: function(value, isModified) { + if (isModified !== undefined) + this.isModified = isModified; + + this.documentCaption = value; if (!value) value = ''; + if (this.isModified) + value = value + '*'; + var dc = $('#header-documentcaption div'); if (dc) dc.html(Common.Utils.String.htmlEncode(value)); @@ -223,10 +225,6 @@ define([ } }, - setDeveloperMode: function(mode) { - $('#header-developer').toggleClass('hidden', !mode); - }, - setCanRename: function(rename) { var dc = $('#header-documentcaption div'); if (rename) { @@ -257,7 +255,6 @@ define([ textBack: 'Go to Documents', openNewTabText: 'Open in New Tab', - txtHeaderDeveloper: 'DEVELOPER MODE', txtRename: 'Rename' }, Common.Views.Header || {})) }); diff --git a/apps/common/main/resources/less/comments.less b/apps/common/main/resources/less/comments.less index af57564b7..e88e72717 100644 --- a/apps/common/main/resources/less/comments.less +++ b/apps/common/main/resources/less/comments.less @@ -295,7 +295,7 @@ height: 20px; line-height: @line-height-base; background-color: #EE3525; - margin: 18px 25px; + margin: 10px 18px; padding: 2px 10px; color: #fff; overflow: hidden; diff --git a/apps/common/main/resources/less/header.less b/apps/common/main/resources/less/header.less index 457b1a24b..f56e67bef 100644 --- a/apps/common/main/resources/less/header.less +++ b/apps/common/main/resources/less/header.less @@ -46,34 +46,6 @@ } } -#header-developer { - background-color: #ffb400; - padding-left: 15px + @app-header-height / 3; - & > div { - position: relative; - background-color: #ffb400; - color: #6e4e00 !important; - padding-right: 15px; - cursor: default; - z-index: 1; - white-space: nowrap; - height: @app-header-height; - line-height: @app-header-height; - - &:after { - content: ''; - position: absolute; - top: 0; - right: -@app-header-height / 2; - width: @app-header-height / 2; - height: @app-header-height; - border-top: @app-header-height / 2 solid transparent; - border-left: @app-header-height / 3 solid #ffb400; - border-bottom: @app-header-height / 2 solid transparent; - } - } -} - #header-documentcaption { width: 100%; max-width: 100px; diff --git a/apps/common/main/resources/less/multislider-gradient.less b/apps/common/main/resources/less/multislider-gradient.less index fdda4ae9e..d42350d94 100644 --- a/apps/common/main/resources/less/multislider-gradient.less +++ b/apps/common/main/resources/less/multislider-gradient.less @@ -4,10 +4,41 @@ .thumb { top: 18px; - background-position: @multislide-thumb-offset-x @multislide-thumb-offset-y; + background: none; - &.active { - background-position: @multislide-thumb-offset-x @multislide-thumb-offset-y - 30px; + .thumb-top { + position: absolute; + top: 2px; + left: 2px; + width: 9px; + height: 9px; + background-color: #ffffff; + -moz-transform: rotate(45deg); + -ms-transform: rotate(45deg); + -webkit-transform: rotate(45deg); + -o-transform: rotate(45deg); + transform: rotate(45deg); + border-top: solid 1px @gray-darker; + border-left: solid 1px @gray-darker; + border-radius: 0 3px; + box-sizing: content-box; + } + + .thumb-bottom { + position: absolute; + top: 6px; + left: 1px; + width: 10px; + height: 8px; + background-color: #ffffff; + border: solid 1px @gray-darker; + border-top: none; + border-radius: 2px; + box-sizing: content-box; + } + + &.active .thumb-bottom { + border-bottom-width: 2px; } } diff --git a/apps/common/mobile/lib/component/ThemeColorPalette.js b/apps/common/mobile/lib/component/ThemeColorPalette.js index 9b4070bd4..56d08a7ee 100644 --- a/apps/common/mobile/lib/component/ThemeColorPalette.js +++ b/apps/common/mobile/lib/component/ThemeColorPalette.js @@ -120,6 +120,11 @@ define([ row = -1, standartColors = Common.Utils.ThemeColor.getStandartColors(); + // Disable duplicate + if ($(me.el).find('.list-block.color-palette').length > 0) { + return + } + _.each(Common.Utils.ThemeColor.getEffectColors(), function(effect, index) { if (0 == index % me.options.themecolors) { themeColors.push([]); diff --git a/apps/documenteditor/main/app/controller/LeftMenu.js b/apps/documenteditor/main/app/controller/LeftMenu.js index 8a0e341e1..33cfebf1f 100644 --- a/apps/documenteditor/main/app/controller/LeftMenu.js +++ b/apps/documenteditor/main/app/controller/LeftMenu.js @@ -174,6 +174,8 @@ define([ if (this.mode.canUseHistory) this.leftMenu.setOptionsPanel('history', this.getApplication().getController('Common.Controllers.History').getView('Common.Views.History')); + this.mode.isTrial && this.leftMenu.setDeveloperMode(true); + Common.util.Shortcuts.resumeEvents(); return this; }, @@ -184,6 +186,7 @@ define([ this.leftMenu.setOptionsPanel('plugins', this.getApplication().getController('Common.Controllers.Plugins').getView('Common.Views.Plugins')); } else this.leftMenu.btnPlugins.hide(); + this.mode.isTrial && this.leftMenu.setDeveloperMode(true); }, clickMenuFileItem: function(menu, action, isopts) { diff --git a/apps/documenteditor/main/app/controller/Main.js b/apps/documenteditor/main/app/controller/Main.js index acf1541d0..ffe757087 100644 --- a/apps/documenteditor/main/app/controller/Main.js +++ b/apps/documenteditor/main/app/controller/Main.js @@ -69,7 +69,8 @@ define([ toolbar: '#viewport #toolbar', leftMenu: '#viewport #left-menu, #viewport #id-toolbar-full-placeholder-btn-settings, #viewport #id-toolbar-short-placeholder-btn-settings', rightMenu: '#viewport #right-menu', - header: '#viewport #header' + header: '#viewport #header', + statusBar: '#statusbar' }; Common.localStorage.setId('text'); @@ -103,7 +104,7 @@ define([ weakCompare : function(obj1, obj2){return obj1.type === obj2.type;} }); - this._state = {isDisconnected: false, usersCount: 1, fastCoauth: true, startModifyDocument: true, lostEditingRights: false, licenseWarning: false}; + this._state = {isDisconnected: false, usersCount: 1, fastCoauth: true, lostEditingRights: false, licenseWarning: false}; // Initialize viewport @@ -168,6 +169,8 @@ define([ if (!/area_id/.test(e.target.id)) { if (/msg-reply/.test(e.target.className)) me.dontCloseDummyComment = true; + else if (/chat-msg-text/.test(e.target.id)) + me.dontCloseChat = true; } }); @@ -180,6 +183,8 @@ define([ me.api.asc_enableKeyEvents(true); if (/msg-reply/.test(e.target.className)) me.dontCloseDummyComment = false; + else if (/chat-msg-text/.test(e.target.id)) + me.dontCloseChat = false; } } }).on('dragover', function(e) { @@ -218,14 +223,23 @@ define([ }, 'menu:show': function(e){ }, - 'menu:hide': function(e){ - if (!me.isModalShowed) + 'menu:hide': function(e, isFromInputControl){ + if (!me.isModalShowed && !isFromInputControl) me.api.asc_enableKeyEvents(true); }, 'edit:complete': _.bind(me.onEditComplete, me) }); this.initNames(); //for shapes + + Common.util.Shortcuts.delegateShortcuts({ + shortcuts: { + 'command+s,ctrl+s': _.bind(function (e) { + e.preventDefault(); + e.stopPropagation(); + }, this) + } + }); } }, @@ -574,14 +588,9 @@ define([ if (id==Asc.c_oAscAsyncAction['Save'] || id==Asc.c_oAscAsyncAction['ForceSaveButton']) { if (this._state.fastCoauth && this._state.usersCount>1) { var me = this; - if (me._state.timerSave===undefined) - me._state.timerSave = setInterval(function(){ - if ((new Date()) - me._state.isSaving>500) { - clearInterval(me._state.timerSave); - me.getApplication().getController('Statusbar').setStatusCaption(me.textChangesSaved, false, 3000); - me._state.timerSave = undefined; - } - }, 500); + me._state.timerSave = setTimeout(function () { + me.getApplication().getController('Statusbar').setStatusCaption(me.textChangesSaved, false, 3000); + }, 500); } else this.getApplication().getController('Statusbar').setStatusCaption(this.textChangesSaved, false, 3000); } else @@ -596,7 +605,7 @@ define([ if ( type == Asc.c_oAscAsyncActionType.BlockInteraction && (!this.getApplication().getController('LeftMenu').dlgSearch || !this.getApplication().getController('LeftMenu').dlgSearch.isVisible()) && - !( id == Asc.c_oAscAsyncAction['ApplyChanges'] && this.dontCloseDummyComment ) ) { + !( id == Asc.c_oAscAsyncAction['ApplyChanges'] && (this.dontCloseDummyComment || this.dontCloseChat)) ) { // this.onEditComplete(this.loadMask); //если делать фокус, то при принятии чужих изменений, заканчивается свой композитный ввод this.api.asc_enableKeyEvents(true); } @@ -613,7 +622,7 @@ define([ case Asc.c_oAscAsyncAction['Save']: case Asc.c_oAscAsyncAction['ForceSaveButton']: - this._state.isSaving = new Date(); + clearTimeout(this._state.timerSave); force = true; title = this.saveTitleText; text = this.saveTextText; @@ -965,7 +974,7 @@ define([ this.appOptions.canUseHistory = this.appOptions.canLicense && !this.appOptions.isLightVersion && this.editorConfig.canUseHistory && this.appOptions.canCoAuthoring && !this.appOptions.isDesktopApp; this.appOptions.canHistoryClose = this.editorConfig.canHistoryClose; this.appOptions.canHistoryRestore= this.editorConfig.canHistoryRestore && !!this.permissions.changeHistory; - this.appOptions.canUseMailMerge= this.appOptions.canLicense && this.appOptions.canEdit && !this.appOptions.isDesktopApp; + this.appOptions.canUseMailMerge= this.appOptions.canLicense && this.appOptions.canEdit && /*!this.appOptions.isDesktopApp*/ !this.appOptions.isOffline; this.appOptions.canSendEmailAddresses = this.appOptions.canLicense && this.editorConfig.canSendEmailAddresses && this.appOptions.canEdit && this.appOptions.canCoAuthoring; this.appOptions.canComments = (licType === Asc.c_oLicenseResult.Success || licType === Asc.c_oLicenseResult.SuccessLimit) && !((typeof (this.editorConfig.customization) == 'object') && this.editorConfig.customization.comments===false); this.appOptions.canChat = (licType === Asc.c_oLicenseResult.Success || licType === Asc.c_oLicenseResult.SuccessLimit) && !this.appOptions.isOffline && !((typeof (this.editorConfig.customization) == 'object') && this.editorConfig.customization.chat===false); @@ -976,6 +985,7 @@ define([ this.appOptions.canForcesave = this.appOptions.isEdit && !this.appOptions.isOffline && (typeof (this.editorConfig.customization) == 'object' && !!this.editorConfig.customization.forcesave); this.appOptions.forcesave = this.appOptions.canForcesave; this.appOptions.canEditComments= this.appOptions.isOffline || !(typeof (this.editorConfig.customization) == 'object' && this.editorConfig.customization.commentAuthorOnly); + this.appOptions.isTrial = params.asc_getTrial(); var type = /^(?:(pdf|djvu|xps))$/.exec(this.document.fileType); this.appOptions.canDownloadOrigin = !this.appOptions.nativeApp && this.permissions.download !== false && (type && typeof type[1] === 'string'); @@ -988,7 +998,6 @@ define([ if (this.appOptions.canBranding) headerView.setBranding(this.editorConfig.customization); - params.asc_getTrial() && headerView.setDeveloperMode(true); this.appOptions.canRename && headerView.setCanRename(true); this.appOptions.canBrandingExt = params.asc_getCanBranding() && (typeof this.editorConfig.customization == 'object' || this.editorConfig.plugins); @@ -1106,7 +1115,6 @@ define([ me.api.asc_registerCallback('asc_onDocumentModifiedChanged', _.bind(me.onDocumentModifiedChanged, me)); me.api.asc_registerCallback('asc_onDocumentCanSaveChanged', _.bind(me.onDocumentCanSaveChanged, me)); - me.api.asc_registerCallback('asc_onSaveUrl', _.bind(me.onSaveUrl, me)); /** coauthoring begin **/ me.api.asc_registerCallback('asc_onCollaborativeChanges', _.bind(me.onCollaborativeChanges, me)); me.api.asc_registerCallback('asc_OnTryUndoInFastCollaborative',_.bind(me.onTryUndoInFastCollaborative, me)); @@ -1259,6 +1267,10 @@ define([ config.msg = this.errorAccessDeny; break; + case Asc.c_oAscError.ID.UplImageUrl: + config.msg = this.errorBadImageUrl; + break; + default: config.msg = this.errorDefaultMessage.replace('%1', id); break; @@ -1355,33 +1367,32 @@ define([ title = headerView.getDocumentCaption() + ' - ' + title; if (isModified) { - if (!_.isUndefined(title) && (!this._state.fastCoauth || this._state.usersCount<2 )) { + clearTimeout(this._state.timerCaption); + if (!_.isUndefined(title)) { title = '* ' + title; - headerView.setDocumentCaption(headerView.getDocumentCaption() + '*', true); + headerView.setDocumentCaption(headerView.getDocumentCaption(), true); } } else { - headerView.setDocumentCaption(headerView.getDocumentCaption()); + if (this._state.fastCoauth && this._state.usersCount>1) { + this._state.timerCaption = setTimeout(function () { + headerView.setDocumentCaption(headerView.getDocumentCaption(), false); + }, 500); + } else + headerView.setDocumentCaption(headerView.getDocumentCaption(), false); } if (window.document.title != title) window.document.title = title; - if (!this._state.fastCoauth || this._state.usersCount<2 ) { - Common.Gateway.setDocumentModified(isModified); - if (isModified) - this.getApplication().getController('Statusbar').setStatusCaption('', true); - } else if ( this._state.startModifyDocument!==undefined && this._state.startModifyDocument === isModified){ - Common.Gateway.setDocumentModified(isModified); - this._state.startModifyDocument = (this._state.startModifyDocument) ? !this._state.startModifyDocument : undefined; - } + Common.Gateway.setDocumentModified(isModified); + if (isModified && (!this._state.fastCoauth || this._state.usersCount<2)) + this.getApplication().getController('Statusbar').setStatusCaption('', true); this._state.isDocModified = isModified; } }, onDocumentModifiedChanged: function() { - if (this._state.fastCoauth && this._state.usersCount>1 && this._state.startModifyDocument===undefined ) return; - var isModified = this.api.asc_isDocumentCanSave(); if (this._state.isDocModified !== isModified) { Common.Gateway.setDocumentModified(this.api.isDocumentModified()); @@ -1467,10 +1478,6 @@ define([ $('#loading-mask').hide().remove(); }, - onSaveUrl: function(url) { - Common.Gateway.save(url); - }, - onDownloadUrl: function(url) { if (this._state.isFromGatewayDownloadAs) Common.Gateway.downloadAs(url); @@ -2122,7 +2129,8 @@ define([ errorAccessDeny: 'You are trying to perform an action you do not have rights for.
Please contact your Document Server administrator.', titleServerVersion: 'Editor updated', errorServerVersion: 'The editor version has been updated. The page will be reloaded to apply the changes.', - textChangesSaved: 'All changes saved' + textChangesSaved: 'All changes saved', + errorBadImageUrl: 'Image url is incorrect' } })(), DE.Controllers.Main || {})) }); diff --git a/apps/documenteditor/main/app/controller/Toolbar.js b/apps/documenteditor/main/app/controller/Toolbar.js index 22e7013dd..255e609d5 100644 --- a/apps/documenteditor/main/app/controller/Toolbar.js +++ b/apps/documenteditor/main/app/controller/Toolbar.js @@ -672,7 +672,7 @@ define([ toolbar.mnuInsertPageNum.setDisabled(need_disable); } - need_disable = paragraph_locked || header_locked || in_header || in_equation && !btn_eq_state; + need_disable = paragraph_locked || header_locked || in_header || in_equation && !btn_eq_state || this.api.asc_IsCursorInFootnote(); if (need_disable != toolbar.btnInsertPageBreak.isDisabled()) { toolbar.btnInsertPageBreak.setDisabled(need_disable); } diff --git a/apps/documenteditor/main/app/view/ChartSettings.js b/apps/documenteditor/main/app/view/ChartSettings.js index c69c6c9e5..3a255e5fc 100644 --- a/apps/documenteditor/main/app/view/ChartSettings.js +++ b/apps/documenteditor/main/app/view/ChartSettings.js @@ -166,7 +166,7 @@ define([ if (this._isChartStylesChanged) { if (rec) - this.cmbChartStyle.fillComboView(this.cmbChartStyle.menuPicker.getSelectedRec(),true); + this.cmbChartStyle.fillComboView(this.cmbChartStyle.menuPicker.getSelectedRec()[0],true); else this.cmbChartStyle.fillComboView(this.cmbChartStyle.menuPicker.store.at(0), true); } diff --git a/apps/documenteditor/main/app/view/DocumentHolder.js b/apps/documenteditor/main/app/view/DocumentHolder.js index 920a42526..a991e6ad1 100644 --- a/apps/documenteditor/main/app/view/DocumentHolder.js +++ b/apps/documenteditor/main/app/view/DocumentHolder.js @@ -2199,8 +2199,8 @@ define([ { caption: '--' }, menuImageAdvanced ] - }).on('hide:after', function(menu) { - me.fireEvent('editcomplete', me); + }).on('hide:after', function(menu, e, isFromInputControl) { + if (!isFromInputControl) me.fireEvent('editcomplete', me); me.currentMenu = null; }); @@ -2767,13 +2767,13 @@ define([ menuHyperlinkSeparator, menuParagraphAdvancedInTable ] - }).on('hide:after', function(menu) { + }).on('hide:after', function(menu, e, isFromInputControl) { if (me.suppressEditComplete) { me.suppressEditComplete = false; return; } - me.fireEvent('editcomplete', me); + if (!isFromInputControl) me.fireEvent('editcomplete', me); me.currentMenu = null; }); @@ -3146,13 +3146,13 @@ define([ menuStyleSeparator, menuStyle ] - }).on('hide:after', function(menu, e) { + }).on('hide:after', function(menu, e, isFromInputControl) { if (me.suppressEditComplete) { me.suppressEditComplete = false; return; } - me.fireEvent('editcomplete', me); + if (!isFromInputControl) me.fireEvent('editcomplete', me); me.currentMenu = null; }); @@ -3178,8 +3178,8 @@ define([ items: [ menuEditHeaderFooter ] - }).on('hide:after', function(menu) { - me.fireEvent('editcomplete', me); + }).on('hide:after', function(menu, e, isFromInputControl) { + if (!isFromInputControl) me.fireEvent('editcomplete', me); me.currentMenu = null; }); diff --git a/apps/documenteditor/main/app/view/LeftMenu.js b/apps/documenteditor/main/app/view/LeftMenu.js index a99cd35f7..d85aafee2 100644 --- a/apps/documenteditor/main/app/view/LeftMenu.js +++ b/apps/documenteditor/main/app/view/LeftMenu.js @@ -358,6 +358,24 @@ define([ Common.NotificationCenter.trigger('layout:changed', 'history'); }, + setDeveloperMode: function(mode) { + if ( !this.$el.is(':visible') ) return; + + if (!this.developerHint) { + this.developerHint = $('
' + this.txtDeveloper + '
').appendTo(this.$el); + this.devHeight = this.developerHint.outerHeight(); + $(window).on('resize', _.bind(this.onWindowResize, this)); + } + this.developerHint.toggleClass('hidden', !mode); + + var lastbtn = this.$el.find('button.btn-category:visible:last-of-type'); + this.minDevPosition = lastbtn.offset().top - lastbtn.offsetParent().offset().top + lastbtn.height() + 20; + this.onWindowResize(); + }, + + onWindowResize: function() { + this.developerHint.css('top', Math.max((this.$el.height()-this.devHeight)/2, this.minDevPosition)); + }, /** coauthoring begin **/ tipComments : 'Comments', tipChat : 'Chat', @@ -366,6 +384,7 @@ define([ tipSupport : 'Feedback & Support', tipFile : 'File', tipSearch : 'Search', - tipPlugins : 'Plugins' + tipPlugins : 'Plugins', + txtDeveloper: 'DEVELOPER MODE' }, DE.Views.LeftMenu || {})); }); diff --git a/apps/documenteditor/main/app/view/ParagraphSettings.js b/apps/documenteditor/main/app/view/ParagraphSettings.js index 57563b833..b6ad0e8d5 100644 --- a/apps/documenteditor/main/app/view/ParagraphSettings.js +++ b/apps/documenteditor/main/app/view/ParagraphSettings.js @@ -457,8 +457,8 @@ define([ this.mnuColorPicker.updateColors(Common.Utils.ThemeColor.getEffectColors(), Common.Utils.ThemeColor.getStandartColors()); }, - onHideMenus: function(e){ - this.fireEvent('editcomplete', this); + onHideMenus: function(menu, e, isFromInputControl){ + if (!isFromInputControl) this.fireEvent('editcomplete', this); }, setLocked: function (locked) { diff --git a/apps/documenteditor/main/app/view/RightMenu.js b/apps/documenteditor/main/app/view/RightMenu.js index 2f76f37d2..018f957dd 100644 --- a/apps/documenteditor/main/app/view/RightMenu.js +++ b/apps/documenteditor/main/app/view/RightMenu.js @@ -79,42 +79,48 @@ define([ asctype: Common.Utils.documentSettingsType.Paragraph, enableToggle: true, disabled: true, - toggleGroup: 'tabpanelbtnsGroup' + toggleGroup: 'tabpanelbtnsGroup', + allowMouseEventsOnDisabled: true }); this.btnTable = new Common.UI.Button({ hint: this.txtTableSettings, asctype: Common.Utils.documentSettingsType.Table, enableToggle: true, disabled: true, - toggleGroup: 'tabpanelbtnsGroup' + toggleGroup: 'tabpanelbtnsGroup', + allowMouseEventsOnDisabled: true }); this.btnImage = new Common.UI.Button({ hint: this.txtImageSettings, asctype: Common.Utils.documentSettingsType.Image, enableToggle: true, disabled: true, - toggleGroup: 'tabpanelbtnsGroup' + toggleGroup: 'tabpanelbtnsGroup', + allowMouseEventsOnDisabled: true }); this.btnHeaderFooter = new Common.UI.Button({ hint: this.txtHeaderFooterSettings, asctype: Common.Utils.documentSettingsType.Header, enableToggle: true, disabled: true, - toggleGroup: 'tabpanelbtnsGroup' + toggleGroup: 'tabpanelbtnsGroup', + allowMouseEventsOnDisabled: true }); this.btnChart = new Common.UI.Button({ hint: this.txtChartSettings, asctype: Common.Utils.documentSettingsType.Chart, enableToggle: true, disabled: true, - toggleGroup: 'tabpanelbtnsGroup' + toggleGroup: 'tabpanelbtnsGroup', + allowMouseEventsOnDisabled: true }); this.btnShape = new Common.UI.Button({ hint: this.txtShapeSettings, asctype: Common.Utils.documentSettingsType.Shape, enableToggle: true, disabled: true, - toggleGroup: 'tabpanelbtnsGroup' + toggleGroup: 'tabpanelbtnsGroup', + allowMouseEventsOnDisabled: true }); this.btnTextArt = new Common.UI.Button({ @@ -122,7 +128,8 @@ define([ asctype: Common.Utils.documentSettingsType.TextArt, enableToggle: true, disabled: true, - toggleGroup: 'tabpanelbtnsGroup' + toggleGroup: 'tabpanelbtnsGroup', + allowMouseEventsOnDisabled: true }); this._settings = []; diff --git a/apps/documenteditor/main/app/view/ShapeSettings.js b/apps/documenteditor/main/app/view/ShapeSettings.js index 2d131a7ad..d33dec7d0 100644 --- a/apps/documenteditor/main/app/view/ShapeSettings.js +++ b/apps/documenteditor/main/app/view/ShapeSettings.js @@ -1341,6 +1341,18 @@ define([ this.sldrGradient.on('thumbdblclick', function(cmp){ me.btnGradColor.cmpEl.find('button').dropdown('toggle'); }); + this.sldrGradient.on('sortthumbs', function(cmp, recalc_indexes){ + var colors = [], + currentIdx; + _.each (recalc_indexes, function(recalc_index, index) { + colors.push(me.GradColor.colors[recalc_index]); + if (me.GradColor.currentIdx == recalc_index) + currentIdx = index; + }); + me.OriginalFillType = null; + me.GradColor.colors = colors; + me.GradColor.currentIdx = currentIdx; + }); this.fillControls.push(this.sldrGradient); this.cmbBorderSize = new Common.UI.ComboBorderSizeEditable({ diff --git a/apps/documenteditor/main/app/view/Statusbar.js b/apps/documenteditor/main/app/view/Statusbar.js index 93d650a5a..4017ad6a0 100644 --- a/apps/documenteditor/main/app/view/Statusbar.js +++ b/apps/documenteditor/main/app/view/Statusbar.js @@ -276,6 +276,8 @@ define([ this.panelUsers = $('#status-users-ct', this.el); this.panelUsers.on('shown.bs.dropdown', function () { me.panelUsersList.scroller.update({minScrollbarLength : 40, alwaysVisibleY: true}); + var tip = me.panelUsersBlock.data('bs.tooltip'); + if (tip) tip.hide(); }); this.panelUsersBlock = this.panelUsers.find('#status-users-block'); diff --git a/apps/documenteditor/main/app/view/TableSettings.js b/apps/documenteditor/main/app/view/TableSettings.js index cebdcf723..9e0012375 100644 --- a/apps/documenteditor/main/app/view/TableSettings.js +++ b/apps/documenteditor/main/app/view/TableSettings.js @@ -430,7 +430,7 @@ define([ if (this._initSettings) this.createDelayedElements(); - this.disableControls(this._locked); + this.disableControls(this._locked); // need to update combodataview after disabled state if (props ) { @@ -461,7 +461,7 @@ define([ if (this._isTemplatesChanged) { if (rec) - this.cmbTableTemplate.fillComboView(this.cmbTableTemplate.menuPicker.getSelectedRec(),true); + this.cmbTableTemplate.fillComboView(this.cmbTableTemplate.menuPicker.getSelectedRec()[0],true); else this.cmbTableTemplate.fillComboView(this.cmbTableTemplate.menuPicker.store.at(0), true); } diff --git a/apps/documenteditor/main/app/view/TextArtSettings.js b/apps/documenteditor/main/app/view/TextArtSettings.js index 4a8259e87..479909abb 100644 --- a/apps/documenteditor/main/app/view/TextArtSettings.js +++ b/apps/documenteditor/main/app/view/TextArtSettings.js @@ -916,6 +916,18 @@ define([ this.sldrGradient.on('thumbdblclick', function(cmp){ me.btnGradColor.cmpEl.find('button').dropdown('toggle'); }); + this.sldrGradient.on('sortthumbs', function(cmp, recalc_indexes){ + var colors = [], + currentIdx; + _.each (recalc_indexes, function(recalc_index, index) { + colors.push(me.GradColor.colors[recalc_index]); + if (me.GradColor.currentIdx == recalc_index) + currentIdx = index; + }); + me.OriginalFillType = null; + me.GradColor.colors = colors; + me.GradColor.currentIdx = currentIdx; + }); this.lockedControls.push(this.sldrGradient); this.cmbBorderSize = new Common.UI.ComboBorderSizeEditable({ diff --git a/apps/documenteditor/main/app/view/Toolbar.js b/apps/documenteditor/main/app/view/Toolbar.js index dd4325f5b..fa20b37f2 100644 --- a/apps/documenteditor/main/app/view/Toolbar.js +++ b/apps/documenteditor/main/app/view/Toolbar.js @@ -1206,7 +1206,9 @@ define([ ); if (this.mode.isDesktopApp || this.mode.canBrandingExt && this.mode.customization && this.mode.customization.header===false) this.mnuitemHideTitleBar.hide(); - + if (this.mode.canBrandingExt && this.mode.customization && this.mode.customization.statusBar===false) + this.mnuitemHideStatusBar.hide(); + this.btnMarkers.setMenu( new Common.UI.Menu({ items: [ diff --git a/apps/documenteditor/main/locale/en.json b/apps/documenteditor/main/locale/en.json index 1e1d4064f..d169ed1ea 100644 --- a/apps/documenteditor/main/locale/en.json +++ b/apps/documenteditor/main/locale/en.json @@ -141,7 +141,7 @@ "Common.Views.ExternalMergeEditor.textTitle": "Mail Merge Recipients", "Common.Views.Header.openNewTabText": "Open in New Tab", "Common.Views.Header.textBack": "Go to Documents", - "Common.Views.Header.txtHeaderDeveloper": "DEVELOPER MODE", + "del_Common.Views.Header.txtHeaderDeveloper": "DEVELOPER MODE", "Common.Views.Header.txtRename": "Rename", "Common.Views.History.textCloseHistory": "Close History", "Common.Views.History.textHide": "Collapse", @@ -301,6 +301,7 @@ "DE.Controllers.Main.titleServerVersion": "Editor updated", "DE.Controllers.Main.errorServerVersion": "The editor version has been updated. The page will be reloaded to apply the changes.", "DE.Controllers.Main.textChangesSaved": "All changes saved", + "DE.Controllers.Main.errorBadImageUrl": "Image URL is incorrect", "DE.Controllers.Statusbar.textHasChanges": "New changes have been tracked", "DE.Controllers.Statusbar.textTrackChanges": "The document is opened with the Track Changes mode enabled", "DE.Controllers.Statusbar.zoomText": "Zoom {0}%", @@ -1089,6 +1090,7 @@ "DE.Views.LeftMenu.tipSearch": "Search", "DE.Views.LeftMenu.tipSupport": "Feedback & Support", "DE.Views.LeftMenu.tipTitles": "Titles", + "DE.Views.LeftMenu.txtDeveloper": "DEVELOPER MODE", "DE.Views.MailMergeEmailDlg.cancelButtonText": "Cancel", "DE.Views.MailMergeEmailDlg.filePlaceholder": "PDF", "DE.Views.MailMergeEmailDlg.okButtonText": "Send", diff --git a/apps/documenteditor/main/resources/less/leftmenu.less b/apps/documenteditor/main/resources/less/leftmenu.less index 964bf5c26..d1c5c039f 100644 --- a/apps/documenteditor/main/resources/less/leftmenu.less +++ b/apps/documenteditor/main/resources/less/leftmenu.less @@ -430,3 +430,19 @@ button.notify .btn-menu-comments {background-position: -0*@toolbar-icon-size -60 font: 12px tahoma, arial, verdana, sans-serif; } } + +#developer-hint { + position: absolute; + left: 0; + padding: 12px 0; + background-color: #ffb400; + color: #6e4e00 !important; + white-space: nowrap; + line-height: @app-header-height; + writing-mode: vertical-rl; + -moz-transform: rotate(180deg); + -ms-transform: rotate(180deg); + -webkit-transform: rotate(180deg); + -o-transform: rotate(180deg); + transform: rotate(180deg); +} \ No newline at end of file diff --git a/apps/documenteditor/main/resources/less/toolbar.less b/apps/documenteditor/main/resources/less/toolbar.less index da920c1b8..98097e47a 100644 --- a/apps/documenteditor/main/resources/less/toolbar.less +++ b/apps/documenteditor/main/resources/less/toolbar.less @@ -394,6 +394,7 @@ color: #ffffff; font: 11px arial; white-space: nowrap; + letter-spacing: 1px; } #id-toolbar-menu-auto-fontcolor > a.selected { diff --git a/apps/documenteditor/mobile/app/controller/DocumentHolder.js b/apps/documenteditor/mobile/app/controller/DocumentHolder.js index a634ded75..73973ca18 100644 --- a/apps/documenteditor/mobile/app/controller/DocumentHolder.js +++ b/apps/documenteditor/mobile/app/controller/DocumentHolder.js @@ -161,7 +161,7 @@ define([ }, onApiShowPopMenu: function(posX, posY) { - if ($('.popover.settings, .popup.settings, .picker-modal.settings, .modal.modal-in').length > 0) { + if ($('.popover.settings, .popup.settings, .picker-modal.settings, .modal.modal-in, .actions-modal').length > 0) { return; } diff --git a/apps/documenteditor/mobile/app/controller/Main.js b/apps/documenteditor/mobile/app/controller/Main.js index 3055cf3d0..ecb792aa4 100644 --- a/apps/documenteditor/mobile/app/controller/Main.js +++ b/apps/documenteditor/mobile/app/controller/Main.js @@ -79,7 +79,6 @@ define([ isDisconnected : false, usersCount : 1, fastCoauth : true, - startModifyDocument : true, lostEditingRights : false, licenseWarning : false }; @@ -313,14 +312,9 @@ define([ me.setLongActionView(action) } else { if (me._state.fastCoauth && me._state.usersCount>1 && id==Asc.c_oAscAsyncAction['Save']) { - if (me._state.timerSave===undefined) - me._state.timerSave = setInterval(function(){ - if ((new Date()) - me._state.isSaving>500) { - clearInterval(me._state.timerSave); - //console.debug('End long action'); - me._state.timerSave = undefined; - } - }, 500); + // me._state.timerSave = setTimeout(function () { + //console.debug('End long action'); + // }, 500); } else { // console.debug('End long action'); } @@ -353,7 +347,7 @@ define([ break; case Asc.c_oAscAsyncAction['Save']: - me._state.isSaving = new Date(); + // clearTimeout(this._state.timerSave); title = me.saveTitleText; text = me.saveTextText; break; @@ -677,7 +671,6 @@ define([ me.api.asc_registerCallback('asc_onDocumentModifiedChanged', _.bind(me.onDocumentModifiedChanged, me)); me.api.asc_registerCallback('asc_onDocumentCanSaveChanged', _.bind(me.onDocumentCanSaveChanged, me)); - me.api.asc_registerCallback('asc_onSaveUrl', _.bind(me.onSaveUrl, me)); /** coauthoring begin **/ me.api.asc_registerCallback('asc_onCollaborativeChanges', _.bind(me.onCollaborativeChanges, me)); me.api.asc_registerCallback('asc_OnTryUndoInFastCollaborative',_.bind(me.onTryUndoInFastCollaborative, me)); @@ -817,6 +810,10 @@ define([ config.msg = this.errorConnectToServer; break; + case Asc.c_oAscError.ID.UplImageUrl: + config.msg = this.errorBadImageUrl; + break; + default: config.msg = this.errorDefaultMessage.replace('%1', id); break; @@ -879,21 +876,12 @@ define([ if (window.document.title != title) window.document.title = title; - if (!this._state.fastCoauth || this._state.usersCount<2 ) - Common.Gateway.setDocumentModified(isModified); - else if ( this._state.startModifyDocument!==undefined && this._state.startModifyDocument === isModified){ - Common.Gateway.setDocumentModified(isModified); - this._state.startModifyDocument = (this._state.startModifyDocument) ? !this._state.startModifyDocument : undefined; - } - + Common.Gateway.setDocumentModified(isModified); this._state.isDocModified = isModified; } }, onDocumentModifiedChanged: function() { - if (this._state.fastCoauth && this._state.usersCount > 1 && this._state.startModifyDocument===undefined ) - return; - var isModified = this.api.asc_isDocumentCanSave(); if (this._state.isDocModified !== isModified) { Common.Gateway.setDocumentModified(this.api.isDocumentModified()); @@ -929,10 +917,6 @@ define([ $('#loading-mask').hide().remove(); }, - onSaveUrl: function(url) { - Common.Gateway.save(url); - }, - onDownloadUrl: function(url) { if (this._state.isFromGatewayDownloadAs) { Common.Gateway.downloadAs(url); @@ -1231,7 +1215,8 @@ define([ textClose: 'Close', textDone: 'Done', titleServerVersion: 'Editor updated', - errorServerVersion: 'The editor version has been updated. The page will be reloaded to apply the changes.' + errorServerVersion: 'The editor version has been updated. The page will be reloaded to apply the changes.', + errorBadImageUrl: 'Image url is incorrect' } })(), DE.Controllers.Main || {})) }); \ No newline at end of file diff --git a/apps/documenteditor/mobile/app/controller/add/AddTable.js b/apps/documenteditor/mobile/app/controller/add/AddTable.js index ea3afb806..d542e043f 100644 --- a/apps/documenteditor/mobile/app/controller/add/AddTable.js +++ b/apps/documenteditor/mobile/app/controller/add/AddTable.js @@ -117,7 +117,7 @@ define([ text: '', afterText: '
' + - '
' + + '
' + '
' + me.textColumns + '
' + '
' + me.textRows + '
' + '
' + @@ -152,9 +152,12 @@ define([ rotateEffect: true, value: [3, 3], cols: [{ - textAlign: 'left', + textAlign: 'center', + width: '100%', values: [1,2,3,4,5,6,7,8,9,10] }, { + textAlign: 'center', + width: '100%', values: [1,2,3,4,5,6,7,8,9,10] }] }); diff --git a/apps/documenteditor/mobile/app/template/AddImage.template b/apps/documenteditor/mobile/app/template/AddImage.template index 0ac3570e4..f5bbcb0c8 100644 --- a/apps/documenteditor/mobile/app/template/AddImage.template +++ b/apps/documenteditor/mobile/app/template/AddImage.template @@ -40,12 +40,13 @@
-
<%= scope.textAddress %>
+ <% if (!android) { %>
<%= scope.textAddress %>
<% } %>