diff --git a/apps/common/embed/lib/view/modals.js b/apps/common/embed/lib/view/modals.js index e6db5edc9..41eb7b846 100644 --- a/apps/common/embed/lib/view/modals.js +++ b/apps/common/embed/lib/view/modals.js @@ -73,7 +73,7 @@ common.view.modals = new(function() { var _$dlg; if (name == 'share') { - if ( config && config.btnsShare ) { + if ( window.config && window.config.btnsShare ) { let _btns = []; for (const key of Object.keys(config.btnsShare)) _btns.push(``); diff --git a/apps/common/forms/resources/img/icon-menu-sprite.svg b/apps/common/forms/resources/img/icon-menu-sprite.svg index 5ce3f5827..ffd9929f8 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 @@ - + @@ -184,5 +184,25 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/apps/common/forms/resources/less/common.less b/apps/common/forms/resources/less/common.less index c1a0ccd51..c49c2dfc8 100644 --- a/apps/common/forms/resources/less/common.less +++ b/apps/common/forms/resources/less/common.less @@ -439,7 +439,7 @@ .svg-icon { background: data-uri('../../../../common/forms/resources/img/icon-menu-sprite.svg') no-repeat; - background-size: @icon-width*24 @icon-height*2; + background-size: @icon-width*27 @icon-height*2; &.download { background-position: -@icon-width 0; @@ -531,6 +531,18 @@ background-position: -@icon-width*23 0; background-position: -@icon-width*23 @icon-normal-top; } + &.search { + background-position: -@icon-width*24 0; + background-position: -@icon-width*24 @icon-normal-top; + } + &.btn-sheet-view { + background-position: -@icon-width*25 0; + background-position: -@icon-width*25 @icon-normal-top; + } + &.hide-password { + background-position: -@icon-width*26 0; + background-position: -@icon-width*26 @icon-normal-top; + } } .btn { diff --git a/apps/common/main/lib/component/ColorButton.js b/apps/common/main/lib/component/ColorButton.js index e33631d3b..8e2a2280b 100644 --- a/apps/common/main/lib/component/ColorButton.js +++ b/apps/common/main/lib/component/ColorButton.js @@ -55,12 +55,15 @@ define([ getPicker: function(color, colors) { if (!this.colorPicker) { - this.colorPicker = new Common.UI.ThemeColorPalette({ + var config = { el: this.cmpEl.find('#' + this.menu.id + '-color-menu'), - transparent: this.options.transparent, value: color, colors: colors - }); + }; + (this.options.transparent!==undefined) && (config['transparent'] = this.options.transparent); + (this.options.hideEmptyColors!==undefined) && (config['hideEmptyColors'] = this.options.hideEmptyColors); + + this.colorPicker = new Common.UI.ThemeColorPalette(config); this.colorPicker.on('select', _.bind(this.onColorSelect, this)); this.cmpEl.find('#' + this.menu.id + '-color-new').on('click', _.bind(this.addNewColor, this)); if (this.options.auto) { @@ -80,7 +83,7 @@ define([ getMenu: function(options) { if (typeof this.menu !== 'object') { options = options || this.options; - var height = options.paletteHeight || 240, + var height = options.paletteHeight ? options.paletteHeight + 'px' : 'auto', id = Common.UI.getId(), auto = []; if (options.auto) { @@ -98,7 +101,8 @@ define([ cls: 'shifted-left', additionalAlign: options.additionalAlign, items: (options.additionalItems ? options.additionalItems : []).concat(auto).concat([ - { template: _.template('
') }, + { template: _.template('
') }, + {caption: '--'}, { id: id + '-color-new', template: _.template('' + this.textNewColor + '') diff --git a/apps/common/main/lib/component/ComboBoxFonts.js b/apps/common/main/lib/component/ComboBoxFonts.js index df6242964..483284aa3 100644 --- a/apps/common/main/lib/component/ComboBoxFonts.js +++ b/apps/common/main/lib/component/ComboBoxFonts.js @@ -66,12 +66,12 @@ define([ spriteCols = 1, applicationPixelRatio = Common.Utils.applicationPixelRatio(); - if (typeof window['AscDesktopEditor'] === 'object') { - thumbs[0].path = window['AscDesktopEditor'].getFontsSprite(''); - thumbs[1].path = window['AscDesktopEditor'].getFontsSprite('@1.25x'); - thumbs[2].path = window['AscDesktopEditor'].getFontsSprite('@1.5x'); - thumbs[3].path = window['AscDesktopEditor'].getFontsSprite('@1.75x'); - thumbs[4].path = window['AscDesktopEditor'].getFontsSprite('@2x'); + if ( Common.Controllers.Desktop.isActive() ) { + thumbs[0].path = Common.Controllers.Desktop.call('getFontsSprite'); + thumbs[1].path = Common.Controllers.Desktop.call('getFontsSprite', '@1.25x'); + thumbs[2].path = Common.Controllers.Desktop.call('getFontsSprite', '@1.5x'); + thumbs[3].path = Common.Controllers.Desktop.call('getFontsSprite', '@1.75x'); + thumbs[4].path = Common.Controllers.Desktop.call('getFontsSprite', '@2x'); } var bestDistance = Math.abs(applicationPixelRatio-thumbs[0].ratio); diff --git a/apps/common/main/lib/component/DataView.js b/apps/common/main/lib/component/DataView.js index 5680c1717..859df45c4 100644 --- a/apps/common/main/lib/component/DataView.js +++ b/apps/common/main/lib/component/DataView.js @@ -476,12 +476,12 @@ define([ var me = this, view_el = $(view.el), tip = record.get('tip'); - if (tip) { + if (tip!==undefined && tip!==null) { if (this.delayRenderTips) view_el.one('mouseenter', function(){ // hide tooltip when mouse is over menu view_el.attr('data-toggle', 'tooltip'); view_el.tooltip({ - title : tip, + title : record.get('tip'), // use actual tip, because it can be changed placement : 'cursor', zIndex : me.tipZIndex }); @@ -490,7 +490,7 @@ define([ else { view_el.attr('data-toggle', 'tooltip'); view_el.tooltip({ - title : tip, + title : record.get('tip'), // use actual tip, because it can be changed placement : 'cursor', zIndex : me.tipZIndex }); @@ -1652,7 +1652,18 @@ define([ if (recents.length > 0 && diff) { me.recentShapes = recents; - me.groups[0].groupStore.reset(me.recentShapes); + var resentsStore = new Common.UI.DataViewStore(); + _.each(me.recentShapes, function (recent) { + var model = { + data: {shapeType: recent.data.shapeType}, + tip: recent.tip, + allowSelected: recent.allowSelected, + selected: recent.selected, + groupName: recent.groupName + }; + resentsStore.push(model); + }); + me.groups[0].groupStore = resentsStore; var store = new Common.UI.DataViewStore(); _.each(me.groups, function (group) { diff --git a/apps/common/main/lib/component/InputField.js b/apps/common/main/lib/component/InputField.js index 2c4ab717e..f1cf1bc52 100644 --- a/apps/common/main/lib/component/InputField.js +++ b/apps/common/main/lib/component/InputField.js @@ -566,7 +566,8 @@ define([ validateOnBlur: true, disabled: false, editable: true, - iconCls: 'toolbar__icon btn-sheet-view', + showCls: 'toolbar__icon btn-sheet-view', + hideCls: 'toolbar__icon hide-password', btnHint: '', repeatInput: null, showPwdOnClick: true @@ -575,6 +576,7 @@ define([ initialize : function(options) { options = options || {}; options.btnHint = options.btnHint || this.textHintShowPwd; + options.iconCls = options.showCls || this.options.showCls; Common.UI.InputFieldBtn.prototype.initialize.call(this, options); @@ -617,7 +619,7 @@ define([ passwordShow: function (e) { if (this.disabled) return; - this._button.setIconCls('toolbar__icon hide-password'); + this._button.setIconCls(this.options.hideCls); this.type = 'text'; this._input.attr('type', this.type); @@ -636,7 +638,7 @@ define([ }, passwordHide: function (e) { - this._button.setIconCls('toolbar__icon btn-sheet-view'); + this._button.setIconCls(this.options.showCls); this.type = 'password'; (this._input.val() !== '') && this._input.attr('type', this.type); diff --git a/apps/common/main/lib/component/Menu.js b/apps/common/main/lib/component/Menu.js index b5eb87827..03e16cc01 100644 --- a/apps/common/main/lib/component/Menu.js +++ b/apps/common/main/lib/component/Menu.js @@ -377,12 +377,12 @@ define([ onBeforeShowMenu: function(e) { Common.NotificationCenter.trigger('menu:show'); this.trigger('show:before', this, e); - this.alignPosition(); + (e && e.target===e.currentTarget) && this.alignPosition(); }, onAfterShowMenu: function(e) { this.trigger('show:after', this, e); - if (this.scroller) { + if (this.scroller && e && e.target===e.currentTarget) { var menuRoot = this.menuRoot; if (this.wheelSpeed===undefined) { var item = menuRoot.find('> li:first'), @@ -664,7 +664,7 @@ define([ if (top + menuH > docH + cg.top) { menuRoot.css('max-height', (docH - top) + 'px'); (!this.scroller) && (this.scroller = new Common.UI.Scroller({ - el: this.$el.find('.dropdown-menu '), + el: this.$el.find('> .dropdown-menu '), minScrollbarLength: 30, suppressScrollX: true, alwaysVisibleY: this.scrollAlwaysVisible @@ -975,12 +975,12 @@ define([ onBeforeShowMenu: function(e) { Common.NotificationCenter.trigger('menu:show'); this.trigger('show:before', this, e); - this.alignPosition(); + (e && e.target===e.currentTarget) && this.alignPosition(); }, onAfterShowMenu: function(e) { this.trigger('show:after', this, e); - if (this.scroller) { + if (this.scroller && e && e.target===e.currentTarget) { this.scroller.update({alwaysVisibleY: this.scrollAlwaysVisible}); var menuRoot = this.menuRoot, $selected = menuRoot.find('> li .checked'); diff --git a/apps/common/main/lib/component/Mixtbar.js b/apps/common/main/lib/component/Mixtbar.js index 364c8464c..9b452c354 100644 --- a/apps/common/main/lib/component/Mixtbar.js +++ b/apps/common/main/lib/component/Mixtbar.js @@ -120,6 +120,7 @@ define([ Common.NotificationCenter.on('tab:visible', _.bind(function(action, visible){ this.setVisible(action, visible); }, this)); + Common.NotificationCenter.on('tab:resize', _.bind(this.onResizeTabs, this)); }, afterRender: function() { @@ -229,7 +230,7 @@ define([ // optsFold.timer = setTimeout(this.collapse, optsFold.timeout); }, - onResize: function(e) { + onResizeTabs: function(e) { if ( this.hasTabInvisible() ) { if ( !$boxTabs.parent().hasClass('short') ) $boxTabs.parent().addClass('short'); @@ -237,6 +238,10 @@ define([ if ( $boxTabs.parent().hasClass('short') ) { $boxTabs.parent().removeClass('short'); } + }, + + onResize: function(e) { + this.onResizeTabs(); this.hideMoreBtns(); this.processPanelVisible(); }, diff --git a/apps/common/main/lib/component/TabBar.js b/apps/common/main/lib/component/TabBar.js index ec6ce90e5..d7a16a04c 100644 --- a/apps/common/main/lib/component/TabBar.js +++ b/apps/common/main/lib/component/TabBar.js @@ -513,10 +513,10 @@ define([ }, setTabVisible: function(index, suppress) { - if (index <= 0 || index == 'first') { + if (index <= 0) { this.$bar.scrollLeft(0); this.checkInvisible(suppress); - } else if ( index >= (this.tabs.length - 1) || index == 'last') { + } else if ( index >= (this.tabs.length - 1)) { var tab = this.tabs[this.tabs.length-1].$el; if (this.$bar.find('.separator-item').length === 0) { this.$bar.append('
  • '); diff --git a/apps/common/main/lib/component/ThemeColorPalette.js b/apps/common/main/lib/component/ThemeColorPalette.js index b2f831021..1af6e825b 100644 --- a/apps/common/main/lib/component/ThemeColorPalette.js +++ b/apps/common/main/lib/component/ThemeColorPalette.js @@ -52,7 +52,9 @@ define([ dynamiccolors: 10, standardcolors: 10, themecolors: 10, + columns: 10, effects: 5, + hideEmptyColors: true, allowReselect: true, transparent: false, value: '000000', @@ -62,7 +64,7 @@ define([ template : _.template( - '
    ' + + '
    ' + '<% var me = this; var idx = 0; %>' + '<% $(colors).each(function(num, item) { %>' + '<% if (me.isBlankSeparator(item)) { %>
    ' + @@ -76,6 +78,9 @@ define([ ' ' + '' + '<% } else if (me.isEffect(item)) { %>' + + '<% if (idx>0 && me.columns>0 && idx%me.columns===0) { %> ' + + '
    ' + + '<% } %>' + '' + ' ' + '' + @@ -85,9 +90,11 @@ define([ '<% }); %>' + '
    ' + '<% if (me.options.dynamiccolors!==undefined) { %>' + - '
    ' + + '
    ' + + '
    ' + + '
    <%=me.textRecentColors%>
    ' + '<% for (var i=0; i' + - '' + + '' + ' ' + '<% } %>' + '<% } %>' + @@ -103,10 +110,12 @@ define([ el = me.$el || $(this.el); this.colors = me.options.colors || this.generateColorData(me.options.themecolors, me.options.effects, me.options.standardcolors, me.options.transparent); + this.columns = me.options.columns || 0; this.enableKeyEvents= me.options.enableKeyEvents; this.tabindex = me.options.tabindex || 0; this.outerMenu = me.options.outerMenu; this.lastSelectedIdx = -1; + this.emptyColorsClass = me.options.hideEmptyColors ? 'hidden' : ''; me.colorItems = []; if (me.options.keyMoveDirection=='vertical') @@ -123,6 +132,15 @@ define([ this.updateColors(this.options.updateColorsArr[0], this.options.updateColorsArr[1]); if (this.options.value) this.select(this.options.value, true); + if (this.options.outerMenu && this.options.outerMenu.focusOnShow && this.options.outerMenu.menu) { + el.addClass('focused'); + this.options.outerMenu.menu.on('show:after', function(menu) { + _.delay(function() { + me.showLastSelected(); + me.focus(); + }, 10); + }); + } this.updateCustomColors(); el.closest('.btn-group').on('show.bs.dropdown', _.bind(this.updateCustomColors, this)); el.closest('.dropdown-submenu').on('show.bs.dropdown', _.bind(this.updateCustomColors, this)); @@ -178,9 +196,12 @@ define([ colors = colors ? colors.split(',') : []; var i = -1, colorEl, c = colors.length < this.options.dynamiccolors ? colors.length : this.options.dynamiccolors; + if (this.options.hideEmptyColors && this._layoutParams && el.find('.dynamic-empty-color').length !== (this.options.dynamiccolors - c)) {// recalc indexed if change custom colors + this._layoutParams = undefined; + } while (++i < c) { colorEl = el.find('.color-dynamic-'+ i); - colorEl.removeClass('dynamic-empty-color').attr('color', colors[i]); + colorEl.removeClass('dynamic-empty-color').removeClass(this.emptyColorsClass).attr('color', colors[i]); colorEl.find('span').css({ 'background-color': '#'+colors[i] }); @@ -193,12 +214,13 @@ define([ while (i < this.options.dynamiccolors) { colorEl = el.find('.color-dynamic-'+ i); colorEl.removeAttr('color'); - colorEl.addClass('dynamic-empty-color'); + colorEl.addClass('dynamic-empty-color').addClass(this.emptyColorsClass); colorEl.find('span').css({ 'background-color': 'transparent' }); i++; } + el.find('.palette-color-dynamiccolors').toggleClass(this.emptyColorsClass, c===0); } }, @@ -207,7 +229,7 @@ define([ var target = $(e.target).closest('a'); var color, cmp; - if (target.length==0) return; + if (target.length==0) return false; if (target.hasClass('color-transparent') ) { me.clearSelection(true); @@ -275,12 +297,16 @@ define([ if (child.length==0) { this.updateCustomColors(); child = el.find('.color-dynamic-' + (this.options.dynamiccolors - 1)); + } else { + if (this.options.hideEmptyColors && this._layoutParams) // recalc indexed + this._layoutParams = undefined; } - child.first().removeClass('dynamic-empty-color').addClass(this.selectedCls).attr('color', color[1]); + child.first().removeClass('dynamic-empty-color').removeClass(this.emptyColorsClass).addClass(this.selectedCls).attr('color', color[1]); child.first().find('span').css({ 'background-color': '#'+color[1] }); + el.find('.palette-color-dynamiccolors').removeClass(this.emptyColorsClass); this.select(color[1], true); } }, @@ -493,7 +519,7 @@ define([ var arr = [], len = (themecolors>0 && effects>0) ? themecolors * effects : 0; if (themecolors>0) { - arr = [this.textThemeColors, '-']; + arr = [this.textThemeColors]; for (var i=0; i 0))); + } + return { init: function (opts) { _.extend(config, opts); @@ -256,12 +264,13 @@ define([ Common.NotificationCenter.on({ 'modal:show': _onModalDialog.bind(this, 'open'), - 'modal:close': _onModalDialog.bind(this, 'close') - , 'uitheme:changed' : function (name) { + 'modal:close': _onModalDialog.bind(this, 'close'), + 'uitheme:changed' : function (name) { var theme = Common.UI.Themes.get(name); if ( theme ) native.execCommand("uitheme:changed", JSON.stringify({name:name, type:theme.type})); - } + }, + 'hints:show': _onHintsShow.bind(this), }); webapp.addListeners({ @@ -313,6 +322,15 @@ define([ // return webapp.getController('Main').api.asc_isOffline(); return webapp.getController('Main').appOptions.isOffline; }, + isFeatureAvailable: function (feature) { + return !!native && !!native[feature]; + }, + call: function (name) { + if ( native[name] ) { + let args = [].slice.call(arguments, 1); + return native[name](...args); + } + }, }; }; diff --git a/apps/common/main/lib/controller/HintManager.js b/apps/common/main/lib/controller/HintManager.js index 9f135fda1..81299f97d 100644 --- a/apps/common/main/lib/controller/HintManager.js +++ b/apps/common/main/lib/controller/HintManager.js @@ -117,7 +117,8 @@ Common.UI.HintManager = new(function() { _inputTimer, _isDocReady = false, _isEditDiagram = false, - _usedTitles = []; + _usedTitles = [], + _appPrefix; var _api; @@ -170,6 +171,8 @@ Common.UI.HintManager = new(function() { } else { _hintVisible = false; } + + Common.NotificationCenter.trigger('hints:show', _hintVisible, _currentLevel); }; var _hideHints = function() { @@ -178,6 +181,8 @@ Common.UI.HintManager = new(function() { item.remove() }); clearInterval(_inputTimer); + + Common.NotificationCenter.trigger('hints:show', false); }; var _nextLevel = function(level) { @@ -436,6 +441,10 @@ Common.UI.HintManager = new(function() { var _init = function(api) { _api = api; + + var filter = Common.localStorage.getKeysFilter(); + _appPrefix = (filter && filter.length) ? filter.split(',')[0] : ''; + Common.NotificationCenter.on({ 'app:ready': function (mode) { var lang = mode.lang ? mode.lang.toLowerCase() : 'en'; @@ -594,7 +603,7 @@ Common.UI.HintManager = new(function() { } } - _needShow = (!e.shiftKey && e.keyCode == Common.UI.Keys.ALT && !Common.Utils.ModalWindow.isVisible() && _isDocReady && _arrAlphabet.length > 0); + _needShow = (Common.Utils.InternalSettings.get(_appPrefix + "settings-use-alt-key") && !e.shiftKey && e.keyCode == Common.UI.Keys.ALT && !Common.Utils.ModalWindow.isVisible() && _isDocReady && _arrAlphabet.length > 0); if (e.altKey && e.keyCode !== 115) { e.preventDefault(); } diff --git a/apps/common/main/lib/controller/ReviewChanges.js b/apps/common/main/lib/controller/ReviewChanges.js index aab8177c2..64386ade3 100644 --- a/apps/common/main/lib/controller/ReviewChanges.js +++ b/apps/common/main/lib/controller/ReviewChanges.js @@ -287,6 +287,9 @@ define([ this.popover = Common.Views.ReviewPopover.prototype.getPopover({ reviewStore : this.popoverChanges, renderTo : this.sdkViewName, + canRequestUsers: (this.appConfig) ? this.appConfig.canRequestUsers : undefined, + canRequestSendNotify: (this.appConfig) ? this.appConfig.canRequestSendNotify : undefined, + mentionShare: (this.appConfig) ? this.appConfig.mentionShare : true, api: this.api }); this.popover.setReviewStore(this.popoverChanges); diff --git a/apps/common/main/lib/extend/Bootstrap.js b/apps/common/main/lib/extend/Bootstrap.js index f5ae4fedc..5f6593b55 100755 --- a/apps/common/main/lib/extend/Bootstrap.js +++ b/apps/common/main/lib/extend/Bootstrap.js @@ -128,8 +128,9 @@ function patchDropDownKeyDown(e) { var mnu = $('> [role=menu]', li), $subitems = mnu.find('> li:not(.divider):not(.disabled):visible > a'), $dataviews = mnu.find('> li:not(.divider):not(.disabled):visible .dataview'), + $palette = mnu.find('> li:not(.divider):not(.disabled):visible .theme-colorpalette.focused'), $internal_menu = mnu.find('> li:not(.divider):not(.disabled):visible ul.internal-menu'); - if ($subitems.length>0 && $dataviews.length<1 && $internal_menu.length<1) + if ($subitems.length>0 && $dataviews.length<1 && $internal_menu.length<1 && $palette.length<1) ($subitems.index($subitems.filter(':focus'))<0) && $subitems.eq(0).focus(); }, 250); } diff --git a/apps/common/main/lib/util/Tip.js b/apps/common/main/lib/util/Tip.js index b0521586d..4a9574c24 100644 --- a/apps/common/main/lib/util/Tip.js +++ b/apps/common/main/lib/util/Tip.js @@ -109,7 +109,7 @@ var me = this; Common.NotificationCenter.on({'layout:changed': function(e){ - if (!me.options.hideonclick && me.tip().is(':visible')) + if (!me.options.keepvisible && !me.options.hideonclick && me.tip().is(':visible')) me.hide(); }}); }, diff --git a/apps/common/main/lib/view/Header.js b/apps/common/main/lib/view/Header.js index 3be730768..54a2fb61d 100644 --- a/apps/common/main/lib/view/Header.js +++ b/apps/common/main/lib/view/Header.js @@ -52,7 +52,7 @@ define([ Common.Views.Header = Backbone.View.extend(_.extend(function(){ var storeUsers, appConfig; - var $userList, $panelUsers, $btnUsers, $btnUserName; + var $userList, $panelUsers, $btnUsers, $btnUserName, $labelDocName; var _readonlyRights = false; var templateUserItem = @@ -186,11 +186,13 @@ define([ } else { $panelUsers['hide'](); } + updateDocNamePosition(appConfig); } function onLostEditRights() { _readonlyRights = true; this.btnShare && this.btnShare.setVisible(false); + updateDocNamePosition(appConfig); } function onUsersClick(e) { @@ -203,27 +205,39 @@ define([ } } - function onAppShowed(config) { - //config.isCrypted =true; //delete fore merge! - if ( this.labelDocName ) { - if ( config.isCrypted ) { - this.labelDocName.attr({'style':'text-align: left;'}); - this.labelDocName.before( - '
    ' + - '' + - '
    '); - this.imgCrypted = this.labelDocName.parent().find('.crypted'); - } - + function updateDocNamePosition(config) { + if ( $labelDocName && config) { + var $parent = $labelDocName.parent(); if (!config.isEdit || !config.customization || !config.customization.compactHeader) { - var $parent = this.labelDocName.parent(); var _left_width = $parent.position().left, _right_width = $parent.next().outerWidth(); - - if ( _left_width < _right_width ) - this.labelDocName.parent().css('padding-left', _right_width - _left_width); - else this.labelDocName.parent().css('padding-right', _left_width - _right_width); + $parent.css('padding-left', _left_width < _right_width ? Math.max(2, _right_width - _left_width) : 2); + $parent.css('padding-right', _left_width < _right_width ? 2 : Math.max(2, _left_width - _right_width)); } + + if (!(config.customization && config.customization.toolbarHideFileName) && (!config.isEdit || config.customization && config.customization.compactHeader)) { + var basis = parseFloat($parent.css('padding-left') || 0) + parseFloat($parent.css('padding-right') || 0) + parseInt($labelDocName.css('min-width') || 50); // 2px - box-shadow + config.isCrypted && (basis += 20); + $parent.css('flex-basis', Math.ceil(basis) + 'px'); + $parent.closest('.extra.right').css('flex-basis', Math.ceil(basis) + $parent.next().outerWidth() + 'px'); + Common.NotificationCenter.trigger('tab:resize'); + } + } + } + + function onAppShowed(config) { + // config.isCrypted =true; //delete fore merge! + if ( $labelDocName ) { + if ( config.isCrypted ) { + $labelDocName.before( + ''); + this.imgCrypted = $labelDocName.parent().find('.crypted'); + this._showImgCrypted = true; + } + + updateDocNamePosition(config); } } @@ -249,6 +263,7 @@ define([ }); me.btnShare.updateHint(me.tipAccessRights); me.btnShare.setVisible(!_readonlyRights && appConfig && (appConfig.sharingSettingsUrl && appConfig.sharingSettingsUrl.length || appConfig.canRequestSharingSettings)); + updateDocNamePosition(appConfig); } if ( me.logo ) @@ -279,6 +294,7 @@ define([ }); $btnUsers.on('click', onUsersClick.bind(me)); $panelUsers[(editingUsers > 1 && appConfig && (appConfig.isEdit || appConfig.isRestrictedEdit)) ? 'show' : 'hide'](); + updateDocNamePosition(appConfig); } if (appConfig.user.guest && appConfig.canRenameAnonymous) { @@ -336,56 +352,57 @@ define([ function onFocusDocName(e){ var me = this; - me.imgCrypted && me.imgCrypted.attr('hidden', true); + me.imgCrypted && me.imgCrypted.toggleClass('hidden', true); me.isSaveDocName =false; if(me.withoutExt) return; - var name = me.cutDocName(me.labelDocName.val()); - _.delay(function(){ - me.labelDocName.val(name); - },100); + var name = me.cutDocName($labelDocName.val()); me.withoutExt = true; + _.delay(function(){ + me.setDocTitle(name); + $labelDocName.select(); + },100); } function onDocNameKeyDown(e) { var me = this; - var name = me.labelDocName.val(); + var name = $labelDocName.val(); if ( e.keyCode == Common.UI.Keys.RETURN ) { name = name.trim(); - me.isSaveDocName =true; if ( !_.isEmpty(name) && me.cutDocName(me.documentCaption) !== name ) { + me.isSaveDocName =true; if ( /[\t*\+:\"<>?|\\\\/]/gim.test(name) ) { _.defer(function() { Common.UI.error({ msg: (new Common.Views.RenameDialog).txtInvalidName + "*+:\"<>?|\/" , callback: function() { _.delay(function() { - me.labelDocName.focus(); + $labelDocName.focus(); me.isSaveDocName =true; }, 50); } }); - //me.labelDocName.blur(); }) } else if(me.withoutExt) { name = me.cutDocName(name); me.options.wopi ? me.api.asc_wopi_renameFile(name) : Common.Gateway.requestRename(name); name += me.fileExtention; - me.labelDocName.val(name); me.withoutExt = false; + me.setDocTitle(name); Common.NotificationCenter.trigger('edit:complete', me); } } else { - Common.NotificationCenter.trigger('edit:complete', me); } } else if ( e.keyCode == Common.UI.Keys.ESC ) { Common.NotificationCenter.trigger('edit:complete', this); } else { - me.labelDocName.attr('size', name.length + me.fileExtention.length > 10 ? name.length + me.fileExtention.length : 10); + _.delay(function(){ + me.setDocTitle(); + },10); } } @@ -442,6 +459,7 @@ define([ Common.NotificationCenter.on({ 'app:ready': function(mode) {Common.Utils.asyncCall(onAppReady, me, mode);}, 'app:face': function(mode) {Common.Utils.asyncCall(onAppShowed, me, mode);}, + 'tab:visible': function() {Common.Utils.asyncCall(updateDocNamePosition, me, appConfig);}, 'collaboration:sharingdeny': function(mode) {Common.Utils.asyncCall(onLostEditRights, me, mode);} }); Common.NotificationCenter.on('uitheme:changed', this.changeLogo.bind(this)); @@ -487,18 +505,16 @@ define([ textShare: this.textShare })); - if ( !me.labelDocName ) { - me.labelDocName = $html.find('#rib-doc-name'); + if ( !$labelDocName ) { + $labelDocName = $html.find('#rib-doc-name'); if ( me.documentCaption ) { - me.labelDocName.val(me.documentCaption); + me.setDocTitle(me.documentCaption); } } else { $html.find('#rib-doc-name').hide(); } - if ( !_.isUndefined(this.options.canRename) ) { - this.setCanRename(this.options.canRename); - } + this.setCanRename(!!this.options.canRename); if ( this.options.canBack === true ) { me.btnGoBack.render($html.find('#slot-btn-back')); @@ -567,10 +583,11 @@ define([ if ( role == 'title' ) { var $html = $(_.template(templateTitleBox)()); - !!me.labelDocName && me.labelDocName.hide().off(); // hide document title if it was created in right box - me.labelDocName = $html.find('#title-doc-name'); - me.labelDocName.val( me.documentCaption ); - me.options.wopi && me.labelDocName.attr('maxlength', me.options.wopi.FileNameMaxLength); + !!$labelDocName && $labelDocName.hide().off(); // hide document title if it was created in right box + $labelDocName = $html.find('#title-doc-name'); + me.setDocTitle( me.documentCaption ); + + me.options.wopi && $labelDocName.attr('maxlength', me.options.wopi.FileNameMaxLength); if (config.user.guest && config.canRenameAnonymous) { me.btnUserName = new Common.UI.Button({ @@ -642,12 +659,8 @@ define([ if (idx>0) this.fileExtention = this.documentCaption.substring(idx); this.isModified && (value += '*'); - if ( this.labelDocName ) { - this.labelDocName.val( value ); - // this.labelDocName.attr('size', value.length); - this.setCanRename(this.options.canRename); - - //this.setCanRename(true); + if ( $labelDocName ) { + this.setDocTitle( value ); } return value; }, @@ -662,7 +675,7 @@ define([ var _name = this.documentCaption; changed && (_name += '*'); - this.labelDocName.val(_name); + this.setDocTitle(_name); }, setCanBack: function (value, text) { @@ -670,7 +683,7 @@ define([ this.btnGoBack[value ? 'show' : 'hide'](); if (value) this.btnGoBack.updateHint((text && typeof text == 'string') ? text : this.textBack); - + updateDocNamePosition(appConfig); return this; }, @@ -683,7 +696,7 @@ define([ this.btnFavorite[value!==undefined && value!==null ? 'show' : 'hide'](); this.btnFavorite.changeIcon(!!value ? {next: 'btn-in-favorite'} : {curr: 'btn-in-favorite'}); this.btnFavorite.updateHint(!value ? this.textAddFavorite : this.textRemoveFavorite); - + updateDocNamePosition(appConfig); return this; }, @@ -692,12 +705,10 @@ define([ }, setCanRename: function (rename) { - //rename = true; //comment out for merge - var me = this; me.options.canRename = rename; - if ( me.labelDocName ) { - var label = me.labelDocName; + if ( $labelDocName ) { + var label = $labelDocName; if ( rename ) { label.removeAttr('disabled').tooltip({ title: me.txtRename, @@ -708,17 +719,17 @@ define([ 'keydown': onDocNameKeyDown.bind(this), 'focus': onFocusDocName.bind(this), 'blur': function (e) { - me.imgCrypted && me.imgCrypted.attr('hidden', false); + me.imgCrypted && me.imgCrypted.toggleClass('hidden', false); + label[0].selectionStart = label[0].selectionEnd = 0; if(!me.isSaveDocName) { - me.labelDocName.val(me.documentCaption); me.withoutExt = false; + me.setDocTitle(me.documentCaption); } }, 'paste': function (e) { setTimeout(function() { - var name = me.cutDocName(me.labelDocName.val()); - me.labelDocName.val(name); - me.labelDocName.attr('size', name.length + me.fileExtention.length > 10 ? name.length + me.fileExtention.length : 10); + var name = me.cutDocName($labelDocName.val()); + me.setDocTitle(name); }); } }); @@ -737,12 +748,37 @@ define([ }, cutDocName: function(name) { - if(name.length <= this.fileExtention.length) return; + if(name.length <= this.fileExtention.length) return name; var idx =name.length - this.fileExtention.length; return (name.substring(idx) == this.fileExtention) ? name.substring(0, idx) : name ; }, + setDocTitle: function(name){ + if(name) + $labelDocName.val(name); + else + name = $labelDocName.val(); + var width = this.getTextWidth(name); + (width>=0) && $labelDocName.width(width); + if (this._showImgCrypted && width>=0) { + this.imgCrypted.toggleClass('hidden', false); + this._showImgCrypted = false; + } + }, + + getTextWidth: function(text) { + if (!this._testCanvas ) { + var font = ($labelDocName.css('font-size') + ' ' + $labelDocName.css('font-family')).trim(); + if (font) { + var canvas = document.createElement("canvas"); + this._testCanvas = canvas.getContext('2d'); + this._testCanvas.font = font; + } + } + return this._testCanvas ? this._testCanvas.measureText(text).width : -1; + }, + setUserName: function(name) { this.options.userName = name; if ( this.btnUserName ) { diff --git a/apps/common/main/lib/view/ListSettingsDialog.js b/apps/common/main/lib/view/ListSettingsDialog.js index 96afdac6a..4df5c4906 100644 --- a/apps/common/main/lib/view/ListSettingsDialog.js +++ b/apps/common/main/lib/view/ListSettingsDialog.js @@ -50,6 +50,13 @@ define([ 'common/main/lib/view/SymbolTableDialog' ], function () { 'use strict'; + var _BulletTypes = {}; + _BulletTypes.none = -1; + _BulletTypes.symbol = 0; + _BulletTypes.image = 2; + _BulletTypes.newSymbol = 1; + _BulletTypes.newImage = -2; + Common.Views.ListSettingsDialog = Common.UI.Window.extend(_.extend({ options: { type: 0, // 0 - markers, 1 - numbers @@ -86,6 +93,15 @@ define([ '', '', '', + '', + '', + '', + '', + '', + '
    ', + '', + '', + '', '', '', '', @@ -106,7 +122,7 @@ define([ '', '', '', - '', + '', '', '', '', @@ -123,6 +139,8 @@ define([ this.props = options.props; this.options.tpl = _.template(this.template)(this.options); this.color = '000000'; + this.storage = !!options.storage; + this.api = options.api; Common.UI.Window.prototype.initialize.call(this, this.options); }, @@ -179,7 +197,9 @@ define([ [ '<% _.each(items, function(item) { %>', '
  • ', - '<%= item.displayValue %><% if (item.value === 0) { %><%=item.symbol%><% } %>', + '<%= item.displayValue %>', + '<% if (item.value === 0) { %><%=item.symbol%>', + '<% } else if (item.value === 2) { %><% } %>', '
  • ', '<% }); %>' ]; @@ -201,22 +221,30 @@ define([ template : _.template(template.join('')), itemsTemplate: _.template(itemsTemplate.join('')), data : [ - { displayValue: this.txtNone, value: -1 }, - { displayValue: this.txtSymbol + ': ', value: 0, symbol: "•", font: 'Arial' }, - { displayValue: this.txtSymbol + ': ', value: 0, symbol: "o", font: 'Courier New' }, - { displayValue: this.txtSymbol + ': ', value: 0, symbol: "§", font: 'Wingdings' }, - { displayValue: this.txtSymbol + ': ', value: 0, symbol: "v", font: 'Wingdings' }, - { displayValue: this.txtSymbol + ': ', value: 0, symbol: "Ø", font: 'Wingdings' }, - { displayValue: this.txtSymbol + ': ', value: 0, symbol: "ü", font: 'Wingdings' }, - { displayValue: this.txtSymbol + ': ', value: 0, symbol: "w", font: 'Wingdings' }, - { displayValue: this.txtSymbol + ': ', value: 0, symbol: "–", font: 'Arial' }, - { displayValue: this.txtNewBullet, value: 1 } + { displayValue: this.txtNone, value: _BulletTypes.none }, + { displayValue: this.txtSymbol + ': ', value: _BulletTypes.symbol, symbol: "•", font: 'Arial' }, + { displayValue: this.txtSymbol + ': ', value: _BulletTypes.symbol, symbol: "o", font: 'Courier New' }, + { displayValue: this.txtSymbol + ': ', value: _BulletTypes.symbol, symbol: "§", font: 'Wingdings' }, + { displayValue: this.txtSymbol + ': ', value: _BulletTypes.symbol, symbol: "v", font: 'Wingdings' }, + { displayValue: this.txtSymbol + ': ', value: _BulletTypes.symbol, symbol: "Ø", font: 'Wingdings' }, + { displayValue: this.txtSymbol + ': ', value: _BulletTypes.symbol, symbol: "ü", font: 'Wingdings' }, + { displayValue: this.txtSymbol + ': ', value: _BulletTypes.symbol, symbol: "w", font: 'Wingdings' }, + { displayValue: this.txtSymbol + ': ', value: _BulletTypes.symbol, symbol: "–", font: 'Arial' }, + { displayValue: this.txtNewBullet, value: _BulletTypes.newSymbol }, + { displayValue: this.txtNewImage, value: _BulletTypes.newImage } ], updateFormControl: function(record) { var formcontrol = $(this.el).find('.form-control'); if (record) { - if (record.get('value')==0) + if (record.get('value')===_BulletTypes.symbol) formcontrol[0].innerHTML = record.get('displayValue') + '' + record.get('symbol') + ''; + else if (record.get('value')===_BulletTypes.image) { + formcontrol[0].innerHTML = record.get('displayValue') + ''; + var bullet = new Asc.asc_CBullet(); + bullet.asc_fillBulletImage(me.imageProps.id); + bullet.drawSquareImage('id-dlg-list-bullet-combo-preview'); + } else if (record.get('value')===_BulletTypes.newImage) + formcontrol[0].innerHTML = me.txtImage; else formcontrol[0].innerHTML = record.get('displayValue'); } else @@ -227,7 +255,9 @@ define([ this.cmbBulletFormat.selectRecord(rec); this.bulletProps = {symbol: rec.get('symbol'), font: rec.get('font')}; this.cmbBulletFormat.on('selected', _.bind(function (combo, record) { - if (record.value === 1) { + this.imageControls.toggleClass('hidden', !(record.value === _BulletTypes.image || record.value === _BulletTypes.newImage)); + this.colorControls.toggleClass('hidden', record.value === _BulletTypes.image || record.value === _BulletTypes.newImage); + if (record.value === _BulletTypes.newSymbol) { var me = this, props = me.bulletProps, handler = function(dlg, result, settings) { @@ -242,10 +272,14 @@ define([ } } var store = combo.store; - if (!store.findWhere({value: 0, symbol: props.symbol, font: props.font})) - store.add({ displayValue: me.txtSymbol + ': ', value: 0, symbol: props.symbol, font: props.font }, {at: store.length-1}); + if (!store.findWhere({value: _BulletTypes.symbol, symbol: props.symbol, font: props.font})) { + var idx = store.indexOf(store.findWhere({value: _BulletTypes.image})); + if (idx<0) + idx = store.indexOf(store.findWhere({value: _BulletTypes.newSymbol})); + store.add({ displayValue: me.txtSymbol + ': ', value: _BulletTypes.symbol, symbol: props.symbol, font: props.font }, {at: idx}); + } combo.setData(store.models); - combo.selectRecord(combo.store.findWhere({value: 0, symbol: props.symbol, font: props.font})); + combo.selectRecord(combo.store.findWhere({value: _BulletTypes.symbol, symbol: props.symbol, font: props.font})); }, win = new Common.Views.SymbolTableDialog({ api: me.options.api, @@ -258,7 +292,11 @@ define([ }); win.show(); win.on('symbol:dblclick', handler); - } else if (record.value == -1) { + } else if (record.value == _BulletTypes.newImage) { // new image + } else if (record.value == _BulletTypes.image) { // image + if (this._changedProps) + this._changedProps.asc_fillBulletImage(this.imageProps.id); + } else if (record.value == _BulletTypes.none) { if (this._changedProps) this._changedProps.asc_putListType(0, record.value); } else { @@ -271,7 +309,9 @@ define([ this._changedProps.asc_putSymbol(this.bulletProps.symbol); } } + this.btnOk.setDisabled(record.value === _BulletTypes.newImage); }, this)); + this.cmbBulletFormat.on('show:after', _.bind(this.onBulletFormatOpen, this)); this.spnSize = new Common.UI.MetricSpinner({ el : $window.find('#id-dlg-list-size'), @@ -314,7 +354,32 @@ define([ } }); - me.numberingControls = $window.find('.numbering'); + this.btnSelectImage = new Common.UI.Button({ + parentEl: $('#id-dlg-list-image'), + cls: 'btn-text-menu-default', + caption: this.textSelect, + style: 'width: 100%;', + menu: new Common.UI.Menu({ + style: 'min-width: 100px;', + maxHeight: 200, + additionalAlign: this.menuAddAlign, + items: [ + {caption: this.textFromFile, value: 0}, + {caption: this.textFromUrl, value: 1}, + {caption: this.textFromStorage, value: 2} + ] + }) + }); + this.btnSelectImage.menu.on('item:click', _.bind(this.onImageSelect, this)); + this.btnSelectImage.menu.items[2].setVisible(this.storage); + + this.btnOk = new Common.UI.Button({ + el: $window.find('.primary') + }); + + me.numberingControls = $window.find('tr.numbering'); + me.imageControls = $window.find('tr.image'); + me.colorControls = $window.find('tr.color'); var el = $window.find('table tr:first() td:first()'); el.width(Math.max($window.find('.numbering .text').width(), el.width())); @@ -323,12 +388,52 @@ define([ }, getFocusedComponents: function() { - return [this.cmbNumFormat, this.cmbBulletFormat, this.spnSize, this.spnStart, this.btnColor]; + return [this.cmbNumFormat, this.cmbBulletFormat, this.btnSelectImage, this.spnSize, this.spnStart, this.btnColor]; }, afterRender: function() { this.updateThemeColors(); this._setDefaults(this.props); + + var me = this; + var onApiImageLoaded = function(bullet) { + me.imageProps = {id: bullet.asc_getImageId(), redraw: true}; + if (me._changedProps) + me._changedProps.asc_fillBulletImage(me.imageProps.id); + // add or update record for image to btnBulletFormat and select it + var store = me.cmbBulletFormat.store; + if (!store.findWhere({value: _BulletTypes.image})) { + var idx = store.indexOf(store.findWhere({value: _BulletTypes.newSymbol})); + store.add({ displayValue: me.txtImage + ':', value: _BulletTypes.image }, {at: idx}); + } + me.cmbBulletFormat.setData(store.models); + me.cmbBulletFormat.selectRecord(me.cmbBulletFormat.store.findWhere({value: _BulletTypes.image})); + me.btnOk.setDisabled(false); + }; + this.api.asc_registerCallback('asc_onBulletImageLoaded', onApiImageLoaded); + + var insertImageFromStorage = function(data) { + if (data && data._urls && data.c=='bullet') { + (new Asc.asc_CBullet()).asc_putImageUrl(data._urls[0], data.token); + } + }; + Common.NotificationCenter.on('storage:image-insert', insertImageFromStorage); + + this.on('close', function(obj){ + me.api.asc_unregisterCallback('asc_onBulletImageLoaded', onApiImageLoaded); + Common.NotificationCenter.off('storage:image-insert', insertImageFromStorage); + }); + }, + + onBulletFormatOpen: function(combo) { + var store = combo.store, + rec = store.findWhere({value: _BulletTypes.image}); + if (rec && this.imageProps.redraw) { + var bullet = new Asc.asc_CBullet(); + bullet.asc_fillBulletImage(this.imageProps.id); + bullet.drawSquareImage('id-dlg-list-bullet-image-preview'); + this.imageProps.redraw = false; + } }, updateThemeColors: function() { @@ -347,9 +452,14 @@ define([ }, ShowHideElem: function(value) { + var isImage = value==0 && (this.cmbBulletFormat.getValue()===_BulletTypes.image || this.cmbBulletFormat.getValue()===_BulletTypes.newImage || + (this.cmbBulletFormat.getValue()===undefined || this.cmbBulletFormat.getValue()==='') && this.originalType === AscFormat.BULLET_TYPE_BULLET_BLIP); this.numberingControls.toggleClass('hidden', value==0); + this.imageControls.toggleClass('hidden', !isImage); + this.colorControls.toggleClass('hidden', isImage); this.cmbNumFormat.setVisible(value==1); this.cmbBulletFormat.setVisible(value==0); + this.btnOk.setDisabled(isImage && (this.cmbBulletFormat.getValue()===_BulletTypes.newImage)); var me = this; _.delay(function(){ if (value) @@ -362,18 +472,28 @@ define([ _handleInput: function(state) { if (this.options.handler) { + if (state == 'ok' && this.btnOk.isDisabled()) { + return; + } var type = this.btnBullet.pressed ? 0 : 1; if (this.originalType == AscFormat.BULLET_TYPE_BULLET_NONE) { this._changedProps = new Asc.asc_CBullet(); - this._changedProps.asc_putColor(Common.Utils.ThemeColor.getRgbColor(this.color)); this._changedProps.asc_putSize(this.spnSize.getNumberValue()); + if (type==0 && this.cmbBulletFormat.getValue()===_BulletTypes.image && this.imageProps) {//image + this._changedProps.asc_fillBulletImage(this.imageProps.id); + } else { + this._changedProps.asc_putColor(Common.Utils.ThemeColor.getRgbColor(this.color)); + } } if (this.originalType == AscFormat.BULLET_TYPE_BULLET_NONE || - this.originalType == AscFormat.BULLET_TYPE_BULLET_CHAR && type==1 || this.originalType == AscFormat.BULLET_TYPE_BULLET_AUTONUM && type==0) { // changed list type + (this.originalType == AscFormat.BULLET_TYPE_BULLET_CHAR || this.originalType == AscFormat.BULLET_TYPE_BULLET_BLIP) && type==1 || + this.originalType == AscFormat.BULLET_TYPE_BULLET_AUTONUM && type==0) { // changed list type if (type==0) {//markers - if (this.cmbBulletFormat.getValue()==-1) { + if (this.cmbBulletFormat.getValue()==_BulletTypes.none) { this._changedProps.asc_putListType(0, -1); + } else if (this.cmbBulletFormat.getValue()==_BulletTypes.image) { + } else { this._changedProps.asc_putFont(this.bulletProps.font); this._changedProps.asc_putSymbol(this.bulletProps.symbol); @@ -432,16 +552,28 @@ define([ if (this.originalType == AscFormat.BULLET_TYPE_BULLET_NONE) { this.cmbNumFormat.setValue(-1); - this.cmbBulletFormat.setValue(-1); + this.cmbBulletFormat.setValue(_BulletTypes.none); type = this.type; } else if (this.originalType == AscFormat.BULLET_TYPE_BULLET_CHAR) { var symbol = bullet.asc_getSymbol(); if (symbol) { this.bulletProps = {symbol: symbol, font: bullet.asc_getFont()}; - if (!this.cmbBulletFormat.store.findWhere({value: 0, symbol: this.bulletProps.symbol, font: this.bulletProps.font})) - this.cmbBulletFormat.store.add({ displayValue: this.txtSymbol + ': ', value: 0, symbol: this.bulletProps.symbol, font: this.bulletProps.font }, {at: this.cmbBulletFormat.store.length-1}); + if (!this.cmbBulletFormat.store.findWhere({value: _BulletTypes.symbol, symbol: this.bulletProps.symbol, font: this.bulletProps.font})) + this.cmbBulletFormat.store.add({ displayValue: this.txtSymbol + ': ', value: _BulletTypes.symbol, symbol: this.bulletProps.symbol, font: this.bulletProps.font }, {at: this.cmbBulletFormat.store.length-2}); this.cmbBulletFormat.setData(this.cmbBulletFormat.store.models); - this.cmbBulletFormat.selectRecord(this.cmbBulletFormat.store.findWhere({value: 0, symbol: this.bulletProps.symbol, font: this.bulletProps.font})); + this.cmbBulletFormat.selectRecord(this.cmbBulletFormat.store.findWhere({value: _BulletTypes.symbol, symbol: this.bulletProps.symbol, font: this.bulletProps.font})); + } else + this.cmbBulletFormat.setValue(''); + this._changedProps = bullet; + type = 0; + } else if (this.originalType == AscFormat.BULLET_TYPE_BULLET_BLIP) { + var id = bullet.asc_getImageId(); + if (id) { + this.imageProps = {id: id, redraw: true}; + if (!this.cmbBulletFormat.store.findWhere({value: _BulletTypes.image})) + this.cmbBulletFormat.store.add({ displayValue: this.txtImage + ':', value: _BulletTypes.image}, {at: this.cmbBulletFormat.store.length-2}); + this.cmbBulletFormat.setData(this.cmbBulletFormat.store.models); + this.cmbBulletFormat.selectRecord(this.cmbBulletFormat.store.findWhere({value: _BulletTypes.image})); } else this.cmbBulletFormat.setValue(''); this._changedProps = bullet; @@ -458,7 +590,7 @@ define([ } } else {// different bullet types this.cmbNumFormat.setValue(-1); - this.cmbBulletFormat.setValue(-1); + this.cmbBulletFormat.setValue(_BulletTypes.none); this._changedProps = new Asc.asc_CBullet(); type = this.type; } @@ -468,6 +600,26 @@ define([ this.ShowHideElem(type); }, + onImageSelect: function(menu, item) { + if (item.value==1) { + var me = this; + (new Common.Views.ImageFromUrlDialog({ + handler: function(result, value) { + if (result == 'ok') { + var checkUrl = value.replace(/ /g, ''); + if (!_.isEmpty(checkUrl)) { + (new Asc.asc_CBullet()).asc_putImageUrl(checkUrl); + } + } + } + })).show(); + } else if (item.value==2) { + Common.NotificationCenter.trigger('storage:image-load', 'bullet'); + } else { + (new Asc.asc_CBullet()).asc_showFileDialog(); + } + }, + txtTitle: 'List Settings', txtSize: 'Size', txtColor: 'Color', @@ -478,6 +630,13 @@ define([ txtType: 'Type', txtNone: 'None', txtNewBullet: 'New bullet', - txtSymbol: 'Symbol' + txtSymbol: 'Symbol', + txtNewImage: 'New image', + txtImage: 'Image', + txtImport: 'Import', + textSelect: 'Select From', + textFromUrl: 'From URL', + textFromFile: 'From File', + textFromStorage: 'From Storage' }, Common.Views.ListSettingsDialog || {})) }); \ No newline at end of file diff --git a/apps/common/main/lib/view/OpenDialog.js b/apps/common/main/lib/view/OpenDialog.js index 962cbf60f..ad039555a 100644 --- a/apps/common/main/lib/view/OpenDialog.js +++ b/apps/common/main/lib/view/OpenDialog.js @@ -205,6 +205,8 @@ define([ this.inputPwd = new Common.UI.InputFieldBtnPassword({ el: $('#id-password-txt'), type: 'password', + showCls: (this.options.iconType==='svg' ? 'svg-icon' : 'toolbar__icon') + ' btn-sheet-view', + hideCls: (this.options.iconType==='svg' ? 'svg-icon' : 'toolbar__icon') + ' hide-password', validateOnBlur: false, showPwdOnClick: true, validation : function(value) { diff --git a/apps/common/main/resources/less/combobox.less b/apps/common/main/resources/less/combobox.less index d561e6ee7..4b8615ed6 100644 --- a/apps/common/main/resources/less/combobox.less +++ b/apps/common/main/resources/less/combobox.less @@ -144,7 +144,7 @@ -webkit-filter: @img-border-type-filter; filter: @img-border-type-filter; } - canvas { + .font-item canvas { -webkit-filter: @img-border-type-filter; filter: @img-border-type-filter; } @@ -154,7 +154,7 @@ -webkit-filter: @img-border-type-filter-selected; filter: @img-border-type-filter-selected; } - canvas { + .font-item canvas { -webkit-filter: @img-border-type-filter-selected; filter: @img-border-type-filter-selected; } diff --git a/apps/common/main/resources/less/dropdown-menu.less b/apps/common/main/resources/less/dropdown-menu.less index 0b090f8c1..840465c8d 100644 --- a/apps/common/main/resources/less/dropdown-menu.less +++ b/apps/common/main/resources/less/dropdown-menu.less @@ -159,6 +159,7 @@ height: @scaled-one-px-value; background-color: @border-divider-ie; background-color: @border-divider; + margin: 4px 0; } .dataview { diff --git a/apps/common/main/resources/less/header.less b/apps/common/main/resources/less/header.less index 5bd584d65..287beb641 100644 --- a/apps/common/main/resources/less/header.less +++ b/apps/common/main/resources/less/header.less @@ -51,6 +51,8 @@ &.right { flex-grow: 1; + flex-shrink: 0; + overflow: hidden; } .status-label { @@ -94,6 +96,9 @@ flex-grow: 1; display: flex; justify-content: center; + padding: 4px 2px; + overflow: hidden; + flex-shrink: 0; } #rib-doc-name { @@ -102,13 +107,20 @@ overflow: hidden; min-width: 50px; text-align: center; - color: @text-toolbar-header-ie; color: @text-toolbar-header; background-color: transparent; border: 0 none; + padding: 1px 5px; cursor: default; - line-height: 32px; + line-height: 24px; + + &:hover:not(:disabled),&:focus { + box-shadow: 0 0 0 1px @highlight-header-button-hover-ie; + box-shadow: 0 0 0 1px @highlight-header-button-hover; + border-radius: 1px; + cursor: text; + } } #rib-save-status { @@ -487,6 +499,7 @@ display: flex; justify-content: center; overflow: hidden; + padding: 4px 2px; } #title-doc-name { @@ -495,10 +508,19 @@ overflow: hidden; text-align: center; font-size: 12px; - line-height: 28px; + line-height: 24px; + padding: 1px 5px; background-color: transparent; border: 0 none; cursor: default; + + &:hover:not(:disabled),&:focus{ + box-shadow: 0 0 0 1px @highlight-header-button-hover-ie; + box-shadow: 0 0 0 1px @highlight-header-button-hover; + border-radius: 1px; + cursor: text; + } + } .lr-separator { @@ -510,7 +532,9 @@ .inner-box-icon.crypted { width: 20px; position: relative; - + margin-right: 1px; + flex-shrink: 0; + flex-grow: 0; > svg { position: absolute; width: 20px; diff --git a/apps/common/main/resources/less/input.less b/apps/common/main/resources/less/input.less index a10827e2e..84218bb34 100644 --- a/apps/common/main/resources/less/input.less +++ b/apps/common/main/resources/less/input.less @@ -42,7 +42,7 @@ content: ''; position: absolute; right: 3px; - top: 4px; + top: 3px; width: 16px; height: 16px; background-position: @input-error-offset-x @input-error-offset-y; diff --git a/apps/common/main/resources/less/theme-colorpalette.less b/apps/common/main/resources/less/theme-colorpalette.less index 9d81c90fd..3c71fba63 100644 --- a/apps/common/main/resources/less/theme-colorpalette.less +++ b/apps/common/main/resources/less/theme-colorpalette.less @@ -14,6 +14,13 @@ } } + &.palette-large em { + span{ + height: 28px; + width: 28px; + } + } + a { padding: 0; margin: calc(1px - 1px / @pixel-ratio-factor); diff --git a/apps/common/main/resources/less/toolbar.less b/apps/common/main/resources/less/toolbar.less index 2f90adc50..c78364c45 100644 --- a/apps/common/main/resources/less/toolbar.less +++ b/apps/common/main/resources/less/toolbar.less @@ -60,6 +60,7 @@ position: relative; overflow: hidden; display: flex; + flex-shrink: 1; > ul { padding: 4px 0 0; @@ -544,6 +545,10 @@ #rib-doc-name { color: @text-normal-ie; color: @text-normal; + &:hover:not(:disabled),&:focus { + box-shadow: 0 0 0 1px @highlight-button-hover-ie; + box-shadow: 0 0 0 1px @highlight-button-hover; + } } &.editor-native-color { @@ -555,7 +560,7 @@ } &.style-skip-docname .toolbar { - #box-doc-name > label { + #box-doc-name > input { display: none; } } diff --git a/apps/common/main/resources/less/variables.less b/apps/common/main/resources/less/variables.less index f3810aec7..5ebe3b98a 100644 --- a/apps/common/main/resources/less/variables.less +++ b/apps/common/main/resources/less/variables.less @@ -772,11 +772,11 @@ // Input error @input-error-offset-x: -73px; -@input-error-offset-y: -170px; +@input-error-offset-y: -169px; // Input warning @input-warning-offset-x: -57px; -@input-warning-offset-y: -170px; +@input-warning-offset-y: -169px; // Spinner @spinner-offset-x: -41px; diff --git a/apps/common/mobile/lib/view/collaboration/Comments.jsx b/apps/common/mobile/lib/view/collaboration/Comments.jsx index 582a7bd99..d8927fca7 100644 --- a/apps/common/mobile/lib/view/collaboration/Comments.jsx +++ b/apps/common/mobile/lib/view/collaboration/Comments.jsx @@ -639,7 +639,7 @@ const ViewComments = inject("storeComments", "storeAppOptions", "storeReview")(o const viewMode = !storeAppOptions.canComments; const comments = storeComments.groupCollectionFilter || storeComments.collectionComments; - const isEdit = storeAppOptions.isEdit; + const isEdit = storeAppOptions.isEdit || storeAppOptions.isRestrictedEdit; const sortComments = comments.length > 0 ? [...comments].sort((a, b) => a.time > b.time ? -1 : 1) : null; const [clickComment, setComment] = useState(); @@ -749,7 +749,7 @@ const CommentList = inject("storeComments", "storeAppOptions", "storeReview")(ob const displayMode = storeReview.displayMode; const viewMode = !storeAppOptions.canComments; - const isEdit = storeAppOptions.isEdit; + const isEdit = storeAppOptions.isEdit || storeAppOptions.isRestrictedEdit; const comments = storeComments.showComments; const [currentIndex, setCurrentIndex] = useState(0); diff --git a/apps/common/mobile/resources/less/common.less b/apps/common/mobile/resources/less/common.less index 1cddf2874..1bd52dcfd 100644 --- a/apps/common/mobile/resources/less/common.less +++ b/apps/common/mobile/resources/less/common.less @@ -95,6 +95,10 @@ } .list { + max-width: 100%; + ul { + width: 100%; + } li.no-indicator { .item-link { .item-inner{ @@ -125,6 +129,9 @@ background-color: @autoColor; } } + .item-link .item-inner { + width: 100%; + } } // Bullets, numbers and multilevels @@ -139,11 +146,12 @@ &:before, &:after { display: none; } - display: flex; + display: grid; + grid-template-columns: repeat(4, auto); justify-content: space-around; + grid-gap: 10px; width: 100%; padding: 5px; - li { width: 70px; height: 70px; @@ -169,6 +177,11 @@ color: @fill-black; } } + + .item-number, .item-marker, .item-multilevellist { + width: 68px; + height: 68px; + } } } } @@ -611,13 +624,15 @@ padding-left: 5px; padding-right: 5px; padding-top: 5px; + background-color: @background-tertiary; li.item-theme { - border: 0.5px solid #c8c7cc; + // border: 0.5px solid #c8c7cc; + border: 2px solid @fill-white; padding: 1px; background-repeat: no-repeat; width: 108px; - height: 52px; - margin-bottom: 10px; + height: 53px; + margin-bottom: 8px; background-position: center; .item-content { width: 100%; @@ -650,6 +665,9 @@ .encoded-svg-background(''); } } + &:after { + display: none; + } } } @@ -902,6 +920,11 @@ input[type="number"]::-webkit-inner-spin-button { } } +.dlg-macros-request { + .dialog-text { + word-break: break-word; + } +} // Skeleton of document @keyframes flickerAnimation { @@ -1083,6 +1106,29 @@ input[type="number"]::-webkit-inner-spin-button { } } +.swiper-container { + height: 100%; +} + +.swiper-pagination-bullet { + background: @background-menu-divider; + opacity: 1; + &-active { + background: @text-secondary; + } +} + +.preview-cell-style { + background-position: center; + background-repeat: no-repeat; + background-size: cover; + width: 104px; + height: 44px; + background-color: @fill-white; + border-radius: 4px; + border: 0.5px solid @background-menu-divider; +} + diff --git a/apps/common/mobile/resources/less/icons.less b/apps/common/mobile/resources/less/icons.less index b2c1097c2..1521fdcca 100644 --- a/apps/common/mobile/resources/less/icons.less +++ b/apps/common/mobile/resources/less/icons.less @@ -30,6 +30,11 @@ i.icon { height: 24px; .encoded-svg-background(''); } + &.icon-remove-style { + width: 24px; + height: 24px; + .encoded-svg-background('') + } // Formats diff --git a/apps/common/mobile/resources/less/material/icons.less b/apps/common/mobile/resources/less/material/icons.less index 2a34e8c73..d047cf12d 100644 --- a/apps/common/mobile/resources/less/material/icons.less +++ b/apps/common/mobile/resources/less/material/icons.less @@ -37,7 +37,7 @@ &.icon-edit { width: 22px; height: 22px; - .encoded-svg-mask(''); + .encoded-svg-mask('', @toolbar-icons); } } } diff --git a/apps/documenteditor/forms/app/controller/ApplicationController.js b/apps/documenteditor/forms/app/controller/ApplicationController.js index 45947fc43..fde1f1150 100644 --- a/apps/documenteditor/forms/app/controller/ApplicationController.js +++ b/apps/documenteditor/forms/app/controller/ApplicationController.js @@ -229,6 +229,7 @@ define([ case Asc.c_oAscError.ID.UpdateVersion: config.msg = this.errorUpdateVersionOnDisconnect; + config.maxwidth = 600; break; case Asc.c_oAscError.ID.AccessDeny: @@ -248,6 +249,7 @@ define([ case Asc.c_oAscError.ID.ForceSaveButton: case Asc.c_oAscError.ID.ForceSaveTimeout: config.msg = this.errorForceSave; + config.maxwidth = 600; break; case Asc.c_oAscError.ID.LoadingFontError: @@ -800,6 +802,7 @@ define([ warning: !(me.appOptions.isDesktopApp && me.appOptions.isOffline) && (typeof advOptions == 'string'), warningMsg: advOptions, validatePwd: !!me._isDRM, + iconType: 'svg', handler: function (result, value) { me.isShowOpenDialog = false; if (result == 'ok') { diff --git a/apps/documenteditor/main/app.js b/apps/documenteditor/main/app.js index c8fffa7c4..9570797fc 100644 --- a/apps/documenteditor/main/app.js +++ b/apps/documenteditor/main/app.js @@ -176,6 +176,9 @@ require([ Common.Locale.apply( function() { require([ + 'common/main/lib/util/LocalStorage', + 'common/main/lib/controller/Themes', + 'common/main/lib/controller/Desktop', 'documenteditor/main/app/controller/Viewport', 'documenteditor/main/app/controller/DocumentHolder', 'documenteditor/main/app/controller/Toolbar', @@ -197,7 +200,6 @@ require([ 'documenteditor/main/app/view/TextArtSettings', 'documenteditor/main/app/view/SignatureSettings', 'common/main/lib/util/utils', - 'common/main/lib/util/LocalStorage', 'common/main/lib/controller/Fonts', 'common/main/lib/controller/History' /** coauthoring begin **/ @@ -211,8 +213,6 @@ require([ ,'common/main/lib/controller/ExternalOleEditor' ,'common/main/lib/controller/ReviewChanges' ,'common/main/lib/controller/Protection' - ,'common/main/lib/controller/Themes' - ,'common/main/lib/controller/Desktop' ], function() { app.start(); }); diff --git a/apps/documenteditor/main/app/controller/DocumentHolder.js b/apps/documenteditor/main/app/controller/DocumentHolder.js index 2e221d0ff..758f4c855 100644 --- a/apps/documenteditor/main/app/controller/DocumentHolder.js +++ b/apps/documenteditor/main/app/controller/DocumentHolder.js @@ -110,18 +110,161 @@ define([ initialize: function() { // + this.addListeners({ + 'DocumentHolder': { + 'createdelayedelements': this.createDelayedElements, + 'equation:callback': this.equationCallback + } + }); + + var me = this; + + me._TtHeight = 20; + me.usertips = []; + me.fastcoauthtips = []; + me._isDisabled = false; + me._state = {}; + me.mode = {}; + me.mouseMoveData = null; + me.isTooltipHiding = false; + + me.screenTip = { + toolTip: new Common.UI.Tooltip({ + owner: this, + html: true, + title: '
    Press Ctrl and click link', + cls: 'link-tooltip' +// style: 'word-wrap: break-word;' + }), + strTip: '', + isHidden: true, + isVisible: false + }; + me.userTooltip = true; + me.wrapEvents = { + userTipMousover: _.bind(me.userTipMousover, me), + userTipMousout: _.bind(me.userTipMousout, me) + }; + + var keymap = {}; + me.hkComments = 'alt+h'; + keymap[me.hkComments] = function() { + if (me.api.can_AddQuotedComment()!==false) { + me.addComment(); + } + }; + Common.util.Shortcuts.delegateShortcuts({shortcuts:keymap}); + }, onLaunch: function() { this.documentHolder = this.createView('DocumentHolder').render(); this.documentHolder.el.tabIndex = -1; + this.onAfterRender(); + + var me = this; + Common.NotificationCenter.on({ + 'window:show': function(e){ + me.screenTip.toolTip.hide(); + me.screenTip.isVisible = false; + /** coauthoring begin **/ + me.userTipHide(); + /** coauthoring end **/ + me.mode && me.mode.isDesktopApp && me.api && me.api.asc_onShowPopupWindow(); + + }, + 'modal:show': function(e){ + me.hideTips(); + }, + 'layout:changed': function(e){ + me.screenTip.toolTip.hide(); + me.screenTip.isVisible = false; + /** coauthoring begin **/ + me.userTipHide(); + /** coauthoring end **/ + me.hideTips(); + me.onDocumentHolderResize(); + } + }); }, - setApi: function(api) { - this.api = api; + setApi: function(o) { + this.api = o; + + if (this.api) { + this.api.asc_registerCallback('asc_onContextMenu', _.bind(this.onContextMenu, this)); + this.api.asc_registerCallback('asc_onMouseMoveStart', _.bind(this.onMouseMoveStart, this)); + this.api.asc_registerCallback('asc_onMouseMoveEnd', _.bind(this.onMouseMoveEnd, this)); + + //hyperlink + this.api.asc_registerCallback('asc_onHyperlinkClick', _.bind(this.onHyperlinkClick, this)); + this.api.asc_registerCallback('asc_onMouseMove', _.bind(this.onMouseMove, this)); + + if (this.mode.isEdit === true) { + this.api.asc_registerCallback('asc_onImgWrapStyleChanged', _.bind(this.onImgWrapStyleChanged, this)); + this.api.asc_registerCallback('asc_onDialogAddHyperlink', _.bind(this.onDialogAddHyperlink, this)); + this.api.asc_registerCallback('asc_doubleClickOnChart', _.bind(this.onDoubleClickOnChart, this)); + this.api.asc_registerCallback('asc_doubleClickOnTableOleObject', _.bind(this.onDoubleClickOnTableOleObject, this)); + this.api.asc_registerCallback('asc_onSpellCheckVariantsFound', _.bind(this.onSpellCheckVariantsFound, this)); + this.api.asc_registerCallback('asc_onRulerDblClick', _.bind(this.onRulerDblClick, this)); + this.api.asc_registerCallback('asc_ChangeCropState', _.bind(this.onChangeCropState, this)); + this.api.asc_registerCallback('asc_onLockDocumentProps', _.bind(this.onApiLockDocumentProps, this)); + this.api.asc_registerCallback('asc_onUnLockDocumentProps', _.bind(this.onApiUnLockDocumentProps, this)); + } + this.api.asc_registerCallback('asc_onCoAuthoringDisconnect', _.bind(this.onCoAuthoringDisconnect, this)); + Common.NotificationCenter.on('api:disconnect', _.bind(this.onCoAuthoringDisconnect, this)); + this.api.asc_registerCallback('asc_onTextLanguage', _.bind(this.onTextLanguage, this)); + this.api.asc_registerCallback('asc_onParaStyleName', _.bind(this.onApiParagraphStyleChange, this)); + + this.api.asc_registerCallback('asc_onShowForeignCursorLabel', _.bind(this.onShowForeignCursorLabel, this)); + this.api.asc_registerCallback('asc_onHideForeignCursorLabel', _.bind(this.onHideForeignCursorLabel, this)); + this.api.asc_registerCallback('asc_onFocusObject', _.bind(this.onFocusObject, this)); + this.api.asc_registerCallback('asc_onShowSpecialPasteOptions', _.bind(this.onShowSpecialPasteOptions, this)); + this.api.asc_registerCallback('asc_onHideSpecialPasteOptions', _.bind(this.onHideSpecialPasteOptions, this)); + if (this.mode.isEdit || this.mode.isRestrictedEdit && this.mode.canFillForms) { + this.api.asc_registerCallback('asc_onShowContentControlsActions',_.bind(this.onShowContentControlsActions, this)); + this.api.asc_registerCallback('asc_onHideContentControlsActions',_.bind(this.onHideContentControlsActions, this)); + } + + this.documentHolder.setApi(this.api); + } + + return this; }, - createDelayedElements: function() { + setMode: function(m) { + this.mode = m; + /** coauthoring begin **/ + !(this.mode.canCoAuthoring && this.mode.canComments) + ? Common.util.Shortcuts.suspendEvents(this.hkComments) + : Common.util.Shortcuts.resumeEvents(this.hkComments); + /** coauthoring end **/ + this.documentHolder.setMode(m); + }, + + createDelayedElements: function(view, type) { + var me = this, + view = me.documentHolder; + + if (type=='view') { + view.menuViewCopy.on('click', _.bind(me.onCutCopyPaste, me)); + view.menuViewPaste.on('click', _.bind(me.onCutCopyPaste, me)); + view.menuViewCut.on('click', _.bind(me.onCutCopyPaste, me)); + view.menuViewUndo.on('click', _.bind(me.onUndo, me)); + view.menuViewAddComment.on('click', _.bind(me.addComment, me)); + view.menuSignatureViewSign.on('click', _.bind(me.onSignatureClick, me)); + view.menuSignatureDetails.on('click', _.bind(me.onSignatureClick, me)); + view.menuSignatureViewSetup.on('click', _.bind(me.onSignatureClick, me)); + view.menuSignatureRemove.on('click', _.bind(me.onSignatureClick, me)); + view.menuViewPrint.on('click', _.bind(me.onPrintSelection, me)); + return; + } else if (type=='pdf') { + view.menuPDFViewCopy.on('click', _.bind(me.onCutCopyPaste, me)); + return; + } + + // type == 'edit' + var diagramEditor = this.getApplication().getController('Common.Controllers.ExternalDiagramEditor').getView('Common.Views.ExternalDiagramEditor'); if (diagramEditor) { diagramEditor.on('internalmessage', _.bind(function(cmp, message) { @@ -138,9 +281,8 @@ define([ this.api.asc_onCloseChartFrame(); this.api.asc_enableKeyEvents(true); } - var me = this; setTimeout(function(){ - me.documentHolder.fireEvent('editcomplete', me.documentHolder); + me.editComplete(); }, 10); }, this)); } @@ -157,9 +299,8 @@ define([ if (this.api) { this.api.asc_enableKeyEvents(true); } - var me = this; setTimeout(function(){ - me.documentHolder.fireEvent('editcomplete', me.documentHolder); + me.editComplete(); }, 10); }, this)); } @@ -178,17 +319,1921 @@ define([ if (this.api) { this.api.asc_enableKeyEvents(true); } - var me = this; setTimeout(function(){ - me.documentHolder.fireEvent('editcomplete', me.documentHolder); + me.editComplete(); }, 10); }, this)); } + + view.menuInsertCaption.on('click', _.bind(me.onInsertCaption, me)); + view.menuEquationInsertCaption.on('click', _.bind(me.onInsertCaption, me)); + view.menuTableInsertCaption.on('click', _.bind(me.onInsertCaption, me)); + view.menuChartEdit.on('click', _.bind(me.editChartClick, me)); + view.menuImgCopy.on('click', _.bind(me.onCutCopyPaste, me)); + view.menuImgPaste.on('click', _.bind(me.onCutCopyPaste, me)); + view.menuImgCut.on('click', _.bind(me.onCutCopyPaste, me)); + view.menuTableCopy.on('click', _.bind(me.onCutCopyPaste, me)); + view.menuTablePaste.on('click', _.bind(me.onCutCopyPaste, me)); + view.menuTableCut.on('click', _.bind(me.onCutCopyPaste, me)); + view.menuParaCopy.on('click', _.bind(me.onCutCopyPaste, me)); + view.menuParaPaste.on('click', _.bind(me.onCutCopyPaste, me)); + view.menuParaCut.on('click', _.bind(me.onCutCopyPaste, me)); + view.menuImgAccept.on('click', _.bind(me.onAcceptRejectChange, me)); + view.menuImgReject.on('click', _.bind(me.onAcceptRejectChange, me)); + view.menuTableAccept.on('click', _.bind(me.onAcceptRejectChange, me)); + view.menuTableReject.on('click', _.bind(me.onAcceptRejectChange, me)); + view.menuParaAccept.on('click', _.bind(me.onAcceptRejectChange, me)); + view.menuParaReject.on('click', _.bind(me.onAcceptRejectChange, me)); + view.menuImgPrint.on('click', _.bind(me.onPrintSelection, me)); + view.menuTablePrint.on('click', _.bind(me.onPrintSelection, me)); + view.menuParaPrint.on('click', _.bind(me.onPrintSelection, me)); + view.menuSignatureEditSign.on('click', _.bind(me.onSignatureClick, me)); + view.menuSignatureEditSetup.on('click', _.bind(me.onSignatureClick, me)); + view.menuImgRotate.menu.items[0].on('click', _.bind(me.onImgRotate, me)); + view.menuImgRotate.menu.items[1].on('click', _.bind(me.onImgRotate, me)); + view.menuImgRotate.menu.items[3].on('click', _.bind(me.onImgFlip, me)); + view.menuImgRotate.menu.items[4].on('click', _.bind(me.onImgFlip, me)); + view.menuImgCrop.menu.on('item:click', _.bind(me.onImgCrop, me)); + view.menuImgRemoveControl.on('click', _.bind(me.onControlsSelect, me)); + view.menuImgControlSettings.on('click', _.bind(me.onControlsSelect, me)); + view.menuTableRemoveForm.on('click', _.bind(me.onControlsSelect, me)); + view.menuTableRemoveControl.on('click', _.bind(me.onControlsSelect, me)); + view.menuTableControlSettings.on('click', _.bind(me.onControlsSelect, me)); + view.menuParaRemoveControl.on('click', _.bind(me.onControlsSelect, me)); + view.menuParaControlSettings.on('click', _.bind(me.onControlsSelect, me)); + view.menuTableCellAlign.menu.on('item:click', _.bind(me.tableCellsVAlign, me)); + view.menuTableAdvanced.on('click', _.bind(me.advancedTableClick, me)); + view.menuParagraphAdvancedInTable.on('click', _.bind(me.advancedParagraphClick, me)); + view.menuParagraphAdvanced.on('click', _.bind(me.advancedParagraphClick, me)); + view.menuEditHyperlinkTable.on('click', _.bind(me.editHyperlink, me)); + view.menuEditHyperlinkPara.on('click', _.bind(me.editHyperlink, me)); + view.menuRemoveHyperlinkTable.on('click', _.bind(me.onRemoveHyperlink, me)); + view.menuRemoveHyperlinkPara.on('click', _.bind(me.onRemoveHyperlink, me)); + view.menuAddHyperlinkTable.on('click', _.bind(me.addHyperlink, me)); + view.menuAddHyperlinkPara.on('click', _.bind(me.addHyperlink, me)); + view.menuAddCommentTable.on('click', _.bind(me.addComment, me)); + view.menuAddCommentPara.on('click', _.bind(me.addComment, me)); + view.menuTableFollow.on('click', _.bind(me.onFollowMove, me)); + view.menuParaFollow.on('click', _.bind(me.onFollowMove, me)); + view.menuTableStartNewList.on('click', _.bind(me.onStartNumbering, me, 1)); + view.menuParaStartNewList.on('click', _.bind(me.onStartNumbering, me, 1)); + view.menuTableStartNumberingFrom.on('click', _.bind(me.onStartNumbering, me, 'advanced')); + view.menuParaStartNumberingFrom.on('click', _.bind(me.onStartNumbering, me, 'advanced')); + view.menuTableContinueNumbering.on('click', _.bind(me.onContinueNumbering, me)); + view.menuParaContinueNumbering.on('click', _.bind(me.onContinueNumbering, me)); + view.menuFrameAdvanced.on('click', _.bind(me.advancedFrameClick, me, true)); + view.menuDropCapAdvanced.on('click', _.bind(me.advancedFrameClick, me, false)); + view.menuStyleSave.on('click', _.bind(me.onMenuSaveStyle, me)); + view.menuStyleUpdate.on('click', _.bind(me.onMenuUpdateStyle, me)); + view.menuTableSelectText.menu.on('item:click', _.bind(me.tableSelectText, me)); + view.menuTableInsertText.menu.on('item:click', _.bind(me.tableInsertText, me)); + view.menuTableDeleteText.menu.on('item:click', _.bind(me.tableDeleteText, me)); + view.menuImageAlign.menu.on('item:click', _.bind(me.onImgAlign, me)); + view.menuImageArrange.menu.on('item:click', _.bind(me.onImgArrange, me)); + view.mnuGroup.on('click', _.bind(me.onImgGroup, me)); + view.mnuUnGroup.on('click', _.bind(me.onImgUnGroup, me)); + view.menuWrapPolygon.on('click', _.bind(me.onImgWrapPolygon, me)); + view.menuImageWrap.menu.on('item:click', _.bind(me.onImgWrap, me)); + view.menuImageAdvanced.on('click', _.bind(me.onImgAdvanced, me)); + view.menuOriginalSize.on('click', _.bind(me.onImgOriginalSize, me)); + view.menuImgReplace.menu.on('item:click', _.bind(me.onImgReplace, me)); + view.menuImgEditPoints.on('click', _.bind(me.onImgEditPoints, me)); + view.mnuTableMerge.on('click', _.bind(me.onTableMerge, me)); + view.mnuTableSplit.on('click', _.bind(me.onTableSplit, me)); + view.menuIgnoreSpellTable.on('click', _.bind(me.onIgnoreSpell, me)); + view.menuIgnoreSpellPara.on('click', _.bind(me.onIgnoreSpell, me)); + view.menuIgnoreAllSpellTable.on('click', _.bind(me.onIgnoreSpell, me)); + view.menuIgnoreAllSpellPara.on('click', _.bind(me.onIgnoreSpell, me)); + view.menuToDictionaryTable.on('click', _.bind(me.onToDictionary, me)); + view.menuToDictionaryPara.on('click', _.bind(me.onToDictionary, me)); + view.menuTableDistRows.on('click', _.bind(me.onTableDist, me)); + view.menuTableDistCols.on('click', _.bind(me.onTableDist, me)); + view.menuTableDirection.menu.on('item:click', _.bind(me.tableDirection, me)); + view.menuTableRefreshField.on('click', _.bind(me.onRefreshField, me)); + view.menuParaRefreshField.on('click', _.bind(me.onRefreshField, me)); + view.menuParagraphBreakBefore.on('click', _.bind(me.onParagraphBreakBefore, me)); + view.menuParagraphKeepLines.on('click', _.bind(me.onParagraphKeepLines, me)); + view.menuParagraphVAlign.menu.on('item:click', _.bind(me.paragraphVAlign, me)); + view.menuParagraphDirection.menu.on('item:click', _.bind(me.paragraphDirection, me)); + view.langParaMenu.menu.on('item:click', _.bind(me.onLangMenu, me, 'para')); + view.langTableMenu.menu.on('item:click', _.bind(me.onLangMenu, me, 'table')); + view.menuTableTOC.menu.on('item:click', _.bind(me.onTOCMenu, me)); + view.menuParaTOCRefresh.menu.on('item:click', _.bind(me.onTOCMenu, me)); + view.menuParaTOCSettings.on('click', _.bind(me.onParaTOCSettings, me)); }, getView: function (name) { return !name ? this.documentHolder : Backbone.Controller.prototype.getView.call() + }, + + showPopupMenu: function(menu, value, event, docElement, eOpts){ + var me = this; + if (!_.isUndefined(menu) && menu !== null){ + Common.UI.Menu.Manager.hideAll(); + + var showPoint = [event.get_X(), event.get_Y()], + menuContainer = $(me.documentHolder.el).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)); + $(me.documentHolder.el).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); + + me.documentHolder.currentMenu = menu; + } + }, + + fillMenuProps: function(selectedElements) { + if (!selectedElements || !_.isArray(selectedElements)) return; + var me = this, + documentHolder = this.documentHolder; + var menu_props = {}, + menu_to_show = documentHolder.textMenu, + noobject = true; + for (var i = 0; i 0) { + me.api.zoomIn(); + } + + event.preventDefault(); + event.stopPropagation(); + } + } + }, + + handleDocumentKeyDown: function(event){ + var me = this; + if (me.api){ + var key = event.keyCode; + if ((event.ctrlKey || event.metaKey) && !event.shiftKey && !event.altKey){ + if (key === Common.UI.Keys.NUM_PLUS || key === Common.UI.Keys.EQUALITY || (Common.Utils.isGecko && key === Common.UI.Keys.EQUALITY_FF) || (Common.Utils.isOpera && key == 43)){ + me.api.zoomIn(); + event.preventDefault(); + event.stopPropagation(); + return false; + } + else if (key === Common.UI.Keys.NUM_MINUS || key === Common.UI.Keys.MINUS || (Common.Utils.isGecko && key === Common.UI.Keys.MINUS_FF) || (Common.Utils.isOpera && key == 45)){ + me.api.zoomOut(); + event.preventDefault(); + event.stopPropagation(); + return false; + } else if (key === 48 || key === 96) {// 0 + me.api.zoom(100); + event.preventDefault(); + event.stopPropagation(); + return false; + } + } + if (me.documentHolder.currentMenu && me.documentHolder.currentMenu.isVisible()) { + if (key == Common.UI.Keys.UP || + key == Common.UI.Keys.DOWN) { + $('ul.dropdown-menu', me.documentHolder.currentMenu.el).focus(); + } + } + + if (key == Common.UI.Keys.ESC) { + Common.UI.Menu.Manager.hideAll(); + if (!Common.UI.HintManager.isHintVisible()) + Common.NotificationCenter.trigger('leftmenu:change', 'hide'); + } + } + }, + + onDocumentHolderResize: function(e){ + var me = this; + me._XY = [ + me.documentHolder.cmpEl.offset().left - $(window).scrollLeft(), + me.documentHolder.cmpEl.offset().top - $(window).scrollTop() + ]; + me._Height = me.documentHolder.cmpEl.height(); + me._BodyWidth = $('body').width(); + }, + + onAfterRender: function(ct){ + var me = this; + var meEl = me.documentHolder.cmpEl; + if (meEl) { + meEl.on('contextmenu', function(e) { + e.preventDefault(); + e.stopPropagation(); + return false; + }); + meEl.on('click', function(e){ + if (e.target.localName == 'canvas') { + if (me._preventClick) + me._preventClick = false; + else + meEl.focus(); + } + }); + meEl.on('mousedown', function(e){ + if (e.target.localName == 'canvas') + Common.UI.Menu.Manager.hideAll(); + }); + + //NOTE: set mouse wheel handler + + var addEvent = function( elem, type, fn ) { + elem.addEventListener ? elem.addEventListener( type, fn, false ) : elem.attachEvent( "on" + type, fn ); + }; + + var eventname=(/Firefox/i.test(navigator.userAgent))? 'DOMMouseScroll' : 'mousewheel'; + addEvent(me.documentHolder.el, eventname, _.bind(me.handleDocumentWheel, me)); + } + + !Common.Utils.isChrome ? $(document).on('mousewheel', _.bind(me.handleDocumentWheel, me)) : + document.addEventListener('mousewheel', _.bind(me.handleDocumentWheel, me), {passive: false}); + $(document).on('keydown', _.bind(me.handleDocumentKeyDown, me)); + + $(window).on('resize', _.bind(me.onDocumentHolderResize, me)); + var viewport = me.getApplication().getController('Viewport').getView('Viewport'); + viewport.hlayout.on('layout:resizedrag', _.bind(me.onDocumentHolderResize, me)); + }, + + getUserName: function(id){ + var usersStore = DE.getCollection('Common.Collections.Users'); + if (usersStore){ + var rec = usersStore.findUser(id); + if (rec) + return AscCommon.UserInfoParser.getParsedName(rec.get('username')); + } + return this.documentHolder.guestText; + }, + + isUserVisible: function(id){ + var usersStore = DE.getCollection('Common.Collections.Users'); + if (usersStore){ + var rec = usersStore.findUser(id); + if (rec) + return !rec.get('hidden'); + } + return true; + }, + + userTipMousover: function (evt, el, opt) { + var me = this; + if (me.userTooltip===true) { + me.userTooltip = new Common.UI.Tooltip({ + owner: evt.currentTarget, + title: me.documentHolder.tipIsLocked + }); + + me.userTooltip.show(); + } + }, + + userTipHide: function () { + var me = this; + if (typeof me.userTooltip == 'object') { + me.userTooltip.hide(); + me.userTooltip = undefined; + + for (var i=0; i0) + window.open(url); + else + Common.UI.warning({ + msg: me.documentHolder.txtWarnUrl, + buttons: ['yes', 'no'], + primary: 'yes', + callback: function(btn) { + (btn == 'yes') && window.open(url); + } + }); + } + }, + + onDialogAddHyperlink: function() { + var me = this; + var win, props, text; + if (me.api && me.mode.isEdit && !me._isDisabled && !me.getApplication().getController('LeftMenu').leftMenu.menuFile.isVisible()){ + var handlerDlg = function(dlg, result) { + if (result == 'ok') { + props = dlg.getSettings(); + (text!==false) + ? me.api.add_Hyperlink(props) + : me.api.change_Hyperlink(props); + } + + me.editComplete(); + }; + + text = me.api.can_AddHyperlink(); + + if (text !== false) { + win = new DE.Views.HyperlinkSettingsDialog({ + api: me.api, + handler: handlerDlg + }); + + props = new Asc.CHyperlinkProperty(); + props.put_Text(text); + + win.show(); + win.setSettings(props); + } else { + var selectedElements = me.api.getSelectedElements(); + if (selectedElements && _.isArray(selectedElements)){ + _.each(selectedElements, function(el, i) { + if (selectedElements[i].get_ObjectType() == Asc.c_oAscTypeSelectElement.Hyperlink) + props = selectedElements[i].get_ObjectValue(); + }); + } + if (props) { + win = new DE.Views.HyperlinkSettingsDialog({ + api: me.api, + handler: handlerDlg + }); + win.show(); + win.setSettings(props); + } + } + Common.component.Analytics.trackEvent('DocumentHolder', 'Add Hyperlink'); + } + }, + + onShowForeignCursorLabel: function(UserId, X, Y, color) { + if (!this.isUserVisible(UserId)) return; + + /** coauthoring begin **/ + var me = this; + var src; + for (var i=0; i0) { + if (typeof me.userTooltip == 'object') { + me.userTooltip.hide(); + me.userTooltip = true; + } + _.each(me.usertips, function(item) { + item.remove(); + }); + } + me.usertips = []; + me.usertipcount = 0; + /** coauthoring end **/ + }, + + onMouseMoveEnd: function() { + var me = this; + if (me.screenTip.isHidden && me.screenTip.isVisible) { + me.screenTip.isVisible = false; + me.isTooltipHiding = true; + me.screenTip.toolTip.hide(function(){ + me.isTooltipHiding = false; + if (me.mouseMoveData) me.onMouseMove(me.mouseMoveData); + me.mouseMoveData = null; + }); + } + }, + + onMouseMove: function(moveData) { + var me = this, + cmpEl = me.documentHolder.cmpEl, + screenTip = me.screenTip; + if (me._XY === undefined) { + me._XY = [ + cmpEl.offset().left - $(window).scrollLeft(), + cmpEl.offset().top - $(window).scrollTop() + ]; + me._Height = cmpEl.height(); + me._BodyWidth = $('body').width(); + } + + if (moveData) { + var showPoint, ToolTip, + type = moveData.get_Type(); + + if (type==Asc.c_oAscMouseMoveDataTypes.Hyperlink || type==Asc.c_oAscMouseMoveDataTypes.Footnote || type==Asc.c_oAscMouseMoveDataTypes.Form || + type==Asc.c_oAscMouseMoveDataTypes.Review && me.mode.reviewHoverMode) { + if (me.isTooltipHiding) { + me.mouseMoveData = moveData; + return; + } + + if (type==Asc.c_oAscMouseMoveDataTypes.Hyperlink) { + var hyperProps = moveData.get_Hyperlink(); + if (!hyperProps) return; + ToolTip = (_.isEmpty(hyperProps.get_ToolTip())) ? hyperProps.get_Value() : hyperProps.get_ToolTip(); + if (ToolTip.length>256) + ToolTip = ToolTip.substr(0, 256) + '...'; + } else if (type == Asc.c_oAscMouseMoveDataTypes.Footnote) { + ToolTip = moveData.get_FootnoteText(); + if (ToolTip.length>1000) + ToolTip = ToolTip.substr(0, 1000) + '...'; + } else if (type==Asc.c_oAscMouseMoveDataTypes.Form) { + ToolTip = moveData.get_FormHelpText(); + if (ToolTip.length>1000) + ToolTip = ToolTip.substr(0, 1000) + '...'; + } else if (type==Asc.c_oAscMouseMoveDataTypes.Review && moveData.get_ReviewChange()) { + var changes = me.getApplication().getController("Common.Controllers.ReviewChanges").readSDKChange([moveData.get_ReviewChange()]); + if (changes && changes.length>0) + changes = changes[0]; + if (changes) { + ToolTip = ''+ Common.Utils.String.htmlEncode(AscCommon.UserInfoParser.getParsedName(changes.get('username'))) +' '; + ToolTip += ''+ changes.get('date') +'
    '; + ToolTip += changes.get('changetext'); + if (ToolTip.length>1000) + ToolTip = ToolTip.substr(0, 1000) + '...'; + } + } + + var recalc = false; + screenTip.isHidden = false; + + if (type!==Asc.c_oAscMouseMoveDataTypes.Review) + ToolTip = Common.Utils.String.htmlEncode(ToolTip); + + if (screenTip.tipType !== type || screenTip.tipLength !== ToolTip.length || screenTip.strTip.indexOf(ToolTip)<0 ) { + screenTip.toolTip.setTitle((type==Asc.c_oAscMouseMoveDataTypes.Hyperlink) ? (ToolTip + '
    ' + me.documentHolder.txtPressLink + '') : ToolTip); + screenTip.tipLength = ToolTip.length; + screenTip.strTip = ToolTip; + screenTip.tipType = type; + recalc = true; + } + + showPoint = [moveData.get_X(), moveData.get_Y()]; + showPoint[1] += (me._XY[1]-15); + showPoint[0] += (me._XY[0]+5); + + if (!screenTip.isVisible || recalc) { + screenTip.isVisible = true; + screenTip.toolTip.show([-10000, -10000]); + } + + if ( recalc ) { + screenTip.tipHeight = screenTip.toolTip.getBSTip().$tip.height(); + screenTip.tipWidth = screenTip.toolTip.getBSTip().$tip.width(); + } + + recalc = false; + if (showPoint[0] + screenTip.tipWidth > me._BodyWidth ) { + showPoint[0] = me._BodyWidth - screenTip.tipWidth; + recalc = true; + } + if (showPoint[1] - screenTip.tipHeight < 0) { + showPoint[1] = (recalc) ? showPoint[1]+30 : 0; + } else + showPoint[1] -= screenTip.tipHeight; + + screenTip.toolTip.getBSTip().$tip.css({top: showPoint[1] + 'px', left: showPoint[0] + 'px'}); + } + /** coauthoring begin **/ + else if (moveData.get_Type()==Asc.c_oAscMouseMoveDataTypes.LockedObject && me.mode.isEdit && me.isUserVisible(moveData.get_UserId())) { // 2 - locked object + var src; + if (me.usertipcount >= me.usertips.length) { + src = $(document.createElement("div")); + src.addClass('username-tip'); + src.css({height: me._TtHeight + 'px', position: 'absolute', zIndex: '900', visibility: 'visible'}); + $(document.body).append(src); + if (me.userTooltip) { + src.on('mouseover', me.wrapEvents.userTipMousover); + src.on('mouseout', me.wrapEvents.userTipMousout); + } + + me.usertips.push(src); + } + src = me.usertips[me.usertipcount]; + me.usertipcount++; + + ToolTip = me.getUserName(moveData.get_UserId()); + + showPoint = [moveData.get_X()+me._XY[0], moveData.get_Y()+me._XY[1]]; + var maxwidth = showPoint[0]; + showPoint[0] = me._BodyWidth - showPoint[0]; + showPoint[1] -= ((moveData.get_LockedObjectType()==2) ? me._TtHeight : 0); + + if (showPoint[1] > me._XY[1] && showPoint[1]+me._TtHeight < me._XY[1]+me._Height) { + src.text(ToolTip); + src.css({visibility: 'visible', top: showPoint[1] + 'px', right: showPoint[0] + 'px', 'max-width': maxwidth + 'px'}); + } else { + src.css({visibility: 'hidden'}); + } + } + /** coauthoring end **/ + } + }, + + onShowSpecialPasteOptions: function(specialPasteShowOptions) { + var me = this, + documentHolder = me.documentHolder; + var coord = specialPasteShowOptions.asc_getCellCoord(), + pasteContainer = documentHolder.cmpEl.find('#special-paste-container'), + pasteItems = specialPasteShowOptions.asc_getOptions(); + if (!pasteItems) return; + + // Prepare menu container + if (pasteContainer.length < 1) { + me._arrSpecialPaste = []; + me._arrSpecialPaste[Asc.c_oSpecialPasteProps.paste] = documentHolder.textPaste; + me._arrSpecialPaste[Asc.c_oSpecialPasteProps.sourceformatting] = documentHolder.txtPasteSourceFormat; + me._arrSpecialPaste[Asc.c_oSpecialPasteProps.keepTextOnly] = documentHolder.txtKeepTextOnly; + me._arrSpecialPaste[Asc.c_oSpecialPasteProps.insertAsNestedTable] = documentHolder.textNest; + me._arrSpecialPaste[Asc.c_oSpecialPasteProps.overwriteCells] = documentHolder.txtOverwriteCells; + + pasteContainer = $('
    '); + documentHolder.cmpEl.find('#id_main_view').append(pasteContainer); + + me.btnSpecialPaste = new Common.UI.Button({ + parentEl: $('#id-document-holder-btn-special-paste'), + cls : 'btn-toolbar', + iconCls : 'toolbar__icon btn-paste', + menu : new Common.UI.Menu({items: []}) + }); + } + + if (pasteItems.length>0) { + var menu = me.btnSpecialPaste.menu; + for (var i = 0; i < menu.items.length; i++) { + menu.removeItem(menu.items[i]); + i--; + } + + var group_prev = -1; + _.each(pasteItems, function(menuItem, index) { + var mnu = new Common.UI.MenuItem({ + caption: me._arrSpecialPaste[menuItem], + value: menuItem, + checkable: true, + toggleGroup : 'specialPasteGroup' + }).on('click', function(item, e) { + me.api.asc_SpecialPaste(item.value); + setTimeout(function(){menu.hide();}, 100); + }); + menu.addItem(mnu); + }); + (menu.items.length>0) && menu.items[0].setChecked(true, true); + } + if (coord.asc_getX()<0 || coord.asc_getY()<0) { + if (pasteContainer.is(':visible')) pasteContainer.hide(); + } else { + var showPoint = [coord.asc_getX() + coord.asc_getWidth() + 3, coord.asc_getY() + coord.asc_getHeight() + 3]; + if (!Common.Utils.InternalSettings.get("de-hidden-rulers")) { + showPoint = [showPoint[0] - 19, showPoint[1] - 26]; + } + pasteContainer.css({left: showPoint[0], top : showPoint[1]}); + pasteContainer.show(); + } + }, + + onHideSpecialPasteOptions: function() { + var pasteContainer = this.documentHolder.cmpEl.find('#special-paste-container'); + if (pasteContainer.is(':visible')) + pasteContainer.hide(); + }, + + onDoubleClickOnChart: function(chart) { + if (this.mode.isEdit && !this._isDisabled) { + var diagramEditor = this.getApplication().getController('Common.Controllers.ExternalDiagramEditor').getView('Common.Views.ExternalDiagramEditor'); + if (diagramEditor && chart) { + diagramEditor.setEditMode(true); + diagramEditor.show(); + diagramEditor.setChartData(new Asc.asc_CChartBinary(chart)); + } + } + }, + + onDoubleClickOnTableOleObject: function(chart) { + if (this.mode.isEdit && !this._isDisabled) { + var oleEditor = this.getApplication().getController('Common.Controllers.ExternalOleEditor').getView('Common.Views.ExternalOleEditor'); + if (oleEditor && chart) { + oleEditor.setEditMode(true); + oleEditor.show(); + oleEditor.setOleData(Asc.asc_putBinaryDataToFrameFromTableOleObject(chart)); + } + } + }, + + onImgWrapStyleChanged: function(type){ + var menuImageWrap = this.documentHolder.menuImageWrap; + switch (type) { + case Asc.c_oAscWrapStyle2.Inline: + menuImageWrap.menu.items[0].setChecked(true); + break; + case Asc.c_oAscWrapStyle2.Square: + menuImageWrap.menu.items[2].setChecked(true); + break; + case Asc.c_oAscWrapStyle2.Tight: + menuImageWrap.menu.items[3].setChecked(true); + break; + case Asc.c_oAscWrapStyle2.Through: + menuImageWrap.menu.items[4].setChecked(true); + break; + case Asc.c_oAscWrapStyle2.TopAndBottom: + menuImageWrap.menu.items[5].setChecked(true); + break; + case Asc.c_oAscWrapStyle2.Behind: + menuImageWrap.menu.items[8].setChecked(true); + break; + case Asc.c_oAscWrapStyle2.InFront: + menuImageWrap.menu.items[7].setChecked(true); + break; + } + }, + + onChangeCropState: function(state) { + this.documentHolder.menuImgCrop.menu.items[0].setChecked(state, true); + }, + + onRulerDblClick: function(type) { + Common.UI.Menu.Manager.hideAll(); + + var win, me = this; + if (type == 'tables') { + win = this.advancedTableClick(); + if (win) + win.setActiveCategory(4); + } else if (type == 'indents' || type == 'tabs') { + win = this.advancedParagraphClick({isChart: false}); + if (win) + win.setActiveCategory(type == 'indents' ? 0 : 4); + } else if (type == 'margins') { + if (me._state.lock_doc) return; + win = new DE.Views.PageMarginsDialog({ + api: me.api, + handler: function(dlg, result) { + if (result == 'ok') { + var props = dlg.getSettings(); + var mnu = DE.getController('Toolbar').toolbar.btnPageMargins.menu.items[0]; + mnu.setVisible(true); + mnu.setChecked(true); + mnu.options.value = mnu.value = [props.get_TopMargin(), props.get_LeftMargin(), props.get_BottomMargin(), props.get_RightMargin()]; + $(mnu.el).html(mnu.template({id: Common.UI.getId(), caption : mnu.caption, options : mnu.options})); + Common.localStorage.setItem("de-pgmargins-top", props.get_TopMargin()); + Common.localStorage.setItem("de-pgmargins-left", props.get_LeftMargin()); + Common.localStorage.setItem("de-pgmargins-bottom", props.get_BottomMargin()); + Common.localStorage.setItem("de-pgmargins-right", props.get_RightMargin()); + + me.api.asc_SetSectionProps(props); + me.editComplete(); + } + } + }); + win.show(); + win.setSettings(me.api.asc_GetSectionProps()); + } else if (type == 'columns') { + win = new DE.Views.CustomColumnsDialog({ + handler: function(dlg, result) { + if (result == 'ok') { + me.api.asc_SetColumnsProps(dlg.getSettings()); + me.editComplete(); + } + } + }); + win.show(); + win.setSettings(me.api.asc_GetColumnsProps()); + } + }, + + onApiParagraphStyleChange: function(name) { + window.currentStyleName = name; + }, + + onHideContentControlsActions: function() { + this.listControlMenu && this.listControlMenu.isVisible() && this.listControlMenu.hide(); + var controlsContainer = this.documentHolder.cmpEl.find('#calendar-control-container'); + if (controlsContainer.is(':visible')) + controlsContainer.hide(); + }, + + onShowDateActions: function(obj, x, y) { + var props = obj.pr, + specProps = props.get_DateTimePr(), + cmpEl = this.documentHolder.cmpEl, + controlsContainer = cmpEl.find('#calendar-control-container'), + me = this; + + this._dateObj = props; + + if (controlsContainer.length < 1) { + controlsContainer = $('
    '); + cmpEl.append(controlsContainer); + } + + Common.UI.Menu.Manager.hideAll(); + + controlsContainer.css({left: x, top : y}); + controlsContainer.show(); + + if (!this.cmpCalendar) { + this.cmpCalendar = new Common.UI.Calendar({ + el: cmpEl.find('#id-document-calendar-control'), + enableKeyEvents: true, + firstday: 1 + }); + this.cmpCalendar.on('date:click', function (cmp, date) { + var specProps = me._dateObj.get_DateTimePr(); + specProps.put_FullDate(new Date(date)); + me.api.asc_SetContentControlDatePickerDate(specProps); + controlsContainer.hide(); + me.api.asc_UncheckContentControlButtons(); + me.editComplete(); + }); + this.cmpCalendar.on('calendar:keydown', function (cmp, e) { + if (e.keyCode==Common.UI.Keys.ESC) { + controlsContainer.hide(); + me.api.asc_UncheckContentControlButtons(); + } + }); + $(document).on('mousedown', function(e) { + if (e.target.localName !== 'canvas' && controlsContainer.is(':visible') && controlsContainer.find(e.target).length==0) { + controlsContainer.hide(); + me.api.asc_UncheckContentControlButtons(); + } + }); + + } + this.cmpCalendar.setDate(new Date(specProps ? specProps.get_FullDate() : undefined)); + + // align + var offset = controlsContainer.offset(), + docW = Common.Utils.innerWidth(), + docH = Common.Utils.innerHeight() - 10, // Yep, it's magic number + menuW = this.cmpCalendar.cmpEl.outerWidth(), + menuH = this.cmpCalendar.cmpEl.outerHeight(), + buttonOffset = 22, + left = offset.left - menuW, + top = offset.top; + if (top + menuH > docH) { + top = docH - menuH; + left -= buttonOffset; + } + if (top < 0) + top = 0; + if (left + menuW > docW) + left = docW - menuW; + this.cmpCalendar.cmpEl.css({left: left, top : top}); + + this._preventClick = true; + }, + + onShowListActions: function(obj, x, y) { + var type = obj.type, + props = obj.pr, + specProps = (type == Asc.c_oAscContentControlSpecificType.ComboBox) ? props.get_ComboBoxPr() : props.get_DropDownListPr(), + isForm = !!props.get_FormPr(), + cmpEl = this.documentHolder.cmpEl, + menu = this.listControlMenu, + menuContainer = menu ? cmpEl.find(Common.Utils.String.format('#menu-container-{0}', menu.id)) : null, + me = this; + + this._listObj = props; + + this._fromShowContentControls = true; + Common.UI.Menu.Manager.hideAll(); + + if (!menu) { + this.listControlMenu = menu = new Common.UI.Menu({ + maxHeight: 207, + menuAlign: 'tr-bl', + items: [] + }); + menu.on('item:click', function(menu, item) { + setTimeout(function(){ + (item.value!==-1) && me.api.asc_SelectContentControlListItem(item.value, me._listObj.get_InternalId()); + }, 1); + }); + + // Prepare menu container + if (!menuContainer || menuContainer.length < 1) { + menuContainer = $(Common.Utils.String.format('', menu.id)); + cmpEl.append(menuContainer); + } + + menu.render(menuContainer); + menu.cmpEl.attr({tabindex: "-1"}); + menu.on('hide:after', function(){ + me.listControlMenu.removeAll(); + if (!me._fromShowContentControls) + me.api.asc_UncheckContentControlButtons(); + }); + } + if (specProps) { + if (isForm){ // for dropdown and combobox form control always add placeholder item + var text = props.get_PlaceholderText(); + menu.addItem(new Common.UI.MenuItem({ + caption : (text.trim()!=='') ? text : this.documentHolder.txtEmpty, + value : '', + template : _.template([ + ' opacity: 0.6 <% } %>">', + '<%= caption %>', + '' + ].join('')) + })); + } + var count = specProps.get_ItemsCount(); + for (var i=0; i', + '<%= Common.Utils.String.htmlEncode(caption) %>', + '' + ].join('')) + })); + } + if (!isForm && menu.items.length<1) { + menu.addItem(new Common.UI.MenuItem({ + caption : this.documentHolder.txtEmpty, + value : -1 + })); + } + } + + menuContainer.css({left: x, top : y}); + menuContainer.attr('data-value', 'prevent-canvas-click'); + this._preventClick = true; + menu.show(); + + _.delay(function() { + menu.cmpEl.focus(); + }, 10); + this._fromShowContentControls = false; + }, + + onShowContentControlsActions: function(obj, x, y) { + var type = obj.type; + switch (type) { + case Asc.c_oAscContentControlSpecificType.DateTime: + this.onShowDateActions(obj, x, y); + break; + case Asc.c_oAscContentControlSpecificType.Picture: + if (obj.pr && obj.pr.get_Lock) { + var lock = obj.pr.get_Lock(); + if (lock == Asc.c_oAscSdtLockType.SdtContentLocked || lock==Asc.c_oAscSdtLockType.ContentLocked) + return; + } + this.api.asc_addImage(obj); + var me = this; + setTimeout(function(){ + me.api.asc_UncheckContentControlButtons(); + }, 500); + break; + case Asc.c_oAscContentControlSpecificType.DropDownList: + case Asc.c_oAscContentControlSpecificType.ComboBox: + this.onShowListActions(obj, x, y); + break; + } + }, + + onApiLockDocumentProps: function() { + this._state.lock_doc = true; + }, + + onApiUnLockDocumentProps: function() { + this._state.lock_doc = false; + }, + + onCoAuthoringDisconnect: function() { + this.mode.isEdit = false; + }, + + SetDisabled: function(state, canProtect, fillFormMode) { + this._isDisabled = state; + this.documentHolder.SetDisabled(state, canProtect, fillFormMode); + }, + + onTextLanguage: function(langid) { + this.documentHolder._currLang.id = langid; + }, + + onSpellCheckVariantsFound: function() { + var me = this; + var selectedElements = me.api.getSelectedElements(true); + var props; + if (selectedElements && _.isArray(selectedElements)){ + for (var i = 0; i = 0; i--) { + var elType, elValue; + elType = selectedElements[i].get_ObjectType(); + elValue = selectedElements[i].get_ObjectValue(); + + if (Asc.c_oAscTypeSelectElement.Paragraph == elType) { + win = new DE.Views.ParagraphSettingsAdvanced({ + tableStylerRows : 2, + tableStylerColumns : 1, + paragraphProps : elValue, + borderProps : me.borderAdvancedProps, + isChart : (item.isChart===true), + isSmartArtInternal : (item.isSmartArtInternal===true), + api : me.api, + handler: function(result, value) { + if (result == 'ok') { + if (me.api) { + me.borderAdvancedProps = value.borderProps; + me.api.paraApply(value.paragraphProps); + } + } + me.editComplete(); + } + }); + break; + } + } + } + } + + if (win) { + win.show(); + return win; + } + }, + + advancedFrameClick: function(isFrame, item, e, eOpt){ + Common.NotificationCenter.trigger('dropcap:settings', isFrame); + }, + + advancedTableClick: function(item, e, eOpt){ + var win, me = this; + if (me.api){ + var selectedElements = me.api.getSelectedElements(); + + if (selectedElements && _.isArray(selectedElements)){ + for (var i = selectedElements.length - 1; i >= 0; i--) { + var elType, elValue; + + elType = selectedElements[i].get_ObjectType(); + elValue = selectedElements[i].get_ObjectValue(); + + if (Asc.c_oAscTypeSelectElement.Table == elType) { + win = new DE.Views.TableSettingsAdvanced({ + tableStylerRows : (elValue.get_CellBorders().get_InsideH()===null && elValue.get_CellSelect()==true) ? 1 : 2, + tableStylerColumns : (elValue.get_CellBorders().get_InsideV()===null && elValue.get_CellSelect()==true) ? 1 : 2, + tableProps : elValue, + borderProps : me.borderAdvancedProps, + sectionProps : me.api.asc_GetSectionProps(), + handler : function(result, value) { + if (result == 'ok') { + if (me.api) { + me.borderAdvancedProps = value.borderProps; + me.api.tblApply(value.tableProps); + } + } + me.editComplete(); + } + }); + break; + } + } + } + } + + if (win) { + win.show(); + return win; + } + }, + + onMenuSaveStyle:function(item, e, eOpt){ + var me = this; + if (me.api) { + Common.NotificationCenter.trigger('style:commitsave', me.api.asc_GetStyleFromFormatting()); + } + }, + + onMenuUpdateStyle:function(item, e, eOpt){ + var me = this; + if (me.api) { + Common.NotificationCenter.trigger('style:commitchange', me.api.asc_GetStyleFromFormatting()); + } + }, + + addComment: function(item, e, eOpt){ + if (this.api && this.mode.canCoAuthoring && this.mode.canComments) { + this.documentHolder.suppressEditComplete = true; + + var controller = DE.getController('Common.Controllers.Comments'); + if (controller) { + controller.addDummyComment(); + } + } + }, + + onCutCopyPaste: function(item, e) { + var me = this; + if (me.api) { + var res = (item.value == 'cut') ? me.api.Cut() : ((item.value == 'copy') ? me.api.Copy() : me.api.Paste()); + if (!res) { + if (!Common.localStorage.getBool("de-hide-copywarning")) { + (new Common.Views.CopyWarningDialog({ + handler: function(dontshow) { + if (dontshow) Common.localStorage.setItem("de-hide-copywarning", 1); + me.editComplete(); + } + })).show(); + } + } + } + me.editComplete(); + }, + + onUndo: function () { + this.api.Undo(); + }, + + onAcceptRejectChange: function(item, e) { + if (this.api) { + if (item.value == 'accept') + this.api.asc_AcceptChanges(); + else if (item.value == 'reject') + this.api.asc_RejectChanges(); + } + this.editComplete(); + }, + + onPrintSelection: function(item){ + if (this.api){ + var printopt = new Asc.asc_CAdjustPrint(); + printopt.asc_setPrintType(Asc.c_oAscPrintType.Selection); + var opts = new Asc.asc_CDownloadOptions(null, Common.Utils.isChrome || Common.Utils.isOpera || Common.Utils.isGecko && Common.Utils.firefoxVersion>86); // if isChrome or isOpera == true use asc_onPrintUrl event + opts.asc_setAdvancedOptions(printopt); + this.api.asc_Print(opts); + this.editComplete(); + Common.component.Analytics.trackEvent('DocumentHolder', 'Print Selection'); + } + }, + + onControlsSelect: function(item, e) { + var me = this; + var props = this.api.asc_GetContentControlProperties(); + if (props) { + if (item.value == 'settings') { + (new DE.Views.ControlSettingsDialog({ + props: props, + api: me.api, + handler: function (result, value) { + if (result == 'ok') { + me.api.asc_SetContentControlProperties(value, props.get_InternalId()); + } + + me.editComplete(); + } + })).show(); + } else if (item.value == 'remove') { + props.get_FormPr() ? this.api.asc_RemoveContentControl(props.get_InternalId()) : this.api.asc_RemoveContentControlWrapper(props.get_InternalId()); + } + } + me.editComplete(); + }, + + onInsertCaption: function() { + this.documentHolder.fireEvent('links:caption'); + }, + + onContinueNumbering: function(item, e) { + this.api.asc_ContinueNumbering(); + this.editComplete(); + }, + + onStartNumbering: function(startfrom, item, e) { + if (startfrom == 1) + this.api.asc_RestartNumbering(item.value.start); + else { + var me = this; + (new DE.Views.NumberingValueDialog({ + title: me.documentHolder.textNumberingValue, + props: item.value, + handler: function (result, value) { + if (result == 'ok') + me.api.asc_RestartNumbering(value); + me.editComplete(); + } + })).show(); + } + this.editComplete(); + }, + + onCellsRemove: function() { + var me = this; + (new Common.Views.OptionsDialog({ + title: me.documentHolder.textTitleCellsRemove, + items: [ + {caption: this.documentHolder.textLeft, value: 'left'}, + {caption: this.documentHolder.textRow, value: 'row'}, + {caption: this.documentHolder.textCol, value: 'col'} + ], + handler: function (dlg, result) { + if (result=='ok') { + var value = dlg.getSettings(); + if (value == 'row') + me.api.remRow(); + else if (value == 'col') + me.api.remColumn(); + else + me.api.asc_RemoveTableCells(); + } + me.editComplete(); + } + })).show(); + this.editComplete(); + }, + + onCellsAdd: function() { + var me = this; + (new DE.Views.CellsAddDialog({ + handler: function (result, settings) { + if (result == 'ok') { + if (settings.row) { + settings.before ? me.api.addRowAbove(settings.count) : me.api.addRowBelow(settings.count); + } else { + settings.before ? me.api.addColumnLeft(settings.count) : me.api.addColumnRight(settings.count); + } + } + me.editComplete(); + } + })).show(); + this.editComplete(); + }, + + onSignatureClick: function(item) { + var datavalue = item.cmpEl.attr('data-value'); + switch (item.value) { + case 0: + Common.NotificationCenter.trigger('protect:sign', datavalue); //guid + break; + case 1: + this.api.asc_ViewCertificate(datavalue); //certificate id + break; + case 2: + Common.NotificationCenter.trigger('protect:signature', 'visible', this._isDisabled, datavalue);//guid, can edit settings for requested signature + break; + case 3: + var me = this; + Common.UI.warning({ + title: this.documentHolder.notcriticalErrorTitle, + msg: this.documentHolder.txtRemoveWarning, + buttons: ['ok', 'cancel'], + primary: 'ok', + callback: function(btn) { + if (btn == 'ok') { + me.api.asc_RemoveSignature(datavalue); + } + } + }); + break; + } + }, + + onImgRotate: function(item) { + var properties = new Asc.asc_CImgProperty(); + properties.asc_putRotAdd((item.value==1 ? 90 : 270) * 3.14159265358979 / 180); + this.api.ImgApply(properties); + this.editComplete(); + }, + + onImgFlip: function(item) { + var properties = new Asc.asc_CImgProperty(); + if (item.value==1) + properties.asc_putFlipHInvert(true); + else + properties.asc_putFlipVInvert(true); + this.api.ImgApply(properties); + this.editComplete(); + }, + + onImgCrop: function(menu, item) { + if (item.value == 1) { + this.api.asc_cropFill(); + } else if (item.value == 2) { + this.api.asc_cropFit(); + } else { + item.checked ? this.api.asc_startEditCrop() : this.api.asc_endEditCrop(); + } + this.editComplete(); + }, + + onFollowMove: function(item) { + if (this.api) { + this.api.asc_FollowRevisionMove(item.value); + } + this.editComplete(); + }, + + tableCellsVAlign: function(menu, item, e) { + if (this.api) { + var properties = new Asc.CTableProp(); + properties.put_CellsVAlign(item.options.valign); + this.api.tblApply(properties); + } + }, + + tableSelectText: function(menu, item, e) { + if (this.api) { + switch (item.value) { + case 0: + this.api.selectRow(); + break; + case 1: + this.api.selectColumn(); + break; + case 2: + this.api.selectCell(); + break; + case 3: + this.api.selectTable(); + break; + } + } + }, + + tableInsertText: function(menu, item, e) { + if (this.api) { + switch (item.value) { + case 0: + this.api.addColumnLeft(); + break; + case 1: + this.api.addColumnRight(); + break; + case 2: + this.api.addRowAbove(); + break; + case 3: + this.api.addRowBelow(); + break; + case 4: + this.onCellsAdd(); + break; + } + } + }, + + tableDeleteText: function(menu, item, e) { + if (this.api) { + switch (item.value) { + case 0: + this.api.remRow(); + break; + case 1: + this.api.remColumn(); + break; + case 2: + this.api.remTable(); + break; + case 3: + this.onCellsRemove(); + break; + } + } + }, + + onImgAlign: function(menu, item, e) { + var me = this; + if (me.api) { + var alignto = Common.Utils.InternalSettings.get("de-img-align-to"), + value = (alignto==1) ? Asc.c_oAscObjectsAlignType.Page : ((me.api.asc_getSelectedDrawingObjectsCount()<2 && !alignto || alignto==2) ? Asc.c_oAscObjectsAlignType.Margin : Asc.c_oAscObjectsAlignType.Selected); + if (item.value < 6) { + me.api.put_ShapesAlign(item.value, value); + Common.component.Analytics.trackEvent('DocumentHolder', 'Shape Align'); + } else if (item.value == 6) { + me.api.DistributeHorizontally(value); + Common.component.Analytics.trackEvent('DocumentHolder', 'Distribute Horizontally'); + } else if (item.value == 7){ + me.api.DistributeVertically(value); + Common.component.Analytics.trackEvent('DocumentHolder', 'Distribute Vertically'); + } + } + me.editComplete(); + }, + + onImgArrange: function(menu, item, e) { + var me = this; + if (me.api && item.options.valign!==undefined) { + var properties = new Asc.asc_CImgProperty(); + properties.put_ChangeLevel(item.options.valign); + me.api.ImgApply(properties); + } + me.editComplete(); + }, + + onImgGroup: function(item) { + var me = this; + if (me.api) { + var properties = new Asc.asc_CImgProperty(); + properties.put_Group(1); + me.api.ImgApply(properties); + } + me.editComplete(); + }, + + onImgUnGroup: function(item) { + var me = this; + if (me.api) { + var properties = new Asc.asc_CImgProperty(); + properties.put_Group(-1); + me.api.ImgApply(properties); + } + me.editComplete(); + }, + + onImgWrapPolygon: function(item) { + this.api && this.api.StartChangeWrapPolygon(); + this.editComplete(); + }, + + onImgWrap: function (menu, item, e) { + var me = this; + if (me.api && item.options.wrapType!==undefined) { + var properties = new Asc.asc_CImgProperty(); + properties.put_WrappingStyle(item.options.wrapType); + + if (me.documentHolder.menuImageWrap._originalProps.get_WrappingStyle() === Asc.c_oAscWrapStyle2.Inline && item.wrapType !== Asc.c_oAscWrapStyle2.Inline ) { + properties.put_PositionH(new Asc.CImagePositionH()); + properties.get_PositionH().put_UseAlign(false); + properties.get_PositionH().put_RelativeFrom(Asc.c_oAscRelativeFromH.Column); + var val = me.documentHolder.menuImageWrap._originalProps.get_Value_X(Asc.c_oAscRelativeFromH.Column); + properties.get_PositionH().put_Value(val); + + properties.put_PositionV(new Asc.CImagePositionV()); + properties.get_PositionV().put_UseAlign(false); + properties.get_PositionV().put_RelativeFrom(Asc.c_oAscRelativeFromV.Paragraph); + val = me.documentHolder.menuImageWrap._originalProps.get_Value_Y(Asc.c_oAscRelativeFromV.Paragraph); + properties.get_PositionV().put_Value(val); + } + me.api.ImgApply(properties); + } + me.editComplete(); + }, + + onImgAdvanced: function(item, e) { + var elType, elValue; + var me = this; + if (me.api){ + var selectedElements = me.api.getSelectedElements(); + + if (selectedElements && _.isArray(selectedElements)) { + for (var i = selectedElements.length - 1; i >= 0; i--) { + elType = selectedElements[i].get_ObjectType(); + elValue = selectedElements[i].get_ObjectValue(); + + if (Asc.c_oAscTypeSelectElement.Image == elType) { + var imgsizeOriginal; + if ( !elValue.get_ChartProperties() && !elValue.get_ShapeProperties() && !me.documentHolder.menuOriginalSize.isDisabled() && me.documentHolder.menuOriginalSize.isVisible()) { + imgsizeOriginal = me.api.get_OriginalSizeImage(); + if (imgsizeOriginal) + imgsizeOriginal = {width:imgsizeOriginal.get_ImageWidth(), height:imgsizeOriginal.get_ImageHeight()}; + } + + var win = new DE.Views.ImageSettingsAdvanced({ + imageProps : elValue, + sizeOriginal: imgsizeOriginal, + api : me.api, + sectionProps: me.api.asc_GetSectionProps(), + handler : function(result, value) { + if (result == 'ok') { + if (me.api) { + me.api.ImgApply(value.imageProps); + } + } + me.editComplete(); + } + }); + win.show(); + win.btnOriginalSize.setVisible(me.documentHolder.menuOriginalSize.isVisible()); + break; + } + } + } + } + }, + + onImgOriginalSize: function(item, e) { + var me = this; + if (me.api){ + var originalImageSize = me.api.get_OriginalSizeImage(); + + var properties = new Asc.asc_CImgProperty(); + properties.put_Width(originalImageSize.get_ImageWidth()); + properties.put_Height(originalImageSize.get_ImageHeight()); + properties.put_ResetCrop(true); + properties.put_Rot(0); + me.api.ImgApply(properties); + + me.editComplete(); + } + }, + + onImgReplace: function(menu, item, e) { + var me = this; + if (item.value==1) { + (new Common.Views.ImageFromUrlDialog({ + handler: function(result, value) { + if (result == 'ok') { + if (me.api) { + var checkUrl = value.replace(/ /g, ''); + if (!_.isEmpty(checkUrl)) { + var props = new Asc.asc_CImgProperty(); + props.put_ImageUrl(checkUrl); + me.api.ImgApply(props); + } + } + } + me.editComplete(); + } + })).show(); + } else if (item.value==2) { + Common.NotificationCenter.trigger('storage:image-load', 'change'); + } else { + setTimeout(function(){ + if (me.api) me.api.ChangeImageFromFile(); + me.editComplete(); + }, 10); + } + }, + + onImgEditPoints: function(item) { + this.api && this.api.asc_editPointsGeometry(); + }, + + onTableMerge: function(item) { + this.api && this.api.MergeCells(); + }, + + onTableSplit: function(item) { + var me = this; + if (me.api){ + (new Common.Views.InsertTableDialog({ + split: true, + handler: function(result, value) { + if (result == 'ok') { + if (me.api) { + me.api.SplitCell(value.columns, value.rows); + } + Common.component.Analytics.trackEvent('DocumentHolder', 'Table'); + } + me.editComplete(); + } + })).show(); + } + }, + + onIgnoreSpell: function(item, e){ + this.api && this.api.asc_ignoreMisspelledWord(this.documentHolder._currentSpellObj, !!item.value); + this.editComplete(); + }, + + onToDictionary: function(item, e){ + this.api && this.api.asc_spellCheckAddToDictionary(this.documentHolder._currentSpellObj); + this.editComplete(); + }, + + onTableDist: function(item, e){ + this.api && this.api.asc_DistributeTableCells(!!item.value); + this.editComplete(); + }, + + tableDirection: function(menu, item, e) { + var me = this; + if (me.api) { + var properties = new Asc.CTableProp(); + properties.put_CellsTextDirection(item.options.direction); + me.api.tblApply(properties); + } + }, + + onRefreshField: function(item, e){ + this.api && this.api.asc_UpdateComplexField(item.options.fieldProps); + this.editComplete(); + }, + + onParagraphBreakBefore: function(item, e){ + this.api && this.api.put_PageBreak(item.checked); + }, + + onParagraphKeepLines: function(item, e){ + this.api && this.api.put_KeepLines(item.checked); + }, + + paragraphVAlign: function(menu, item, e) { + var me = this; + if (me.api) { + var properties = new Asc.asc_CImgProperty(); + properties.put_VerticalTextAlign(item.options.valign); + me.api.ImgApply(properties); + } + }, + + paragraphDirection: function(menu, item, e) { + var me = this; + if (me.api) { + var properties = new Asc.asc_CImgProperty(); + properties.put_Vert(item.options.direction); + me.api.ImgApply(properties); + } + }, + + onLangMenu: function(type, menu, item){ + var me = this; + if (me.api){ + if (!_.isUndefined(item.langid)) + me.api.put_TextPrLang(item.langid); + + (type==='para') ? (me.documentHolder._currLang.paraid = item.langid) : (me.documentHolder._currLang.tableid = item.langid); + me.editComplete(); + } + }, + + onTOCMenu: function(menu, item, e) { + this.documentHolder.fireEvent((item.value==='settings') ? 'links:contents' : 'links:update', [item.value, true]); + }, + + onParaTOCSettings: function(item, e) { + this.documentHolder.fireEvent('links:contents', [item.value, true]); + }, + + editComplete: function() { + this.documentHolder && this.documentHolder.fireEvent('editcomplete', this.documentHolder); } }); }); \ No newline at end of file diff --git a/apps/documenteditor/main/app/controller/LeftMenu.js b/apps/documenteditor/main/app/controller/LeftMenu.js index 07a94cb51..4f8f3eb0d 100644 --- a/apps/documenteditor/main/app/controller/LeftMenu.js +++ b/apps/documenteditor/main/app/controller/LeftMenu.js @@ -816,6 +816,11 @@ define([ this.leftMenu.panelThumbnails.hide(); this.leftMenu.onBtnMenuClick(this.leftMenu.btnThumbnails); } + else if (this.leftMenu.btnNavigation.isActive()) { + this.leftMenu.btnNavigation.toggle(false); + this.leftMenu.panelNavigation.hide(); + this.leftMenu.onBtnMenuClick(this.leftMenu.btnNavigation); + } } } }, diff --git a/apps/documenteditor/main/app/controller/Links.js b/apps/documenteditor/main/app/controller/Links.js index f8947d704..cd3577712 100644 --- a/apps/documenteditor/main/app/controller/Links.js +++ b/apps/documenteditor/main/app/controller/Links.js @@ -454,7 +454,8 @@ define([ onShowTOCActions: function(obj, x, y) { var action = obj.button, menu = (action==AscCommon.CCButtonType.Toc) ? this.view.contentsUpdateMenu : this.view.contentsMenu, - documentHolderView = this.getApplication().getController('DocumentHolder').documentHolder, + documentHolder = this.getApplication().getController('DocumentHolder'), + documentHolderView = documentHolder.getView(), menuContainer = documentHolderView.cmpEl.find(Common.Utils.String.format('#menu-container-{0}', menu.id)), me = this; @@ -479,7 +480,7 @@ define([ menuContainer.css({left: x, top : y}); menuContainer.attr('data-value', 'prevent-canvas-click'); - documentHolderView._preventClick = true; + documentHolder._preventClick = true; menu.show(); menu.alignPosition(); diff --git a/apps/documenteditor/main/app/controller/Main.js b/apps/documenteditor/main/app/controller/Main.js index cc29c1909..4a5707872 100644 --- a/apps/documenteditor/main/app/controller/Main.js +++ b/apps/documenteditor/main/app/controller/Main.js @@ -169,6 +169,8 @@ define([ weakCompare : function(obj1, obj2){return obj1.type === obj2.type;} }); + this.stackMacrosRequests = []; + this._state = {isDisconnected: false, usersCount: 1, fastCoauth: true, lostEditingRights: false, licenseType: false, isDocModified: false}; this.languages = null; @@ -436,6 +438,9 @@ define([ value = parseInt(value); Common.Utils.InternalSettings.set("de-macros-mode", value); + value = Common.localStorage.getItem("de-allow-macros-request"); + Common.Utils.InternalSettings.set("de-allow-macros-request", (value !== null) ? parseInt(value) : 0); + this.appOptions.wopi = this.editorConfig.wopi; Common.Controllers.Desktop.init(this.appOptions); @@ -509,6 +514,7 @@ define([ } this.api.asc_registerCallback('asc_onGetEditorPermissions', _.bind(this.onEditorPermissions, this)); this.api.asc_registerCallback('asc_onLicenseChanged', _.bind(this.onLicenseChanged, this)); + this.api.asc_registerCallback('asc_onMacrosPermissionRequest', _.bind(this.onMacrosPermissionRequest, this)); this.api.asc_registerCallback('asc_onRunAutostartMacroses', _.bind(this.onRunAutostartMacroses, this)); this.api.asc_setDocInfo(docInfo); this.api.asc_getEditorPermissions(this.editorConfig.licenseUrl, this.editorConfig.customerId); @@ -814,7 +820,7 @@ define([ app.getController('Toolbar').DisableToolbar(disable, options.viewMode, options.reviewMode, options.fillFormMode); } if (options.documentHolder) { - app.getController('DocumentHolder').getView().SetDisabled(disable, options.allowProtect, options.fillFormMode); + app.getController('DocumentHolder').SetDisabled(disable, options.allowProtect, options.fillFormMode); } if (options.leftMenu) { if (options.leftMenu.disable) @@ -1221,6 +1227,9 @@ define([ Common.Utils.InternalSettings.set("de-settings-inputmode", value); me.api.SetTextBoxInputMode(value); + value = Common.localStorage.getBool("de-settings-use-alt-key", true); + Common.Utils.InternalSettings.set("de-settings-use-alt-key", value); + /** coauthoring begin **/ me._state.fastCoauth = Common.Utils.InternalSettings.get("de-settings-coauthmode"); me.api.asc_SetFastCollaborative(me._state.fastCoauth); @@ -1262,7 +1271,7 @@ define([ pluginsController.setApi(me.api); documentHolderController.setApi(me.api); - documentHolderController.createDelayedElements(); + // documentHolderController.createDelayedElements(); statusbarController.createDelayedElements(); leftmenuController.getView('LeftMenu').disableMenu('all',false); @@ -1270,7 +1279,7 @@ define([ if (me.appOptions.canBranding) me.getApplication().getController('LeftMenu').leftMenu.getMenu('about').setLicInfo(me.editorConfig.customization); - documentHolderController.getView().setApi(me.api).on('editcomplete', _.bind(me.onEditComplete, me)); + documentHolderController.getView().on('editcomplete', _.bind(me.onEditComplete, me)); if (me.appOptions.isEdit) { if (me.appOptions.canForcesave) {// use asc_setIsForceSaveOnUserSave only when customization->forcesave = true @@ -1645,7 +1654,7 @@ define([ var app = this.getApplication(), viewport = app.getController('Viewport').getView('Viewport'), statusbarView = app.getController('Statusbar').getView('Statusbar'), - documentHolder = app.getController('DocumentHolder').getView(), + documentHolder = app.getController('DocumentHolder'), toolbarController = app.getController('Toolbar'); viewport && viewport.setMode(this.appOptions); @@ -2259,7 +2268,7 @@ define([ synchronizeChanges: function() { this.getApplication().getController('Statusbar').synchronizeChanges(); this.getApplication().getController('Common.Controllers.ReviewChanges').synchronizeChanges(); - this.getApplication().getController('DocumentHolder').getView().hideTips(); + this.getApplication().getController('DocumentHolder').hideTips(); /** coauthoring begin **/ this.getApplication().getController('Toolbar').getView().synchronizeChanges(); /** coauthoring end **/ @@ -2708,6 +2717,47 @@ define([ } }, + onMacrosPermissionRequest: function(url, callback) { + if (url && callback) { + this.stackMacrosRequests.push({url: url, callback: callback}); + if (this.stackMacrosRequests.length>1) { + return; + } + } else if (this.stackMacrosRequests.length>0) { + url = this.stackMacrosRequests[0].url; + callback = this.stackMacrosRequests[0].callback; + } else + return; + + var me = this; + var value = Common.Utils.InternalSettings.get("de-allow-macros-request"); + if (value>0) { + callback && callback(value === 1); + this.stackMacrosRequests.shift(); + this.onMacrosPermissionRequest(); + } else { + Common.UI.warning({ + msg: this.textRequestMacros.replace('%1', url), + buttons: ['yes', 'no'], + primary: 'yes', + dontshow: true, + textDontShow: this.textRememberMacros, + maxwidth: 600, + callback: function(btn, dontshow){ + if (dontshow) { + Common.Utils.InternalSettings.set("de-allow-macros-request", (btn == 'yes') ? 1 : 2); + Common.localStorage.setItem("de-allow-macros-request", (btn == 'yes') ? 1 : 2); + } + setTimeout(function() { + if (callback) callback(btn == 'yes'); + me.stackMacrosRequests.shift(); + me.onMacrosPermissionRequest(); + }, 1); + } + }); + } + }, + loadAutoCorrectSettings: function() { // autocorrection var me = this; @@ -3163,7 +3213,7 @@ define([ txtEnterDate: 'Enter a date', txtTypeEquation: 'Type equation here', textHasMacros: 'The file contains automatic macros.
    Do you want to run macros?', - textRemember: 'Remember my choice', + textRemember: 'Remember my choice for all files', warnLicenseLimitedRenewed: 'License needs to be renewed.
    You have a limited access to document editing functionality.
    Please contact your administrator to get full access', warnLicenseLimitedNoAccess: 'License expired.
    You have no access to document editing functionality.
    Please contact your administrator.', saveErrorTextDesktop: 'This file cannot be saved or created.
    Possible reasons are:
    1. The file is read-only.
    2. The file is being edited by other users.
    3. The disk is full or corrupted.', @@ -3187,7 +3237,9 @@ define([ errorLang: 'The interface language is not loaded.
    Please contact your Document Server administrator.', errorLoadingFont: 'Fonts are not loaded.
    Please contact your Document Server administrator.', errorEmptyTOC: 'Start creating a table of contents by applying a heading style from the Styles gallery to the selected text.', - errorNoTOC: 'There\'s no table of contents to update. You can insert one from the References tab.' + errorNoTOC: 'There\'s no table of contents to update. You can insert one from the References tab.', + textRequestMacros: 'A macro makes a request to URL. Do you want to allow the request to the %1?', + textRememberMacros: 'Remember my choice for all macros' } })(), DE.Controllers.Main || {})) }); \ No newline at end of file diff --git a/apps/documenteditor/main/app/controller/Navigation.js b/apps/documenteditor/main/app/controller/Navigation.js index fa2f2b980..31daa23b5 100644 --- a/apps/documenteditor/main/app/controller/Navigation.js +++ b/apps/documenteditor/main/app/controller/Navigation.js @@ -118,6 +118,10 @@ define([ panelNavigation.viewNavigationList.on('item:add', _.bind(this.onItemAdd, this)); panelNavigation.navigationMenu.on('item:click', _.bind(this.onMenuItemClick, this)); panelNavigation.navigationMenu.items[11].menu.on('item:click', _.bind(this.onMenuLevelsItemClick, this)); + panelNavigation.btnSettingsMenu.on('item:click', _.bind(this.onMenuSettingsItemClick, this)); + panelNavigation.btnSettingsMenu.items[2].menu.on('item:click', _.bind(this.onMenuLevelsItemClick, this)); + panelNavigation.btnSettingsMenu.items[4].menu.on('item:click', _.bind(this.onMenuFontSizeClick, this)); + panelNavigation.btnClose.on('click', _.bind(this.onClickClosePanel, this)); var viewport = this.getApplication().getController('Viewport').getView('Viewport'); viewport.hlayout.on('layout:resizedrag', function () { @@ -245,7 +249,6 @@ define([ onMenuItemClick: function (menu, item) { if (!this._navigationObject && !this._viewerNavigationObject) return; - var index = parseInt(menu.cmpEl.attr('data-value')); if (item.value == 'promote') { this._navigationObject.promote(index); @@ -265,11 +268,32 @@ define([ this.panelNavigation.viewNavigationList.collapseAll(); } }, + onClickClosePanel: function() { + Common.NotificationCenter.trigger('leftmenu:change', 'hide'); + }, + + onMenuSettingsItemClick: function (menu, item){ + switch (item.value){ + case 'expand': + this.panelNavigation.viewNavigationList.expandAll(); + break; + case 'collapse': + this.panelNavigation.viewNavigationList.collapseAll(); + break; + case 'wrap': + this.panelNavigation.changeWrapHeadings(); + break; + } + }, onMenuLevelsItemClick: function (menu, item) { this.panelNavigation.viewNavigationList.expandToLevel(item.value-1); }, + onMenuFontSizeClick: function (menu, item){ + this.panelNavigation.changeFontSize(item.value); + }, + SetDisabled: function(state) { this._isDisabled = state; }, diff --git a/apps/documenteditor/main/app/controller/Toolbar.js b/apps/documenteditor/main/app/controller/Toolbar.js index 7125ea6c0..4386d3cd4 100644 --- a/apps/documenteditor/main/app/controller/Toolbar.js +++ b/apps/documenteditor/main/app/controller/Toolbar.js @@ -991,9 +991,9 @@ define([ if (this._state.clrhighlight != -1) { this.toolbar.mnuHighlightTransparent.setChecked(true, true); - if (this.toolbar.mnuHighlightColorPicker.cmpEl) { + if (this.toolbar.mnuHighlightColorPicker) { this._state.clrhighlight = -1; - this.toolbar.mnuHighlightColorPicker.select(null, true); + this.toolbar.mnuHighlightColorPicker.clearSelection(); } } } else if (c !== null) { @@ -1001,13 +1001,13 @@ define([ this.toolbar.mnuHighlightTransparent.setChecked(false); this._state.clrhighlight = c.get_hex().toUpperCase(); - if ( _.contains(this.toolbar.mnuHighlightColorPicker.colors, this._state.clrhighlight) ) - this.toolbar.mnuHighlightColorPicker.select(this._state.clrhighlight, true); + if ( this.toolbar.mnuHighlightColorPicker && _.contains(this.toolbar.mnuHighlightColorPicker.colors, this._state.clrhighlight) ) + this.toolbar.mnuHighlightColorPicker.selectByRGB(this._state.clrhighlight, true); } } else { if ( this._state.clrhighlight !== c) { this.toolbar.mnuHighlightTransparent.setChecked(false, true); - this.toolbar.mnuHighlightColorPicker.select(null, true); + this.toolbar.mnuHighlightColorPicker && this.toolbar.mnuHighlightColorPicker.clearSelection(); this._state.clrhighlight = c; } } diff --git a/apps/documenteditor/main/app/controller/ViewTab.js b/apps/documenteditor/main/app/controller/ViewTab.js index 31dfecc38..07567b2a5 100644 --- a/apps/documenteditor/main/app/controller/ViewTab.js +++ b/apps/documenteditor/main/app/controller/ViewTab.js @@ -82,7 +82,6 @@ define([ mode: mode, compactToolbar: this.toolbar.toolbar.isCompactView }); - this.addListeners({ 'ViewTab': { 'zoom:topage': _.bind(this.onBtnZoomTo, this, 'topage'), @@ -128,6 +127,10 @@ define([ })).then(function(){ me.view.setEvents(); + if (!Common.UI.Themes.available()) { + me.view.btnInterfaceTheme.$el.closest('.group').remove(); + me.view.$el.find('.separator-theme').remove(); + } if (config.canBrandingExt && config.customization && config.customization.statusBar === false || !Common.UI.LayoutManager.isElementVisible('statusBar')) { me.view.chStatusbar.$el.remove(); var slotChkRulers = me.view.chRulers.$el, @@ -153,30 +156,32 @@ define([ me.view.turnNavigation(state); }); - var menuItems = [], - currentTheme = Common.UI.Themes.currentThemeId() || Common.UI.Themes.defaultThemeId(); - for (var t in Common.UI.Themes.map()) { - menuItems.push({ - value: t, - caption: Common.UI.Themes.get(t).text, - checked: t === currentTheme, - checkable: true, - toggleGroup: 'interface-theme' - }); - } + if (Common.UI.Themes.available()) { + var menuItems = [], + currentTheme = Common.UI.Themes.currentThemeId() || Common.UI.Themes.defaultThemeId(); + for (var t in Common.UI.Themes.map()) { + menuItems.push({ + value: t, + caption: Common.UI.Themes.get(t).text, + checked: t === currentTheme, + checkable: true, + toggleGroup: 'interface-theme' + }); + } - if (menuItems.length) { - me.view.btnInterfaceTheme.setMenu(new Common.UI.Menu({items: menuItems})); - me.view.btnInterfaceTheme.menu.on('item:click', _.bind(function (menu, item) { - var value = item.value; - Common.UI.Themes.setTheme(value); - Common.Utils.lockControls(Common.enumLock.inLightTheme, !Common.UI.Themes.isDarkTheme(), {array: [me.view.btnDarkDocument]}); - }, me)); + if (menuItems.length) { + me.view.btnInterfaceTheme.setMenu(new Common.UI.Menu({items: menuItems})); + me.view.btnInterfaceTheme.menu.on('item:click', _.bind(function (menu, item) { + var value = item.value; + Common.UI.Themes.setTheme(value); + Common.Utils.lockControls(Common.enumLock.inLightTheme, !Common.UI.Themes.isDarkTheme(), {array: [me.view.btnDarkDocument]}); + }, me)); - setTimeout(function () { - me.onContentThemeChangedToDark(Common.UI.Themes.isContentThemeDark()); - Common.Utils.lockControls(Common.enumLock.inLightTheme, !Common.UI.Themes.isDarkTheme(), {array: [me.view.btnDarkDocument]}); - }, 0); + setTimeout(function () { + me.onContentThemeChangedToDark(Common.UI.Themes.isContentThemeDark()); + Common.Utils.lockControls(Common.enumLock.inLightTheme, !Common.UI.Themes.isDarkTheme(), {array: [me.view.btnDarkDocument]}); + }, 0); + } } }); } @@ -255,7 +260,7 @@ define([ }, onThemeChanged: function () { - if (this.view) { + if (this.view && Common.UI.Themes.available()) { var current_theme = Common.UI.Themes.currentThemeId() || Common.UI.Themes.defaultThemeId(), menu_item = _.findWhere(this.view.btnInterfaceTheme.menu.items, {value: current_theme}); if ( menu_item ) { diff --git a/apps/documenteditor/main/app/view/ControlSettingsDialog.js b/apps/documenteditor/main/app/view/ControlSettingsDialog.js index f8c10561a..c0a71b0b6 100644 --- a/apps/documenteditor/main/app/view/ControlSettingsDialog.js +++ b/apps/documenteditor/main/app/view/ControlSettingsDialog.js @@ -141,7 +141,6 @@ define([ 'text!documenteditor/main/app/template/ControlSettingsDialog.template', '33CCCC', '3366FF', '800080', '999999', 'FF00FF', 'FFCC00', 'FFFF00', '00FF00', '00FFFF', '00CCFF', '993366', 'C0C0C0', 'FF99CC', 'FFCC99', 'FFFF99', 'CCFFCC', 'CCFFFF', 'C9C8FF', 'CC99FF', 'FFFFFF' ], - paletteHeight: 94, cls: 'move-focus', takeFocusOnClose: true }); diff --git a/apps/documenteditor/main/app/view/DocumentHolder.js b/apps/documenteditor/main/app/view/DocumentHolder.js index d66adfac4..41e2eba48 100644 --- a/apps/documenteditor/main/app/view/DocumentHolder.js +++ b/apps/documenteditor/main/app/view/DocumentHolder.js @@ -71,1582 +71,11 @@ define([ }, initialize: function () { - var me = this; - - /** coauthoring begin **/ - var usersStore = DE.getCollection('Common.Collections.Users'); - /** coauthoring end **/ - - me._TtHeight = 20; - me._currentSpellObj = undefined; - me._currLang = {}; - me.usertips = []; - me.fastcoauthtips = []; - me._currentMathObj = undefined; - me._currentParaObjDisabled = false; - me._isDisabled = false; - me._state = {}; - var showPopupMenu = function(menu, value, event, docElement, eOpts){ - if (!_.isUndefined(menu) && menu !== null){ - Common.UI.Menu.Manager.hideAll(); - - var showPoint = [event.get_X(), event.get_Y()], - menuContainer = $(me.el).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)); - $(me.el).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); - - me.currentMenu = menu; - } - }; - - var fillMenuProps = function(selectedElements) { - if (!selectedElements || !_.isArray(selectedElements)) return; - var menu_props = {}, - menu_to_show = me.textMenu, - noobject = true; - for (var i = 0; i 0) { - me.api.zoomIn(); - } - - event.preventDefault(); - event.stopPropagation(); - } - } - }; - - var handleDocumentKeyDown = function(event){ - if (me.api){ - var key = event.keyCode; - if ((event.ctrlKey || event.metaKey) && !event.shiftKey && !event.altKey){ - if (key === Common.UI.Keys.NUM_PLUS || key === Common.UI.Keys.EQUALITY || (Common.Utils.isGecko && key === Common.UI.Keys.EQUALITY_FF) || (Common.Utils.isOpera && key == 43)){ - me.api.zoomIn(); - event.preventDefault(); - event.stopPropagation(); - return false; - } - else if (key === Common.UI.Keys.NUM_MINUS || key === Common.UI.Keys.MINUS || (Common.Utils.isGecko && key === Common.UI.Keys.MINUS_FF) || (Common.Utils.isOpera && key == 45)){ - me.api.zoomOut(); - event.preventDefault(); - event.stopPropagation(); - return false; - } else if (key === 48 || key === 96) {// 0 - me.api.zoom(100); - event.preventDefault(); - event.stopPropagation(); - return false; - } - } - if (me.currentMenu && me.currentMenu.isVisible()) { - if (key == Common.UI.Keys.UP || - key == Common.UI.Keys.DOWN) { - $('ul.dropdown-menu', me.currentMenu.el).focus(); - } - } - - if (key == Common.UI.Keys.ESC) { - Common.UI.Menu.Manager.hideAll(); - if (!Common.UI.HintManager.isHintVisible()) - Common.NotificationCenter.trigger('leftmenu:change', 'hide'); - } - } - }; - - var onDocumentHolderResize = function(e){ - me._XY = [ - me.cmpEl.offset().left - $(window).scrollLeft(), - me.cmpEl.offset().top - $(window).scrollTop() - ]; - me._Height = me.cmpEl.height(); - me._BodyWidth = $('body').width(); - }; - - var onAfterRender = function(ct){ - var meEl = me.cmpEl; - if (meEl) { - meEl.on('contextmenu', function(e) { - e.preventDefault(); - e.stopPropagation(); - return false; - }); - meEl.on('click', function(e){ - if (e.target.localName == 'canvas') { - if (me._preventClick) - me._preventClick = false; - else - meEl.focus(); - } - }); - meEl.on('mousedown', function(e){ - if (e.target.localName == 'canvas') - Common.UI.Menu.Manager.hideAll(); - }); - - //NOTE: set mouse wheel handler - - var addEvent = function( elem, type, fn ) { - elem.addEventListener ? elem.addEventListener( type, fn, false ) : elem.attachEvent( "on" + type, fn ); - }; - - var eventname=(/Firefox/i.test(navigator.userAgent))? 'DOMMouseScroll' : 'mousewheel'; - addEvent(me.el, eventname, handleDocumentWheel); - } - - !Common.Utils.isChrome ? $(document).on('mousewheel', handleDocumentWheel) : - document.addEventListener('mousewheel', handleDocumentWheel, {passive: false}); - $(document).on('keydown', handleDocumentKeyDown); - - $(window).on('resize', onDocumentHolderResize); - var viewport = DE.getController('Viewport').getView('Viewport'); - viewport.hlayout.on('layout:resizedrag', onDocumentHolderResize); - }; - - /** coauthoring begin **/ - var getUserName = function(id){ - if (usersStore){ - var rec = usersStore.findUser(id); - if (rec) - return AscCommon.UserInfoParser.getParsedName(rec.get('username')); - } - return me.guestText; - }; - var isUserVisible = function(id){ - if (usersStore){ - var rec = usersStore.findUser(id); - if (rec) - return !rec.get('hidden'); - } - return true; - }; - /** coauthoring end **/ - - - var screenTip = { - toolTip: new Common.UI.Tooltip({ - owner: this, - html: true, - title: '
    Press Ctrl and click link', - cls: 'link-tooltip' -// style: 'word-wrap: break-word;' - }), - strTip: '', - isHidden: true, - isVisible: false - }; - - /** coauthoring begin **/ - var userTooltip = true; - - var userTipMousover = function (evt, el, opt) { - if (userTooltip===true) { - userTooltip = new Common.UI.Tooltip({ - owner: evt.currentTarget, - title: me.tipIsLocked - }); - - userTooltip.show(); - } - }; - - var userTipHide = function () { - if (typeof userTooltip == 'object') { - userTooltip.hide(); - userTooltip = undefined; - - for (var i=0; i0) - window.open(url); - else - Common.UI.warning({ - msg: me.txtWarnUrl, - buttons: ['yes', 'no'], - primary: 'yes', - callback: function(btn) { - (btn == 'yes') && window.open(url); - } - }); - } - }; - - var onMouseMoveStart = function() { - screenTip.isHidden = true; - /** coauthoring begin **/ - if (me.usertips.length>0) { - if (typeof userTooltip == 'object') { - userTooltip.hide(); - userTooltip = true; - } - _.each(me.usertips, function(item) { - item.remove(); - }); - } - me.usertips = []; - me.usertipcount = 0; - /** coauthoring end **/ - }; - - var mouseMoveData = null, - isTooltipHiding = false; - - var onMouseMoveEnd = function() { - if (screenTip.isHidden && screenTip.isVisible) { - screenTip.isVisible = false; - isTooltipHiding = true; - screenTip.toolTip.hide(function(){ - isTooltipHiding = false; - if (mouseMoveData) onMouseMove(mouseMoveData); - mouseMoveData = null; - }); - } - }; - - var onMouseMove = function(moveData) { - if (me._XY === undefined) { - me._XY = [ - me.cmpEl.offset().left - $(window).scrollLeft(), - me.cmpEl.offset().top - $(window).scrollTop() - ]; - me._Height = me.cmpEl.height(); - me._BodyWidth = $('body').width(); - } - - if (moveData) { - var showPoint, ToolTip, - type = moveData.get_Type(); - - if (type==Asc.c_oAscMouseMoveDataTypes.Hyperlink || type==Asc.c_oAscMouseMoveDataTypes.Footnote || type==Asc.c_oAscMouseMoveDataTypes.Form || - type==Asc.c_oAscMouseMoveDataTypes.Review && me.mode.reviewHoverMode) { - if (isTooltipHiding) { - mouseMoveData = moveData; - return; - } - - if (type==Asc.c_oAscMouseMoveDataTypes.Hyperlink) { - var hyperProps = moveData.get_Hyperlink(); - if (!hyperProps) return; - ToolTip = (_.isEmpty(hyperProps.get_ToolTip())) ? hyperProps.get_Value() : hyperProps.get_ToolTip(); - if (ToolTip.length>256) - ToolTip = ToolTip.substr(0, 256) + '...'; - } else if (type == Asc.c_oAscMouseMoveDataTypes.Footnote) { - ToolTip = moveData.get_FootnoteText(); - if (ToolTip.length>1000) - ToolTip = ToolTip.substr(0, 1000) + '...'; - } else if (type==Asc.c_oAscMouseMoveDataTypes.Form) { - ToolTip = moveData.get_FormHelpText(); - if (ToolTip.length>1000) - ToolTip = ToolTip.substr(0, 1000) + '...'; - } else if (type==Asc.c_oAscMouseMoveDataTypes.Review && moveData.get_ReviewChange()) { - var changes = DE.getController("Common.Controllers.ReviewChanges").readSDKChange([moveData.get_ReviewChange()]); - if (changes && changes.length>0) - changes = changes[0]; - if (changes) { - ToolTip = ''+ Common.Utils.String.htmlEncode(AscCommon.UserInfoParser.getParsedName(changes.get('username'))) +' '; - ToolTip += ''+ changes.get('date') +'
    '; - ToolTip += changes.get('changetext'); - if (ToolTip.length>1000) - ToolTip = ToolTip.substr(0, 1000) + '...'; - } - } - - var recalc = false; - screenTip.isHidden = false; - - if (type!==Asc.c_oAscMouseMoveDataTypes.Review) - ToolTip = Common.Utils.String.htmlEncode(ToolTip); - - if (screenTip.tipType !== type || screenTip.tipLength !== ToolTip.length || screenTip.strTip.indexOf(ToolTip)<0 ) { - screenTip.toolTip.setTitle((type==Asc.c_oAscMouseMoveDataTypes.Hyperlink) ? (ToolTip + '
    ' + me.txtPressLink + '') : ToolTip); - screenTip.tipLength = ToolTip.length; - screenTip.strTip = ToolTip; - screenTip.tipType = type; - recalc = true; - } - - showPoint = [moveData.get_X(), moveData.get_Y()]; - showPoint[1] += (me._XY[1]-15); - showPoint[0] += (me._XY[0]+5); - - if (!screenTip.isVisible || recalc) { - screenTip.isVisible = true; - screenTip.toolTip.show([-10000, -10000]); - } - - if ( recalc ) { - screenTip.tipHeight = screenTip.toolTip.getBSTip().$tip.height(); - screenTip.tipWidth = screenTip.toolTip.getBSTip().$tip.width(); - } - - recalc = false; - if (showPoint[0] + screenTip.tipWidth > me._BodyWidth ) { - showPoint[0] = me._BodyWidth - screenTip.tipWidth; - recalc = true; - } - if (showPoint[1] - screenTip.tipHeight < 0) { - showPoint[1] = (recalc) ? showPoint[1]+30 : 0; - } else - showPoint[1] -= screenTip.tipHeight; - - screenTip.toolTip.getBSTip().$tip.css({top: showPoint[1] + 'px', left: showPoint[0] + 'px'}); - } - /** coauthoring begin **/ - else if (moveData.get_Type()==Asc.c_oAscMouseMoveDataTypes.LockedObject && me.mode.isEdit && isUserVisible(moveData.get_UserId())) { // 2 - locked object - var src; - if (me.usertipcount >= me.usertips.length) { - src = $(document.createElement("div")); - src.addClass('username-tip'); - src.css({height: me._TtHeight + 'px', position: 'absolute', zIndex: '900', visibility: 'visible'}); - $(document.body).append(src); - if (userTooltip) { - src.on('mouseover', userTipMousover); - src.on('mouseout', userTipMousout); - } - - me.usertips.push(src); - } - src = me.usertips[me.usertipcount]; - me.usertipcount++; - - ToolTip = getUserName(moveData.get_UserId()); - - showPoint = [moveData.get_X()+me._XY[0], moveData.get_Y()+me._XY[1]]; - var maxwidth = showPoint[0]; - showPoint[0] = me._BodyWidth - showPoint[0]; - showPoint[1] -= ((moveData.get_LockedObjectType()==2) ? me._TtHeight : 0); - - if (showPoint[1] > me._XY[1] && showPoint[1]+me._TtHeight < me._XY[1]+me._Height) { - src.text(ToolTip); - src.css({visibility: 'visible', top: showPoint[1] + 'px', right: showPoint[0] + 'px', 'max-width': maxwidth + 'px'}); - } else { - src.css({visibility: 'hidden'}); - } - } - /** coauthoring end **/ - } - }; - - var onShowForeignCursorLabel = function(UserId, X, Y, color) { - if (!isUserVisible(UserId)) return; - - /** coauthoring begin **/ - var src; - for (var i=0; i
    '); - me.cmpEl.find('#id_main_view').append(pasteContainer); - - me.btnSpecialPaste = new Common.UI.Button({ - parentEl: $('#id-document-holder-btn-special-paste'), - cls : 'btn-toolbar', - iconCls : 'toolbar__icon btn-paste', - menu : new Common.UI.Menu({items: []}) - }); - } - - if (pasteItems.length>0) { - var menu = me.btnSpecialPaste.menu; - for (var i = 0; i < menu.items.length; i++) { - menu.removeItem(menu.items[i]); - i--; - } - - var group_prev = -1; - _.each(pasteItems, function(menuItem, index) { - var mnu = new Common.UI.MenuItem({ - caption: me._arrSpecialPaste[menuItem], - value: menuItem, - checkable: true, - toggleGroup : 'specialPasteGroup' - }).on('click', function(item, e) { - me.api.asc_SpecialPaste(item.value); - setTimeout(function(){menu.hide();}, 100); - }); - menu.addItem(mnu); - }); - (menu.items.length>0) && menu.items[0].setChecked(true, true); - } - if (coord.asc_getX()<0 || coord.asc_getY()<0) { - if (pasteContainer.is(':visible')) pasteContainer.hide(); - } else { - var showPoint = [coord.asc_getX() + coord.asc_getWidth() + 3, coord.asc_getY() + coord.asc_getHeight() + 3]; - if (!Common.Utils.InternalSettings.get("de-hidden-rulers")) { - showPoint = [showPoint[0] - 19, showPoint[1] - 26]; - } - pasteContainer.css({left: showPoint[0], top : showPoint[1]}); - pasteContainer.show(); - } - }; - - var onHideSpecialPasteOptions = function() { - var pasteContainer = me.cmpEl.find('#special-paste-container'); - if (pasteContainer.is(':visible')) - pasteContainer.hide(); - }; - - var onDialogAddHyperlink = function() { - var win, props, text; - if (me.api && me.mode.isEdit && !me._isDisabled && !DE.getController('LeftMenu').leftMenu.menuFile.isVisible()){ - var handlerDlg = function(dlg, result) { - if (result == 'ok') { - props = dlg.getSettings(); - (text!==false) - ? me.api.add_Hyperlink(props) - : me.api.change_Hyperlink(props); - } - - me.fireEvent('editcomplete', me); - }; - - text = me.api.can_AddHyperlink(); - - if (text !== false) { - win = new DE.Views.HyperlinkSettingsDialog({ - api: me.api, - handler: handlerDlg - }); - - props = new Asc.CHyperlinkProperty(); - props.put_Text(text); - - win.show(); - win.setSettings(props); - } else { - var selectedElements = me.api.getSelectedElements(); - if (selectedElements && _.isArray(selectedElements)){ - _.each(selectedElements, function(el, i) { - if (selectedElements[i].get_ObjectType() == Asc.c_oAscTypeSelectElement.Hyperlink) - props = selectedElements[i].get_ObjectValue(); - }); - } - if (props) { - win = new DE.Views.HyperlinkSettingsDialog({ - api: me.api, - handler: handlerDlg - }); - win.show(); - win.setSettings(props); - } - } - Common.component.Analytics.trackEvent('DocumentHolder', 'Add Hyperlink'); - } - }; - - var onDoubleClickOnChart = function(chart) { - if (me.mode.isEdit && !me._isDisabled) { - var diagramEditor = DE.getController('Common.Controllers.ExternalDiagramEditor').getView('Common.Views.ExternalDiagramEditor'); - if (diagramEditor && chart) { - diagramEditor.setEditMode(true); - diagramEditor.show(); - diagramEditor.setChartData(new Asc.asc_CChartBinary(chart)); - } - } - }; - - var onDoubleClickOnTableOleObject = function(chart) { - if (me.mode.isEdit && !me._isDisabled) { - var oleEditor = DE.getController('Common.Controllers.ExternalOleEditor').getView('Common.Views.ExternalOleEditor'); - if (oleEditor && chart) { - oleEditor.setEditMode(true); - oleEditor.show(); - oleEditor.setOleData(Asc.asc_putBinaryDataToFrameFromTableOleObject(chart)); - } - } - }; - - var onCoAuthoringDisconnect= function() { - me.mode.isEdit = false; - }; - - var onTextLanguage = function(langid) { - me._currLang.id = langid; - }; - - this.changeLanguageMenu = function(menu) { - if (me._currLang.id===null || me._currLang.id===undefined) { - menu.clearAll(); - } else { - var index = _.findIndex(menu.items, {langid: me._currLang.id}); - (index>-1) && !menu.items[index].checked && menu.setChecked(index, true); - } - }; - - var onSpellCheckVariantsFound = function() { - var selectedElements = me.api.getSelectedElements(true); - var props; - if (selectedElements && _.isArray(selectedElements)){ - for (var i = 0; i 0) { - moreMenu.setVisible(variants.length > 3); - moreMenu.setDisabled(me._currentParaObjDisabled); - - _.each(variants, function(variant, index) { - var mnu = new Common.UI.MenuItem({ - caption : variant, - spellword : true, - disabled : me._currentParaObjDisabled - }).on('click', function(item, e) { - if (me.api) { - me.api.asc_replaceMisspelledWord(item.caption, me._currentSpellObj); - me.fireEvent('editcomplete', me); - } - }); - - (index < 3) ? arr.push(mnu) : arrMore.push(mnu); - }); - - if (arr.length > 0) { - if (isParagraph) { - _.each(arr, function(variant, index){ - me.textMenu.insertItem(index, variant); - }) - } else { - _.each(arr, function(variant, index){ - me.menuSpellCheckTable.menu.insertItem(index, variant); - }) - } - } - - if (arrMore.length > 0) { - _.each(arrMore, function(variant, index){ - moreMenu.menu.addItem(variant); - }); - } - - spellMenu.setVisible(false); - } else { - moreMenu.setVisible(false); - spellMenu.setVisible(true); - spellMenu.setCaption(me.noSpellVariantsText, true); - } - }; - - this.clearWordVariants = function(isParagraph) { - var spellMenu = (isParagraph) ? me.textMenu : me.menuSpellCheckTable.menu; - - for (var i = 0; i < spellMenu.items.length; i++) { - if (spellMenu.items[i].options.spellword) { - if (spellMenu.checkeditem == spellMenu.items[i]) { - spellMenu.checkeditem = undefined; - spellMenu.activeItem = undefined; - } - - spellMenu.removeItem(spellMenu.items[i]); - i--; - } - } - (isParagraph) ? me.menuSpellMorePara.menu.removeAll() : me.menuSpellMoreTable.menu.removeAll(); - - me.menuSpellMorePara.menu.checkeditem = undefined; - me.menuSpellMorePara.menu.activeItem = undefined; - me.menuSpellMoreTable.menu.checkeditem = undefined; - me.menuSpellMoreTable.menu.activeItem = undefined; - }; - - this.initEquationMenu = function() { - if (!me._currentMathObj) return; - var type = me._currentMathObj.get_Type(), - value = me._currentMathObj, - mnu, arr = []; - - switch (type) { - case Asc.c_oAscMathInterfaceType.Accent: - mnu = new Common.UI.MenuItem({ - caption : me.txtRemoveAccentChar, - equation : true, - disabled : me._currentParaObjDisabled, - equationProps: {type: type, callback: 'remove_AccentCharacter'} - }); - arr.push(mnu); - break; - case Asc.c_oAscMathInterfaceType.BorderBox: - mnu = new Common.UI.MenuItem({ - caption : me.txtBorderProps, - equation : true, - disabled : me._currentParaObjDisabled, - menu : new Common.UI.Menu({ - cls: 'shifted-right', - menuAlign: 'tl-tr', - items : [ - { - caption: value.get_HideTop() ? me.txtAddTop : me.txtHideTop, - equationProps: {type: type, callback: 'put_HideTop', value: !value.get_HideTop()} - }, - { - caption: value.get_HideBottom() ? me.txtAddBottom : me.txtHideBottom, - equationProps: {type: type, callback: 'put_HideBottom', value: !value.get_HideBottom()} - }, - { - caption: value.get_HideLeft() ? me.txtAddLeft : me.txtHideLeft, - equationProps: {type: type, callback: 'put_HideLeft', value: !value.get_HideLeft()} - }, - { - caption: value.get_HideRight() ? me.txtAddRight : me.txtHideRight, - equationProps: {type: type, callback: 'put_HideRight', value: !value.get_HideRight()} - }, - { - caption: value.get_HideHor() ? me.txtAddHor : me.txtHideHor, - equationProps: {type: type, callback: 'put_HideHor', value: !value.get_HideHor()} - }, - { - caption: value.get_HideVer() ? me.txtAddVer : me.txtHideVer, - equationProps: {type: type, callback: 'put_HideVer', value: !value.get_HideVer()} - }, - { - caption: value.get_HideTopLTR() ? me.txtAddLT : me.txtHideLT, - equationProps: {type: type, callback: 'put_HideTopLTR', value: !value.get_HideTopLTR()} - }, - { - caption: value.get_HideTopRTL() ? me.txtAddLB : me.txtHideLB, - equationProps: {type: type, callback: 'put_HideTopRTL', value: !value.get_HideTopRTL()} - } - ] - }) - }); - arr.push(mnu); - break; - case Asc.c_oAscMathInterfaceType.Bar: - mnu = new Common.UI.MenuItem({ - caption : me.txtRemoveBar, - equation : true, - disabled : me._currentParaObjDisabled, - equationProps: {type: type, callback: 'remove_Bar'} - }); - arr.push(mnu); - mnu = new Common.UI.MenuItem({ - caption : (value.get_Pos()==Asc.c_oAscMathInterfaceBarPos.Top) ? me.txtUnderbar : me.txtOverbar, - equation : true, - disabled : me._currentParaObjDisabled, - equationProps: {type: type, callback: 'put_Pos', value: (value.get_Pos()==Asc.c_oAscMathInterfaceBarPos.Top) ? Asc.c_oAscMathInterfaceBarPos.Bottom : Asc.c_oAscMathInterfaceBarPos.Top} - }); - arr.push(mnu); - break; - case Asc.c_oAscMathInterfaceType.Script: - var scripttype = value.get_ScriptType(); - if (scripttype == Asc.c_oAscMathInterfaceScript.PreSubSup) { - mnu = new Common.UI.MenuItem({ - caption : me.txtScriptsAfter, - equation : true, - disabled : me._currentParaObjDisabled, - equationProps: {type: type, callback: 'put_ScriptType', value: Asc.c_oAscMathInterfaceScript.SubSup} - }); - arr.push(mnu); - mnu = new Common.UI.MenuItem({ - caption : me.txtRemScripts, - equation : true, - disabled : me._currentParaObjDisabled, - equationProps: {type: type, callback: 'put_ScriptType', value: Asc.c_oAscMathInterfaceScript.None} - }); - arr.push(mnu); - } else { - if (scripttype == Asc.c_oAscMathInterfaceScript.SubSup) { - mnu = new Common.UI.MenuItem({ - caption : me.txtScriptsBefore, - equation : true, - disabled : me._currentParaObjDisabled, - equationProps: {type: type, callback: 'put_ScriptType', value: Asc.c_oAscMathInterfaceScript.PreSubSup} - }); - arr.push(mnu); - } - if (scripttype == Asc.c_oAscMathInterfaceScript.SubSup || scripttype == Asc.c_oAscMathInterfaceScript.Sub ) { - mnu = new Common.UI.MenuItem({ - caption : me.txtRemSubscript, - equation : true, - disabled : me._currentParaObjDisabled, - equationProps: {type: type, callback: 'put_ScriptType', value: (scripttype == Asc.c_oAscMathInterfaceScript.SubSup) ? Asc.c_oAscMathInterfaceScript.Sup : Asc.c_oAscMathInterfaceScript.None } - }); - arr.push(mnu); - } - if (scripttype == Asc.c_oAscMathInterfaceScript.SubSup || scripttype == Asc.c_oAscMathInterfaceScript.Sup ) { - mnu = new Common.UI.MenuItem({ - caption : me.txtRemSuperscript, - equation : true, - disabled : me._currentParaObjDisabled, - equationProps: {type: type, callback: 'put_ScriptType', value: (scripttype == Asc.c_oAscMathInterfaceScript.SubSup) ? Asc.c_oAscMathInterfaceScript.Sub : Asc.c_oAscMathInterfaceScript.None } - }); - arr.push(mnu); - } - } - break; - case Asc.c_oAscMathInterfaceType.Fraction: - var fraction = value.get_FractionType(); - if (fraction==Asc.c_oAscMathInterfaceFraction.Skewed || fraction==Asc.c_oAscMathInterfaceFraction.Linear) { - mnu = new Common.UI.MenuItem({ - caption : me.txtFractionStacked, - equation : true, - disabled : me._currentParaObjDisabled, - equationProps: {type: type, callback: 'put_FractionType', value: Asc.c_oAscMathInterfaceFraction.Bar} - }); - arr.push(mnu); - } - if (fraction==Asc.c_oAscMathInterfaceFraction.Bar || fraction==Asc.c_oAscMathInterfaceFraction.Linear) { - mnu = new Common.UI.MenuItem({ - caption : me.txtFractionSkewed, - equation : true, - disabled : me._currentParaObjDisabled, - equationProps: {type: type, callback: 'put_FractionType', value: Asc.c_oAscMathInterfaceFraction.Skewed} - }); - arr.push(mnu); - } - if (fraction==Asc.c_oAscMathInterfaceFraction.Bar || fraction==Asc.c_oAscMathInterfaceFraction.Skewed) { - mnu = new Common.UI.MenuItem({ - caption : me.txtFractionLinear, - equation : true, - disabled : me._currentParaObjDisabled, - equationProps: {type: type, callback: 'put_FractionType', value: Asc.c_oAscMathInterfaceFraction.Linear} - }); - arr.push(mnu); - } - if (fraction==Asc.c_oAscMathInterfaceFraction.Bar || fraction==Asc.c_oAscMathInterfaceFraction.NoBar) { - mnu = new Common.UI.MenuItem({ - caption : (fraction==Asc.c_oAscMathInterfaceFraction.Bar) ? me.txtRemFractionBar : me.txtAddFractionBar, - equation : true, - disabled : me._currentParaObjDisabled, - equationProps: {type: type, callback: 'put_FractionType', value: (fraction==Asc.c_oAscMathInterfaceFraction.Bar) ? Asc.c_oAscMathInterfaceFraction.NoBar : Asc.c_oAscMathInterfaceFraction.Bar} - }); - arr.push(mnu); - } - break; - case Asc.c_oAscMathInterfaceType.Limit: - mnu = new Common.UI.MenuItem({ - caption : (value.get_Pos()==Asc.c_oAscMathInterfaceLimitPos.Top) ? me.txtLimitUnder : me.txtLimitOver, - equation : true, - disabled : me._currentParaObjDisabled, - equationProps: {type: type, callback: 'put_Pos', value: (value.get_Pos()==Asc.c_oAscMathInterfaceLimitPos.Top) ? Asc.c_oAscMathInterfaceLimitPos.Bottom : Asc.c_oAscMathInterfaceLimitPos.Top} - }); - arr.push(mnu); - mnu = new Common.UI.MenuItem({ - caption : me.txtRemLimit, - equation : true, - disabled : me._currentParaObjDisabled, - equationProps: {type: type, callback: 'put_Pos', value: Asc.c_oAscMathInterfaceLimitPos.None} - }); - arr.push(mnu); - break; - case Asc.c_oAscMathInterfaceType.Matrix: - mnu = new Common.UI.MenuItem({ - caption : value.get_HidePlaceholder() ? me.txtShowPlaceholder : me.txtHidePlaceholder, - equation : true, - disabled : me._currentParaObjDisabled, - equationProps: {type: type, callback: 'put_HidePlaceholder', value: !value.get_HidePlaceholder()} - }); - arr.push(mnu); - mnu = new Common.UI.MenuItem({ - caption : me.insertText, - equation : true, - disabled : me._currentParaObjDisabled, - menu : new Common.UI.Menu({ - cls: 'shifted-right', - menuAlign: 'tl-tr', - items : [ - { - caption: me.insertRowAboveText, - equationProps: {type: type, callback: 'insert_MatrixRow', value: true} - }, - { - caption: me.insertRowBelowText, - equationProps: {type: type, callback: 'insert_MatrixRow', value: false} - }, - { - caption: me.insertColumnLeftText, - equationProps: {type: type, callback: 'insert_MatrixColumn', value: true} - }, - { - caption: me.insertColumnRightText, - equationProps: {type: type, callback: 'insert_MatrixColumn', value: false} - } - ] - }) - }); - arr.push(mnu); - mnu = new Common.UI.MenuItem({ - caption : me.deleteText, - equation : true, - disabled : me._currentParaObjDisabled, - menu : new Common.UI.Menu({ - cls: 'shifted-right', - menuAlign: 'tl-tr', - items : [ - { - caption: me.deleteRowText, - equationProps: {type: type, callback: 'delete_MatrixRow'} - }, - { - caption: me.deleteColumnText, - equationProps: {type: type, callback: 'delete_MatrixColumn'} - } - ] - }) - }); - arr.push(mnu); - mnu = new Common.UI.MenuItem({ - caption : me.txtMatrixAlign, - equation : true, - disabled : me._currentParaObjDisabled, - menu : new Common.UI.Menu({ - cls: 'shifted-right', - menuAlign: 'tl-tr', - items : [ - { - caption: me.txtTop, - checkable : true, - checked : (value.get_MatrixAlign()==Asc.c_oAscMathInterfaceMatrixMatrixAlign.Top), - equationProps: {type: type, callback: 'put_MatrixAlign', value: Asc.c_oAscMathInterfaceMatrixMatrixAlign.Top} - }, - { - caption: me.centerText, - checkable : true, - checked : (value.get_MatrixAlign()==Asc.c_oAscMathInterfaceMatrixMatrixAlign.Center), - equationProps: {type: type, callback: 'put_MatrixAlign', value: Asc.c_oAscMathInterfaceMatrixMatrixAlign.Center} - }, - { - caption: me.txtBottom, - checkable : true, - checked : (value.get_MatrixAlign()==Asc.c_oAscMathInterfaceMatrixMatrixAlign.Bottom), - equationProps: {type: type, callback: 'put_MatrixAlign', value: Asc.c_oAscMathInterfaceMatrixMatrixAlign.Bottom} - } - ] - }) - }); - arr.push(mnu); - mnu = new Common.UI.MenuItem({ - caption : me.txtColumnAlign, - equation : true, - disabled : me._currentParaObjDisabled, - menu : new Common.UI.Menu({ - cls: 'shifted-right', - menuAlign: 'tl-tr', - items : [ - { - caption: me.leftText, - checkable : true, - checked : (value.get_ColumnAlign()==Asc.c_oAscMathInterfaceMatrixColumnAlign.Left), - equationProps: {type: type, callback: 'put_ColumnAlign', value: Asc.c_oAscMathInterfaceMatrixColumnAlign.Left} - }, - { - caption: me.centerText, - checkable : true, - checked : (value.get_ColumnAlign()==Asc.c_oAscMathInterfaceMatrixColumnAlign.Center), - equationProps: {type: type, callback: 'put_ColumnAlign', value: Asc.c_oAscMathInterfaceMatrixColumnAlign.Center} - }, - { - caption: me.rightText, - checkable : true, - checked : (value.get_ColumnAlign()==Asc.c_oAscMathInterfaceMatrixColumnAlign.Right), - equationProps: {type: type, callback: 'put_ColumnAlign', value: Asc.c_oAscMathInterfaceMatrixColumnAlign.Right} - } - ] - }) - }); - arr.push(mnu); - break; - case Asc.c_oAscMathInterfaceType.EqArray: - mnu = new Common.UI.MenuItem({ - caption : me.txtInsertEqBefore, - equation : true, - disabled : me._currentParaObjDisabled, - equationProps: {type: type, callback: 'insert_Equation', value: true} - }); - arr.push(mnu); - mnu = new Common.UI.MenuItem({ - caption : me.txtInsertEqAfter, - equation : true, - disabled : me._currentParaObjDisabled, - equationProps: {type: type, callback: 'insert_Equation', value: false} - }); - arr.push(mnu); - mnu = new Common.UI.MenuItem({ - caption : me.txtDeleteEq, - equation : true, - disabled : me._currentParaObjDisabled, - equationProps: {type: type, callback: 'delete_Equation'} - }); - arr.push(mnu); - mnu = new Common.UI.MenuItem({ - caption : me.alignmentText, - equation : true, - disabled : me._currentParaObjDisabled, - menu : new Common.UI.Menu({ - cls: 'shifted-right', - menuAlign: 'tl-tr', - items : [ - { - caption: me.txtTop, - checkable : true, - checked : (value.get_Align()==Asc.c_oAscMathInterfaceEqArrayAlign.Top), - equationProps: {type: type, callback: 'put_Align', value: Asc.c_oAscMathInterfaceEqArrayAlign.Top} - }, - { - caption: me.centerText, - checkable : true, - checked : (value.get_Align()==Asc.c_oAscMathInterfaceEqArrayAlign.Center), - equationProps: {type: type, callback: 'put_Align', value: Asc.c_oAscMathInterfaceEqArrayAlign.Center} - }, - { - caption: me.txtBottom, - checkable : true, - checked : (value.get_Align()==Asc.c_oAscMathInterfaceEqArrayAlign.Bottom), - equationProps: {type: type, callback: 'put_Align', value: Asc.c_oAscMathInterfaceEqArrayAlign.Bottom} - } - ] - }) - }); - arr.push(mnu); - break; - case Asc.c_oAscMathInterfaceType.LargeOperator: - mnu = new Common.UI.MenuItem({ - caption : me.txtLimitChange, - equation : true, - disabled : me._currentParaObjDisabled, - equationProps: {type: type, callback: 'put_LimitLocation', value: (value.get_LimitLocation() == Asc.c_oAscMathInterfaceNaryLimitLocation.UndOvr) ? Asc.c_oAscMathInterfaceNaryLimitLocation.SubSup : Asc.c_oAscMathInterfaceNaryLimitLocation.UndOvr} - }); - arr.push(mnu); - if (value.get_HideUpper() !== undefined) { - mnu = new Common.UI.MenuItem({ - caption : value.get_HideUpper() ? me.txtShowTopLimit : me.txtHideTopLimit, - equation : true, - disabled : me._currentParaObjDisabled, - equationProps: {type: type, callback: 'put_HideUpper', value: !value.get_HideUpper()} - }); - arr.push(mnu); - } - if (value.get_HideLower() !== undefined) { - mnu = new Common.UI.MenuItem({ - caption : value.get_HideLower() ? me.txtShowBottomLimit : me.txtHideBottomLimit, - equation : true, - disabled : me._currentParaObjDisabled, - equationProps: {type: type, callback: 'put_HideLower', value: !value.get_HideLower()} - }); - arr.push(mnu); - } - break; - case Asc.c_oAscMathInterfaceType.Delimiter: - mnu = new Common.UI.MenuItem({ - caption : me.txtInsertArgBefore, - equation : true, - disabled : me._currentParaObjDisabled, - equationProps: {type: type, callback: 'insert_DelimiterArgument', value: true} - }); - arr.push(mnu); - mnu = new Common.UI.MenuItem({ - caption : me.txtInsertArgAfter, - equation : true, - disabled : me._currentParaObjDisabled, - equationProps: {type: type, callback: 'insert_DelimiterArgument', value: false} - }); - arr.push(mnu); - if (value.can_DeleteArgument()) { - mnu = new Common.UI.MenuItem({ - caption : me.txtDeleteArg, - equation : true, - disabled : me._currentParaObjDisabled, - equationProps: {type: type, callback: 'delete_DelimiterArgument'} - }); - arr.push(mnu); - } - mnu = new Common.UI.MenuItem({ - caption : value.has_Separators() ? me.txtDeleteCharsAndSeparators : me.txtDeleteChars, - equation : true, - disabled : me._currentParaObjDisabled, - equationProps: {type: type, callback: 'remove_DelimiterCharacters'} - }); - arr.push(mnu); - mnu = new Common.UI.MenuItem({ - caption : value.get_HideOpeningBracket() ? me.txtShowOpenBracket : me.txtHideOpenBracket, - equation : true, - disabled : me._currentParaObjDisabled, - equationProps: {type: type, callback: 'put_HideOpeningBracket', value: !value.get_HideOpeningBracket()} - }); - arr.push(mnu); - mnu = new Common.UI.MenuItem({ - caption : value.get_HideClosingBracket() ? me.txtShowCloseBracket : me.txtHideCloseBracket, - equation : true, - disabled : me._currentParaObjDisabled, - equationProps: {type: type, callback: 'put_HideClosingBracket', value: !value.get_HideClosingBracket()} - }); - arr.push(mnu); - mnu = new Common.UI.MenuItem({ - caption : me.txtStretchBrackets, - equation : true, - disabled : me._currentParaObjDisabled, - checkable : true, - checked : value.get_StretchBrackets(), - equationProps: {type: type, callback: 'put_StretchBrackets', value: !value.get_StretchBrackets()} - }); - arr.push(mnu); - mnu = new Common.UI.MenuItem({ - caption : me.txtMatchBrackets, - equation : true, - disabled : (!value.get_StretchBrackets() || me._currentParaObjDisabled), - checkable : true, - checked : value.get_StretchBrackets() && value.get_MatchBrackets(), - equationProps: {type: type, callback: 'put_MatchBrackets', value: !value.get_MatchBrackets()} - }); - arr.push(mnu); - break; - case Asc.c_oAscMathInterfaceType.GroupChar: - if (value.can_ChangePos()) { - mnu = new Common.UI.MenuItem({ - caption : (value.get_Pos()==Asc.c_oAscMathInterfaceGroupCharPos.Top) ? me.txtGroupCharUnder : me.txtGroupCharOver, - equation : true, - disabled : me._currentParaObjDisabled, - equationProps: {type: type, callback: 'put_Pos', value: (value.get_Pos()==Asc.c_oAscMathInterfaceGroupCharPos.Top) ? Asc.c_oAscMathInterfaceGroupCharPos.Bottom : Asc.c_oAscMathInterfaceGroupCharPos.Top} - }); - arr.push(mnu); - mnu = new Common.UI.MenuItem({ - caption : me.txtDeleteGroupChar, - equation : true, - disabled : me._currentParaObjDisabled, - equationProps: {type: type, callback: 'put_Pos', value: Asc.c_oAscMathInterfaceGroupCharPos.None} - }); - arr.push(mnu); - } - break; - case Asc.c_oAscMathInterfaceType.Radical: - if (value.get_HideDegree() !== undefined) { - mnu = new Common.UI.MenuItem({ - caption : value.get_HideDegree() ? me.txtShowDegree : me.txtHideDegree, - equation : true, - disabled : me._currentParaObjDisabled, - equationProps: {type: type, callback: 'put_HideDegree', value: !value.get_HideDegree()} - }); - arr.push(mnu); - } - mnu = new Common.UI.MenuItem({ - caption : me.txtDeleteRadical, - equation : true, - disabled : me._currentParaObjDisabled, - equationProps: {type: type, callback: 'remove_Radical'} - }); - arr.push(mnu); - break; - } - if (value.can_IncreaseArgumentSize()) { - mnu = new Common.UI.MenuItem({ - caption : me.txtIncreaseArg, - equation : true, - disabled : me._currentParaObjDisabled, - equationProps: {type: type, callback: 'increase_ArgumentSize'} - }); - arr.push(mnu); - } - if (value.can_DecreaseArgumentSize()) { - mnu = new Common.UI.MenuItem({ - caption : me.txtDecreaseArg, - equation : true, - disabled : me._currentParaObjDisabled, - equationProps: {type: type, callback: 'decrease_ArgumentSize'} - }); - arr.push(mnu); - } - if (value.can_InsertManualBreak()) { - mnu = new Common.UI.MenuItem({ - caption : me.txtInsertBreak, - equation : true, - disabled : me._currentParaObjDisabled, - equationProps: {type: type, callback: 'insert_ManualBreak'} - }); - arr.push(mnu); - } - if (value.can_DeleteManualBreak()) { - mnu = new Common.UI.MenuItem({ - caption : me.txtDeleteBreak, - equation : true, - disabled : me._currentParaObjDisabled, - equationProps: {type: type, callback: 'delete_ManualBreak'} - }); - arr.push(mnu); - } - if (value.can_AlignToCharacter()) { - mnu = new Common.UI.MenuItem({ - caption : me.txtAlignToChar, - equation : true, - disabled : me._currentParaObjDisabled, - equationProps: {type: type, callback: 'align_ToCharacter'} - }); - arr.push(mnu); - } - return arr; - }; - - this.addEquationMenu = function(isParagraph, insertIdx) { - if (_.isUndefined(isParagraph)) { - isParagraph = me.textMenu.isVisible(); - } - - me.clearEquationMenu(isParagraph, insertIdx); - - var equationMenu = (isParagraph) ? me.textMenu : me.tableMenu, - menuItems = me.initEquationMenu(); - - if (menuItems.length > 0) { - _.each(menuItems, function(menuItem, index) { - if (menuItem.menu) { - _.each(menuItem.menu.items, function(item) { - item.on('click', _.bind(me.equationCallback, me, item.options.equationProps)); - }); - } else - menuItem.on('click', _.bind(me.equationCallback, me, menuItem.options.equationProps)); - equationMenu.insertItem(insertIdx, menuItem); - insertIdx++; - }); - } - return menuItems.length; - }; - - this.clearEquationMenu = function(isParagraph, insertIdx) { - var equationMenu = (isParagraph) ? me.textMenu : me.tableMenu; - for (var i = insertIdx; i < equationMenu.items.length; i++) { - if (equationMenu.items[i].options.equation) { - if (equationMenu.items[i].menu) { - _.each(equationMenu.items[i].menu.items, function(item) { - item.off('click'); - }); - } else - equationMenu.items[i].off('click'); - equationMenu.removeItem(equationMenu.items[i]); - i--; - } else - break; - } - }; - - this.equationCallback = function(eqProps) { - if (eqProps) { - var eqObj; - switch (eqProps.type) { - case Asc.c_oAscMathInterfaceType.Accent: - eqObj = new CMathMenuAccent(); - break; - case Asc.c_oAscMathInterfaceType.BorderBox: - eqObj = new CMathMenuBorderBox(); - break; - case Asc.c_oAscMathInterfaceType.Box: - eqObj = new CMathMenuBox(); - break; - case Asc.c_oAscMathInterfaceType.Bar: - eqObj = new CMathMenuBar(); - break; - case Asc.c_oAscMathInterfaceType.Script: - eqObj = new CMathMenuScript(); - break; - case Asc.c_oAscMathInterfaceType.Fraction: - eqObj = new CMathMenuFraction(); - break; - case Asc.c_oAscMathInterfaceType.Limit: - eqObj = new CMathMenuLimit(); - break; - case Asc.c_oAscMathInterfaceType.Matrix: - eqObj = new CMathMenuMatrix(); - break; - case Asc.c_oAscMathInterfaceType.EqArray: - eqObj = new CMathMenuEqArray(); - break; - case Asc.c_oAscMathInterfaceType.LargeOperator: - eqObj = new CMathMenuNary(); - break; - case Asc.c_oAscMathInterfaceType.Delimiter: - eqObj = new CMathMenuDelimiter(); - break; - case Asc.c_oAscMathInterfaceType.GroupChar: - eqObj = new CMathMenuGroupCharacter(); - break; - case Asc.c_oAscMathInterfaceType.Radical: - eqObj = new CMathMenuRadical(); - break; - case Asc.c_oAscMathInterfaceType.Common: - eqObj = new CMathMenuBase(); - break; - } - if (eqObj) { - eqObj[eqProps.callback](eqProps.value); - me.api.asc_SetMathProps(eqObj); - } - } - me.fireEvent('editcomplete', me); - }; - - this.changePosition = function() { - me._XY = [ - me.cmpEl.offset().left - $(window).scrollLeft(), - me.cmpEl.offset().top - $(window).scrollTop() - ]; - me._Height = me.cmpEl.height(); - me._BodyWidth = $('body').width(); - onMouseMoveStart(); - }; - - this.hideTips = function() { - /** coauthoring begin **/ - if (typeof userTooltip == 'object') { - userTooltip.hide(); - userTooltip = true; - } - _.each(me.usertips, function(item) { - item.remove(); - }); - me.usertips = []; - me.usertipcount = 0; - /** coauthoring end **/ - }; - - /** coauthoring begin **/ - var keymap = {}; - var hkComments = 'alt+h'; - keymap[hkComments] = function() { - if (me.api.can_AddQuotedComment()!==false) { - me.addComment(); - } - }; - Common.util.Shortcuts.delegateShortcuts({shortcuts:keymap}); - /** coauthoring end **/ - - this.setApi = function(o) { - this.api = o; - - if (this.api) { - this.api.asc_registerCallback('asc_onContextMenu', _.bind(onContextMenu, this)); - this.api.asc_registerCallback('asc_onMouseMoveStart', _.bind(onMouseMoveStart, this)); - this.api.asc_registerCallback('asc_onMouseMoveEnd', _.bind(onMouseMoveEnd, this)); - - //hyperlink - this.api.asc_registerCallback('asc_onHyperlinkClick', _.bind(onHyperlinkClick, this)); - this.api.asc_registerCallback('asc_onMouseMove', _.bind(onMouseMove, this)); - - if (this.mode.isEdit === true) { - this.api.asc_registerCallback('asc_onImgWrapStyleChanged', _.bind(this.onImgWrapStyleChanged, this)); - this.api.asc_registerCallback('asc_onDialogAddHyperlink', onDialogAddHyperlink); - this.api.asc_registerCallback('asc_doubleClickOnChart', onDoubleClickOnChart); - this.api.asc_registerCallback('asc_doubleClickOnTableOleObject', onDoubleClickOnTableOleObject); - this.api.asc_registerCallback('asc_onSpellCheckVariantsFound', _.bind(onSpellCheckVariantsFound, this)); - this.api.asc_registerCallback('asc_onRulerDblClick', _.bind(this.onRulerDblClick, this)); - this.api.asc_registerCallback('asc_ChangeCropState', _.bind(this.onChangeCropState, this)); - this.api.asc_registerCallback('asc_onLockDocumentProps', _.bind(this.onApiLockDocumentProps, this)); - this.api.asc_registerCallback('asc_onUnLockDocumentProps', _.bind(this.onApiUnLockDocumentProps, this)); - } - this.api.asc_registerCallback('asc_onCoAuthoringDisconnect', _.bind(onCoAuthoringDisconnect, this)); - Common.NotificationCenter.on('api:disconnect', _.bind(onCoAuthoringDisconnect, this)); - this.api.asc_registerCallback('asc_onTextLanguage', _.bind(onTextLanguage, this)); - this.api.asc_registerCallback('asc_onParaStyleName', _.bind(this.onApiParagraphStyleChange, this)); - - this.api.asc_registerCallback('asc_onShowForeignCursorLabel', _.bind(onShowForeignCursorLabel, this)); - this.api.asc_registerCallback('asc_onHideForeignCursorLabel', _.bind(onHideForeignCursorLabel, this)); - this.api.asc_registerCallback('asc_onFocusObject', _.bind(onFocusObject, this)); - this.api.asc_registerCallback('asc_onShowSpecialPasteOptions', _.bind(onShowSpecialPasteOptions, this)); - this.api.asc_registerCallback('asc_onHideSpecialPasteOptions', _.bind(onHideSpecialPasteOptions, this)); - if (this.mode.isEdit || this.mode.isRestrictedEdit && this.mode.canFillForms) { - this.api.asc_registerCallback('asc_onShowContentControlsActions',_.bind(this.onShowContentControlsActions, this)); - this.api.asc_registerCallback('asc_onHideContentControlsActions',_.bind(this.onHideContentControlsActions, this)); - } - } - - return this; - }; - - this.mode = {}; - this.setMode = function(m) { - this.mode = m; - /** coauthoring begin **/ - !(this.mode.canCoAuthoring && this.mode.canComments) - ? Common.util.Shortcuts.suspendEvents(hkComments) - : Common.util.Shortcuts.resumeEvents(hkComments); - /** coauthoring end **/ - this.editorConfig = {user: m.user}; - this._fillFormMode = !this.mode.isEdit && this.mode.canFillForms; - }; - - me.on('render:after', onAfterRender, me); + this._currentMathObj = undefined; + this._currentSpellObj = undefined; + this._currentParaObjDisabled = false; + this._currLang = {}; + this._isDisabled = false; }, render: function () { @@ -1658,432 +87,62 @@ define([ return this; }, - onImgWrapStyleChanged: function(type){ - switch (type) { - case Asc.c_oAscWrapStyle2.Inline: - this.menuImageWrap.menu.items[0].setChecked(true); - break; - case Asc.c_oAscWrapStyle2.Square: - this.menuImageWrap.menu.items[2].setChecked(true); - break; - case Asc.c_oAscWrapStyle2.Tight: - this.menuImageWrap.menu.items[3].setChecked(true); - break; - case Asc.c_oAscWrapStyle2.Through: - this.menuImageWrap.menu.items[4].setChecked(true); - break; - case Asc.c_oAscWrapStyle2.TopAndBottom: - this.menuImageWrap.menu.items[5].setChecked(true); - break; - case Asc.c_oAscWrapStyle2.Behind: - this.menuImageWrap.menu.items[8].setChecked(true); - break; - case Asc.c_oAscWrapStyle2.InFront: - this.menuImageWrap.menu.items[7].setChecked(true); - break; - } + setApi: function(o) { + this.api = o; + return this; }, - onChangeCropState: function(state) { - this.menuImgCrop.menu.items[0].setChecked(state, true); - }, - - onApiParagraphStyleChange: function(name) { - window.currentStyleName = name; - }, - - advancedParagraphClick: function(item, e, eOpt){ - var win, me = this; - if (me.api){ - var selectedElements = me.api.getSelectedElements(); - if (selectedElements && _.isArray(selectedElements)){ - for (var i = selectedElements.length - 1; i >= 0; i--) { - var elType, elValue; - elType = selectedElements[i].get_ObjectType(); - elValue = selectedElements[i].get_ObjectValue(); - - if (Asc.c_oAscTypeSelectElement.Paragraph == elType) { - win = new DE.Views.ParagraphSettingsAdvanced({ - tableStylerRows : 2, - tableStylerColumns : 1, - paragraphProps : elValue, - borderProps : me.borderAdvancedProps, - isChart : (item.isChart===true), - isSmartArtInternal : (item.isSmartArtInternal===true), - api : me.api, - handler: function(result, value) { - if (result == 'ok') { - if (me.api) { - me.borderAdvancedProps = value.borderProps; - me.api.paraApply(value.paragraphProps); - } - } - me.fireEvent('editcomplete', me); - } - }); - break; - } - } - } - } - - if (win) { - win.show(); - return win; - } - }, - - advancedFrameClick: function(isFrame, item, e, eOpt){ - Common.NotificationCenter.trigger('dropcap:settings', isFrame); - }, - - advancedTableClick: function(item, e, eOpt){ - var win, me = this; - if (me.api){ - var selectedElements = me.api.getSelectedElements(); - - if (selectedElements && _.isArray(selectedElements)){ - for (var i = selectedElements.length - 1; i >= 0; i--) { - var elType, elValue; - - elType = selectedElements[i].get_ObjectType(); - elValue = selectedElements[i].get_ObjectValue(); - - if (Asc.c_oAscTypeSelectElement.Table == elType) { - win = new DE.Views.TableSettingsAdvanced({ - tableStylerRows : (elValue.get_CellBorders().get_InsideH()===null && elValue.get_CellSelect()==true) ? 1 : 2, - tableStylerColumns : (elValue.get_CellBorders().get_InsideV()===null && elValue.get_CellSelect()==true) ? 1 : 2, - tableProps : elValue, - borderProps : me.borderAdvancedProps, - sectionProps : me.api.asc_GetSectionProps(), - handler : function(result, value) { - if (result == 'ok') { - if (me.api) { - me.borderAdvancedProps = value.borderProps; - me.api.tblApply(value.tableProps); - } - } - me.fireEvent('editcomplete', me); - } - }); - break; - } - } - } - } - - if (win) { - win.show(); - return win; - } - }, - - onRulerDblClick: function(type) { - Common.UI.Menu.Manager.hideAll(); - - var win, me = this; - if (type == 'tables') { - win = this.advancedTableClick(); - if (win) - win.setActiveCategory(4); - } else if (type == 'indents' || type == 'tabs') { - win = this.advancedParagraphClick({isChart: false}); - if (win) - win.setActiveCategory(type == 'indents' ? 0 : 4); - } else if (type == 'margins') { - if (me._state.lock_doc) return; - win = new DE.Views.PageMarginsDialog({ - api: me.api, - handler: function(dlg, result) { - if (result == 'ok') { - var props = dlg.getSettings(); - var mnu = DE.getController('Toolbar').toolbar.btnPageMargins.menu.items[0]; - mnu.setVisible(true); - mnu.setChecked(true); - mnu.options.value = mnu.value = [props.get_TopMargin(), props.get_LeftMargin(), props.get_BottomMargin(), props.get_RightMargin()]; - $(mnu.el).html(mnu.template({id: Common.UI.getId(), caption : mnu.caption, options : mnu.options})); - Common.localStorage.setItem("de-pgmargins-top", props.get_TopMargin()); - Common.localStorage.setItem("de-pgmargins-left", props.get_LeftMargin()); - Common.localStorage.setItem("de-pgmargins-bottom", props.get_BottomMargin()); - Common.localStorage.setItem("de-pgmargins-right", props.get_RightMargin()); - - me.api.asc_SetSectionProps(props); - me.fireEvent('editcomplete', me); - } - } - }); - win.show(); - win.setSettings(me.api.asc_GetSectionProps()); - } else if (type == 'columns') { - win = new DE.Views.CustomColumnsDialog({ - handler: function(dlg, result) { - if (result == 'ok') { - me.api.asc_SetColumnsProps(dlg.getSettings()); - me.fireEvent('editcomplete', me); - } - } - }); - win.show(); - win.setSettings(me.api.asc_GetColumnsProps()); - } - }, - - editHyperlink: function(item, e, eOpt){ - var win, me = this; - if (me.api){ - win = new DE.Views.HyperlinkSettingsDialog({ - api: me.api, - handler: function(dlg, result) { - if (result == 'ok') { - me.api.change_Hyperlink(win.getSettings()); - } - me.fireEvent('editcomplete', me); - } - }); - win.show(); - win.setSettings(item.hyperProps.value); - } - }, - - onMenuSaveStyle:function(item, e, eOpt){ - var me = this; - if (me.api) { - Common.NotificationCenter.trigger('style:commitsave', me.api.asc_GetStyleFromFormatting()); - } - }, - - onMenuUpdateStyle:function(item, e, eOpt){ - var me = this; - if (me.api) { - Common.NotificationCenter.trigger('style:commitchange', me.api.asc_GetStyleFromFormatting()); - } - }, - - /** coauthoring begin **/ - addComment: function(item, e, eOpt){ - if (this.api && this.mode.canCoAuthoring && this.mode.canComments) { - this.suppressEditComplete = true; - - var controller = DE.getController('Common.Controllers.Comments'); - if (controller) { - controller.addDummyComment(); - } - } - }, - /** coauthoring end **/ - - addHyperlink: function(item, e, eOpt){ - var win, me = this; - if (me.api){ - win = new DE.Views.HyperlinkSettingsDialog({ - api: me.api, - handler: function(dlg, result) { - if (result == 'ok') { - me.api.add_Hyperlink(dlg.getSettings()); - } - me.fireEvent('editcomplete', me); - } - }); - - win.show(); - win.setSettings(item.hyperProps.value); - - Common.component.Analytics.trackEvent('DocumentHolder', 'Add Hyperlink'); - } - }, - - editChartClick: function(){ - var diagramEditor = DE.getController('Common.Controllers.ExternalDiagramEditor').getView('Common.Views.ExternalDiagramEditor'); - if (diagramEditor) { - diagramEditor.setEditMode(true); - diagramEditor.show(); - - var chart = this.api.asc_getChartObject(); - if (chart) { - diagramEditor.setChartData(new Asc.asc_CChartBinary(chart)); - } - } - }, - - onCutCopyPaste: function(item, e) { - var me = this; - if (me.api) { - var res = (item.value == 'cut') ? me.api.Cut() : ((item.value == 'copy') ? me.api.Copy() : me.api.Paste()); - if (!res) { - if (!Common.localStorage.getBool("de-hide-copywarning")) { - (new Common.Views.CopyWarningDialog({ - handler: function(dontshow) { - if (dontshow) Common.localStorage.setItem("de-hide-copywarning", 1); - me.fireEvent('editcomplete', me); - } - })).show(); - } - } - } - me.fireEvent('editcomplete', me); - }, - - onAcceptRejectChange: function(item, e) { - if (this.api) { - if (item.value == 'accept') - this.api.asc_AcceptChanges(); - else if (item.value == 'reject') - this.api.asc_RejectChanges(); - } - this.fireEvent('editcomplete', this); - }, - - onPrintSelection: function(item){ - if (this.api){ - var printopt = new Asc.asc_CAdjustPrint(); - printopt.asc_setPrintType(Asc.c_oAscPrintType.Selection); - var opts = new Asc.asc_CDownloadOptions(null, Common.Utils.isChrome || Common.Utils.isOpera || Common.Utils.isGecko && Common.Utils.firefoxVersion>86); // if isChrome or isOpera == true use asc_onPrintUrl event - opts.asc_setAdvancedOptions(printopt); - this.api.asc_Print(opts); - this.fireEvent('editcomplete', this); - Common.component.Analytics.trackEvent('DocumentHolder', 'Print Selection'); - } - }, - - onControlsSelect: function(item, e) { - var me = this; - var props = this.api.asc_GetContentControlProperties(); - if (props) { - if (item.value == 'settings') { - (new DE.Views.ControlSettingsDialog({ - props: props, - api: me.api, - handler: function (result, value) { - if (result == 'ok') { - me.api.asc_SetContentControlProperties(value, props.get_InternalId()); - } - - me.fireEvent('editcomplete', me); - } - })).show(); - } else if (item.value == 'remove') { - props.get_FormPr() ? this.api.asc_RemoveContentControl(props.get_InternalId()) : this.api.asc_RemoveContentControlWrapper(props.get_InternalId()); - } - } - me.fireEvent('editcomplete', me); - }, - - onInsertCaption: function() { - this.fireEvent('links:caption'); - }, - - onContinueNumbering: function(item, e) { - this.api.asc_ContinueNumbering(); - this.fireEvent('editcomplete', this); - }, - - onStartNumbering: function(startfrom, item, e) { - if (startfrom == 1) - this.api.asc_RestartNumbering(item.value.start); - else { - var me = this; - (new DE.Views.NumberingValueDialog({ - title: me.textNumberingValue, - props: item.value, - handler: function (result, value) { - if (result == 'ok') - me.api.asc_RestartNumbering(value); - me.fireEvent('editcomplete', me); - } - })).show(); - } - this.fireEvent('editcomplete', this); - }, - - onCellsRemove: function() { - var me = this; - (new Common.Views.OptionsDialog({ - title: me.textTitleCellsRemove, - items: [ - {caption: this.textLeft, value: 'left'}, - {caption: this.textRow, value: 'row'}, - {caption: this.textCol, value: 'col'} - ], - handler: function (dlg, result) { - if (result=='ok') { - var value = dlg.getSettings(); - if (value == 'row') - me.api.remRow(); - else if (value == 'col') - me.api.remColumn(); - else - me.api.asc_RemoveTableCells(); - } - me.fireEvent('editcomplete', me); - } - })).show(); - this.fireEvent('editcomplete', this); - }, - - onCellsAdd: function() { - var me = this; - (new DE.Views.CellsAddDialog({ - handler: function (result, settings) { - if (result == 'ok') { - if (settings.row) { - settings.before ? me.api.addRowAbove(settings.count) : me.api.addRowBelow(settings.count); - } else { - settings.before ? me.api.addColumnLeft(settings.count) : me.api.addColumnRight(settings.count); - } - } - me.fireEvent('editcomplete', me); - } - })).show(); - this.fireEvent('editcomplete', this); + setMode: function(m) { + this.mode = m; + this._fillFormMode = !this.mode.isEdit && this.mode.canFillForms; + return this; }, createDelayedElementsViewer: function() { var me = this; - var menuViewCopy = new Common.UI.MenuItem({ + me.menuViewCopy = new Common.UI.MenuItem({ iconCls: 'menu__icon btn-copy', caption: me.textCopy, value: 'copy' - }).on('click', _.bind(me.onCutCopyPaste, me)); + }); - var menuViewPaste = new Common.UI.MenuItem({ + me.menuViewPaste = new Common.UI.MenuItem({ iconCls: 'menu__icon btn-paste', caption : me.textPaste, value : 'paste' - }).on('click', _.bind(me.onCutCopyPaste, me)); + }); - var menuViewCut = new Common.UI.MenuItem({ + me.menuViewCut = new Common.UI.MenuItem({ iconCls: 'menu__icon btn-cut', caption : me.textCut, value : 'cut' - }).on('click', _.bind(me.onCutCopyPaste, me)); - - var menuViewUndo = new Common.UI.MenuItem({ - iconCls: 'menu__icon btn-undo', - caption: me.textUndo - }).on('click', function () { - me.api.Undo(); }); - var menuViewCopySeparator = new Common.UI.MenuItem({ + me.menuViewUndo = new Common.UI.MenuItem({ + iconCls: 'menu__icon btn-undo', + caption: me.textUndo + }); + + me.menuViewCopySeparator = new Common.UI.MenuItem({ caption: '--' }); - var menuViewAddComment = new Common.UI.MenuItem({ + me.menuViewAddComment = new Common.UI.MenuItem({ iconCls: 'menu__icon btn-menu-comments', caption: me.addCommentText - }).on('click', _.bind(me.addComment, me)); + }); - var menuSignatureViewSign = new Common.UI.MenuItem({caption: this.strSign, value: 0 }).on('click', _.bind(me.onSignatureClick, me)); - var menuSignatureDetails = new Common.UI.MenuItem({caption: this.strDetails, value: 1 }).on('click', _.bind(me.onSignatureClick, me)); - var menuSignatureViewSetup = new Common.UI.MenuItem({caption: this.strSetup, value: 2 }).on('click', _.bind(me.onSignatureClick, me)); - var menuSignatureRemove = new Common.UI.MenuItem({caption: this.strDelete, value: 3 }).on('click', _.bind(me.onSignatureClick, me)); - var menuViewSignSeparator = new Common.UI.MenuItem({caption: '--' }); + me.menuSignatureViewSign = new Common.UI.MenuItem({caption: this.strSign, value: 0 }); + me.menuSignatureDetails = new Common.UI.MenuItem({caption: this.strDetails, value: 1 }); + me.menuSignatureViewSetup = new Common.UI.MenuItem({caption: this.strSetup, value: 2 }); + me.menuSignatureRemove = new Common.UI.MenuItem({caption: this.strDelete, value: 3 }); + me.menuViewSignSeparator = new Common.UI.MenuItem({caption: '--' }); - var menuViewPrint = new Common.UI.MenuItem({ + me.menuViewPrint = new Common.UI.MenuItem({ iconCls: 'menu__icon btn-print', caption : me.txtPrintSelection - }).on('click', _.bind(me.onPrintSelection, me)); + }); this.viewModeMenu = new Common.UI.Menu({ cls: 'shifted-right', @@ -2109,51 +168,51 @@ define([ canEditControl = spectype !== undefined && (spectype === Asc.c_oAscContentControlSpecificType.None || spectype === Asc.c_oAscContentControlSpecificType.ComboBox) && !control_lock; } - menuViewUndo.setVisible(me.mode.canCoAuthoring && me.mode.canComments && !me._isDisabled); - menuViewUndo.setDisabled(!me.api.asc_getCanUndo() && !me._isDisabled); - menuViewCopySeparator.setVisible(isInSign); + me.menuViewUndo.setVisible(me.mode.canCoAuthoring && me.mode.canComments && !me._isDisabled); + me.menuViewUndo.setDisabled(!me.api.asc_getCanUndo()); + me.menuViewCopySeparator.setVisible(isInSign); var isRequested = (signProps) ? signProps.asc_getRequested() : false; - menuSignatureViewSign.setVisible(isInSign && isRequested); - menuSignatureDetails.setVisible(isInSign && !isRequested); - menuSignatureViewSetup.setVisible(isInSign); - menuSignatureRemove.setVisible(isInSign && !isRequested); - menuViewSignSeparator.setVisible(canComment); + me.menuSignatureViewSign.setVisible(isInSign && isRequested); + me.menuSignatureDetails.setVisible(isInSign && !isRequested); + me.menuSignatureViewSetup.setVisible(isInSign); + me.menuSignatureRemove.setVisible(isInSign && !isRequested); + me.menuViewSignSeparator.setVisible(canComment); if (isInSign) { - menuSignatureViewSign.cmpEl.attr('data-value', signGuid); // sign - menuSignatureDetails.cmpEl.attr('data-value', signProps.asc_getId()); // view certificate - menuSignatureViewSetup.cmpEl.attr('data-value', signGuid); // view signature settings - menuSignatureRemove.cmpEl.attr('data-value', signGuid); + me.menuSignatureViewSign.cmpEl.attr('data-value', signGuid); // sign + me.menuSignatureDetails.cmpEl.attr('data-value', signProps.asc_getId()); // view certificate + me.menuSignatureViewSetup.cmpEl.attr('data-value', signGuid); // view signature settings + me.menuSignatureRemove.cmpEl.attr('data-value', signGuid); } - menuViewAddComment.setVisible(canComment); - menuViewAddComment.setDisabled(value.paraProps && value.paraProps.locked === true); + me.menuViewAddComment.setVisible(canComment); + me.menuViewAddComment.setDisabled(value.paraProps && value.paraProps.locked === true); var disabled = value.paraProps && value.paraProps.locked === true; var cancopy = me.api && me.api.can_CopyCut(); - menuViewCopy.setDisabled(!cancopy); - menuViewCut.setVisible(me._fillFormMode && canEditControl); - menuViewCut.setDisabled(disabled || !cancopy); - menuViewPaste.setVisible(me._fillFormMode && canEditControl); - menuViewPaste.setDisabled(disabled); - menuViewPrint.setVisible(me.mode.canPrint && !me._fillFormwMode); - menuViewPrint.setDisabled(!cancopy); + me.menuViewCopy.setDisabled(!cancopy); + me.menuViewCut.setVisible(me._fillFormMode && canEditControl); + me.menuViewCut.setDisabled(disabled || !cancopy); + me.menuViewPaste.setVisible(me._fillFormMode && canEditControl); + me.menuViewPaste.setDisabled(disabled); + me.menuViewPrint.setVisible(me.mode.canPrint && !me._fillFormMode); + me.menuViewPrint.setDisabled(!cancopy); }, items: [ - menuViewCut, - menuViewCopy, - menuViewPaste, - menuViewUndo, - menuViewPrint, - menuViewCopySeparator, - menuSignatureViewSign, - menuSignatureDetails, - menuSignatureViewSetup, - menuSignatureRemove, - menuViewSignSeparator, - menuViewAddComment + me.menuViewCut, + me.menuViewCopy, + me.menuViewPaste, + me.menuViewUndo, + me.menuViewPrint, + me.menuViewCopySeparator, + me.menuSignatureViewSign, + me.menuSignatureDetails, + me.menuSignatureViewSetup, + me.menuSignatureRemove, + me.menuViewSignSeparator, + me.menuViewAddComment ] }).on('hide:after', function (menu, e, isFromInputControl) { if (me.suppressEditComplete) { @@ -2165,24 +224,25 @@ define([ me.currentMenu = null; }); + this.fireEvent('createdelayedelements', [this, 'view']); }, createDelayedElementsPDFViewer: function() { var me = this; - var menuPDFViewCopy = new Common.UI.MenuItem({ + me.menuPDFViewCopy = new Common.UI.MenuItem({ iconCls: 'menu__icon btn-copy', caption: me.textCopy, value: 'copy' - }).on('click', _.bind(me.onCutCopyPaste, me)); + }); this.viewPDFModeMenu = new Common.UI.Menu({ cls: 'shifted-right', initMenu: function (value) { - menuPDFViewCopy.setDisabled(!(me.api && me.api.can_CopyCut())); + me.menuPDFViewCopy.setDisabled(!(me.api && me.api.can_CopyCut())); }, items: [ - menuPDFViewCopy + me.menuPDFViewCopy ] }).on('hide:after', function (menu, e, isFromInputControl) { if (me.suppressEditComplete) { @@ -2194,419 +254,264 @@ define([ me.currentMenu = null; }); + this.fireEvent('createdelayedelements', [this, 'pdf']); }, createDelayedElements: function() { var me = this; - var menuInsertCaption = new Common.UI.MenuItem({ + me.menuInsertCaption = new Common.UI.MenuItem({ caption : me.txtInsertCaption - }).on('click', _.bind(me.onInsertCaption, me)); + }); var menuInsertCaptionSeparator = new Common.UI.MenuItem({ caption: '--' }); - var menuEquationInsertCaption = new Common.UI.MenuItem({ + me.menuEquationInsertCaption = new Common.UI.MenuItem({ caption : me.txtInsertCaption - }).on('click', _.bind(me.onInsertCaption, me)); + }); var menuEquationInsertCaptionSeparator = new Common.UI.MenuItem({ caption: '--' }); - var menuImageAlign = new Common.UI.MenuItem({ + me.menuImageAlign = new Common.UI.MenuItem({ caption : me.textAlign, - menu : (function(){ - function onItemClick(item, e) { - if (me.api) { - var alignto = Common.Utils.InternalSettings.get("de-img-align-to"), - value = (alignto==1) ? Asc.c_oAscObjectsAlignType.Page : ((me.api.asc_getSelectedDrawingObjectsCount()<2 && !alignto || alignto==2) ? Asc.c_oAscObjectsAlignType.Margin : Asc.c_oAscObjectsAlignType.Selected); - if (item.value < 6) { - me.api.put_ShapesAlign(item.value, value); - Common.component.Analytics.trackEvent('DocumentHolder', 'Shape Align'); - } else if (item.value == 6) { - me.api.DistributeHorizontally(value); - Common.component.Analytics.trackEvent('DocumentHolder', 'Distribute Horizontally'); - } else if (item.value == 7){ - me.api.DistributeVertically(value); - Common.component.Analytics.trackEvent('DocumentHolder', 'Distribute Vertically'); - } - } - me.fireEvent('editcomplete', me); - } - return new Common.UI.Menu({ - cls: 'ppm-toolbar shifted-right', - menuAlign: 'tl-tr', - items: [ - new Common.UI.MenuItem({ - caption : me.textShapeAlignLeft, - iconCls : 'menu__icon shape-align-left', - value: Asc.c_oAscAlignShapeType.ALIGN_LEFT - }).on('click', onItemClick), - new Common.UI.MenuItem({ - caption : me.textShapeAlignCenter, - iconCls : 'menu__icon shape-align-center', - value: Asc.c_oAscAlignShapeType.ALIGN_CENTER - }).on('click', onItemClick), - new Common.UI.MenuItem({ - caption : me.textShapeAlignRight, - iconCls : 'menu__icon shape-align-right', - value: Asc.c_oAscAlignShapeType.ALIGN_RIGHT - }).on('click', onItemClick), - new Common.UI.MenuItem({ - caption : me.textShapeAlignTop, - iconCls : 'menu__icon shape-align-top', - value: Asc.c_oAscAlignShapeType.ALIGN_TOP - }).on('click', onItemClick), - new Common.UI.MenuItem({ - caption : me.textShapeAlignMiddle, - iconCls : 'menu__icon shape-align-middle', - value: Asc.c_oAscAlignShapeType.ALIGN_MIDDLE - }).on('click', onItemClick), - new Common.UI.MenuItem({ - caption : me.textShapeAlignBottom, - iconCls : 'menu__icon shape-align-bottom', - value: Asc.c_oAscAlignShapeType.ALIGN_BOTTOM - }).on('click', onItemClick), - {caption : '--'}, - new Common.UI.MenuItem({ - caption : me.txtDistribHor, - iconCls : 'menu__icon shape-distribute-hor', - value : 6 - }).on('click', onItemClick), - new Common.UI.MenuItem({ - caption : me.txtDistribVert, - iconCls : 'menu__icon shape-distribute-vert', - value : 7 - }).on('click', onItemClick) - ] - }) - })() - }); - - var mnuGroup = new Common.UI.MenuItem({ - caption : this.txtGroup, - iconCls : 'menu__icon shape-group' - }).on('click', function(item, e) { - if (me.api) { - var properties = new Asc.asc_CImgProperty(); - properties.put_Group(1); - me.api.ImgApply(properties); - } - me.fireEvent('editcomplete', this); - }); - - var mnuUnGroup = new Common.UI.MenuItem({ - iconCls : 'menu__icon shape-ungroup', - caption : this.txtUngroup - }).on('click', function(item, e) { - if (me.api) { - var properties = new Asc.asc_CImgProperty(); - properties.put_Group(-1); - me.api.ImgApply(properties); - } - me.fireEvent('editcomplete', this); - }); - - var menuImageArrange = new Common.UI.MenuItem({ - caption : me.textArrange, - menu : (function(){ - function onItemClick(item, e) { - if (me.api) { - var properties = new Asc.asc_CImgProperty(); - properties.put_ChangeLevel(item.options.valign); - me.api.ImgApply(properties); - } - me.fireEvent('editcomplete', me); - } - - return new Common.UI.Menu({ - cls: 'ppm-toolbar shifted-right', - menuAlign: 'tl-tr', - items: [ - new Common.UI.MenuItem({ - caption : me.textArrangeFront, - iconCls : 'menu__icon arrange-front', - valign : Asc.c_oAscChangeLevel.BringToFront - }).on('click', onItemClick), - new Common.UI.MenuItem({ - caption : me.textArrangeBack, - iconCls : 'menu__icon arrange-back', - valign : Asc.c_oAscChangeLevel.SendToBack - }).on('click', onItemClick), - new Common.UI.MenuItem({ - caption : me.textArrangeForward, - iconCls : 'menu__icon arrange-forward', - valign : Asc.c_oAscChangeLevel.BringForward - }).on('click', onItemClick), - new Common.UI.MenuItem({ - caption : me.textArrangeBackward, - iconCls : 'menu__icon arrange-backward', - valign : Asc.c_oAscChangeLevel.BringBackward - }).on('click', onItemClick), - { caption: '--' }, - mnuGroup, - mnuUnGroup - ] - }) - })() - }); - - var menuWrapPolygon = new Common.UI.MenuItem({ - caption : me.textEditWrapBoundary, - cls : 'no-icon-wrap-item' - }).on('click', function(item, e) { - if (me.api) { - me.api.StartChangeWrapPolygon(); - } - me.fireEvent('editcomplete', me); - }); - - this.menuImageWrap = new Common.UI.MenuItem({ - iconCls: 'menu__icon wrap-inline', - caption : me.textWrap, - menu : (function(){ - function onItemClick(item, e) { - if (me.api) { - var properties = new Asc.asc_CImgProperty(); - properties.put_WrappingStyle(item.options.wrapType); - - if (me.menuImageWrap._originalProps.get_WrappingStyle() === Asc.c_oAscWrapStyle2.Inline && item.wrapType !== Asc.c_oAscWrapStyle2.Inline ) { - properties.put_PositionH(new Asc.CImagePositionH()); - properties.get_PositionH().put_UseAlign(false); - properties.get_PositionH().put_RelativeFrom(Asc.c_oAscRelativeFromH.Column); - var val = me.menuImageWrap._originalProps.get_Value_X(Asc.c_oAscRelativeFromH.Column); - properties.get_PositionH().put_Value(val); - - properties.put_PositionV(new Asc.CImagePositionV()); - properties.get_PositionV().put_UseAlign(false); - properties.get_PositionV().put_RelativeFrom(Asc.c_oAscRelativeFromV.Paragraph); - val = me.menuImageWrap._originalProps.get_Value_Y(Asc.c_oAscRelativeFromV.Paragraph); - properties.get_PositionV().put_Value(val); - } - me.api.ImgApply(properties); - } - me.fireEvent('editcomplete', me); - } - - return new Common.UI.Menu({ - cls: 'ppm-toolbar shifted-right', - menuAlign: 'tl-tr', - items: [ - new Common.UI.MenuItem({ - caption : me.txtInline, - iconCls : 'menu__icon wrap-inline', - toggleGroup : 'popuppicturewrapping', - wrapType : Asc.c_oAscWrapStyle2.Inline, - checkmark : false, - checkable : true - }).on('click', onItemClick), - { caption: '--' }, - new Common.UI.MenuItem({ - caption : me.txtSquare, - iconCls : 'menu__icon wrap-square', - toggleGroup : 'popuppicturewrapping', - wrapType : Asc.c_oAscWrapStyle2.Square, - checkmark : false, - checkable : true - }).on('click', onItemClick), - new Common.UI.MenuItem({ - caption : me.txtTight, - iconCls : 'menu__icon wrap-tight', - toggleGroup : 'popuppicturewrapping', - wrapType : Asc.c_oAscWrapStyle2.Tight, - checkmark : false, - checkable : true - }).on('click', onItemClick), - new Common.UI.MenuItem({ - caption : me.txtThrough, - iconCls : 'menu__icon wrap-through', - toggleGroup : 'popuppicturewrapping', - wrapType : Asc.c_oAscWrapStyle2.Through, - checkmark : false, - checkable : true - }).on('click', onItemClick), - new Common.UI.MenuItem({ - caption : me.txtTopAndBottom, - iconCls : 'menu__icon wrap-topandbottom', - toggleGroup : 'popuppicturewrapping', - wrapType : Asc.c_oAscWrapStyle2.TopAndBottom, - checkmark : false, - checkable : true - }).on('click', onItemClick), - { caption: '--' }, - new Common.UI.MenuItem({ - caption : me.txtInFront, - iconCls : 'menu__icon wrap-infront', - toggleGroup : 'popuppicturewrapping', - wrapType : Asc.c_oAscWrapStyle2.InFront, - checkmark : false, - checkable : true - }).on('click', onItemClick), - new Common.UI.MenuItem({ - caption : me.txtBehind, - iconCls : 'menu__icon wrap-behind', - toggleGroup : 'popuppicturewrapping', - wrapType : Asc.c_oAscWrapStyle2.Behind, - checkmark : false, - checkable : true - }).on('click', onItemClick), - { caption: '--' }, - menuWrapPolygon - ] - }) - })() - }); - - var menuImageAdvanced = new Common.UI.MenuItem({ - iconCls: 'menu__icon btn-menu-image', - caption : me.advancedText - }).on('click', function(item, e) { - var elType, elValue; - - if (me.api){ - var selectedElements = me.api.getSelectedElements(); - - if (selectedElements && _.isArray(selectedElements)) { - for (var i = selectedElements.length - 1; i >= 0; i--) { - elType = selectedElements[i].get_ObjectType(); - elValue = selectedElements[i].get_ObjectValue(); - - if (Asc.c_oAscTypeSelectElement.Image == elType) { - var imgsizeOriginal; - if ( !elValue.get_ChartProperties() && !elValue.get_ShapeProperties() && !me.menuOriginalSize.isDisabled() && me.menuOriginalSize.isVisible()) { - imgsizeOriginal = me.api.get_OriginalSizeImage(); - if (imgsizeOriginal) - imgsizeOriginal = {width:imgsizeOriginal.get_ImageWidth(), height:imgsizeOriginal.get_ImageHeight()}; - } - - var win = new DE.Views.ImageSettingsAdvanced({ - imageProps : elValue, - sizeOriginal: imgsizeOriginal, - api : me.api, - sectionProps: me.api.asc_GetSectionProps(), - handler : function(result, value) { - if (result == 'ok') { - if (me.api) { - me.api.ImgApply(value.imageProps); - } - } - me.fireEvent('editcomplete', me); - } - }); - win.show(); - win.btnOriginalSize.setVisible(me.menuOriginalSize.isVisible()); - break; - } - } - } - } - }); - - var menuChartEdit = new Common.UI.MenuItem({ - caption : me.editChartText - }).on('click', _.bind(me.editChartClick, me)); - - var menuChartEditSeparator = new Common.UI.MenuItem({ - caption : '--' - }); - - this.menuOriginalSize = new Common.UI.MenuItem({ - caption : me.originalSizeText - }).on('click', function(item, e) { - if (me.api){ - var originalImageSize = me.api.get_OriginalSizeImage(); - - var properties = new Asc.asc_CImgProperty(); - properties.put_Width(originalImageSize.get_ImageWidth()); - properties.put_Height(originalImageSize.get_ImageHeight()); - properties.put_ResetCrop(true); - properties.put_Rot(0); - me.api.ImgApply(properties); - - me.fireEvent('editcomplete', this); - } - }); - - var menuImgReplace = new Common.UI.MenuItem({ - caption : me.textReplace, menu : new Common.UI.Menu({ - cls: 'shifted-right', + cls: 'ppm-toolbar shifted-right', menuAlign: 'tl-tr', items: [ new Common.UI.MenuItem({ - caption : this.textFromFile - }).on('click', function(item) { - setTimeout(function(){ - if (me.api) me.api.ChangeImageFromFile(); - me.fireEvent('editcomplete', me); - }, 10); + caption : me.textShapeAlignLeft, + iconCls : 'menu__icon shape-align-left', + value: Asc.c_oAscAlignShapeType.ALIGN_LEFT }), new Common.UI.MenuItem({ - caption : this.textFromUrl - }).on('click', function(item) { - (new Common.Views.ImageFromUrlDialog({ - handler: function(result, value) { - if (result == 'ok') { - if (me.api) { - var checkUrl = value.replace(/ /g, ''); - if (!_.isEmpty(checkUrl)) { - var props = new Asc.asc_CImgProperty(); - props.put_ImageUrl(checkUrl); - me.api.ImgApply(props); - } - } - } - me.fireEvent('editcomplete', me); - } - })).show(); + caption : me.textShapeAlignCenter, + iconCls : 'menu__icon shape-align-center', + value: Asc.c_oAscAlignShapeType.ALIGN_CENTER }), new Common.UI.MenuItem({ - caption : this.textFromStorage - }).on('click', function(item) { - Common.NotificationCenter.trigger('storage:image-load', 'change'); + caption : me.textShapeAlignRight, + iconCls : 'menu__icon shape-align-right', + value: Asc.c_oAscAlignShapeType.ALIGN_RIGHT + }), + new Common.UI.MenuItem({ + caption : me.textShapeAlignTop, + iconCls : 'menu__icon shape-align-top', + value: Asc.c_oAscAlignShapeType.ALIGN_TOP + }), + new Common.UI.MenuItem({ + caption : me.textShapeAlignMiddle, + iconCls : 'menu__icon shape-align-middle', + value: Asc.c_oAscAlignShapeType.ALIGN_MIDDLE + }), + new Common.UI.MenuItem({ + caption : me.textShapeAlignBottom, + iconCls : 'menu__icon shape-align-bottom', + value: Asc.c_oAscAlignShapeType.ALIGN_BOTTOM + }), + {caption : '--'}, + new Common.UI.MenuItem({ + caption : me.txtDistribHor, + iconCls : 'menu__icon shape-distribute-hor', + value : 6 + }), + new Common.UI.MenuItem({ + caption : me.txtDistribVert, + iconCls : 'menu__icon shape-distribute-vert', + value : 7 }) ] }) }); - var menuImgCopy = new Common.UI.MenuItem({ + me.mnuGroup = new Common.UI.MenuItem({ + caption : this.txtGroup, + iconCls : 'menu__icon shape-group' + }); + + me.mnuUnGroup = new Common.UI.MenuItem({ + iconCls : 'menu__icon shape-ungroup', + caption : this.txtUngroup + }); + + me.menuImageArrange = new Common.UI.MenuItem({ + caption : me.textArrange, + menu : new Common.UI.Menu({ + cls: 'ppm-toolbar shifted-right', + menuAlign: 'tl-tr', + items: [ + new Common.UI.MenuItem({ + caption : me.textArrangeFront, + iconCls : 'menu__icon arrange-front', + valign : Asc.c_oAscChangeLevel.BringToFront + }), + new Common.UI.MenuItem({ + caption : me.textArrangeBack, + iconCls : 'menu__icon arrange-back', + valign : Asc.c_oAscChangeLevel.SendToBack + }), + new Common.UI.MenuItem({ + caption : me.textArrangeForward, + iconCls : 'menu__icon arrange-forward', + valign : Asc.c_oAscChangeLevel.BringForward + }), + new Common.UI.MenuItem({ + caption : me.textArrangeBackward, + iconCls : 'menu__icon arrange-backward', + valign : Asc.c_oAscChangeLevel.BringBackward + }), + { caption: '--' }, + me.mnuGroup, + me.mnuUnGroup + ] + }) + }); + + me.menuWrapPolygon = new Common.UI.MenuItem({ + caption : me.textEditWrapBoundary, + cls : 'no-icon-wrap-item' + }); + + me.menuImageWrap = new Common.UI.MenuItem({ + iconCls: 'menu__icon wrap-inline', + caption : me.textWrap, + menu : new Common.UI.Menu({ + cls: 'ppm-toolbar shifted-right', + menuAlign: 'tl-tr', + items: [ + new Common.UI.MenuItem({ + caption : me.txtInline, + iconCls : 'menu__icon wrap-inline', + toggleGroup : 'popuppicturewrapping', + wrapType : Asc.c_oAscWrapStyle2.Inline, + checkmark : false, + checkable : true + }), + { caption: '--' }, + new Common.UI.MenuItem({ + caption : me.txtSquare, + iconCls : 'menu__icon wrap-square', + toggleGroup : 'popuppicturewrapping', + wrapType : Asc.c_oAscWrapStyle2.Square, + checkmark : false, + checkable : true + }), + new Common.UI.MenuItem({ + caption : me.txtTight, + iconCls : 'menu__icon wrap-tight', + toggleGroup : 'popuppicturewrapping', + wrapType : Asc.c_oAscWrapStyle2.Tight, + checkmark : false, + checkable : true + }), + new Common.UI.MenuItem({ + caption : me.txtThrough, + iconCls : 'menu__icon wrap-through', + toggleGroup : 'popuppicturewrapping', + wrapType : Asc.c_oAscWrapStyle2.Through, + checkmark : false, + checkable : true + }), + new Common.UI.MenuItem({ + caption : me.txtTopAndBottom, + iconCls : 'menu__icon wrap-topandbottom', + toggleGroup : 'popuppicturewrapping', + wrapType : Asc.c_oAscWrapStyle2.TopAndBottom, + checkmark : false, + checkable : true + }), + { caption: '--' }, + new Common.UI.MenuItem({ + caption : me.txtInFront, + iconCls : 'menu__icon wrap-infront', + toggleGroup : 'popuppicturewrapping', + wrapType : Asc.c_oAscWrapStyle2.InFront, + checkmark : false, + checkable : true + }), + new Common.UI.MenuItem({ + caption : me.txtBehind, + iconCls : 'menu__icon wrap-behind', + toggleGroup : 'popuppicturewrapping', + wrapType : Asc.c_oAscWrapStyle2.Behind, + checkmark : false, + checkable : true + }), + { caption: '--' }, + me.menuWrapPolygon + ] + }) + }); + + me.menuImageAdvanced = new Common.UI.MenuItem({ + iconCls: 'menu__icon btn-menu-image', + caption : me.advancedText + }); + + me.menuChartEdit = new Common.UI.MenuItem({ + caption : me.editChartText + }); + + var menuChartEditSeparator = new Common.UI.MenuItem({ + caption : '--' + }); + + me.menuOriginalSize = new Common.UI.MenuItem({ + caption : me.originalSizeText + }); + + me.menuImgReplace = new Common.UI.MenuItem({ + caption : me.textReplace, + menu : new Common.UI.Menu({ + cls: 'shifted-right', + menuAlign: 'tl-tr', + items: [ + new Common.UI.MenuItem({caption: this.textFromFile, value: 0}), + new Common.UI.MenuItem({caption: this.textFromUrl, value: 1}), + new Common.UI.MenuItem({caption: this.textFromStorage, value: 2}) + ] + }) + }); + + me.menuImgCopy = new Common.UI.MenuItem({ iconCls: 'menu__icon btn-copy', caption : me.textCopy, value : 'copy' - }).on('click', _.bind(me.onCutCopyPaste, me)); + }); - var menuImgPaste = new Common.UI.MenuItem({ + me.menuImgPaste = new Common.UI.MenuItem({ iconCls: 'menu__icon btn-paste', caption : me.textPaste, value : 'paste' - }).on('click', _.bind(me.onCutCopyPaste, me)); + }); - var menuImgCut = new Common.UI.MenuItem({ + me.menuImgCut = new Common.UI.MenuItem({ iconCls: 'menu__icon btn-cut', caption : me.textCut, value : 'cut' - }).on('click', _.bind(me.onCutCopyPaste, me)); + }); - var menuImgAccept = new Common.UI.MenuItem({ + me.menuImgAccept = new Common.UI.MenuItem({ caption : me.textAccept, value : 'accept' - }).on('click', _.bind(me.onAcceptRejectChange, me)); + }); - var menuImgReject = new Common.UI.MenuItem({ + me.menuImgReject = new Common.UI.MenuItem({ caption : me.textReject, value : 'reject' - }).on('click', _.bind(me.onAcceptRejectChange, me)); + }); var menuImgReviewSeparator = new Common.UI.MenuItem({ caption : '--' }); - var menuImgPrint = new Common.UI.MenuItem({ + me.menuImgPrint = new Common.UI.MenuItem({ iconCls: 'menu__icon btn-print', caption : me.txtPrintSelection - }).on('click', _.bind(me.onPrintSelection, me)); + }); - var menuSignatureEditSign = new Common.UI.MenuItem({caption: this.strSign, value: 0 }).on('click', _.bind(me.onSignatureClick, me)); - var menuSignatureEditSetup = new Common.UI.MenuItem({caption: this.strSetup, value: 2 }).on('click', _.bind(me.onSignatureClick, me)); + me.menuSignatureEditSign = new Common.UI.MenuItem({caption: this.strSign, value: 0 }); + me.menuSignatureEditSetup = new Common.UI.MenuItem({caption: this.strSetup, value: 2 }); var menuEditSignSeparator = new Common.UI.MenuItem({ caption: '--' }); - var menuImgRotate = new Common.UI.MenuItem({ + me.menuImgRotate = new Common.UI.MenuItem({ caption : me.textRotate, menu : new Common.UI.Menu({ cls: 'shifted-right', @@ -2616,23 +521,23 @@ define([ iconCls: 'menu__icon btn-rotate-90', caption: this.textRotate90, value : 1 - }).on('click', _.bind(me.onImgRotate, me)), + }), new Common.UI.MenuItem({ iconCls: 'menu__icon btn-rotate-270', caption: this.textRotate270, value : 0 - }).on('click', _.bind(me.onImgRotate, me)), + }), { caption: '--' }, new Common.UI.MenuItem({ iconCls: 'menu__icon btn-flip-hor', caption: this.textFlipH, value : 1 - }).on('click', _.bind(me.onImgFlip, me)), + }), new Common.UI.MenuItem({ iconCls: 'menu__icon btn-flip-vert', caption: this.textFlipV, value : 0 - }).on('click', _.bind(me.onImgFlip, me)) + }) ] }) }); @@ -2648,38 +553,36 @@ define([ checkable: true, allowDepress: true, value : 0 - }).on('click', _.bind(me.onImgCrop, me)), + }), new Common.UI.MenuItem({ caption: me.textCropFill, value : 1 - }).on('click', _.bind(me.onImgCrop, me)), + }), new Common.UI.MenuItem({ caption: me.textCropFit, value : 2 - }).on('click', _.bind(me.onImgCrop, me)) + }) ] }) }); - var menuImgRemoveControl = new Common.UI.MenuItem({ + me.menuImgRemoveControl = new Common.UI.MenuItem({ iconCls: 'menu__icon cc-remove', caption: me.textRemoveControl, value: 'remove' - }).on('click', _.bind(me.onControlsSelect, me)); + }); - var menuImgControlSettings = new Common.UI.MenuItem({ + me.menuImgControlSettings = new Common.UI.MenuItem({ caption: me.textEditControls, value: 'settings' - }).on('click', _.bind(me.onControlsSelect, me)); + }); var menuImgControlSeparator = new Common.UI.MenuItem({ caption : '--' }); - var menuImgEditPoints = new Common.UI.MenuItem({ + me.menuImgEditPoints = new Common.UI.MenuItem({ caption: me.textEditPoints - }).on('click', function(item) { - me.api && me.api.asc_editPointsGeometry(); }); var menuImgEditPointsSeparator = new Common.UI.MenuItem({ @@ -2748,17 +651,16 @@ define([ }); var onlyCommonProps = ( value.imgProps.isImg && value.imgProps.isChart || value.imgProps.isImg && value.imgProps.isShape || - value.imgProps.isShape && value.imgProps.isChart); + value.imgProps.isShape && value.imgProps.isChart); if (onlyCommonProps) { - menuImageAdvanced.setCaption(me.advancedText, true); - menuImageAdvanced.setIconCls('menu__icon btn-menu-image'); + me.menuImageAdvanced.setCaption(me.advancedText, true); + me.menuImageAdvanced.setIconCls('menu__icon btn-menu-image'); } else { - menuImageAdvanced.setCaption((value.imgProps.isImg) ? me.imageText : ((value.imgProps.isChart) ? me.chartText : me.shapeText), true); - menuImageAdvanced.setIconCls('menu__icon ' + (value.imgProps.isImg ? 'btn-menu-image' : (value.imgProps.isChart ? 'btn-menu-chart' : 'btn-menu-shape'))); + me.menuImageAdvanced.setCaption((value.imgProps.isImg) ? me.imageText : ((value.imgProps.isChart) ? me.chartText : me.shapeText), true); + me.menuImageAdvanced.setIconCls('menu__icon ' + (value.imgProps.isImg ? 'btn-menu-image' : (value.imgProps.isChart ? 'btn-menu-chart' : 'btn-menu-shape'))); } - menuChartEdit.setVisible(!_.isNull(value.imgProps.value.get_ChartProperties()) && !onlyCommonProps); - + me.menuChartEdit.setVisible(!_.isNull(value.imgProps.value.get_ChartProperties()) && !onlyCommonProps); me.menuOriginalSize.setVisible(value.imgProps.isOnlyImg || !value.imgProps.isChart && !value.imgProps.isShape); var in_control = me.api.asc_IsContentControl(), @@ -2767,119 +669,119 @@ define([ content_locked = lock_type==Asc.c_oAscSdtLockType.SdtContentLocked || lock_type==Asc.c_oAscSdtLockType.ContentLocked, is_form = control_props && control_props.get_FormPr(); - menuImgRemoveControl.setVisible(in_control); - menuImgControlSettings.setVisible(in_control && me.mode.canEditContentControl && !is_form); + me.menuImgRemoveControl.setVisible(in_control); + me.menuImgControlSettings.setVisible(in_control && me.mode.canEditContentControl && !is_form); menuImgControlSeparator.setVisible(in_control); if (in_control) { - menuImgRemoveControl.setDisabled(lock_type==Asc.c_oAscSdtLockType.SdtContentLocked || lock_type==Asc.c_oAscSdtLockType.SdtLocked); - menuImgRemoveControl.setCaption(is_form ? me.getControlLabel(control_props) : me.textRemoveControl); + me.menuImgRemoveControl.setDisabled(lock_type==Asc.c_oAscSdtLockType.SdtContentLocked || lock_type==Asc.c_oAscSdtLockType.SdtLocked); + me.menuImgRemoveControl.setCaption(is_form ? me.getControlLabel(control_props) : me.textRemoveControl); } var islocked = value.imgProps.locked || (value.headerProps!==undefined && value.headerProps.locked) || content_locked; var pluginGuid = value.imgProps.value.asc_getPluginGuid(); - menuImgReplace.setVisible(value.imgProps.isOnlyImg && (pluginGuid===null || pluginGuid===undefined)); - if (menuImgReplace.isVisible()) - menuImgReplace.setDisabled(islocked || pluginGuid===null); - menuImgReplace.menu.items[2].setVisible(me.mode.canRequestInsertImage || me.mode.fileChoiceUrl && me.mode.fileChoiceUrl.indexOf("{documentType}")>-1); + me.menuImgReplace.setVisible(value.imgProps.isOnlyImg && (pluginGuid===null || pluginGuid===undefined)); + if (me.menuImgReplace.isVisible()) + me.menuImgReplace.setDisabled(islocked || pluginGuid===null); + me.menuImgReplace.menu.items[2].setVisible(me.mode.canRequestInsertImage || me.mode.fileChoiceUrl && me.mode.fileChoiceUrl.indexOf("{documentType}")>-1); - menuImgRotate.setVisible(!value.imgProps.isChart && (pluginGuid===null || pluginGuid===undefined)); - if (menuImgRotate.isVisible()) { - menuImgRotate.setDisabled(islocked || value.imgProps.isSmartArt); - menuImgRotate.menu.items[3].setDisabled(value.imgProps.isSmartArtInternal); - menuImgRotate.menu.items[4].setDisabled(value.imgProps.isSmartArtInternal); + me.menuImgRotate.setVisible(!value.imgProps.isChart && (pluginGuid===null || pluginGuid===undefined)); + if (me.menuImgRotate.isVisible()) { + me.menuImgRotate.setDisabled(islocked || value.imgProps.isSmartArt); + me.menuImgRotate.menu.items[3].setDisabled(value.imgProps.isSmartArtInternal); + me.menuImgRotate.menu.items[4].setDisabled(value.imgProps.isSmartArtInternal); } me.menuImgCrop.setVisible(me.api.asc_canEditCrop()); if (me.menuImgCrop.isVisible()) me.menuImgCrop.setDisabled(islocked); - if (menuChartEdit.isVisible()) - menuChartEdit.setDisabled(islocked || value.imgProps.value.get_SeveralCharts()); + if (me.menuChartEdit.isVisible()) + me.menuChartEdit.setDisabled(islocked || value.imgProps.value.get_SeveralCharts()); - menuChartEditSeparator.setVisible(menuChartEdit.isVisible()); + menuChartEditSeparator.setVisible(me.menuChartEdit.isVisible()); me.menuOriginalSize.setDisabled(islocked || value.imgProps.value.get_ImageUrl()===null || value.imgProps.value.get_ImageUrl()===undefined); - menuImageAdvanced.setDisabled(islocked); - menuImageAlign.setDisabled( islocked || (wrapping == Asc.c_oAscWrapStyle2.Inline) ); + me.menuImageAdvanced.setDisabled(islocked); + me.menuImageAlign.setDisabled( islocked || (wrapping == Asc.c_oAscWrapStyle2.Inline) ); if (!(islocked || (wrapping == Asc.c_oAscWrapStyle2.Inline))) { var objcount = me.api.asc_getSelectedDrawingObjectsCount(), alignto = Common.Utils.InternalSettings.get("de-img-align-to"); // 1 - page, 2 - margin, 3 - selected - menuImageAlign.menu.items[7].setDisabled(objcount==2 && (!alignto || alignto==3)); - menuImageAlign.menu.items[8].setDisabled(objcount==2 && (!alignto || alignto==3)); + me.menuImageAlign.menu.items[7].setDisabled(objcount==2 && (!alignto || alignto==3)); + me.menuImageAlign.menu.items[8].setDisabled(objcount==2 && (!alignto || alignto==3)); } - menuImageArrange.setDisabled( (wrapping == Asc.c_oAscWrapStyle2.Inline) && !value.imgProps.value.get_FromGroup() || content_locked || - (me.api && !me.api.CanUnGroup() && !me.api.CanGroup() && value.imgProps.isSmartArtInternal)); - menuImageArrange.menu.items[0].setDisabled(value.imgProps.isSmartArtInternal); - menuImageArrange.menu.items[1].setDisabled(value.imgProps.isSmartArtInternal); - menuImageArrange.menu.items[2].setDisabled(value.imgProps.isSmartArtInternal); - menuImageArrange.menu.items[3].setDisabled(value.imgProps.isSmartArtInternal); + me.menuImageArrange.setDisabled( (wrapping == Asc.c_oAscWrapStyle2.Inline) && !value.imgProps.value.get_FromGroup() || content_locked || + (me.api && !me.api.CanUnGroup() && !me.api.CanGroup() && value.imgProps.isSmartArtInternal)); + me.menuImageArrange.menu.items[0].setDisabled(value.imgProps.isSmartArtInternal); + me.menuImageArrange.menu.items[1].setDisabled(value.imgProps.isSmartArtInternal); + me.menuImageArrange.menu.items[2].setDisabled(value.imgProps.isSmartArtInternal); + me.menuImageArrange.menu.items[3].setDisabled(value.imgProps.isSmartArtInternal); if (me.api) { - mnuUnGroup.setDisabled(islocked || !me.api.CanUnGroup()); - mnuGroup.setDisabled(islocked || !me.api.CanGroup()); - menuWrapPolygon.setDisabled(islocked || !me.api.CanChangeWrapPolygon()); + me.mnuUnGroup.setDisabled(islocked || !me.api.CanUnGroup()); + me.mnuGroup.setDisabled(islocked || !me.api.CanGroup()); + me.menuWrapPolygon.setDisabled(islocked || !me.api.CanChangeWrapPolygon()); } - me.menuImageWrap.setDisabled(islocked || value.imgProps.value.get_FromGroup() || (notflow && menuWrapPolygon.isDisabled()) || + me.menuImageWrap.setDisabled(islocked || value.imgProps.value.get_FromGroup() || (notflow && me.menuWrapPolygon.isDisabled()) || (!!control_props && control_props.get_SpecificType()==Asc.c_oAscContentControlSpecificType.Picture && !control_props.get_FormPr())); var cancopy = me.api && me.api.can_CopyCut(); - menuImgCopy.setDisabled(!cancopy); - menuImgCut.setDisabled(islocked || !cancopy); - menuImgPaste.setDisabled(islocked); - menuImgPrint.setVisible(me.mode.canPrint); - menuImgPrint.setDisabled(!cancopy); + me.menuImgCopy.setDisabled(!cancopy); + me.menuImgCut.setDisabled(islocked || !cancopy); + me.menuImgPaste.setDisabled(islocked); + me.menuImgPrint.setVisible(me.mode.canPrint); + me.menuImgPrint.setDisabled(!cancopy); var lockreview = Common.Utils.InternalSettings.get("de-accept-reject-lock"); - menuImgAccept.setVisible(!lockreview); - menuImgReject.setVisible(!lockreview); + me.menuImgAccept.setVisible(!lockreview); + me.menuImgReject.setVisible(!lockreview); menuImgReviewSeparator.setVisible(!lockreview); var signGuid = (value.imgProps && value.imgProps.value && me.mode.isSignatureSupport) ? value.imgProps.value.asc_getSignatureId() : undefined, isInSign = !!signGuid; - menuSignatureEditSign.setVisible(isInSign); - menuSignatureEditSetup.setVisible(isInSign); + me.menuSignatureEditSign.setVisible(isInSign); + me.menuSignatureEditSetup.setVisible(isInSign); menuEditSignSeparator.setVisible(isInSign); if (isInSign) { - menuSignatureEditSign.cmpEl.attr('data-value', signGuid); // sign - menuSignatureEditSetup.cmpEl.attr('data-value', signGuid); // edit signature settings + me.menuSignatureEditSign.cmpEl.attr('data-value', signGuid); // sign + me.menuSignatureEditSetup.cmpEl.attr('data-value', signGuid); // edit signature settings } var canEditPoints = me.api && me.api.asc_canEditGeometry(); - menuImgEditPoints.setVisible(canEditPoints); + me.menuImgEditPoints.setVisible(canEditPoints); menuImgEditPointsSeparator.setVisible(canEditPoints); - canEditPoints && menuImgEditPoints.setDisabled(islocked); + canEditPoints && me.menuImgEditPoints.setDisabled(islocked); }, items: [ - menuImgCut, - menuImgCopy, - menuImgPaste, - menuImgPrint, + me.menuImgCut, + me.menuImgCopy, + me.menuImgPaste, + me.menuImgPrint, { caption: '--' }, - menuImgAccept, - menuImgReject, + me.menuImgAccept, + me.menuImgReject, menuImgReviewSeparator, - menuSignatureEditSign, - menuSignatureEditSetup, + me.menuSignatureEditSign, + me.menuSignatureEditSetup, menuEditSignSeparator, - menuImgRemoveControl, - menuImgControlSettings, + me.menuImgRemoveControl, + me.menuImgControlSettings, menuImgControlSeparator, - menuImgEditPoints, + me.menuImgEditPoints, menuImgEditPointsSeparator, - menuImageArrange, - menuImageAlign, + me.menuImageArrange, + me.menuImageAlign, me.menuImageWrap, - menuImgRotate, + me.menuImgRotate, { caption: '--' }, - menuInsertCaption, + me.menuInsertCaption, menuInsertCaptionSeparator, me.menuImgCrop, me.menuOriginalSize, - menuImgReplace, - menuChartEdit, + me.menuImgReplace, + me.menuChartEdit, menuChartEditSeparator, - menuImageAdvanced + me.menuImageAdvanced ] }).on('hide:after', function(menu, e, isFromInputControl) { if (!isFromInputControl) me.fireEvent('editcomplete', me); @@ -2888,46 +790,20 @@ define([ /* table menu*/ - var menuTableInsertCaption = new Common.UI.MenuItem({ + me.menuTableInsertCaption = new Common.UI.MenuItem({ caption : me.txtInsertCaption - }).on('click', _.bind(me.onInsertCaption, me)); + }); - var mnuTableMerge = new Common.UI.MenuItem({ + me.mnuTableMerge = new Common.UI.MenuItem({ iconCls: 'menu__icon btn-merge-cells', caption : me.mergeCellsText - }).on('click', function(item) { - if (me.api) - me.api.MergeCells(); }); - var mnuTableSplit = new Common.UI.MenuItem({ + me.mnuTableSplit = new Common.UI.MenuItem({ caption : me.splitCellsText - }).on('click', function(item) { - if (me.api){ - (new Common.Views.InsertTableDialog({ - split: true, - handler: function(result, value) { - if (result == 'ok') { - if (me.api) { - me.api.SplitCell(value.columns, value.rows); - } - Common.component.Analytics.trackEvent('DocumentHolder', 'Table'); - } - me.fireEvent('editcomplete', me); - } - })).show(); - } }); - var tableCellsVAlign = function(item, e) { - if (me.api) { - var properties = new Asc.CTableProp(); - properties.put_CellsVAlign(item.options.valign); - me.api.tblApply(properties); - } - }; - - var menuTableCellAlign = new Common.UI.MenuItem({ + me.menuTableCellAlign = new Common.UI.MenuItem({ iconCls: 'menu__icon btn-align-top', caption : me.cellAlignText, menu : new Common.UI.Menu({ @@ -2942,7 +818,7 @@ define([ checkable : true, checked : false, valign : Asc.c_oAscVertAlignJc.Top - }).on('click', _.bind(tableCellsVAlign, me)), + }), me.menuTableCellCenter = new Common.UI.MenuItem({ iconCls: 'menu__icon btn-align-middle', caption : me.textShapeAlignMiddle, @@ -2951,7 +827,7 @@ define([ checkable : true, checked : false, valign : Asc.c_oAscVertAlignJc.Center - }).on('click', _.bind(tableCellsVAlign, me)), + }), me.menuTableCellBottom = new Common.UI.MenuItem({ iconCls: 'menu__icon btn-align-bottom', caption : me.textShapeAlignBottom, @@ -2960,34 +836,31 @@ define([ checkable : true, checked : false, valign : Asc.c_oAscVertAlignJc.Bottom - }).on('click', _.bind(tableCellsVAlign, me)) + }) ] }) }); - var menuTableAdvanced = new Common.UI.MenuItem({ + me.menuTableAdvanced = new Common.UI.MenuItem({ iconCls: 'menu__icon btn-menu-table', caption : me.advancedTableText - }).on('click', _.bind(me.advancedTableClick, me)); + }); - var menuParagraphAdvancedInTable = new Common.UI.MenuItem({ + me.menuParagraphAdvancedInTable = new Common.UI.MenuItem({ iconCls: 'menu__icon btn-paragraph', caption : me.advancedParagraphText - }).on('click', _.bind(me.advancedParagraphClick, me)); + }); var menuHyperlinkSeparator = new Common.UI.MenuItem({ caption : '--' }); - var menuEditHyperlinkTable = new Common.UI.MenuItem({ + me.menuEditHyperlinkTable = new Common.UI.MenuItem({ caption : me.editHyperlinkText - }).on('click', _.bind(me.editHyperlink, me)); + }); - var menuRemoveHyperlinkTable = new Common.UI.MenuItem({ + me.menuRemoveHyperlinkTable = new Common.UI.MenuItem({ caption : me.removeHyperlinkText - }).on('click', function(item, e){ - me.api && me.api.remove_Hyperlink(item.hyperProps.value); - me.fireEvent('editcomplete', me); }); var menuHyperlinkTable = new Common.UI.MenuItem({ @@ -2997,28 +870,28 @@ define([ cls: 'shifted-right', menuAlign: 'tl-tr', items : [ - menuEditHyperlinkTable, - menuRemoveHyperlinkTable + me.menuEditHyperlinkTable, + me.menuRemoveHyperlinkTable ] }) }); - var menuTableRemoveForm = new Common.UI.MenuItem({ + me.menuTableRemoveForm = new Common.UI.MenuItem({ iconCls: 'menu__icon cc-remove', caption: me.textRemove, value: 'remove' - }).on('click', _.bind(me.onControlsSelect, me)); + }); - var menuTableRemoveControl = new Common.UI.MenuItem({ + me.menuTableRemoveControl = new Common.UI.MenuItem({ iconCls: 'menu__icon cc-remove', caption: me.textRemoveControl, value: 'remove' - }).on('click', _.bind(me.onControlsSelect, me)); + }); - var menuTableControlSettings = new Common.UI.MenuItem({ + me.menuTableControlSettings = new Common.UI.MenuItem({ caption: me.textSettings, value: 'settings' - }).on('click', _.bind(me.onControlsSelect, me)); + }); var menuTableControl = new Common.UI.MenuItem({ caption: me.textContentControls, @@ -3026,13 +899,13 @@ define([ cls: 'shifted-right', menuAlign: 'tl-tr', items : [ - menuTableRemoveControl, - menuTableControlSettings + me.menuTableRemoveControl, + me.menuTableControlSettings ] }) }); - var menuTableTOC = new Common.UI.MenuItem({ + me.menuTableTOC = new Common.UI.MenuItem({ caption : me.textTOC, menu : new Common.UI.Menu({ cls: 'shifted-right', @@ -3053,25 +926,22 @@ define([ ] }) }); - menuTableTOC.menu.on('item:click', function (menu, item, e) { - me.fireEvent((item.value=='settings') ? 'links:contents' : 'links:update', [item.value, true]); - }); /** coauthoring begin **/ - var menuAddCommentTable = new Common.UI.MenuItem({ + me.menuAddCommentTable = new Common.UI.MenuItem({ iconCls: 'menu__icon btn-menu-comments', caption : me.addCommentText - }).on('click', _.bind(me.addComment, me)); + }); /** coauthoring end **/ - var menuAddHyperlinkTable = new Common.UI.MenuItem({ + me.menuAddHyperlinkTable = new Common.UI.MenuItem({ iconCls: 'menu__icon btn-inserthyperlink', caption : me.hyperlinkText - }).on('click', _.bind(me.addHyperlink, me)); + }); - var menuTableFollow = new Common.UI.MenuItem({ + me.menuTableFollow = new Common.UI.MenuItem({ caption: me.textFollow - }).on('click', _.bind(me.onFollowMove, me)); + }); me.menuSpellTable = new Common.UI.MenuItem({ caption : me.loadSpellText, @@ -3109,29 +979,18 @@ define([ }) }); - var menuIgnoreSpellTable = new Common.UI.MenuItem({ - caption : me.ignoreSpellText - }).on('click', function(item) { - if (me.api) { - me.api.asc_ignoreMisspelledWord(me._currentSpellObj, false); - me.fireEvent('editcomplete', me); - } + me.menuIgnoreSpellTable = new Common.UI.MenuItem({ + caption : me.ignoreSpellText, + value: false }); - var menuIgnoreAllSpellTable = new Common.UI.MenuItem({ - caption : me.ignoreAllSpellText - }).on('click', function(menu) { - if (me.api) { - me.api.asc_ignoreMisspelledWord(me._currentSpellObj, true); - me.fireEvent('editcomplete', me); - } + me.menuIgnoreAllSpellTable = new Common.UI.MenuItem({ + caption : me.ignoreAllSpellText, + value: true }); - var menuToDictionaryTable = new Common.UI.MenuItem({ + me.menuToDictionaryTable = new Common.UI.MenuItem({ caption : me.toDictionaryText - }).on('click', function(item, e) { - me.api.asc_spellCheckAddToDictionary(me._currentSpellObj); - me.fireEvent('editcomplete', me); }); var menuIgnoreSpellTableSeparator = new Common.UI.MenuItem({ @@ -3152,82 +1011,68 @@ define([ me.menuSpellTable, me.menuSpellMoreTable, menuIgnoreSpellTableSeparator, - menuIgnoreSpellTable, - menuIgnoreAllSpellTable, - menuToDictionaryTable, + me.menuIgnoreSpellTable, + me.menuIgnoreAllSpellTable, + me.menuToDictionaryTable, { caption: '--' }, me.langTableMenu ] }) }); - var menuTableCopy = new Common.UI.MenuItem({ + me.menuTableCopy = new Common.UI.MenuItem({ iconCls: 'menu__icon btn-copy', caption : me.textCopy, value : 'copy' - }).on('click', _.bind(me.onCutCopyPaste, me)); + }); - var menuTablePaste = new Common.UI.MenuItem({ + me.menuTablePaste = new Common.UI.MenuItem({ iconCls: 'menu__icon btn-paste', caption : me.textPaste, value : 'paste' - }).on('click', _.bind(me.onCutCopyPaste, me)); + }); - var menuTableCut = new Common.UI.MenuItem({ + me.menuTableCut = new Common.UI.MenuItem({ iconCls: 'menu__icon btn-cut', caption : me.textCut, value : 'cut' - }).on('click', _.bind(me.onCutCopyPaste, me)); + }); - var menuTableAccept = new Common.UI.MenuItem({ + me.menuTableAccept = new Common.UI.MenuItem({ caption : me.textAccept, value : 'accept' - }).on('click', _.bind(me.onAcceptRejectChange, me)); + }); - var menuTableReject = new Common.UI.MenuItem({ + me.menuTableReject = new Common.UI.MenuItem({ caption : me.textReject, value : 'reject' - }).on('click', _.bind(me.onAcceptRejectChange, me)); + }); var menuTableReviewSeparator = new Common.UI.MenuItem({ caption : '--' }); - var menuTablePrint = new Common.UI.MenuItem({ + me.menuTablePrint = new Common.UI.MenuItem({ iconCls: 'menu__icon btn-print', caption : me.txtPrintSelection - }).on('click', _.bind(me.onPrintSelection, me)); + }); var menuEquationSeparatorInTable = new Common.UI.MenuItem({ caption : '--' }); - var menuTableDistRows = new Common.UI.MenuItem({ - caption : me.textDistributeRows - }).on('click', _.bind(function(){ - if (me.api) - me.api.asc_DistributeTableCells(false); - me.fireEvent('editcomplete', me); - }, me)); + me.menuTableDistRows = new Common.UI.MenuItem({ + caption : me.textDistributeRows, + value: false + }); - var menuTableDistCols = new Common.UI.MenuItem({ - caption : me.textDistributeCols - }).on('click', _.bind(function(){ - if (me.api) - me.api.asc_DistributeTableCells(true); - me.fireEvent('editcomplete', me); - }, me)); + me.menuTableDistCols = new Common.UI.MenuItem({ + caption : me.textDistributeCols, + value: true + }); - var tableDirection = function(item, e) { - if (me.api) { - var properties = new Asc.CTableProp(); - properties.put_CellsTextDirection(item.options.direction); - me.api.tblApply(properties); - } - }; - - var menuTableDirection = new Common.UI.MenuItem({ + me.menuTableDirection = new Common.UI.MenuItem({ iconCls: 'menu__icon text-orient-hor', caption : me.directionText, menu : new Common.UI.Menu({ @@ -3242,7 +1087,7 @@ define([ checked : false, toggleGroup : 'popuptabledirect', direction : Asc.c_oAscCellTextDirection.LRTB - }).on('click', _.bind(tableDirection, me)), + }), me.menuTableDirect90 = new Common.UI.MenuItem({ caption : me.direct90Text, iconCls : 'menu__icon text-orient-rdown', @@ -3251,7 +1096,7 @@ define([ checked : false, toggleGroup : 'popuptabledirect', direction : Asc.c_oAscCellTextDirection.TBRL - }).on('click', _.bind(tableDirection, me)), + }), me.menuTableDirect270 = new Common.UI.MenuItem({ caption : me.direct270Text, iconCls : 'menu__icon text-orient-rup', @@ -3260,22 +1105,22 @@ define([ checked : false, toggleGroup : 'popuptabledirect', direction : Asc.c_oAscCellTextDirection.BTLR - }).on('click', _.bind(tableDirection, me)) + }) ] }) }); - var menuTableStartNewList = new Common.UI.MenuItem({ + me.menuTableStartNewList = new Common.UI.MenuItem({ caption: me.textStartNewList - }).on('click', _.bind(me.onStartNumbering, me, 1)); + }); - var menuTableStartNumberingFrom = new Common.UI.MenuItem({ + me.menuTableStartNumberingFrom = new Common.UI.MenuItem({ caption: me.textStartNumberingFrom - }).on('click', _.bind(me.onStartNumbering, me, 'advanced')); + }); - var menuTableContinueNumbering = new Common.UI.MenuItem({ + me.menuTableContinueNumbering = new Common.UI.MenuItem({ caption: me.textContinueNumbering - }).on('click', _.bind(me.onContinueNumbering, me)); + }); var menuNumberingTable = new Common.UI.MenuItem({ caption : me.bulletsText, @@ -3283,24 +1128,107 @@ define([ cls: 'shifted-right', menuAlign: 'tl-tr', items : [ - menuTableStartNewList, - menuTableStartNumberingFrom, - menuTableContinueNumbering + me.menuTableStartNewList, + me.menuTableStartNumberingFrom, + me.menuTableContinueNumbering ] }) }); - var menuTableRefreshField = new Common.UI.MenuItem({ + me.menuTableRefreshField = new Common.UI.MenuItem({ caption: me.textRefreshField - }).on('click', function(item, e){ - me.api.asc_UpdateComplexField(item.options.fieldProps); - me.fireEvent('editcomplete', me); }); var menuTableFieldSeparator = new Common.UI.MenuItem({ caption : '--' }); + me.menuTableSelectText = new Common.UI.MenuItem({ + caption : me.selectText, + menu : new Common.UI.Menu({ + cls: 'shifted-right', + menuAlign: 'tl-tr', + style : 'width: 100px', + items : [ + new Common.UI.MenuItem({ + caption: me.rowText, + value: 0 + }), + new Common.UI.MenuItem({ + caption: me.columnText, + value: 1 + }), + new Common.UI.MenuItem({ + caption: me.cellText, + value: 2 + }), + new Common.UI.MenuItem({ + caption: me.tableText, + value: 3 + }) + ] + }) + }); + + me.menuTableInsertText = new Common.UI.MenuItem({ + iconCls: 'menu__icon btn-addcell', + caption : me.insertText, + menu : new Common.UI.Menu({ + cls: 'shifted-right', + menuAlign: 'tl-tr', + items : [ + new Common.UI.MenuItem({ + caption: me.insertColumnLeftText, + value: 0 + }), + new Common.UI.MenuItem({ + caption: me.insertColumnRightText, + value: 1 + }), + new Common.UI.MenuItem({ + caption: me.insertRowAboveText, + value: 2 + }), + new Common.UI.MenuItem({ + caption: me.insertRowBelowText, + value: 3 + }), + new Common.UI.MenuItem({ + caption: me.textSeveral, + value: 4 + }) + ] + }) + }); + + me.menuTableDeleteText = new Common.UI.MenuItem({ + iconCls: 'menu__icon btn-delcell', + caption : me.deleteText, + menu : new Common.UI.Menu({ + cls: 'shifted-right', + menuAlign: 'tl-tr', + style : 'width: 100px', + items : [ + new Common.UI.MenuItem({ + caption: me.rowText, + value: 0 + }), + new Common.UI.MenuItem({ + caption: me.columnText, + value: 1 + }), + new Common.UI.MenuItem({ + caption: me.tableText, + value: 2 + }), + new Common.UI.MenuItem({ + caption: me.textCells, + value: 3 + }) + ] + }) + }); + this.tableMenu = new Common.UI.Menu({ cls: 'shifted-right', restoreHeightAndTop: true, @@ -3328,7 +1256,7 @@ define([ cls = 'menu__icon btn-align-bottom'; break; } - menuTableCellAlign.setIconCls(cls); + me.menuTableCellAlign.setIconCls(cls); me.menuTableCellTop.setChecked(align == Asc.c_oAscVertAlignJc.Top); me.menuTableCellCenter.setChecked(align == Asc.c_oAscVertAlignJc.Center); me.menuTableCellBottom.setChecked(align == Asc.c_oAscVertAlignJc.Bottom); @@ -3346,7 +1274,7 @@ define([ cls = 'menu__icon text-orient-rup'; break; } - menuTableDirection.setIconCls(cls); + me.menuTableDirection.setIconCls(cls); me.menuTableDirectH.setChecked(dir == Asc.c_oAscCellTextDirection.LRTB); me.menuTableDirect90.setChecked(dir == Asc.c_oAscCellTextDirection.TBRL); me.menuTableDirect270.setChecked(dir == Asc.c_oAscCellTextDirection.BTLR); @@ -3356,26 +1284,26 @@ define([ me.tableMenu.items[15].setDisabled(disabled); if (me.api) { - mnuTableMerge.setDisabled(disabled || !me.api.CheckBeforeMergeCells()); - mnuTableSplit.setDisabled(disabled || !me.api.CheckBeforeSplitCells()); + me.mnuTableMerge.setDisabled(disabled || !me.api.CheckBeforeMergeCells()); + me.mnuTableSplit.setDisabled(disabled || !me.api.CheckBeforeSplitCells()); } - menuTableDistRows.setDisabled(disabled); - menuTableDistCols.setDisabled(disabled); - menuTableCellAlign.setDisabled(disabled); - menuTableDirection.setDisabled(disabled); - menuTableAdvanced.setDisabled(disabled); + me.menuTableDistRows.setDisabled(disabled); + me.menuTableDistCols.setDisabled(disabled); + me.menuTableCellAlign.setDisabled(disabled); + me.menuTableDirection.setDisabled(disabled); + me.menuTableAdvanced.setDisabled(disabled); var cancopy = me.api && me.api.can_CopyCut(); - menuTableCopy.setDisabled(!cancopy); - menuTableCut.setDisabled(disabled || !cancopy); - menuTablePaste.setDisabled(disabled); - menuTablePrint.setVisible(me.mode.canPrint); - menuTablePrint.setDisabled(!cancopy); + me.menuTableCopy.setDisabled(!cancopy); + me.menuTableCut.setDisabled(disabled || !cancopy); + me.menuTablePaste.setDisabled(disabled); + me.menuTablePrint.setVisible(me.mode.canPrint); + me.menuTablePrint.setDisabled(!cancopy); var lockreview = Common.Utils.InternalSettings.get("de-accept-reject-lock"); - menuTableAccept.setVisible(!lockreview); - menuTableReject.setVisible(!lockreview); + me.menuTableAccept.setVisible(!lockreview); + me.menuTableReject.setVisible(!lockreview); menuTableReviewSeparator.setVisible(!lockreview); // bullets & numbering @@ -3386,12 +1314,12 @@ define([ var numLvl = me.api.asc_GetNumberingPr(listId).get_Lvl(me.api.asc_GetCurrentNumberingLvl()), format = numLvl.get_Format(), start = me.api.asc_GetCalculatedNumberingValue(); - menuTableStartNewList.setVisible(numLvl.get_Start()!=start); - menuTableStartNewList.value = {start: numLvl.get_Start()}; - menuTableStartNumberingFrom.setVisible(format != Asc.c_oAscNumberingFormat.Bullet); - menuTableStartNumberingFrom.value = {format: format, start: start}; - menuTableStartNewList.setCaption((format == Asc.c_oAscNumberingFormat.Bullet) ? me.textSeparateList : me.textStartNewList); - menuTableContinueNumbering.setCaption((format == Asc.c_oAscNumberingFormat.Bullet) ? me.textJoinList : me.textContinueNumbering); + me.menuTableStartNewList.setVisible(numLvl.get_Start()!=start); + me.menuTableStartNewList.value = {start: numLvl.get_Start()}; + me.menuTableStartNumberingFrom.setVisible(format != Asc.c_oAscNumberingFormat.Bullet); + me.menuTableStartNumberingFrom.value = {format: format, start: start}; + me.menuTableStartNewList.setCaption((format == Asc.c_oAscNumberingFormat.Bullet) ? me.textSeparateList : me.textStartNewList); + me.menuTableContinueNumbering.setCaption((format == Asc.c_oAscNumberingFormat.Bullet) ? me.textJoinList : me.textContinueNumbering); } // hyperlink properties @@ -3399,43 +1327,43 @@ define([ if (me.api) { text = me.api.can_AddHyperlink(); } - menuAddHyperlinkTable.setVisible(value.hyperProps===undefined && text!==false); + me.menuAddHyperlinkTable.setVisible(value.hyperProps===undefined && text!==false); menuHyperlinkTable.setVisible(value.hyperProps!==undefined); - menuEditHyperlinkTable.hyperProps = value.hyperProps; - menuRemoveHyperlinkTable.hyperProps = value.hyperProps; + me.menuEditHyperlinkTable.hyperProps = value.hyperProps; + me.menuRemoveHyperlinkTable.hyperProps = value.hyperProps; if (text!==false) { - menuAddHyperlinkTable.hyperProps = {}; - menuAddHyperlinkTable.hyperProps.value = new Asc.CHyperlinkProperty(); - menuAddHyperlinkTable.hyperProps.value.put_Text(text); + me.menuAddHyperlinkTable.hyperProps = {}; + me.menuAddHyperlinkTable.hyperProps.value = new Asc.CHyperlinkProperty(); + me.menuAddHyperlinkTable.hyperProps.value.put_Text(text); } // review move var data = me.api.asc_GetRevisionsChangesStack(), move = false; - menuTableFollow.value = null; + me.menuTableFollow.value = null; _.each(data, function(item) { if ((item.get_Type()==Asc.c_oAscRevisionsChangeType.TextAdd || item.get_Type() == Asc.c_oAscRevisionsChangeType.TextRem) && item.get_MoveType()!=Asc.c_oAscRevisionsMove.NoMove) { - menuTableFollow.value = item; + me.menuTableFollow.value = item; move = true; } }); - menuTableFollow.setVisible(move); + me.menuTableFollow.setVisible(move); - menuHyperlinkSeparator.setVisible(menuAddHyperlinkTable.isVisible() || menuHyperlinkTable.isVisible() || menuNumberingTable.isVisible() || menuTableFollow.isVisible()); + menuHyperlinkSeparator.setVisible(me.menuAddHyperlinkTable.isVisible() || menuHyperlinkTable.isVisible() || menuNumberingTable.isVisible() || me.menuTableFollow.isVisible()); // paragraph properties - menuParagraphAdvancedInTable.setVisible(value.paraProps!==undefined); + me.menuParagraphAdvancedInTable.setVisible(value.paraProps!==undefined); me._currentParaObjDisabled = disabled = value.paraProps.locked || (value.headerProps!==undefined && value.headerProps.locked); - menuAddHyperlinkTable.setDisabled(disabled); + me.menuAddHyperlinkTable.setDisabled(disabled); menuHyperlinkTable.setDisabled(disabled || value.hyperProps!==undefined && value.hyperProps.isSeveralLinks===true); - menuParagraphAdvancedInTable.setDisabled(disabled); + me.menuParagraphAdvancedInTable.setDisabled(disabled); me.menuSpellCheckTable.setVisible(value.spellProps!==undefined && value.spellProps.value.get_Checked()===false); - menuToDictionaryTable.setVisible(me.mode.isDesktopApp); + me.menuToDictionaryTable.setVisible(me.mode.isDesktopApp); menuSpellcheckTableSeparator.setVisible(value.spellProps!==undefined && value.spellProps.value.get_Checked()===false); me.langTableMenu.setDisabled(disabled); @@ -3468,185 +1396,81 @@ define([ var control_props = me.api.asc_GetContentControlProperties(), lock_type = (control_props) ? control_props.get_Lock() : Asc.c_oAscSdtLockType.Unlocked, is_form = control_props && control_props.get_FormPr(); - menuTableRemoveForm.setVisible(is_form); + me.menuTableRemoveForm.setVisible(is_form); menuTableControl.setVisible(!is_form); if (is_form) { - menuTableRemoveForm.setDisabled(lock_type==Asc.c_oAscSdtLockType.SdtContentLocked || lock_type==Asc.c_oAscSdtLockType.SdtLocked); - menuTableRemoveForm.setCaption(me.getControlLabel(control_props)); + me.menuTableRemoveForm.setDisabled(lock_type==Asc.c_oAscSdtLockType.SdtContentLocked || lock_type==Asc.c_oAscSdtLockType.SdtLocked); + me.menuTableRemoveForm.setCaption(me.getControlLabel(control_props)); } else { - menuTableRemoveControl.setDisabled(lock_type==Asc.c_oAscSdtLockType.SdtContentLocked || lock_type==Asc.c_oAscSdtLockType.SdtLocked); - menuTableControlSettings.setVisible(me.mode.canEditContentControl); + me.menuTableRemoveControl.setDisabled(lock_type==Asc.c_oAscSdtLockType.SdtContentLocked || lock_type==Asc.c_oAscSdtLockType.SdtLocked); + me.menuTableControlSettings.setVisible(me.mode.canEditContentControl); } var spectype = control_props ? control_props.get_SpecificType() : Asc.c_oAscContentControlSpecificType.None; control_lock = control_lock || spectype==Asc.c_oAscContentControlSpecificType.CheckBox || spectype==Asc.c_oAscContentControlSpecificType.Picture || spectype==Asc.c_oAscContentControlSpecificType.ComboBox || spectype==Asc.c_oAscContentControlSpecificType.DropDownList || spectype==Asc.c_oAscContentControlSpecificType.DateTime; } else { menuTableControl.setVisible(in_control); - menuTableRemoveForm.setVisible(in_control); + me.menuTableRemoveForm.setVisible(in_control); } - menuTableTOC.setVisible(in_toc); + me.menuTableTOC.setVisible(in_toc); /** coauthoring begin **/ // comments - menuAddCommentTable.setVisible(me.api.can_AddQuotedComment()!==false && me.mode.canCoAuthoring && me.mode.canComments && !control_lock); - menuAddCommentTable.setDisabled(value.paraProps!==undefined && value.paraProps.locked===true); + me.menuAddCommentTable.setVisible(me.api.can_AddQuotedComment()!==false && me.mode.canCoAuthoring && me.mode.canComments && !control_lock); + me.menuAddCommentTable.setDisabled(value.paraProps!==undefined && value.paraProps.locked===true); /** coauthoring end **/ var in_field = me.api.asc_GetCurrentComplexField(); - menuTableRefreshField.setVisible(!!in_field); - menuTableRefreshField.setDisabled(disabled); + me.menuTableRefreshField.setVisible(!!in_field); + me.menuTableRefreshField.setDisabled(disabled); menuTableFieldSeparator.setVisible(!!in_field); if (in_field) { - menuTableRefreshField.options.fieldProps = in_field; + me.menuTableRefreshField.options.fieldProps = in_field; } }, items: [ me.menuSpellCheckTable, menuSpellcheckTableSeparator, - menuTableCut, - menuTableCopy, - menuTablePaste, - menuTablePrint, + me.menuTableCut, + me.menuTableCopy, + me.menuTablePaste, + me.menuTablePrint, { caption: '--' }, - menuTableAccept, - menuTableReject, + me.menuTableAccept, + me.menuTableReject, menuTableReviewSeparator, menuEquationSeparatorInTable, - menuTableRefreshField, + me.menuTableRefreshField, menuTableFieldSeparator, - { - caption : me.selectText, - menu : new Common.UI.Menu({ - cls: 'shifted-right', - menuAlign: 'tl-tr', - style : 'width: 100px', - items : [ - new Common.UI.MenuItem({ - caption: me.rowText - }).on('click', function(item) { - if (me.api) - me.api.selectRow(); - }), - new Common.UI.MenuItem({ - caption: me.columnText - }).on('click', function(item) { - if (me.api) - me.api.selectColumn(); - }), - new Common.UI.MenuItem({ - caption: me.cellText - }).on('click', function(item) { - if (me.api) - me.api.selectCell(); - }), - new Common.UI.MenuItem({ - caption: me.tableText - }).on('click', function(item) { - if (me.api) - me.api.selectTable(); - }) - ] - }) - }, - { - iconCls: 'menu__icon btn-addcell', - caption : me.insertText, - menu : new Common.UI.Menu({ - cls: 'shifted-right', - menuAlign: 'tl-tr', - items : [ - new Common.UI.MenuItem({ - caption: me.insertColumnLeftText - }).on('click', function(item) { - if (me.api) - me.api.addColumnLeft(); - }), - new Common.UI.MenuItem({ - caption: me.insertColumnRightText - }).on('click', function(item) { - if (me.api) - me.api.addColumnRight(); - }), - new Common.UI.MenuItem({ - caption: me.insertRowAboveText - }).on('click', function(item) { - if (me.api) - me.api.addRowAbove(); - }), - new Common.UI.MenuItem({ - caption: me.insertRowBelowText - }).on('click', function(item) { - if (me.api) - me.api.addRowBelow(); - }), - new Common.UI.MenuItem({ - caption: me.textSeveral - }).on('click', function(item) { - me.onCellsAdd(); - }) - ] - }) - }, - { - iconCls: 'menu__icon btn-delcell', - caption : me.deleteText, - menu : new Common.UI.Menu({ - cls: 'shifted-right', - menuAlign: 'tl-tr', - style : 'width: 100px', - items : [ - new Common.UI.MenuItem({ - caption: me.rowText - }).on('click', function(item) { - if (me.api) - me.api.remRow(); - }), - new Common.UI.MenuItem({ - caption: me.columnText - }).on('click', function(item) { - if (me.api) - me.api.remColumn(); - }), - new Common.UI.MenuItem({ - caption: me.tableText - }).on('click', function(item) { - if (me.api) - me.api.remTable(); - }), - new Common.UI.MenuItem({ - caption: me.textCells - }).on('click', function(item) { - me.onCellsRemove(); - }) - ] - }) - }, + me.menuTableSelectText, + me.menuTableInsertText, + me.menuTableDeleteText, { caption: '--' }, - mnuTableMerge, - mnuTableSplit, + me.mnuTableMerge, + me.mnuTableSplit, { caption: '--' }, - menuTableDistRows, - menuTableDistCols, + me.menuTableDistRows, + me.menuTableDistCols, { caption: '--' }, - menuTableCellAlign, - menuTableDirection, + me.menuTableCellAlign, + me.menuTableDirection, { caption: '--' }, - menuTableInsertCaption, + me.menuTableInsertCaption, { caption: '--' }, - menuTableAdvanced, + me.menuTableAdvanced, { caption: '--' }, /** coauthoring begin **/ - menuAddCommentTable, + me.menuAddCommentTable, /** coauthoring end **/ menuNumberingTable, - menuAddHyperlinkTable, + me.menuAddHyperlinkTable, menuHyperlinkTable, - menuTableFollow, + me.menuTableFollow, menuHyperlinkSeparator, - menuTableRemoveForm, + me.menuTableRemoveForm, menuTableControl, - menuTableTOC, - menuParagraphAdvancedInTable + me.menuTableTOC, + me.menuParagraphAdvancedInTable ] }).on('hide:after', function(menu, e, isFromInputControl) { if (me.suppressEditComplete) { @@ -3660,29 +1484,17 @@ define([ /* text menu */ - var menuParagraphBreakBefore = new Common.UI.MenuItem({ + me.menuParagraphBreakBefore = new Common.UI.MenuItem({ caption : me.breakBeforeText, checkable : true - }).on('click', function(item, e) { - me.api.put_PageBreak(item.checked); }); - var menuParagraphKeepLines = new Common.UI.MenuItem({ + me.menuParagraphKeepLines = new Common.UI.MenuItem({ caption : me.keepLinesText, checkable : true - }).on('click', function(item, e) { - me.api.put_KeepLines(item.checked); }); - var paragraphVAlign = function(item, e) { - if (me.api) { - var properties = new Asc.asc_CImgProperty(); - properties.put_VerticalTextAlign(item.options.valign); - me.api.ImgApply(properties); - } - }; - - var menuParagraphVAlign = new Common.UI.MenuItem({ + me.menuParagraphVAlign = new Common.UI.MenuItem({ iconCls: 'menu__icon btn-align-top', caption : me.vertAlignText, menu : new Common.UI.Menu({ @@ -3697,7 +1509,7 @@ define([ checked : false, toggleGroup : 'popupparagraphvalign', valign : Asc.c_oAscVAlign.Top - }).on('click', _.bind(paragraphVAlign, me)), + }), me.menuParagraphCenter = new Common.UI.MenuItem({ iconCls: 'menu__icon btn-align-middle', caption : me.textShapeAlignMiddle, @@ -3706,7 +1518,7 @@ define([ checked : false, toggleGroup : 'popupparagraphvalign', valign : Asc.c_oAscVAlign.Center - }).on('click', _.bind(paragraphVAlign, me)), + }), me.menuParagraphBottom = new Common.UI.MenuItem({ iconCls: 'menu__icon btn-align-bottom', caption : me.textShapeAlignBottom, @@ -3715,20 +1527,12 @@ define([ checked : false, toggleGroup : 'popupparagraphvalign', valign : Asc.c_oAscVAlign.Bottom - }).on('click', _.bind(paragraphVAlign, me)) + }) ] }) }); - var paragraphDirection = function(item, e) { - if (me.api) { - var properties = new Asc.asc_CImgProperty(); - properties.put_Vert(item.options.direction); - me.api.ImgApply(properties); - } - }; - - var menuParagraphDirection = new Common.UI.MenuItem({ + me.menuParagraphDirection = new Common.UI.MenuItem({ iconCls: 'menu__icon text-orient-hor', caption : me.directionText, menu : new Common.UI.Menu({ @@ -3743,7 +1547,7 @@ define([ checked : false, toggleGroup : 'popupparagraphdirect', direction : Asc.c_oAscVertDrawingText.normal - }).on('click', _.bind(paragraphDirection, me)), + }), me.menuParagraphDirect90 = new Common.UI.MenuItem({ caption : me.direct90Text, iconCls : 'menu__icon text-orient-rdown', @@ -3752,7 +1556,7 @@ define([ checked : false, toggleGroup : 'popupparagraphdirect', direction : Asc.c_oAscVertDrawingText.vert - }).on('click', _.bind(paragraphDirection, me)), + }), me.menuParagraphDirect270 = new Common.UI.MenuItem({ caption : me.direct270Text, iconCls : 'menu__icon text-orient-rup', @@ -3761,54 +1565,51 @@ define([ checked : false, toggleGroup : 'popupparagraphdirect', direction : Asc.c_oAscVertDrawingText.vert270 - }).on('click', _.bind(paragraphDirection, me)) + }) ] }) }); - var menuParagraphAdvanced = new Common.UI.MenuItem({ + me.menuParagraphAdvanced = new Common.UI.MenuItem({ iconCls: 'menu__icon btn-paragraph', caption : me.advancedParagraphText - }).on('click', _.bind(me.advancedParagraphClick, me)); + }); - var menuFrameAdvanced = new Common.UI.MenuItem({ + me.menuFrameAdvanced = new Common.UI.MenuItem({ caption : me.advancedFrameText - }).on('click', _.bind(me.advancedFrameClick, me, true)); + }); - var menuDropCapAdvanced = new Common.UI.MenuItem({ + me.menuDropCapAdvanced = new Common.UI.MenuItem({ iconCls: 'menu__icon dropcap-intext', caption : me.advancedDropCapText - }).on('click', _.bind(me.advancedFrameClick, me, false)); + }); /** coauthoring begin **/ var menuCommentSeparatorPara = new Common.UI.MenuItem({ caption : '--' }); - var menuAddCommentPara = new Common.UI.MenuItem({ + me.menuAddCommentPara = new Common.UI.MenuItem({ iconCls: 'menu__icon btn-menu-comments', caption : me.addCommentText - }).on('click', _.bind(me.addComment, me)); + }); /** coauthoring end **/ var menuHyperlinkParaSeparator = new Common.UI.MenuItem({ caption : '--' }); - var menuAddHyperlinkPara = new Common.UI.MenuItem({ + me.menuAddHyperlinkPara = new Common.UI.MenuItem({ iconCls: 'menu__icon btn-inserthyperlink', caption : me.hyperlinkText - }).on('click', _.bind(me.addHyperlink, me)); + }); - var menuEditHyperlinkPara = new Common.UI.MenuItem({ + me.menuEditHyperlinkPara = new Common.UI.MenuItem({ caption : me.editHyperlinkText - }).on('click', _.bind(me.editHyperlink, me)); + }); - var menuRemoveHyperlinkPara = new Common.UI.MenuItem({ + me.menuRemoveHyperlinkPara = new Common.UI.MenuItem({ caption : me.removeHyperlinkText - }).on('click', function(item, e) { - me.api.remove_Hyperlink(item.hyperProps.value); - me.fireEvent('editcomplete', me); }); var menuHyperlinkPara = new Common.UI.MenuItem({ @@ -3818,8 +1619,8 @@ define([ cls: 'shifted-right', menuAlign: 'tl-tr', items : [ - menuEditHyperlinkPara, - menuRemoveHyperlinkPara + me.menuEditHyperlinkPara, + me.menuRemoveHyperlinkPara ] }) }); @@ -3833,10 +1634,10 @@ define([ items: [ me.menuStyleSave = new Common.UI.MenuItem({ caption: me.saveStyleText - }).on('click', _.bind(me.onMenuSaveStyle, me)), + }), me.menuStyleUpdate = new Common.UI.MenuItem({ caption: me.updateStyleText.replace('%1', window.currentStyleName) - }).on('click', _.bind(me.onMenuUpdateStyle, me)) + }) ] }) }); @@ -3869,25 +1670,18 @@ define([ }) }); - var menuIgnoreSpellPara = new Common.UI.MenuItem({ - caption : me.ignoreSpellText - }).on('click', function(item, e) { - me.api.asc_ignoreMisspelledWord(me._currentSpellObj, false); - me.fireEvent('editcomplete', me); + me.menuIgnoreSpellPara = new Common.UI.MenuItem({ + caption : me.ignoreSpellText, + value: false }); - var menuIgnoreAllSpellPara = new Common.UI.MenuItem({ - caption : me.ignoreAllSpellText - }).on('click', function(item, e) { - me.api.asc_ignoreMisspelledWord(me._currentSpellObj, true); - me.fireEvent('editcomplete', me); + me.menuIgnoreAllSpellPara = new Common.UI.MenuItem({ + caption : me.ignoreAllSpellText, + value: true }); - var menuToDictionaryPara = new Common.UI.MenuItem({ + me.menuToDictionaryPara = new Common.UI.MenuItem({ caption : me.toDictionaryText - }).on('click', function(item, e) { - me.api.asc_spellCheckAddToDictionary(me._currentSpellObj); - me.fireEvent('editcomplete', me); }); var menuIgnoreSpellParaSeparator = new Common.UI.MenuItem({ @@ -3898,71 +1692,69 @@ define([ caption : '--' }); - var menuParaCopy = new Common.UI.MenuItem({ + me.menuParaCopy = new Common.UI.MenuItem({ iconCls: 'menu__icon btn-copy', caption : me.textCopy, value : 'copy' - }).on('click', _.bind(me.onCutCopyPaste, me)); + }); - var menuParaPaste = new Common.UI.MenuItem({ + me.menuParaPaste = new Common.UI.MenuItem({ iconCls: 'menu__icon btn-paste', caption : me.textPaste, value : 'paste' - }).on('click', _.bind(me.onCutCopyPaste, me)); + }); - var menuParaCut = new Common.UI.MenuItem({ + me.menuParaCut = new Common.UI.MenuItem({ iconCls: 'menu__icon btn-cut', caption : me.textCut, value : 'cut' - }).on('click', _.bind(me.onCutCopyPaste, me)); + }); - var menuParaAccept = new Common.UI.MenuItem({ + me.menuParaAccept = new Common.UI.MenuItem({ caption : me.textAccept, value : 'accept' - }).on('click', _.bind(me.onAcceptRejectChange, me)); + }); - var menuParaReject = new Common.UI.MenuItem({ + me.menuParaReject = new Common.UI.MenuItem({ caption : me.textReject, value : 'reject' - }).on('click', _.bind(me.onAcceptRejectChange, me)); + }); var menuParaReviewSeparator = new Common.UI.MenuItem({ caption : '--' }); - var menuParaPrint = new Common.UI.MenuItem({ + me.menuParaPrint = new Common.UI.MenuItem({ iconCls: 'menu__icon btn-print', caption : me.txtPrintSelection - }).on('click', _.bind(me.onPrintSelection, me)); + }); var menuEquationSeparator = new Common.UI.MenuItem({ caption : '--' }); - var menuParaRemoveControl = new Common.UI.MenuItem({ + me.menuParaRemoveControl = new Common.UI.MenuItem({ iconCls: 'menu__icon cc-remove', caption: me.textRemoveControl, value: 'remove' - }).on('click', _.bind(me.onControlsSelect, me)); + }); - var menuParaControlSettings = new Common.UI.MenuItem( + me.menuParaControlSettings = new Common.UI.MenuItem( { caption: me.textEditControls, value: 'settings' - }).on('click', _.bind(me.onControlsSelect, me)); + }); var menuParaControlSeparator = new Common.UI.MenuItem({ caption : '--' }); - var menuParaTOCSettings = new Common.UI.MenuItem({ + me.menuParaTOCSettings = new Common.UI.MenuItem({ caption: me.textTOCSettings, value: 'settings' - }).on('click', function (item, e) { - me.fireEvent('links:contents', [item.value, true]); }); - var menuParaTOCRefresh = new Common.UI.MenuItem({ + me.menuParaTOCRefresh = new Common.UI.MenuItem({ caption : me.textUpdateTOC, menu : new Common.UI.Menu({ cls: 'shifted-right', @@ -3979,44 +1771,38 @@ define([ ] }) }); - menuParaTOCRefresh.menu.on('item:click', function (menu, item, e) { - me.fireEvent('links:update', [item.value, true]); - }); var menuParaTOCSeparator = new Common.UI.MenuItem({ caption : '--' }); - var menuParaRefreshField = new Common.UI.MenuItem({ + me.menuParaRefreshField = new Common.UI.MenuItem({ caption: me.textRefreshField - }).on('click', function(item, e){ - me.api.asc_UpdateComplexField(item.options.fieldProps); - me.fireEvent('editcomplete', me); }); var menuParaFieldSeparator = new Common.UI.MenuItem({ caption : '--' }); - var menuParaStartNewList = new Common.UI.MenuItem({ + me.menuParaStartNewList = new Common.UI.MenuItem({ caption: me.textStartNewList - }).on('click', _.bind(me.onStartNumbering, me, 1)); + }); - var menuParaStartNumberingFrom = new Common.UI.MenuItem({ + me.menuParaStartNumberingFrom = new Common.UI.MenuItem({ caption: me.textStartNumberingFrom - }).on('click', _.bind(me.onStartNumbering, me, 'advanced')); + }); - var menuParaContinueNumbering = new Common.UI.MenuItem({ + me.menuParaContinueNumbering = new Common.UI.MenuItem({ caption: me.textContinueNumbering - }).on('click', _.bind(me.onContinueNumbering, me)); + }); var menuParaNumberingSeparator = new Common.UI.MenuItem({ caption : '--' }); - var menuParaFollow = new Common.UI.MenuItem({ + me.menuParaFollow = new Common.UI.MenuItem({ caption: me.textFollow - }).on('click', _.bind(me.onFollowMove, me)); + }); var menuParaFollowSeparator = new Common.UI.MenuItem({ caption : '--' @@ -4034,8 +1820,8 @@ define([ control_props = in_control ? me.api.asc_GetContentControlProperties() : null, is_form = control_props && control_props.get_FormPr(); - menuParagraphVAlign.setVisible(isInShape && !isInChart && !isEquation && !(is_form && control_props.get_FormPr().get_Fixed())); // после того, как заголовок можно будет растягивать по вертикали, вернуть "|| isInChart" !! - menuParagraphDirection.setVisible(isInShape && !isInChart && !isEquation && !(is_form && control_props.get_FormPr().get_Fixed())); // после того, как заголовок можно будет растягивать по вертикали, вернуть "|| isInChart" !! + me.menuParagraphVAlign.setVisible(isInShape && !isInChart && !isEquation && !(is_form && control_props.get_FormPr().get_Fixed())); // после того, как заголовок можно будет растягивать по вертикали, вернуть "|| isInChart" !! + me.menuParagraphDirection.setVisible(isInShape && !isInChart && !isEquation && !(is_form && control_props.get_FormPr().get_Fixed())); // после того, как заголовок можно будет растягивать по вертикали, вернуть "|| isInChart" !! if ( isInShape || isInChart ) { var align = value.imgProps.value.get_VerticalTextAlign(); var cls = ''; @@ -4050,7 +1836,7 @@ define([ cls = 'menu__icon btn-align-bottom'; break; } - menuParagraphVAlign.setIconCls(cls); + me.menuParagraphVAlign.setIconCls(cls); me.menuParagraphTop.setChecked(align == Asc.c_oAscVAlign.Top); me.menuParagraphCenter.setChecked(align == Asc.c_oAscVAlign.Center); me.menuParagraphBottom.setChecked(align == Asc.c_oAscVAlign.Bottom); @@ -4068,80 +1854,80 @@ define([ cls = 'menu__icon text-orient-rup'; break; } - menuParagraphDirection.setIconCls(cls); + me.menuParagraphDirection.setIconCls(cls); me.menuParagraphDirectH.setChecked(dir == Asc.c_oAscVertDrawingText.normal); me.menuParagraphDirect90.setChecked(dir == Asc.c_oAscVertDrawingText.vert); me.menuParagraphDirect270.setChecked(dir == Asc.c_oAscVertDrawingText.vert270); } - menuParagraphAdvanced.isChart = (value.imgProps && value.imgProps.isChart); - menuParagraphAdvanced.isSmartArtInternal = (value.imgProps && value.imgProps.isSmartArtInternal); - menuParagraphBreakBefore.setVisible(!isInShape && !isInChart && !isEquation); - menuParagraphKeepLines.setVisible(!isInShape && !isInChart && !isEquation); + me.menuParagraphAdvanced.isChart = (value.imgProps && value.imgProps.isChart); + me.menuParagraphAdvanced.isSmartArtInternal = (value.imgProps && value.imgProps.isSmartArtInternal); + me.menuParagraphBreakBefore.setVisible(!isInShape && !isInChart && !isEquation); + me.menuParagraphKeepLines.setVisible(!isInShape && !isInChart && !isEquation); if (value.paraProps) { - menuParagraphBreakBefore.setChecked(value.paraProps.value.get_PageBreakBefore()); - menuParagraphKeepLines.setChecked(value.paraProps.value.get_KeepLines()); + me.menuParagraphBreakBefore.setChecked(value.paraProps.value.get_PageBreakBefore()); + me.menuParagraphKeepLines.setChecked(value.paraProps.value.get_KeepLines()); } var text = null; if (me.api) { text = me.api.can_AddHyperlink(); } - menuAddHyperlinkPara.setVisible(value.hyperProps===undefined && text!==false); + me.menuAddHyperlinkPara.setVisible(value.hyperProps===undefined && text!==false); menuHyperlinkPara.setVisible(value.hyperProps!==undefined); - menuHyperlinkParaSeparator.setVisible(menuAddHyperlinkPara.isVisible() || menuHyperlinkPara.isVisible()); - menuEditHyperlinkPara.hyperProps = value.hyperProps; - menuRemoveHyperlinkPara.hyperProps = value.hyperProps; + menuHyperlinkParaSeparator.setVisible(me.menuAddHyperlinkPara.isVisible() || menuHyperlinkPara.isVisible()); + me.menuEditHyperlinkPara.hyperProps = value.hyperProps; + me.menuRemoveHyperlinkPara.hyperProps = value.hyperProps; if (text!==false) { - menuAddHyperlinkPara.hyperProps = {}; - menuAddHyperlinkPara.hyperProps.value = new Asc.CHyperlinkProperty(); - menuAddHyperlinkPara.hyperProps.value.put_Text(text); + me.menuAddHyperlinkPara.hyperProps = {}; + me.menuAddHyperlinkPara.hyperProps.value = new Asc.CHyperlinkProperty(); + me.menuAddHyperlinkPara.hyperProps.value.put_Text(text); } var disabled = value.paraProps.locked || (value.headerProps!==undefined && value.headerProps.locked); me._currentParaObjDisabled = disabled; - menuAddHyperlinkPara.setDisabled(disabled); + me.menuAddHyperlinkPara.setDisabled(disabled); menuHyperlinkPara.setDisabled(disabled || value.hyperProps!==undefined && value.hyperProps.isSeveralLinks===true); // review move var data = me.api.asc_GetRevisionsChangesStack(), move = false; - menuParaFollow.value = null; + me.menuParaFollow.value = null; _.each(data, function(item) { if ((item.get_Type()==Asc.c_oAscRevisionsChangeType.TextAdd || item.get_Type() == Asc.c_oAscRevisionsChangeType.TextRem) && item.get_MoveType()!=Asc.c_oAscRevisionsMove.NoMove) { - menuParaFollow.value = item; + me.menuParaFollow.value = item; move = true; } }); - menuParaFollow.setVisible(move); + me.menuParaFollow.setVisible(move); menuParaFollowSeparator.setVisible(move); - menuParagraphBreakBefore.setDisabled(disabled || !_.isUndefined(value.headerProps) || !_.isUndefined(value.imgProps)); - menuParagraphKeepLines.setDisabled(disabled); - menuParagraphAdvanced.setDisabled(disabled); - menuFrameAdvanced.setDisabled(disabled); - menuDropCapAdvanced.setDisabled(disabled); - menuParagraphVAlign.setDisabled(disabled); - menuParagraphDirection.setDisabled(disabled); + me.menuParagraphBreakBefore.setDisabled(disabled || !_.isUndefined(value.headerProps) || !_.isUndefined(value.imgProps)); + me.menuParagraphKeepLines.setDisabled(disabled); + me.menuParagraphAdvanced.setDisabled(disabled); + me.menuFrameAdvanced.setDisabled(disabled); + me.menuDropCapAdvanced.setDisabled(disabled); + me.menuParagraphVAlign.setDisabled(disabled); + me.menuParagraphDirection.setDisabled(disabled); var cancopy = me.api && me.api.can_CopyCut(); - menuParaCopy.setDisabled(!cancopy); - menuParaCut.setDisabled(disabled || !cancopy); - menuParaPaste.setDisabled(disabled); - menuParaPrint.setVisible(me.mode.canPrint); - menuParaPrint.setDisabled(!cancopy); + me.menuParaCopy.setDisabled(!cancopy); + me.menuParaCut.setDisabled(disabled || !cancopy); + me.menuParaPaste.setDisabled(disabled); + me.menuParaPrint.setVisible(me.mode.canPrint); + me.menuParaPrint.setDisabled(!cancopy); var lockreview = Common.Utils.InternalSettings.get("de-accept-reject-lock"); - menuParaAccept.setVisible(!lockreview); - menuParaReject.setVisible(!lockreview); + me.menuParaAccept.setVisible(!lockreview); + me.menuParaReject.setVisible(!lockreview); menuParaReviewSeparator.setVisible(!lockreview); // spellCheck var spell = (value.spellProps!==undefined && value.spellProps.value.get_Checked()===false); me.menuSpellPara.setVisible(spell); menuSpellcheckParaSeparator.setVisible(spell); - menuIgnoreSpellPara.setVisible(spell); - menuIgnoreAllSpellPara.setVisible(spell); - menuToDictionaryPara.setVisible(spell && me.mode.isDesktopApp); + me.menuIgnoreSpellPara.setVisible(spell); + me.menuIgnoreAllSpellPara.setVisible(spell); + me.menuToDictionaryPara.setVisible(spell && me.mode.isDesktopApp); me.langParaMenu.setVisible(spell); me.langParaMenu.setDisabled(disabled); menuIgnoreSpellParaSeparator.setVisible(spell); @@ -4165,14 +1951,14 @@ define([ } else me.clearEquationMenu(true, 18); menuEquationSeparator.setVisible(isEquation && eqlen>0); - menuEquationInsertCaption.setVisible(isEquation); + me.menuEquationInsertCaption.setVisible(isEquation); menuEquationInsertCaptionSeparator.setVisible(isEquation); var frame_pr = value.paraProps.value.get_FramePr(); - menuFrameAdvanced.setVisible(frame_pr !== undefined); - menuDropCapAdvanced.setVisible(frame_pr !== undefined); + me.menuFrameAdvanced.setVisible(frame_pr !== undefined); + me.menuDropCapAdvanced.setVisible(frame_pr !== undefined); if (frame_pr) - menuDropCapAdvanced.setIconCls(frame_pr.get_DropCap()===Asc.c_oAscDropCap.Drop ? 'menu__icon dropcap-intext' : 'menu__icon dropcap-inmargin'); + me.menuDropCapAdvanced.setIconCls(frame_pr.get_DropCap()===Asc.c_oAscDropCap.Drop ? 'menu__icon dropcap-intext' : 'menu__icon dropcap-inmargin'); var edit_style = me.mode.canEditStyles && !isInChart && !(value.imgProps && value.imgProps.isSmartArtInternal); menuStyleSeparator.setVisible(edit_style); @@ -4184,21 +1970,21 @@ define([ var control_lock = (value.paraProps) ? (!value.paraProps.value.can_DeleteBlockContentControl() || !value.paraProps.value.can_EditBlockContentControl() || !value.paraProps.value.can_DeleteInlineContentControl() || !value.paraProps.value.can_EditInlineContentControl()) : false; - menuParaRemoveControl.setVisible(in_control); - menuParaControlSettings.setVisible(in_control && me.mode.canEditContentControl && !is_form); + me.menuParaRemoveControl.setVisible(in_control); + me.menuParaControlSettings.setVisible(in_control && me.mode.canEditContentControl && !is_form); menuParaControlSeparator.setVisible(in_control); if (in_control) { var lock_type = (control_props) ? control_props.get_Lock() : Asc.c_oAscSdtLockType.Unlocked; - menuParaRemoveControl.setDisabled(lock_type==Asc.c_oAscSdtLockType.SdtContentLocked || lock_type==Asc.c_oAscSdtLockType.SdtLocked); - menuParaRemoveControl.setCaption(is_form ? me.getControlLabel(control_props) : me.textRemoveControl); + me.menuParaRemoveControl.setDisabled(lock_type==Asc.c_oAscSdtLockType.SdtContentLocked || lock_type==Asc.c_oAscSdtLockType.SdtLocked); + me.menuParaRemoveControl.setCaption(is_form ? me.getControlLabel(control_props) : me.textRemoveControl); var spectype = control_props ? control_props.get_SpecificType() : Asc.c_oAscContentControlSpecificType.None; control_lock = control_lock || spectype==Asc.c_oAscContentControlSpecificType.CheckBox || spectype==Asc.c_oAscContentControlSpecificType.Picture || spectype==Asc.c_oAscContentControlSpecificType.ComboBox || spectype==Asc.c_oAscContentControlSpecificType.DropDownList || spectype==Asc.c_oAscContentControlSpecificType.DateTime; } - menuParaTOCSettings.setVisible(in_toc); - menuParaTOCRefresh.setVisible(in_toc); + me.menuParaTOCSettings.setVisible(in_toc); + me.menuParaTOCRefresh.setVisible(in_toc); menuParaTOCSeparator.setVisible(in_toc); /** coauthoring begin **/ @@ -4206,84 +1992,84 @@ define([ if (me.mode.compatibleFeatures) isVisible = isVisible && !isInShape; menuCommentSeparatorPara.setVisible(isVisible); - menuAddCommentPara.setVisible(isVisible); - menuAddCommentPara.setDisabled(value.paraProps && value.paraProps.locked === true); + me.menuAddCommentPara.setVisible(isVisible); + me.menuAddCommentPara.setDisabled(value.paraProps && value.paraProps.locked === true); /** coauthoring end **/ var in_field = me.api.asc_GetCurrentComplexField(); - menuParaRefreshField.setVisible(!!in_field); - menuParaRefreshField.setDisabled(disabled); + me.menuParaRefreshField.setVisible(!!in_field); + me.menuParaRefreshField.setDisabled(disabled); menuParaFieldSeparator.setVisible(!!in_field); if (in_field) { - menuParaRefreshField.options.fieldProps = in_field; + me.menuParaRefreshField.options.fieldProps = in_field; } var listId = me.api.asc_GetCurrentNumberingId(), in_list = (listId !== null); menuParaNumberingSeparator.setVisible(in_list); // hide when first item is selected - menuParaStartNewList.setVisible(in_list); - menuParaStartNumberingFrom.setVisible(in_list); - menuParaContinueNumbering.setVisible(in_list); + me.menuParaStartNewList.setVisible(in_list); + me.menuParaStartNumberingFrom.setVisible(in_list); + me.menuParaContinueNumbering.setVisible(in_list); if (in_list) { var numLvl = me.api.asc_GetNumberingPr(listId).get_Lvl(me.api.asc_GetCurrentNumberingLvl()), format = numLvl.get_Format(), start = me.api.asc_GetCalculatedNumberingValue(); - menuParaStartNewList.setVisible(numLvl.get_Start()!=start); - menuParaStartNewList.value = {start: numLvl.get_Start()}; - menuParaStartNumberingFrom.setVisible(format != Asc.c_oAscNumberingFormat.Bullet); - menuParaStartNumberingFrom.value = {format: format, start: start}; - menuParaStartNewList.setCaption((format == Asc.c_oAscNumberingFormat.Bullet) ? me.textSeparateList : me.textStartNewList); - menuParaContinueNumbering.setCaption((format == Asc.c_oAscNumberingFormat.Bullet) ? me.textJoinList : me.textContinueNumbering); + me.menuParaStartNewList.setVisible(numLvl.get_Start()!=start); + me.menuParaStartNewList.value = {start: numLvl.get_Start()}; + me.menuParaStartNumberingFrom.setVisible(format != Asc.c_oAscNumberingFormat.Bullet); + me.menuParaStartNumberingFrom.value = {format: format, start: start}; + me.menuParaStartNewList.setCaption((format == Asc.c_oAscNumberingFormat.Bullet) ? me.textSeparateList : me.textStartNewList); + me.menuParaContinueNumbering.setCaption((format == Asc.c_oAscNumberingFormat.Bullet) ? me.textJoinList : me.textContinueNumbering); } }, items: [ me.menuSpellPara, me.menuSpellMorePara, menuSpellcheckParaSeparator, - menuIgnoreSpellPara, - menuIgnoreAllSpellPara, - menuToDictionaryPara, + me.menuIgnoreSpellPara, + me.menuIgnoreAllSpellPara, + me.menuToDictionaryPara, me.langParaMenu, menuIgnoreSpellParaSeparator, - menuParaCut, - menuParaCopy, - menuParaPaste, - menuParaPrint, + me.menuParaCut, + me.menuParaCopy, + me.menuParaPaste, + me.menuParaPrint, menuParaReviewSeparator, - menuParaAccept, - menuParaReject, + me.menuParaAccept, + me.menuParaReject, menuEquationInsertCaptionSeparator, - menuEquationInsertCaption, + me.menuEquationInsertCaption, { caption: '--' }, menuEquationSeparator, - menuParaRemoveControl, - menuParaControlSettings, + me.menuParaRemoveControl, + me.menuParaControlSettings, menuParaControlSeparator, - menuParaRefreshField, + me.menuParaRefreshField, menuParaFieldSeparator, - menuParaTOCSettings, - menuParaTOCRefresh, + me.menuParaTOCSettings, + me.menuParaTOCRefresh, menuParaTOCSeparator, - menuParagraphBreakBefore, - menuParagraphKeepLines, - menuParagraphVAlign, - menuParagraphDirection, - menuParagraphAdvanced, - menuFrameAdvanced, - menuDropCapAdvanced, + me.menuParagraphBreakBefore, + me.menuParagraphKeepLines, + me.menuParagraphVAlign, + me.menuParagraphDirection, + me.menuParagraphAdvanced, + me.menuFrameAdvanced, + me.menuDropCapAdvanced, /** coauthoring begin **/ menuCommentSeparatorPara, - menuAddCommentPara, + me.menuAddCommentPara, /** coauthoring end **/ menuHyperlinkParaSeparator, - menuAddHyperlinkPara, + me.menuAddHyperlinkPara, menuHyperlinkPara, menuParaFollowSeparator, - menuParaFollow, + me.menuParaFollow, menuParaNumberingSeparator, - menuParaStartNewList, - menuParaStartNumberingFrom, - menuParaContinueNumbering, + me.menuParaStartNewList, + me.menuParaStartNumberingFrom, + me.menuParaContinueNumbering, menuStyleSeparator, menuStyle ] @@ -4338,6 +2124,667 @@ define([ title : me.textPrevPage + Common.Utils.String.platformKey('Alt+PgUp'), placement : 'top-right' }); + + this.fireEvent('createdelayedelements', [this, 'edit']); + }, + + initEquationMenu: function() { + var me = this; + if (!me._currentMathObj) return; + var type = me._currentMathObj.get_Type(), + value = me._currentMathObj, + mnu, arr = []; + + switch (type) { + case Asc.c_oAscMathInterfaceType.Accent: + mnu = new Common.UI.MenuItem({ + caption : me.txtRemoveAccentChar, + equation : true, + disabled : me._currentParaObjDisabled, + equationProps: {type: type, callback: 'remove_AccentCharacter'} + }); + arr.push(mnu); + break; + case Asc.c_oAscMathInterfaceType.BorderBox: + mnu = new Common.UI.MenuItem({ + caption : me.txtBorderProps, + equation : true, + disabled : me._currentParaObjDisabled, + menu : new Common.UI.Menu({ + cls: 'shifted-right', + menuAlign: 'tl-tr', + items : [ + { + caption: value.get_HideTop() ? me.txtAddTop : me.txtHideTop, + equationProps: {type: type, callback: 'put_HideTop', value: !value.get_HideTop()} + }, + { + caption: value.get_HideBottom() ? me.txtAddBottom : me.txtHideBottom, + equationProps: {type: type, callback: 'put_HideBottom', value: !value.get_HideBottom()} + }, + { + caption: value.get_HideLeft() ? me.txtAddLeft : me.txtHideLeft, + equationProps: {type: type, callback: 'put_HideLeft', value: !value.get_HideLeft()} + }, + { + caption: value.get_HideRight() ? me.txtAddRight : me.txtHideRight, + equationProps: {type: type, callback: 'put_HideRight', value: !value.get_HideRight()} + }, + { + caption: value.get_HideHor() ? me.txtAddHor : me.txtHideHor, + equationProps: {type: type, callback: 'put_HideHor', value: !value.get_HideHor()} + }, + { + caption: value.get_HideVer() ? me.txtAddVer : me.txtHideVer, + equationProps: {type: type, callback: 'put_HideVer', value: !value.get_HideVer()} + }, + { + caption: value.get_HideTopLTR() ? me.txtAddLT : me.txtHideLT, + equationProps: {type: type, callback: 'put_HideTopLTR', value: !value.get_HideTopLTR()} + }, + { + caption: value.get_HideTopRTL() ? me.txtAddLB : me.txtHideLB, + equationProps: {type: type, callback: 'put_HideTopRTL', value: !value.get_HideTopRTL()} + } + ] + }) + }); + arr.push(mnu); + break; + case Asc.c_oAscMathInterfaceType.Bar: + mnu = new Common.UI.MenuItem({ + caption : me.txtRemoveBar, + equation : true, + disabled : me._currentParaObjDisabled, + equationProps: {type: type, callback: 'remove_Bar'} + }); + arr.push(mnu); + mnu = new Common.UI.MenuItem({ + caption : (value.get_Pos()==Asc.c_oAscMathInterfaceBarPos.Top) ? me.txtUnderbar : me.txtOverbar, + equation : true, + disabled : me._currentParaObjDisabled, + equationProps: {type: type, callback: 'put_Pos', value: (value.get_Pos()==Asc.c_oAscMathInterfaceBarPos.Top) ? Asc.c_oAscMathInterfaceBarPos.Bottom : Asc.c_oAscMathInterfaceBarPos.Top} + }); + arr.push(mnu); + break; + case Asc.c_oAscMathInterfaceType.Script: + var scripttype = value.get_ScriptType(); + if (scripttype == Asc.c_oAscMathInterfaceScript.PreSubSup) { + mnu = new Common.UI.MenuItem({ + caption : me.txtScriptsAfter, + equation : true, + disabled : me._currentParaObjDisabled, + equationProps: {type: type, callback: 'put_ScriptType', value: Asc.c_oAscMathInterfaceScript.SubSup} + }); + arr.push(mnu); + mnu = new Common.UI.MenuItem({ + caption : me.txtRemScripts, + equation : true, + disabled : me._currentParaObjDisabled, + equationProps: {type: type, callback: 'put_ScriptType', value: Asc.c_oAscMathInterfaceScript.None} + }); + arr.push(mnu); + } else { + if (scripttype == Asc.c_oAscMathInterfaceScript.SubSup) { + mnu = new Common.UI.MenuItem({ + caption : me.txtScriptsBefore, + equation : true, + disabled : me._currentParaObjDisabled, + equationProps: {type: type, callback: 'put_ScriptType', value: Asc.c_oAscMathInterfaceScript.PreSubSup} + }); + arr.push(mnu); + } + if (scripttype == Asc.c_oAscMathInterfaceScript.SubSup || scripttype == Asc.c_oAscMathInterfaceScript.Sub ) { + mnu = new Common.UI.MenuItem({ + caption : me.txtRemSubscript, + equation : true, + disabled : me._currentParaObjDisabled, + equationProps: {type: type, callback: 'put_ScriptType', value: (scripttype == Asc.c_oAscMathInterfaceScript.SubSup) ? Asc.c_oAscMathInterfaceScript.Sup : Asc.c_oAscMathInterfaceScript.None } + }); + arr.push(mnu); + } + if (scripttype == Asc.c_oAscMathInterfaceScript.SubSup || scripttype == Asc.c_oAscMathInterfaceScript.Sup ) { + mnu = new Common.UI.MenuItem({ + caption : me.txtRemSuperscript, + equation : true, + disabled : me._currentParaObjDisabled, + equationProps: {type: type, callback: 'put_ScriptType', value: (scripttype == Asc.c_oAscMathInterfaceScript.SubSup) ? Asc.c_oAscMathInterfaceScript.Sub : Asc.c_oAscMathInterfaceScript.None } + }); + arr.push(mnu); + } + } + break; + case Asc.c_oAscMathInterfaceType.Fraction: + var fraction = value.get_FractionType(); + if (fraction==Asc.c_oAscMathInterfaceFraction.Skewed || fraction==Asc.c_oAscMathInterfaceFraction.Linear) { + mnu = new Common.UI.MenuItem({ + caption : me.txtFractionStacked, + equation : true, + disabled : me._currentParaObjDisabled, + equationProps: {type: type, callback: 'put_FractionType', value: Asc.c_oAscMathInterfaceFraction.Bar} + }); + arr.push(mnu); + } + if (fraction==Asc.c_oAscMathInterfaceFraction.Bar || fraction==Asc.c_oAscMathInterfaceFraction.Linear) { + mnu = new Common.UI.MenuItem({ + caption : me.txtFractionSkewed, + equation : true, + disabled : me._currentParaObjDisabled, + equationProps: {type: type, callback: 'put_FractionType', value: Asc.c_oAscMathInterfaceFraction.Skewed} + }); + arr.push(mnu); + } + if (fraction==Asc.c_oAscMathInterfaceFraction.Bar || fraction==Asc.c_oAscMathInterfaceFraction.Skewed) { + mnu = new Common.UI.MenuItem({ + caption : me.txtFractionLinear, + equation : true, + disabled : me._currentParaObjDisabled, + equationProps: {type: type, callback: 'put_FractionType', value: Asc.c_oAscMathInterfaceFraction.Linear} + }); + arr.push(mnu); + } + if (fraction==Asc.c_oAscMathInterfaceFraction.Bar || fraction==Asc.c_oAscMathInterfaceFraction.NoBar) { + mnu = new Common.UI.MenuItem({ + caption : (fraction==Asc.c_oAscMathInterfaceFraction.Bar) ? me.txtRemFractionBar : me.txtAddFractionBar, + equation : true, + disabled : me._currentParaObjDisabled, + equationProps: {type: type, callback: 'put_FractionType', value: (fraction==Asc.c_oAscMathInterfaceFraction.Bar) ? Asc.c_oAscMathInterfaceFraction.NoBar : Asc.c_oAscMathInterfaceFraction.Bar} + }); + arr.push(mnu); + } + break; + case Asc.c_oAscMathInterfaceType.Limit: + mnu = new Common.UI.MenuItem({ + caption : (value.get_Pos()==Asc.c_oAscMathInterfaceLimitPos.Top) ? me.txtLimitUnder : me.txtLimitOver, + equation : true, + disabled : me._currentParaObjDisabled, + equationProps: {type: type, callback: 'put_Pos', value: (value.get_Pos()==Asc.c_oAscMathInterfaceLimitPos.Top) ? Asc.c_oAscMathInterfaceLimitPos.Bottom : Asc.c_oAscMathInterfaceLimitPos.Top} + }); + arr.push(mnu); + mnu = new Common.UI.MenuItem({ + caption : me.txtRemLimit, + equation : true, + disabled : me._currentParaObjDisabled, + equationProps: {type: type, callback: 'put_Pos', value: Asc.c_oAscMathInterfaceLimitPos.None} + }); + arr.push(mnu); + break; + case Asc.c_oAscMathInterfaceType.Matrix: + mnu = new Common.UI.MenuItem({ + caption : value.get_HidePlaceholder() ? me.txtShowPlaceholder : me.txtHidePlaceholder, + equation : true, + disabled : me._currentParaObjDisabled, + equationProps: {type: type, callback: 'put_HidePlaceholder', value: !value.get_HidePlaceholder()} + }); + arr.push(mnu); + mnu = new Common.UI.MenuItem({ + caption : me.insertText, + equation : true, + disabled : me._currentParaObjDisabled, + menu : new Common.UI.Menu({ + cls: 'shifted-right', + menuAlign: 'tl-tr', + items : [ + { + caption: me.insertRowAboveText, + equationProps: {type: type, callback: 'insert_MatrixRow', value: true} + }, + { + caption: me.insertRowBelowText, + equationProps: {type: type, callback: 'insert_MatrixRow', value: false} + }, + { + caption: me.insertColumnLeftText, + equationProps: {type: type, callback: 'insert_MatrixColumn', value: true} + }, + { + caption: me.insertColumnRightText, + equationProps: {type: type, callback: 'insert_MatrixColumn', value: false} + } + ] + }) + }); + arr.push(mnu); + mnu = new Common.UI.MenuItem({ + caption : me.deleteText, + equation : true, + disabled : me._currentParaObjDisabled, + menu : new Common.UI.Menu({ + cls: 'shifted-right', + menuAlign: 'tl-tr', + items : [ + { + caption: me.deleteRowText, + equationProps: {type: type, callback: 'delete_MatrixRow'} + }, + { + caption: me.deleteColumnText, + equationProps: {type: type, callback: 'delete_MatrixColumn'} + } + ] + }) + }); + arr.push(mnu); + mnu = new Common.UI.MenuItem({ + caption : me.txtMatrixAlign, + equation : true, + disabled : me._currentParaObjDisabled, + menu : new Common.UI.Menu({ + cls: 'shifted-right', + menuAlign: 'tl-tr', + items : [ + { + caption: me.txtTop, + checkable : true, + checked : (value.get_MatrixAlign()==Asc.c_oAscMathInterfaceMatrixMatrixAlign.Top), + equationProps: {type: type, callback: 'put_MatrixAlign', value: Asc.c_oAscMathInterfaceMatrixMatrixAlign.Top} + }, + { + caption: me.centerText, + checkable : true, + checked : (value.get_MatrixAlign()==Asc.c_oAscMathInterfaceMatrixMatrixAlign.Center), + equationProps: {type: type, callback: 'put_MatrixAlign', value: Asc.c_oAscMathInterfaceMatrixMatrixAlign.Center} + }, + { + caption: me.txtBottom, + checkable : true, + checked : (value.get_MatrixAlign()==Asc.c_oAscMathInterfaceMatrixMatrixAlign.Bottom), + equationProps: {type: type, callback: 'put_MatrixAlign', value: Asc.c_oAscMathInterfaceMatrixMatrixAlign.Bottom} + } + ] + }) + }); + arr.push(mnu); + mnu = new Common.UI.MenuItem({ + caption : me.txtColumnAlign, + equation : true, + disabled : me._currentParaObjDisabled, + menu : new Common.UI.Menu({ + cls: 'shifted-right', + menuAlign: 'tl-tr', + items : [ + { + caption: me.leftText, + checkable : true, + checked : (value.get_ColumnAlign()==Asc.c_oAscMathInterfaceMatrixColumnAlign.Left), + equationProps: {type: type, callback: 'put_ColumnAlign', value: Asc.c_oAscMathInterfaceMatrixColumnAlign.Left} + }, + { + caption: me.centerText, + checkable : true, + checked : (value.get_ColumnAlign()==Asc.c_oAscMathInterfaceMatrixColumnAlign.Center), + equationProps: {type: type, callback: 'put_ColumnAlign', value: Asc.c_oAscMathInterfaceMatrixColumnAlign.Center} + }, + { + caption: me.rightText, + checkable : true, + checked : (value.get_ColumnAlign()==Asc.c_oAscMathInterfaceMatrixColumnAlign.Right), + equationProps: {type: type, callback: 'put_ColumnAlign', value: Asc.c_oAscMathInterfaceMatrixColumnAlign.Right} + } + ] + }) + }); + arr.push(mnu); + break; + case Asc.c_oAscMathInterfaceType.EqArray: + mnu = new Common.UI.MenuItem({ + caption : me.txtInsertEqBefore, + equation : true, + disabled : me._currentParaObjDisabled, + equationProps: {type: type, callback: 'insert_Equation', value: true} + }); + arr.push(mnu); + mnu = new Common.UI.MenuItem({ + caption : me.txtInsertEqAfter, + equation : true, + disabled : me._currentParaObjDisabled, + equationProps: {type: type, callback: 'insert_Equation', value: false} + }); + arr.push(mnu); + mnu = new Common.UI.MenuItem({ + caption : me.txtDeleteEq, + equation : true, + disabled : me._currentParaObjDisabled, + equationProps: {type: type, callback: 'delete_Equation'} + }); + arr.push(mnu); + mnu = new Common.UI.MenuItem({ + caption : me.alignmentText, + equation : true, + disabled : me._currentParaObjDisabled, + menu : new Common.UI.Menu({ + cls: 'shifted-right', + menuAlign: 'tl-tr', + items : [ + { + caption: me.txtTop, + checkable : true, + checked : (value.get_Align()==Asc.c_oAscMathInterfaceEqArrayAlign.Top), + equationProps: {type: type, callback: 'put_Align', value: Asc.c_oAscMathInterfaceEqArrayAlign.Top} + }, + { + caption: me.centerText, + checkable : true, + checked : (value.get_Align()==Asc.c_oAscMathInterfaceEqArrayAlign.Center), + equationProps: {type: type, callback: 'put_Align', value: Asc.c_oAscMathInterfaceEqArrayAlign.Center} + }, + { + caption: me.txtBottom, + checkable : true, + checked : (value.get_Align()==Asc.c_oAscMathInterfaceEqArrayAlign.Bottom), + equationProps: {type: type, callback: 'put_Align', value: Asc.c_oAscMathInterfaceEqArrayAlign.Bottom} + } + ] + }) + }); + arr.push(mnu); + break; + case Asc.c_oAscMathInterfaceType.LargeOperator: + mnu = new Common.UI.MenuItem({ + caption : me.txtLimitChange, + equation : true, + disabled : me._currentParaObjDisabled, + equationProps: {type: type, callback: 'put_LimitLocation', value: (value.get_LimitLocation() == Asc.c_oAscMathInterfaceNaryLimitLocation.UndOvr) ? Asc.c_oAscMathInterfaceNaryLimitLocation.SubSup : Asc.c_oAscMathInterfaceNaryLimitLocation.UndOvr} + }); + arr.push(mnu); + if (value.get_HideUpper() !== undefined) { + mnu = new Common.UI.MenuItem({ + caption : value.get_HideUpper() ? me.txtShowTopLimit : me.txtHideTopLimit, + equation : true, + disabled : me._currentParaObjDisabled, + equationProps: {type: type, callback: 'put_HideUpper', value: !value.get_HideUpper()} + }); + arr.push(mnu); + } + if (value.get_HideLower() !== undefined) { + mnu = new Common.UI.MenuItem({ + caption : value.get_HideLower() ? me.txtShowBottomLimit : me.txtHideBottomLimit, + equation : true, + disabled : me._currentParaObjDisabled, + equationProps: {type: type, callback: 'put_HideLower', value: !value.get_HideLower()} + }); + arr.push(mnu); + } + break; + case Asc.c_oAscMathInterfaceType.Delimiter: + mnu = new Common.UI.MenuItem({ + caption : me.txtInsertArgBefore, + equation : true, + disabled : me._currentParaObjDisabled, + equationProps: {type: type, callback: 'insert_DelimiterArgument', value: true} + }); + arr.push(mnu); + mnu = new Common.UI.MenuItem({ + caption : me.txtInsertArgAfter, + equation : true, + disabled : me._currentParaObjDisabled, + equationProps: {type: type, callback: 'insert_DelimiterArgument', value: false} + }); + arr.push(mnu); + if (value.can_DeleteArgument()) { + mnu = new Common.UI.MenuItem({ + caption : me.txtDeleteArg, + equation : true, + disabled : me._currentParaObjDisabled, + equationProps: {type: type, callback: 'delete_DelimiterArgument'} + }); + arr.push(mnu); + } + mnu = new Common.UI.MenuItem({ + caption : value.has_Separators() ? me.txtDeleteCharsAndSeparators : me.txtDeleteChars, + equation : true, + disabled : me._currentParaObjDisabled, + equationProps: {type: type, callback: 'remove_DelimiterCharacters'} + }); + arr.push(mnu); + mnu = new Common.UI.MenuItem({ + caption : value.get_HideOpeningBracket() ? me.txtShowOpenBracket : me.txtHideOpenBracket, + equation : true, + disabled : me._currentParaObjDisabled, + equationProps: {type: type, callback: 'put_HideOpeningBracket', value: !value.get_HideOpeningBracket()} + }); + arr.push(mnu); + mnu = new Common.UI.MenuItem({ + caption : value.get_HideClosingBracket() ? me.txtShowCloseBracket : me.txtHideCloseBracket, + equation : true, + disabled : me._currentParaObjDisabled, + equationProps: {type: type, callback: 'put_HideClosingBracket', value: !value.get_HideClosingBracket()} + }); + arr.push(mnu); + mnu = new Common.UI.MenuItem({ + caption : me.txtStretchBrackets, + equation : true, + disabled : me._currentParaObjDisabled, + checkable : true, + checked : value.get_StretchBrackets(), + equationProps: {type: type, callback: 'put_StretchBrackets', value: !value.get_StretchBrackets()} + }); + arr.push(mnu); + mnu = new Common.UI.MenuItem({ + caption : me.txtMatchBrackets, + equation : true, + disabled : (!value.get_StretchBrackets() || me._currentParaObjDisabled), + checkable : true, + checked : value.get_StretchBrackets() && value.get_MatchBrackets(), + equationProps: {type: type, callback: 'put_MatchBrackets', value: !value.get_MatchBrackets()} + }); + arr.push(mnu); + break; + case Asc.c_oAscMathInterfaceType.GroupChar: + if (value.can_ChangePos()) { + mnu = new Common.UI.MenuItem({ + caption : (value.get_Pos()==Asc.c_oAscMathInterfaceGroupCharPos.Top) ? me.txtGroupCharUnder : me.txtGroupCharOver, + equation : true, + disabled : me._currentParaObjDisabled, + equationProps: {type: type, callback: 'put_Pos', value: (value.get_Pos()==Asc.c_oAscMathInterfaceGroupCharPos.Top) ? Asc.c_oAscMathInterfaceGroupCharPos.Bottom : Asc.c_oAscMathInterfaceGroupCharPos.Top} + }); + arr.push(mnu); + mnu = new Common.UI.MenuItem({ + caption : me.txtDeleteGroupChar, + equation : true, + disabled : me._currentParaObjDisabled, + equationProps: {type: type, callback: 'put_Pos', value: Asc.c_oAscMathInterfaceGroupCharPos.None} + }); + arr.push(mnu); + } + break; + case Asc.c_oAscMathInterfaceType.Radical: + if (value.get_HideDegree() !== undefined) { + mnu = new Common.UI.MenuItem({ + caption : value.get_HideDegree() ? me.txtShowDegree : me.txtHideDegree, + equation : true, + disabled : me._currentParaObjDisabled, + equationProps: {type: type, callback: 'put_HideDegree', value: !value.get_HideDegree()} + }); + arr.push(mnu); + } + mnu = new Common.UI.MenuItem({ + caption : me.txtDeleteRadical, + equation : true, + disabled : me._currentParaObjDisabled, + equationProps: {type: type, callback: 'remove_Radical'} + }); + arr.push(mnu); + break; + } + if (value.can_IncreaseArgumentSize()) { + mnu = new Common.UI.MenuItem({ + caption : me.txtIncreaseArg, + equation : true, + disabled : me._currentParaObjDisabled, + equationProps: {type: type, callback: 'increase_ArgumentSize'} + }); + arr.push(mnu); + } + if (value.can_DecreaseArgumentSize()) { + mnu = new Common.UI.MenuItem({ + caption : me.txtDecreaseArg, + equation : true, + disabled : me._currentParaObjDisabled, + equationProps: {type: type, callback: 'decrease_ArgumentSize'} + }); + arr.push(mnu); + } + if (value.can_InsertManualBreak()) { + mnu = new Common.UI.MenuItem({ + caption : me.txtInsertBreak, + equation : true, + disabled : me._currentParaObjDisabled, + equationProps: {type: type, callback: 'insert_ManualBreak'} + }); + arr.push(mnu); + } + if (value.can_DeleteManualBreak()) { + mnu = new Common.UI.MenuItem({ + caption : me.txtDeleteBreak, + equation : true, + disabled : me._currentParaObjDisabled, + equationProps: {type: type, callback: 'delete_ManualBreak'} + }); + arr.push(mnu); + } + if (value.can_AlignToCharacter()) { + mnu = new Common.UI.MenuItem({ + caption : me.txtAlignToChar, + equation : true, + disabled : me._currentParaObjDisabled, + equationProps: {type: type, callback: 'align_ToCharacter'} + }); + arr.push(mnu); + } + return arr; + }, + + addEquationMenu: function(isParagraph, insertIdx) { + var me = this; + if (_.isUndefined(isParagraph)) { + isParagraph = me.textMenu.isVisible(); + } + + me.clearEquationMenu(isParagraph, insertIdx); + + var equationMenu = (isParagraph) ? me.textMenu : me.tableMenu, + menuItems = me.initEquationMenu(); + + if (menuItems.length > 0) { + _.each(menuItems, function(menuItem, index) { + if (menuItem.menu) { + _.each(menuItem.menu.items, function(item) { + item.on('click', _.bind(me.equationCallback, me, item.options.equationProps)); + }); + } else + menuItem.on('click', _.bind(me.equationCallback, me, menuItem.options.equationProps)); + equationMenu.insertItem(insertIdx, menuItem); + insertIdx++; + }); + } + return menuItems.length; + }, + + clearEquationMenu: function(isParagraph, insertIdx) { + var me = this; + var equationMenu = (isParagraph) ? me.textMenu : me.tableMenu; + for (var i = insertIdx; i < equationMenu.items.length; i++) { + if (equationMenu.items[i].options.equation) { + if (equationMenu.items[i].menu) { + _.each(equationMenu.items[i].menu.items, function(item) { + item.off('click'); + }); + } else + equationMenu.items[i].off('click'); + equationMenu.removeItem(equationMenu.items[i]); + i--; + } else + break; + } + }, + + equationCallback: function(eqProps) { + this.fireEvent('equation:callback', [eqProps]); + }, + + addWordVariants: function(isParagraph) { + var me = this; + if (!me.textMenu || !me.textMenu.isVisible() && !me.tableMenu.isVisible()) return; + + if (_.isUndefined(isParagraph)) { + isParagraph = me.textMenu.isVisible(); + } + + me.clearWordVariants(isParagraph); + + var moreMenu = (isParagraph) ? me.menuSpellMorePara : me.menuSpellMoreTable; + var spellMenu = (isParagraph) ? me.menuSpellPara : me.menuSpellTable; + var arr = [], + arrMore = []; + var variants = me._currentSpellObj.get_Variants(); + + if (variants.length > 0) { + moreMenu.setVisible(variants.length > 3); + moreMenu.setDisabled(me._currentParaObjDisabled); + + _.each(variants, function(variant, index) { + var mnu = new Common.UI.MenuItem({ + caption : variant, + spellword : true, + disabled : me._currentParaObjDisabled + }).on('click', function(item, e) { + if (me.api) { + me.api.asc_replaceMisspelledWord(item.caption, me._currentSpellObj); + me.fireEvent('editcomplete', me); + } + }); + + (index < 3) ? arr.push(mnu) : arrMore.push(mnu); + }); + + if (arr.length > 0) { + if (isParagraph) { + _.each(arr, function(variant, index){ + me.textMenu.insertItem(index, variant); + }) + } else { + _.each(arr, function(variant, index){ + me.menuSpellCheckTable.menu.insertItem(index, variant); + }) + } + } + + if (arrMore.length > 0) { + _.each(arrMore, function(variant, index){ + moreMenu.menu.addItem(variant); + }); + } + + spellMenu.setVisible(false); + } else { + moreMenu.setVisible(false); + spellMenu.setVisible(true); + spellMenu.setCaption(me.noSpellVariantsText, true); + } + }, + + clearWordVariants: function(isParagraph) { + var me = this; + var spellMenu = (isParagraph) ? me.textMenu : me.menuSpellCheckTable.menu; + + for (var i = 0; i < spellMenu.items.length; i++) { + if (spellMenu.items[i].options.spellword) { + if (spellMenu.checkeditem == spellMenu.items[i]) { + spellMenu.checkeditem = undefined; + spellMenu.activeItem = undefined; + } + + spellMenu.removeItem(spellMenu.items[i]); + i--; + } + } + (isParagraph) ? me.menuSpellMorePara.menu.removeAll() : me.menuSpellMoreTable.menu.removeAll(); + + me.menuSpellMorePara.menu.checkeditem = undefined; + me.menuSpellMorePara.menu.activeItem = undefined; + me.menuSpellMoreTable.menu.checkeditem = undefined; + me.menuSpellMoreTable.menu.activeItem = undefined; }, setLanguages: function(langs){ @@ -4358,285 +2805,16 @@ define([ }); me.langParaMenu.menu.resetItems(arrPara); me.langTableMenu.menu.resetItems(arrTable); - - me.langParaMenu.menu.on('item:click', function(menu, item){ - if (me.api){ - if (!_.isUndefined(item.langid)) - me.api.put_TextPrLang(item.langid); - - me._currLang.paraid = item.langid; - me.fireEvent('editcomplete', me); - } - }); - - me.langTableMenu.menu.on('item:click', function(menu, item, e){ - if (me.api){ - if (!_.isUndefined(item.langid)) - me.api.put_TextPrLang(item.langid); - - me._currLang.tableid = item.langid; - me.fireEvent('editcomplete', me); - } - }); } }, - onSignatureClick: function(item) { - var datavalue = item.cmpEl.attr('data-value'); - switch (item.value) { - case 0: - Common.NotificationCenter.trigger('protect:sign', datavalue); //guid - break; - case 1: - this.api.asc_ViewCertificate(datavalue); //certificate id - break; - case 2: - Common.NotificationCenter.trigger('protect:signature', 'visible', this._isDisabled, datavalue);//guid, can edit settings for requested signature - break; - case 3: - var me = this; - Common.UI.warning({ - title: this.notcriticalErrorTitle, - msg: this.txtRemoveWarning, - buttons: ['ok', 'cancel'], - primary: 'ok', - callback: function(btn) { - if (btn == 'ok') { - me.api.asc_RemoveSignature(datavalue); - } - } - }); - break; - } - }, - - onImgRotate: function(item) { - var properties = new Asc.asc_CImgProperty(); - properties.asc_putRotAdd((item.value==1 ? 90 : 270) * 3.14159265358979 / 180); - this.api.ImgApply(properties); - this.fireEvent('editcomplete', this); - }, - - onImgFlip: function(item) { - var properties = new Asc.asc_CImgProperty(); - if (item.value==1) - properties.asc_putFlipHInvert(true); - else - properties.asc_putFlipVInvert(true); - this.api.ImgApply(properties); - this.fireEvent('editcomplete', this); - }, - - onImgCrop: function(item) { - if (item.value == 1) { - this.api.asc_cropFill(); - } else if (item.value == 2) { - this.api.asc_cropFit(); + changeLanguageMenu: function(menu) { + if (this._currLang.id===null || this._currLang.id===undefined) { + menu.clearAll(); } else { - item.checked ? this.api.asc_startEditCrop() : this.api.asc_endEditCrop(); + var index = _.findIndex(menu.items, {langid: this._currLang.id}); + (index>-1) && !menu.items[index].checked && menu.setChecked(index, true); } - this.fireEvent('editcomplete', this); - }, - - onFollowMove: function(item) { - if (this.api) { - this.api.asc_FollowRevisionMove(item.value); - } - this.fireEvent('editcomplete', this); - }, - - onHideContentControlsActions: function() { - this.listControlMenu && this.listControlMenu.isVisible() && this.listControlMenu.hide(); - var controlsContainer = this.cmpEl.find('#calendar-control-container'); - if (controlsContainer.is(':visible')) - controlsContainer.hide(); - }, - - onShowDateActions: function(obj, x, y) { - var props = obj.pr, - specProps = props.get_DateTimePr(), - controlsContainer = this.cmpEl.find('#calendar-control-container'), - me = this; - - this._dateObj = props; - - if (controlsContainer.length < 1) { - controlsContainer = $('
    '); - this.cmpEl.append(controlsContainer); - } - - Common.UI.Menu.Manager.hideAll(); - - controlsContainer.css({left: x, top : y}); - controlsContainer.show(); - - if (!this.cmpCalendar) { - this.cmpCalendar = new Common.UI.Calendar({ - el: this.cmpEl.find('#id-document-calendar-control'), - enableKeyEvents: true, - firstday: 1 - }); - this.cmpCalendar.on('date:click', function (cmp, date) { - var specProps = me._dateObj.get_DateTimePr(); - specProps.put_FullDate(new Date(date)); - me.api.asc_SetContentControlDatePickerDate(specProps); - controlsContainer.hide(); - me.api.asc_UncheckContentControlButtons(); - me.fireEvent('editcomplete', me); - }); - this.cmpCalendar.on('calendar:keydown', function (cmp, e) { - if (e.keyCode==Common.UI.Keys.ESC) { - controlsContainer.hide(); - me.api.asc_UncheckContentControlButtons(); - } - }); - $(document).on('mousedown', function(e) { - if (e.target.localName !== 'canvas' && controlsContainer.is(':visible') && controlsContainer.find(e.target).length==0) { - controlsContainer.hide(); - me.api.asc_UncheckContentControlButtons(); - } - }); - - } - this.cmpCalendar.setDate(new Date(specProps ? specProps.get_FullDate() : undefined)); - - // align - var offset = controlsContainer.offset(), - docW = Common.Utils.innerWidth(), - docH = Common.Utils.innerHeight() - 10, // Yep, it's magic number - menuW = this.cmpCalendar.cmpEl.outerWidth(), - menuH = this.cmpCalendar.cmpEl.outerHeight(), - buttonOffset = 22, - left = offset.left - menuW, - top = offset.top; - if (top + menuH > docH) { - top = docH - menuH; - left -= buttonOffset; - } - if (top < 0) - top = 0; - if (left + menuW > docW) - left = docW - menuW; - this.cmpCalendar.cmpEl.css({left: left, top : top}); - - this._preventClick = true; - }, - - onShowListActions: function(obj, x, y) { - var type = obj.type, - props = obj.pr, - specProps = (type == Asc.c_oAscContentControlSpecificType.ComboBox) ? props.get_ComboBoxPr() : props.get_DropDownListPr(), - isForm = !!props.get_FormPr(), - menu = this.listControlMenu, - menuContainer = menu ? this.cmpEl.find(Common.Utils.String.format('#menu-container-{0}', menu.id)) : null, - me = this; - - this._listObj = props; - - this._fromShowContentControls = true; - Common.UI.Menu.Manager.hideAll(); - - if (!menu) { - this.listControlMenu = menu = new Common.UI.Menu({ - maxHeight: 207, - menuAlign: 'tr-bl', - items: [] - }); - menu.on('item:click', function(menu, item) { - setTimeout(function(){ - (item.value!==-1) && me.api.asc_SelectContentControlListItem(item.value, me._listObj.get_InternalId()); - }, 1); - }); - - // Prepare menu container - if (!menuContainer || menuContainer.length < 1) { - menuContainer = $(Common.Utils.String.format('', menu.id)); - this.cmpEl.append(menuContainer); - } - - menu.render(menuContainer); - menu.cmpEl.attr({tabindex: "-1"}); - menu.on('hide:after', function(){ - me.listControlMenu.removeAll(); - if (!me._fromShowContentControls) - me.api.asc_UncheckContentControlButtons(); - }); - } - if (specProps) { - if (isForm){ // for dropdown and combobox form control always add placeholder item - var text = props.get_PlaceholderText(); - menu.addItem(new Common.UI.MenuItem({ - caption : (text.trim()!=='') ? text : this.txtEmpty, - value : '', - template : _.template([ - ' opacity: 0.6 <% } %>">', - '<%= caption %>', - '' - ].join('')) - })); - } - var count = specProps.get_ItemsCount(); - for (var i=0; i', - '<%= Common.Utils.String.htmlEncode(caption) %>', - '' - ].join('')) - })); - } - if (!isForm && menu.items.length<1) { - menu.addItem(new Common.UI.MenuItem({ - caption : this.txtEmpty, - value : -1 - })); - } - } - - menuContainer.css({left: x, top : y}); - menuContainer.attr('data-value', 'prevent-canvas-click'); - this._preventClick = true; - menu.show(); - - _.delay(function() { - menu.cmpEl.focus(); - }, 10); - this._fromShowContentControls = false; - }, - - onShowContentControlsActions: function(obj, x, y) { - var type = obj.type; - switch (type) { - case Asc.c_oAscContentControlSpecificType.DateTime: - this.onShowDateActions(obj, x, y); - break; - case Asc.c_oAscContentControlSpecificType.Picture: - if (obj.pr && obj.pr.get_Lock) { - var lock = obj.pr.get_Lock(); - if (lock == Asc.c_oAscSdtLockType.SdtContentLocked || lock==Asc.c_oAscSdtLockType.ContentLocked) - return; - } - this.api.asc_addImage(obj); - var me = this; - setTimeout(function(){ - me.api.asc_UncheckContentControlButtons(); - }, 500); - break; - case Asc.c_oAscContentControlSpecificType.DropDownList: - case Asc.c_oAscContentControlSpecificType.ComboBox: - this.onShowListActions(obj, x, y); - break; - } - }, - - onApiLockDocumentProps: function() { - this._state.lock_doc = true; - }, - - onApiUnLockDocumentProps: function() { - this._state.lock_doc = false; }, getControlLabel: function(props) { diff --git a/apps/documenteditor/main/app/view/FileMenuPanels.js b/apps/documenteditor/main/app/view/FileMenuPanels.js index 0e98802b5..e03640684 100644 --- a/apps/documenteditor/main/app/view/FileMenuPanels.js +++ b/apps/documenteditor/main/app/view/FileMenuPanels.js @@ -341,6 +341,9 @@ define([ '', '
    ', '', + '', + '
    ', + '', '', '', '', @@ -400,6 +403,14 @@ define([ dataHintOffset: 'small' }); + this.chUseAltKey = new Common.UI.CheckBox({ + el: $markup.findById('#fms-chb-use-alt-key'), + labelText: Common.Utils.isMac ? this.txtUseOptionKey : this.txtUseAltKey, + dataHint: '2', + dataHintDirection: 'left', + dataHintOffset: 'small' + }); + /** coauthoring begin **/ this.chLiveComment = new Common.UI.CheckBox({ el: $markup.findById('#fms-chb-live-comment'), @@ -776,6 +787,8 @@ define([ updateSettings: function() { this.chInputMode.setValue(Common.Utils.InternalSettings.get("de-settings-inputmode")); + this.chUseAltKey.setValue(Common.Utils.InternalSettings.get("de-settings-use-alt-key")); + var value = Common.Utils.InternalSettings.get("de-settings-zoom"); value = (value!==null) ? parseInt(value) : (this.mode.customization && this.mode.customization.zoom ? parseInt(this.mode.customization.zoom) : 100); var item = this.cmbZoom.store.findWhere({value: value}); @@ -858,6 +871,8 @@ define([ if (!this.chDarkMode.isDisabled() && (this.chDarkMode.isChecked() !== Common.UI.Themes.isContentThemeDark())) Common.UI.Themes.toggleContentTheme(); Common.localStorage.setItem("de-settings-inputmode", this.chInputMode.isChecked() ? 1 : 0); + Common.localStorage.setItem("de-settings-use-alt-key", this.chUseAltKey.isChecked() ? 1 : 0); + Common.Utils.InternalSettings.set("de-settings-use-alt-key", Common.localStorage.getBool("de-settings-use-alt-key")); Common.localStorage.setItem("de-settings-zoom", this.cmbZoom.getValue()); Common.Utils.InternalSettings.set("de-settings-zoom", Common.localStorage.getItem("de-settings-zoom")); @@ -996,6 +1011,8 @@ define([ txtShowTrackChanges: 'Show track changes', txtWorkspace: 'Workspace', txtHieroglyphs: 'Hieroglyphs', + txtUseAltKey: 'Use Alt key to navigate the user interface using the keyboard', + txtUseOptionKey: 'Use Option key to navigate the user interface using the keyboard', strShowComments: 'Show comments in text', strShowResolvedComments: 'Show resolved comments', txtFastTip: 'Real-time co-editing. All changes are saved automatically', @@ -1240,8 +1257,8 @@ define([ '', '', '', - '', - '', + '', + '', '', '', '', @@ -1254,6 +1271,11 @@ define([ '', '', '', + '', + '', + '', + '', + '', '', '', '', @@ -1412,6 +1434,7 @@ define([ this.lblPdfAuthor = $markup.findById('#id-lbl-info-author'); this.lblPdfVer = $markup.findById('#id-info-pdf-ver'); this.lblPdfTagged = $markup.findById('#id-info-pdf-tagged'); + this.lblPdfProducer = $markup.findById('#id-info-pdf-produce'); this.lblFastWV = $markup.findById('#id-info-fast-wv'); this.btnApply = new Common.UI.Button({ @@ -1498,7 +1521,7 @@ define([ this.lblApplication.text(appname); } else if (pdfProps) { $('.docx-info', this.el).hide(); - appname = pdfProps ? pdfProps.Producer || '' : ''; + appname = pdfProps ? pdfProps.Creator || '' : ''; this.lblApplication.text(appname); } this._ShowHideInfoItem(this.lblApplication, !!appname); @@ -1625,6 +1648,10 @@ define([ this.lblPdfTagged.text(value===true ? this.txtYes : this.txtNo); this._ShowHideInfoItem(this.lblPdfTagged, value !== undefined); + value = props.Producer; + value && this.lblPdfProducer.text(value); + this._ShowHideInfoItem(this.lblPdfProducer, !!value); + value = props.FastWebView; if (value !== undefined) this.lblFastWV.text(value===true ? this.txtYes : this.txtNo); @@ -1790,7 +1817,8 @@ define([ txtPdfTagged: 'Tagged PDF', txtFastWV: 'Fast Web View', txtYes: 'Yes', - txtNo: 'No' + txtNo: 'No', + txtPdfProducer: 'PDF Producer' }, DE.Views.FileMenuPanels.DocumentInfo || {})); diff --git a/apps/documenteditor/main/app/view/FormSettings.js b/apps/documenteditor/main/app/view/FormSettings.js index 2af5d2f4f..17cfd67b3 100644 --- a/apps/documenteditor/main/app/view/FormSettings.js +++ b/apps/documenteditor/main/app/view/FormSettings.js @@ -1150,7 +1150,6 @@ define([ '33CCCC', '3366FF', '800080', '999999', 'FF00FF', 'FFCC00', 'FFFF00', '00FF00', '00FFFF', '00CCFF', '993366', 'C0C0C0', 'FF99CC', 'FFCC99', 'FFFF99', 'CCFFCC', 'CCFFFF', 'C9C8FF', 'CC99FF', 'FFFFFF' ], - paletteHeight: 94, dataHint: '1', dataHintDirection: 'bottom', dataHintOffset: 'big' diff --git a/apps/documenteditor/main/app/view/FormsTab.js b/apps/documenteditor/main/app/view/FormsTab.js index b6c2d3f5d..d3a0a2199 100644 --- a/apps/documenteditor/main/app/view/FormsTab.js +++ b/apps/documenteditor/main/app/view/FormsTab.js @@ -258,7 +258,6 @@ define([ '33CCCC', '3366FF', '800080', '999999', 'FF00FF', 'FFCC00', 'FFFF00', '00FF00', '00FFFF', '00CCFF', '993366', 'C0C0C0', 'FF99CC', 'FFCC99', 'FFFF99', 'CCFFCC', 'CCFFFF', 'C9C8FF', 'CC99FF', 'FFFFFF' ], - paletteHeight: 94, dataHint: '1', dataHintDirection: 'left', dataHintOffset: 'small' diff --git a/apps/documenteditor/main/app/view/ImageSettingsAdvanced.js b/apps/documenteditor/main/app/view/ImageSettingsAdvanced.js index 1a70d2d23..5a345e2d2 100644 --- a/apps/documenteditor/main/app/view/ImageSettingsAdvanced.js +++ b/apps/documenteditor/main/app/view/ImageSettingsAdvanced.js @@ -106,6 +106,7 @@ define([ 'text!documenteditor/main/app/template/ImageSettingsAdvanced.templat this.api = this.options.api; this._changedProps = null; this._changedShapeProps = null; + this._isSmartArt = false; }, render: function() { @@ -253,7 +254,7 @@ define([ 'text!documenteditor/main/app/template/ImageSettingsAdvanced.templat minValue: 0 }); this.spnShapeWidth.on('change', _.bind(function(field, newValue, oldValue, eOpts){ - if (this.chRatio.getValue()=='checked' && !this.chRatio.isDisabled()) { + if (this.chRatio.getValue()=='checked' && (!this.chRatio.isDisabled() || this._isSmartArt)) { var w = field.getNumberValue(); var h = w/this._nRatio; if (h>this.sizeMax.height) { @@ -281,7 +282,7 @@ define([ 'text!documenteditor/main/app/template/ImageSettingsAdvanced.templat }); this.spnShapeHeight.on('change', _.bind(function(field, newValue, oldValue, eOpts){ var h = field.getNumberValue(), w = null; - if (this.chRatio.getValue()=='checked' && !this.chRatio.isDisabled()) { + if (this.chRatio.getValue()=='checked' && (!this.chRatio.isDisabled() || this._isSmartArt)) { w = h * this._nRatio; if (w>this.sizeMax.width) { w = this.sizeMax.width; @@ -1408,7 +1409,7 @@ define([ 'text!documenteditor/main/app/template/ImageSettingsAdvanced.templat this._setShapeDefaults(shapeprops); this.setTitle(this.textTitleShape); value = props.asc_getLockAspect(); - this.chRatio.setValue(value); + this.chRatio.setValue(value || this._isSmartArt, true); // can resize smart art only proportionately this.spnShapeWidth.setMaxValue(this.sizeMax.width); this.spnShapeHeight.setMaxValue(this.sizeMax.height); @@ -1450,7 +1451,7 @@ define([ 'text!documenteditor/main/app/template/ImageSettingsAdvanced.templat value = props.get_Height(); this.spnShapeHeight.setValue((value!==undefined) ? Common.Utils.Metric.fnRecalcFromMM(value).toFixed(2) : '', true); } - this.chRatio.setDisabled(this.radioVSizePc.getValue() || this.radioHSizePc.getValue()); + this.chRatio.setDisabled(this.radioVSizePc.getValue() || this.radioHSizePc.getValue() || this._isSmartArt); var margins = shapeprops.get_paddings(); if (margins) { @@ -1558,11 +1559,13 @@ define([ 'text!documenteditor/main/app/template/ImageSettingsAdvanced.templat this.radioHSizePc.setDisabled(true); this.radioVSizePc.setDisabled(true); this.btnsCategory[2].setDisabled(true); + this._isSmartArt = true; } if (props.get_FromSmartArtInternal()) { this.chAutofit.setDisabled(true); this.chFlipHor.setDisabled(true); this.chFlipVert.setDisabled(true); + this.btnsCategory[1].setDisabled(true); } var stroke = props.get_stroke(); diff --git a/apps/documenteditor/main/app/view/LeftMenu.js b/apps/documenteditor/main/app/view/LeftMenu.js index a6ad60492..a51a96b0e 100644 --- a/apps/documenteditor/main/app/view/LeftMenu.js +++ b/apps/documenteditor/main/app/view/LeftMenu.js @@ -154,7 +154,7 @@ define([ this.btnNavigation = new Common.UI.Button({ el: $markup.elementById('#left-btn-navigation'), - hint: this.tipNavigation, + hint: this.tipOutline, enableToggle: true, disabled: true, toggleGroup: 'leftMenuGroup' @@ -501,6 +501,7 @@ define([ txtTrial: 'TRIAL MODE', txtTrialDev: 'Trial Developer Mode', tipNavigation: 'Navigation', + tipOutline: 'Headings', txtLimit: 'Limit Access' }, DE.Views.LeftMenu || {})); }); diff --git a/apps/documenteditor/main/app/view/Navigation.js b/apps/documenteditor/main/app/view/Navigation.js index 6bf35e380..83b41c226 100644 --- a/apps/documenteditor/main/app/view/Navigation.js +++ b/apps/documenteditor/main/app/view/Navigation.js @@ -49,7 +49,11 @@ define([ storeNavigation: undefined, template: _.template([ '' @@ -63,8 +67,97 @@ define([ render: function(el) { el = el || this.el; $(el).html(this.template({scope: this})); + var isWrap = Common.localStorage.getBool("de-outline-wrap",true); + var fontSizeClass = Common.localStorage.getItem("de-outline-fontsize"); + if(!fontSizeClass) fontSizeClass = 'medium'; this.$el = $(el); + this.btnClose = new Common.UI.Button({ + parentEl: $('#navigation-btn-close', this.$el), + cls: 'btn-toolbar', + iconCls: 'toolbar__icon btn-close', + hint: this.txtClosePanel, + }); + + this.btnSettings = new Common.UI.Button({ + parentEl: $('#navigation-btn-settings', this.$el), + cls: 'btn-toolbar', + iconCls: 'toolbar__icon btn-settings', + hint: this.txtSettings, + menu: new Common.UI.Menu({ + menuAlign: 'tr-br', + style: 'min-width: auto;', + items: [ + { + caption: this.txtExpand, + value: 'expand', + iconCls : 'menu__icon expand-all' + }, + { + caption: this.txtCollapse, + value: 'collapse', + iconCls : 'menu__icon collapse-all' + }, + { + caption: this.txtExpandToLevel, + value: 'expand-level', + menu: new Common.UI.Menu({ + menuAlign: 'tl-tr', + style: 'min-width: auto;', + items: [{ caption : '1', value: 1 }, { caption : '2', value: 2 }, { caption : '3', value: 3 }, + { caption : '4', value: 4 }, { caption : '5', value: 5 }, { caption : '6', value: 6 }, + { caption : '7', value: 7 }, { caption : '8', value: 8 }, { caption : '9', value: 9 }]}) + }, + { + caption: '--', + visible: true + }, + { + caption: this.txtFontSize, + value: 'font-size', + menu: new Common.UI.Menu({ + menuAlign: 'tl-tr', + style: 'min-width: auto;', + items: [ + { + caption: this.txtSmall, + checkable: true, + value: 'small', + checked: fontSizeClass == 'small', + toggleGroup: 'fontsize' + }, + { + caption: this.txtMedium, + checkable: true, + value: 'medium', + checked: fontSizeClass == 'medium', + toggleGroup: 'fontsize' + }, + { + caption: this.txtLarge, + checkable: true, + checked: fontSizeClass == 'large', + value: 'large', + toggleGroup: 'fontsize' + } + ]}) + + }, + { + caption: '--', + visible: true + }, + { + caption: this.txtWrapHeadings, + checkable: true, + checked: isWrap, + value: 'wrap' + } + ] + }) + }); + this.btnSettingsMenu = this.btnSettings.menu; + this.viewNavigationList = new Common.UI.TreeView({ el: $('#navigation-list'), store: this.storeNavigation, @@ -75,7 +168,10 @@ define([ delayRenderTips: true, minScrollbarLength: 25 }); + this.viewNavigationList.cmpEl.off('click'); + this.viewNavigationList.$el.addClass( fontSizeClass); + isWrap && this.viewNavigationList.$el.addClass( 'wrap'); this.navigationMenu = new Common.UI.Menu({ cls: 'shifted-right', items: [{ @@ -137,7 +233,6 @@ define([ } ] }); - this.trigger('render:after', this); return this; }, @@ -152,6 +247,21 @@ define([ this.fireEvent('hide', this ); }, + changeWrapHeadings: function(){ + Common.localStorage.setBool("de-outline-wrap", this.btnSettingsMenu.items[6].checked); + if(!this.btnSettingsMenu.items[6].checked) + this.viewNavigationList.$el.removeClass('wrap'); + else + this.viewNavigationList.$el.addClass('wrap'); + }, + + changeFontSize: function (value){ + Common.localStorage.setItem("de-outline-fontsize", value); + this.viewNavigationList.$el.removeClass(); + this.viewNavigationList.$el.addClass( value); + this.changeWrapHeadings(); + }, + ChangeSettings: function(props) { }, @@ -166,7 +276,15 @@ define([ txtExpandToLevel: 'Expand to level...', txtEmpty: 'There are no headings in the document.
    Apply a heading style to the text so that it appears in the table of contents.', txtEmptyItem: 'Empty Heading', - txtEmptyViewer: 'There are no headings in the document.' + txtEmptyViewer: 'There are no headings in the document.', + strNavigate: "Headings", + txtWrapHeadings: "Wrap long headings", + txtFontSize: "Font size", + txtSmall: "Small", + txtMedium: "Medium", + txtLarge:"Large", + txtClosePanel: "Close headings", + txtSettings: "Headings settings" }, DE.Views.Navigation || {})); }); \ No newline at end of file diff --git a/apps/documenteditor/main/app/view/StyleTitleDialog.js b/apps/documenteditor/main/app/view/StyleTitleDialog.js index c49039411..f673631ad 100644 --- a/apps/documenteditor/main/app/view/StyleTitleDialog.js +++ b/apps/documenteditor/main/app/view/StyleTitleDialog.js @@ -85,6 +85,7 @@ define([ style : 'width: 100%;', validateOnBlur: false, validation : function(value) { + value = value.trim(); var isvalid = value != ''; if (isvalid) { @@ -121,7 +122,7 @@ define([ getTitle: function () { var me = this; - return me.inputTitle.getValue(); + return me.inputTitle.getValue().trim(); }, getNextStyle: function () { diff --git a/apps/documenteditor/main/app/view/Toolbar.js b/apps/documenteditor/main/app/view/Toolbar.js index 4276b6948..35fdb5245 100644 --- a/apps/documenteditor/main/app/view/Toolbar.js +++ b/apps/documenteditor/main/app/view/Toolbar.js @@ -355,7 +355,7 @@ define([ menu: new Common.UI.Menu({ style: 'min-width: 100px;', items: [ - {template: _.template('
    ')}, + {template: _.template('
    ')}, {caption: '--'}, this.mnuHighlightTransparent = new Common.UI.MenuItem({ caption: this.strMenuNoFill, @@ -898,7 +898,8 @@ define([ checkable: true }), {caption: '--'}, - {template: _.template('
    ')}, + {template: _.template('
    ')}, + {caption: '--'}, { id: 'id-toolbar-menu-new-control-color', template: _.template('' + this.textNewColor + '') @@ -2329,15 +2330,19 @@ define([ if (this.btnHighlightColor.cmpEl) { this.btnHighlightColor.currentColor = 'FFFF00'; this.btnHighlightColor.setColor(this.btnHighlightColor.currentColor); - this.mnuHighlightColorPicker = new Common.UI.ColorPalette({ + this.mnuHighlightColorPicker = new Common.UI.ThemeColorPalette({ el: $('#id-toolbar-menu-highlight'), colors: [ 'FFFF00', '00FF00', '00FFFF', 'FF00FF', '0000FF', 'FF0000', '00008B', '008B8B', '006400', '800080', '8B0000', '808000', 'FFFFFF', 'D3D3D3', 'A9A9A9', '000000' - ] + ], + value: 'FFFF00', + dynamiccolors: 0, + columns: 4, + outerMenu: {menu: this.btnHighlightColor.menu, index: 0, focusOnShow: true} }); - this.mnuHighlightColorPicker.select('FFFF00'); this.btnHighlightColor.setPicker(this.mnuHighlightColorPicker); + this.btnHighlightColor.menu.setInnerMenu([{menu: this.mnuHighlightColorPicker, index: 0}]); } if (this.btnFontColor.cmpEl) { diff --git a/apps/documenteditor/main/app/view/ViewTab.js b/apps/documenteditor/main/app/view/ViewTab.js index 76f3a51c1..407388c79 100644 --- a/apps/documenteditor/main/app/view/ViewTab.js +++ b/apps/documenteditor/main/app/view/ViewTab.js @@ -73,7 +73,7 @@ define([ '' + '' + '
    ' + - '
    ' + + '
    ' + '
    ' + '
    ' + '' + @@ -135,7 +135,7 @@ define([ cls: 'btn-toolbar x-huge icon-top', iconCls: 'toolbar__icon btn-menu-navigation', lock: [_set.lostConnect, _set.disableOnStart], - caption: this.textNavigation, + caption: this.textOutline, enableToggle: true, dataHint: '1', dataHintDirection: 'bottom', @@ -305,6 +305,7 @@ define([ }, textNavigation: 'Navigation', + textOutline: 'Headings', textZoom: 'Zoom', textFitToPage: 'Fit To Page', textFitToWidth: 'Fit To Width', diff --git a/apps/documenteditor/main/app_dev.js b/apps/documenteditor/main/app_dev.js index a43f32677..5c1187311 100644 --- a/apps/documenteditor/main/app_dev.js +++ b/apps/documenteditor/main/app_dev.js @@ -166,6 +166,9 @@ require([ Common.Locale.apply( function() { require([ + 'common/main/lib/util/LocalStorage', + 'common/main/lib/controller/Themes', + 'common/main/lib/controller/Desktop', 'documenteditor/main/app/controller/Viewport', 'documenteditor/main/app/controller/DocumentHolder', 'documenteditor/main/app/controller/Toolbar', @@ -187,7 +190,6 @@ require([ 'documenteditor/main/app/view/TextArtSettings', 'documenteditor/main/app/view/SignatureSettings', 'common/main/lib/util/utils', - 'common/main/lib/util/LocalStorage', 'common/main/lib/controller/Fonts', 'common/main/lib/controller/History' /** coauthoring begin **/ @@ -201,8 +203,6 @@ require([ ,'common/main/lib/controller/ExternalOleEditor' ,'common/main/lib/controller/ReviewChanges' ,'common/main/lib/controller/Protection' - ,'common/main/lib/controller/Themes' - ,'common/main/lib/controller/Desktop' ], function() { window.compareVersions = true; app.start(); diff --git a/apps/documenteditor/main/index.html b/apps/documenteditor/main/index.html index f20c40c65..d5d34d2b4 100644 --- a/apps/documenteditor/main/index.html +++ b/apps/documenteditor/main/index.html @@ -255,8 +255,10 @@ window.frameEditorId = params["frameEditorId"]; window.parentOrigin = params["parentOrigin"]; - if(/MSIE \d|Trident.*rv:/.test(navigator.userAgent)) + if(/MSIE \d|Trident.*rv:/.test(navigator.userAgent)) { document.write(' diff --git a/apps/documenteditor/main/locale/de.json b/apps/documenteditor/main/locale/de.json index 7544cff11..a65bcc81f 100644 --- a/apps/documenteditor/main/locale/de.json +++ b/apps/documenteditor/main/locale/de.json @@ -1700,6 +1700,7 @@ "DE.Views.FileMenuPanels.DocumentInfo.txtTitle": "Titel", "DE.Views.FileMenuPanels.DocumentInfo.txtUploaded": "Hochgeladen", "DE.Views.FileMenuPanels.DocumentInfo.txtWords": "Wörter", + "DE.Views.FileMenuPanels.DocumentInfo.txtPdfProducer": "PDF-Ersteller", "DE.Views.FileMenuPanels.DocumentRights.txtBtnAccessRights": "Zugriffsrechte ändern", "DE.Views.FileMenuPanels.DocumentRights.txtRights": "Personen mit Berechtigungen", "DE.Views.FileMenuPanels.ProtectDoc.notcriticalErrorTitle": "Warnung", diff --git a/apps/documenteditor/main/locale/en.json b/apps/documenteditor/main/locale/en.json index dd174ddf3..ae4d86cc1 100644 --- a/apps/documenteditor/main/locale/en.json +++ b/apps/documenteditor/main/locale/en.json @@ -183,6 +183,7 @@ "Common.UI.SearchDialog.txtBtnReplaceAll": "Replace All", "Common.UI.SynchronizeTip.textDontShow": "Don't show this message again", "Common.UI.SynchronizeTip.textSynchronize": "The document has been changed by another user.
    Please click to save your changes and reload the updates.", + "Common.UI.ThemeColorPalette.textRecentColors": "Recent Colors", "Common.UI.ThemeColorPalette.textStandartColors": "Standard Colors", "Common.UI.ThemeColorPalette.textThemeColors": "Theme Colors", "Common.UI.Themes.txtThemeClassicLight": "Classic Light", @@ -621,6 +622,7 @@ "DE.Controllers.Main.textPaidFeature": "Paid feature", "DE.Controllers.Main.textReconnect": "Connection is restored", "DE.Controllers.Main.textRemember": "Remember my choice for all files", + "DE.Controllers.Main.textRememberMacros": "Remember my choice for all macros", "DE.Controllers.Main.textRenameError": "User name must not be empty.", "DE.Controllers.Main.textRenameLabel": "Enter a name to be used for collaboration", "DE.Controllers.Main.textShape": "Shape", @@ -895,6 +897,7 @@ "DE.Controllers.Main.warnNoLicense": "You've reached the limit for simultaneous connections to %1 editors. This document will be opened for viewing only.
    Contact %1 sales team for personal upgrade terms.", "DE.Controllers.Main.warnNoLicenseUsers": "You've reached the user limit for %1 editors. Contact %1 sales team for personal upgrade terms.", "DE.Controllers.Main.warnProcessRightsChange": "You have been denied the right to edit the file.", + "DE.Controllers.Main.textRequestMacros": "A macro makes a request to URL. Do you want to allow the request to the %1?", "DE.Controllers.Navigation.txtBeginning": "Beginning of document", "DE.Controllers.Navigation.txtGotoBeginning": "Go to the beginning of the document", "DE.Controllers.Statusbar.textDisconnect": "Connection is lost
    Trying to connect. Please check connection settings.", @@ -1708,6 +1711,7 @@ "DE.Views.FileMenuPanels.DocumentInfo.txtParagraphs": "Paragraphs", "DE.Views.FileMenuPanels.DocumentInfo.txtPdfTagged": "Tagged PDF", "DE.Views.FileMenuPanels.DocumentInfo.txtPdfVer": "PDF Version", + "DE.Views.FileMenuPanels.DocumentInfo.txtPdfProducer": "PDF Producer", "DE.Views.FileMenuPanels.DocumentInfo.txtPlacement": "Location", "DE.Views.FileMenuPanels.DocumentInfo.txtRights": "Persons who have rights", "DE.Views.FileMenuPanels.DocumentInfo.txtSpaces": "Symbols with spaces", @@ -1783,6 +1787,8 @@ "DE.Views.FileMenuPanels.Settings.txtFitPage": "Fit to Page", "DE.Views.FileMenuPanels.Settings.txtFitWidth": "Fit to Width", "DE.Views.FileMenuPanels.Settings.txtHieroglyphs": "Hieroglyphs", + "DE.Views.FileMenuPanels.Settings.txtUseAltKey": "Use Alt key to navigate the user interface using the keyboard", + "DE.Views.FileMenuPanels.Settings.txtUseOptionKey": "Use Option key to navigate the user interface using the keyboard", "DE.Views.FileMenuPanels.Settings.txtInch": "Inch", "DE.Views.FileMenuPanels.Settings.txtInput": "Alternate Input", "DE.Views.FileMenuPanels.Settings.txtLast": "View Last", @@ -2020,6 +2026,7 @@ "DE.Views.LeftMenu.tipChat": "Chat", "DE.Views.LeftMenu.tipComments": "Comments", "DE.Views.LeftMenu.tipNavigation": "Navigation", + "DE.Views.LeftMenu.tipOutline": "Headings", "DE.Views.LeftMenu.tipPlugins": "Plugins", "DE.Views.LeftMenu.tipSearch": "Search", "DE.Views.LeftMenu.tipSupport": "Feedback & Support", @@ -2144,6 +2151,8 @@ "DE.Views.MailMergeSettings.txtPrev": "To previous record", "DE.Views.MailMergeSettings.txtUntitled": "Untitled", "DE.Views.MailMergeSettings.warnProcessMailMerge": "Starting merge failed", + "DE.Views.Navigation.strNavigate": "Headings", + "DE.Views.Navigation.txtClosePanel": "Close headings", "DE.Views.Navigation.txtCollapse": "Collapse all", "DE.Views.Navigation.txtDemote": "Demote", "DE.Views.Navigation.txtEmpty": "There are no headings in the document.
    Apply a heading style to the text so that it appears in the table of contents.", @@ -2151,11 +2160,17 @@ "DE.Views.Navigation.txtEmptyViewer": "There are no headings in the document.", "DE.Views.Navigation.txtExpand": "Expand all", "DE.Views.Navigation.txtExpandToLevel": "Expand to level", + "DE.Views.Navigation.txtFontSize": "Font size", "DE.Views.Navigation.txtHeadingAfter": "New heading after", "DE.Views.Navigation.txtHeadingBefore": "New heading before", + "DE.Views.Navigation.txtLarge":"Large", + "DE.Views.Navigation.txtMedium": "Medium", "DE.Views.Navigation.txtNewHeading": "New subheading", "DE.Views.Navigation.txtPromote": "Promote", "DE.Views.Navigation.txtSelect": "Select content", + "DE.Views.Navigation.txtSettings": "Headings settings", + "DE.Views.Navigation.txtSmall": "Small", + "DE.Views.Navigation.txtWrapHeadings": "Wrap long headings", "DE.Views.NoteSettingsDialog.textApply": "Apply", "DE.Views.NoteSettingsDialog.textApplyTo": "Apply changes to", "DE.Views.NoteSettingsDialog.textContinue": "Continuous", @@ -2849,6 +2864,7 @@ "DE.Views.ViewTab.textFitToWidth": "Fit To Width", "DE.Views.ViewTab.textInterfaceTheme": "Interface theme", "DE.Views.ViewTab.textNavigation": "Navigation", + "DE.Views.ViewTab.textOutline": "Headings", "DE.Views.ViewTab.textRulers": "Rulers", "DE.Views.ViewTab.textStatusBar": "Status Bar", "DE.Views.ViewTab.textZoom": "Zoom", diff --git a/apps/documenteditor/main/locale/es.json b/apps/documenteditor/main/locale/es.json index 2d4ec44eb..7480669bc 100644 --- a/apps/documenteditor/main/locale/es.json +++ b/apps/documenteditor/main/locale/es.json @@ -1702,6 +1702,7 @@ "DE.Views.FileMenuPanels.DocumentInfo.txtParagraphs": "Párrafos", "DE.Views.FileMenuPanels.DocumentInfo.txtPdfTagged": "PDF etiquetado", "DE.Views.FileMenuPanels.DocumentInfo.txtPdfVer": "Versión PDF", + "DE.Views.FileMenuPanels.DocumentInfo.txtPdfProducer": "Productor PDF", "DE.Views.FileMenuPanels.DocumentInfo.txtPlacement": "Ubicación", "DE.Views.FileMenuPanels.DocumentInfo.txtRights": "Personas que tienen derechos", "DE.Views.FileMenuPanels.DocumentInfo.txtSpaces": "Símbolos con espacios", diff --git a/apps/documenteditor/main/locale/fr.json b/apps/documenteditor/main/locale/fr.json index 4322d0030..d397ab29a 100644 --- a/apps/documenteditor/main/locale/fr.json +++ b/apps/documenteditor/main/locale/fr.json @@ -1702,6 +1702,7 @@ "DE.Views.FileMenuPanels.DocumentInfo.txtParagraphs": "Paragraphes", "DE.Views.FileMenuPanels.DocumentInfo.txtPdfTagged": "PDF marqué", "DE.Views.FileMenuPanels.DocumentInfo.txtPdfVer": "Version PDF", + "DE.Views.FileMenuPanels.DocumentInfo.txtPdfProducer": "Producteur PDF", "DE.Views.FileMenuPanels.DocumentInfo.txtPlacement": "Emplacement", "DE.Views.FileMenuPanels.DocumentInfo.txtRights": "Personnes qui ont des droits", "DE.Views.FileMenuPanels.DocumentInfo.txtSpaces": "Symboles avec des espaces", diff --git a/apps/documenteditor/main/locale/it.json b/apps/documenteditor/main/locale/it.json index 10f5b078b..6d0b2d864 100644 --- a/apps/documenteditor/main/locale/it.json +++ b/apps/documenteditor/main/locale/it.json @@ -1700,6 +1700,7 @@ "DE.Views.FileMenuPanels.DocumentInfo.txtTitle": "Titolo documento", "DE.Views.FileMenuPanels.DocumentInfo.txtUploaded": "Caricato", "DE.Views.FileMenuPanels.DocumentInfo.txtWords": "Parole", + "DE.Views.FileMenuPanels.DocumentInfo.txtPdfProducer": "Produttore PDF", "DE.Views.FileMenuPanels.DocumentRights.txtBtnAccessRights": "Modifica diritti di accesso", "DE.Views.FileMenuPanels.DocumentRights.txtRights": "Persone che hanno diritti", "DE.Views.FileMenuPanels.ProtectDoc.notcriticalErrorTitle": "Avviso", diff --git a/apps/documenteditor/main/locale/ru.json b/apps/documenteditor/main/locale/ru.json index 065187092..8ede8d475 100644 --- a/apps/documenteditor/main/locale/ru.json +++ b/apps/documenteditor/main/locale/ru.json @@ -1703,6 +1703,7 @@ "DE.Views.FileMenuPanels.DocumentInfo.txtParagraphs": "Абзацы", "DE.Views.FileMenuPanels.DocumentInfo.txtPdfTagged": "PDF с тегами", "DE.Views.FileMenuPanels.DocumentInfo.txtPdfVer": "Версия PDF", + "DE.Views.FileMenuPanels.DocumentInfo.txtPdfProducer": "Производитель PDF", "DE.Views.FileMenuPanels.DocumentInfo.txtPlacement": "Размещение", "DE.Views.FileMenuPanels.DocumentInfo.txtRights": "Люди, имеющие права", "DE.Views.FileMenuPanels.DocumentInfo.txtSpaces": "Символы с пробелами", diff --git a/apps/documenteditor/main/resources/less/filemenu.less b/apps/documenteditor/main/resources/less/filemenu.less index 260a36e47..650055751 100644 --- a/apps/documenteditor/main/resources/less/filemenu.less +++ b/apps/documenteditor/main/resources/less/filemenu.less @@ -102,46 +102,46 @@ .svg-format- { &docx { - background: ~"url(../../../apps/common/main/resources/img/doc-formats/docx.svg) no-repeat center"; + background: ~"url('@{common-image-const-path}/doc-formats/docx.svg') no-repeat center"; } &pdf { - background: ~"url(../../../apps/common/main/resources/img/doc-formats/pdf.svg) no-repeat center"; + background: ~"url('@{common-image-const-path}/doc-formats/pdf.svg') no-repeat center"; } &odt { - background: ~"url(../../../apps/common/main/resources/img/doc-formats/odt.svg) no-repeat center"; + background: ~"url('@{common-image-const-path}/doc-formats/odt.svg') no-repeat center"; } &txt { - background: ~"url(../../../apps/common/main/resources/img/doc-formats/txt.svg) no-repeat center"; + background: ~"url('@{common-image-const-path}/doc-formats/txt.svg') no-repeat center"; } &dotx { - background: ~"url(../../../apps/common/main/resources/img/doc-formats/dotx.svg) no-repeat center"; + background: ~"url('@{common-image-const-path}/doc-formats/dotx.svg') no-repeat center"; } &pdfa { - background: ~"url(../../../apps/common/main/resources/img/doc-formats/pdfa.svg) no-repeat center"; + background: ~"url('@{common-image-const-path}/doc-formats/pdfa.svg') no-repeat center"; } &ott { - background: ~"url(../../../apps/common/main/resources/img/doc-formats/ott.svg) no-repeat center"; + background: ~"url('@{common-image-const-path}/doc-formats/ott.svg') no-repeat center"; } &rtf { - background: ~"url(../../../apps/common/main/resources/img/doc-formats/rtf.svg) no-repeat center"; + background: ~"url('@{common-image-const-path}/doc-formats/rtf.svg') no-repeat center"; } &docm { - background: ~"url(../../../apps/common/main/resources/img/doc-formats/docm.svg) no-repeat center"; + background: ~"url('@{common-image-const-path}/doc-formats/docm.svg') no-repeat center"; } &docxf { - background: ~"url(../../../apps/common/main/resources/img/doc-formats/docxf.svg) no-repeat center"; + background: ~"url('@{common-image-const-path}/doc-formats/docxf.svg') no-repeat center"; } &oform { - background: ~"url(../../../apps/common/main/resources/img/doc-formats/oform.svg) no-repeat center"; + background: ~"url('@{common-image-const-path}/doc-formats/oform.svg') no-repeat center"; } &html { - background: ~"url(../../../apps/common/main/resources/img/doc-formats/html.svg) no-repeat center"; + background: ~"url('@{common-image-const-path}/doc-formats/html.svg') no-repeat center"; } &fb2 { - background: ~"url(../../../apps/common/main/resources/img/doc-formats/fb2.svg) no-repeat center"; + background: ~"url('@{common-image-const-path}/doc-formats/fb2.svg') no-repeat center"; } &epub { - background: ~"url(../../../apps/common/main/resources/img/doc-formats/epub.svg) no-repeat center"; + background: ~"url('@{common-image-const-path}/doc-formats/epub.svg') no-repeat center"; } } @@ -162,10 +162,10 @@ cursor: pointer; .svg-format-blank { - background: ~"url(resources/img/blank.svg) no-repeat center" ; + background: ~"url(@{app-image-const-path}/blank.svg) no-repeat center" ; } .svg-file-template{ - background: ~"url(resources/img/file-template.svg) no-repeat center" ; + background: ~"url(@{app-image-const-path}/file-template.svg) no-repeat center" ; } div { @@ -342,7 +342,7 @@ width: 100%; height: 100%; .svg-file-recent { - background: ~"url(resources/img/recent-file.svg) no-repeat top"; + background: ~"url(@{app-image-const-path}/recent-file.svg) no-repeat top"; } } } diff --git a/apps/documenteditor/main/resources/less/navigation.less b/apps/documenteditor/main/resources/less/navigation.less index e537517ce..9fd80ddb9 100644 --- a/apps/documenteditor/main/resources/less/navigation.less +++ b/apps/documenteditor/main/resources/less/navigation.less @@ -5,17 +5,23 @@ #navigation-header { position: absolute; - height: 38px; + height: 45px; left: 0; top: 0; width: 100%; - .font-weight-bold(); - padding: 10px 12px; + padding: 12px; + overflow: hidden; border-bottom: @scaled-one-px-value-ie solid @border-toolbar-ie; border-bottom: @scaled-one-px-value solid @border-toolbar; + label { + font-size: 12px; + .font-weight-bold(); + margin-top: 2px; + } } #navigation-list { + padding-top: 45px; height: 100%; overflow: hidden; font-size: 12px; @@ -30,14 +36,34 @@ } } } + .tree-item { + min-height: 25px; + .name { + padding: 5px 0; + } + } + } + &.small{ + font-size: 10px; + } + &.medium{ + font-size: 12px; + .name { + padding: 4px 0; + } + } + &.large{ + font-size: 14px; } - .name.not-header { font-style: italic; } - .name { + &.wrap .name{ white-space: pre-wrap; + } + + .name { word-break: break-word; max-height: 350px; } diff --git a/apps/documenteditor/mobile/locale/az.json b/apps/documenteditor/mobile/locale/az.json index 65ac70397..87e44b940 100644 --- a/apps/documenteditor/mobile/locale/az.json +++ b/apps/documenteditor/mobile/locale/az.json @@ -532,7 +532,8 @@ "warnProcessRightsChange": "Bu faylı redaktə etmək icazəniz yoxdur.", "textNoTextFound": "Text not found", "textReplaceSkipped": "The replacement has been made. {0} occurrences were skipped.", - "textReplaceSuccess": "The search has been done. Occurrences replaced: {0}" + "textReplaceSuccess": "The search has been done. Occurrences replaced: {0}", + "textRequestMacros": "A macro makes a request to URL. Do you want to allow the request to the %1?" }, "Settings": { "advDRMOptions": "Qorunan Fayl", @@ -655,7 +656,8 @@ "textNavigation": "Navigation", "textEmptyScreens": "There are no headings in the document. Apply a headings style to the text so that it appeas in the table of cotents.", "textBeginningDocument": "Beginning of document", - "textEmptyHeading": "Empty Heading" + "textEmptyHeading": "Empty Heading", + "textPdfProducer": "PDF Producer" }, "Toolbar": { "dlgLeaveMsgText": "Saxlanmamış dəyişiklikləriniz var. Avtomatik saxlanmanı gözləmək üçün \"Bu Səhifədə Qalın\" üzərinə klikləyin. Bütün saxlanmamış dəyişiklikləri ləğv etmək üçün \"Bu səhifədən Çıxın\" hissəsinin üzərinə klikləyin.", diff --git a/apps/documenteditor/mobile/locale/be.json b/apps/documenteditor/mobile/locale/be.json index 1c64fa788..7fcf1ce31 100644 --- a/apps/documenteditor/mobile/locale/be.json +++ b/apps/documenteditor/mobile/locale/be.json @@ -532,7 +532,8 @@ "warnLicenseUsersExceeded": "You've reached the user limit for %1 editors. Contact your administrator to learn more.", "warnNoLicense": "You've reached the limit for simultaneous connections to %1 editors. This document will be opened for viewing only. Contact %1 sales team for personal upgrade terms.", "warnNoLicenseUsers": "You've reached the user limit for %1 editors. Contact %1 sales team for personal upgrade terms.", - "warnProcessRightsChange": "You don't have permission to edit this file." + "warnProcessRightsChange": "You don't have permission to edit this file.", + "textRequestMacros": "A macro makes a request to URL. Do you want to allow the request to the %1?" }, "Settings": { "advDRMOptions": "Абаронены файл", @@ -655,7 +656,8 @@ "textNavigation": "Navigation", "textEmptyScreens": "There are no headings in the document. Apply a headings style to the text so that it appeas in the table of cotents.", "textBeginningDocument": "Beginning of document", - "textEmptyHeading": "Empty Heading" + "textEmptyHeading": "Empty Heading", + "textPdfProducer": "PDF Producer" }, "Toolbar": { "dlgLeaveTitleText": "Вы выходзіце з праграмы", diff --git a/apps/documenteditor/mobile/locale/bg.json b/apps/documenteditor/mobile/locale/bg.json index cc3ee0c00..4542b418d 100644 --- a/apps/documenteditor/mobile/locale/bg.json +++ b/apps/documenteditor/mobile/locale/bg.json @@ -532,7 +532,8 @@ "warnProcessRightsChange": "You don't have permission to edit this file.", "textReplaceSuccess": "The search has been done. Occurrences replaced: {0}", "textReplaceSkipped": "The replacement has been made. {0} occurrences were skipped.", - "textNoTextFound": "Text not found" + "textNoTextFound": "Text not found", + "textRequestMacros": "A macro makes a request to URL. Do you want to allow the request to the %1?" }, "Settings": { "advDRMOptions": "Protected File", @@ -655,7 +656,8 @@ "textPdfTagged": "Tagged PDF", "textFastWV": "Fast Web View", "textYes": "Yes", - "textNo": "No" + "textNo": "No", + "textPdfProducer": "PDF Producer" }, "Toolbar": { "dlgLeaveMsgText": "You have unsaved changes. Click 'Stay on this Page' to wait for autosave. Click 'Leave this Page' to discard all the unsaved changes.", diff --git a/apps/documenteditor/mobile/locale/ca.json b/apps/documenteditor/mobile/locale/ca.json index 0e7d8ec90..365dd6327 100644 --- a/apps/documenteditor/mobile/locale/ca.json +++ b/apps/documenteditor/mobile/locale/ca.json @@ -532,7 +532,8 @@ "warnLicenseUsersExceeded": "Has arribat al límit d'usuari per a %1 editors. Contacta amb el teu administrador per a més informació.", "warnNoLicense": "Has arribat al límit de connexions simultànies a %1 editors. Aquest document només s'obrirà en mode lectura. Contacta amb l'equip de vendes %1 per a les condicions d'una actualització personal.", "warnNoLicenseUsers": "Has arribat al límit d'usuaris per a %1 editors. Contacta amb l'equip de vendes de %1 per obtenir les condicions de millora personals dels teus serveis.", - "warnProcessRightsChange": "No tens permís per editar aquest fitxer." + "warnProcessRightsChange": "No tens permís per editar aquest fitxer.", + "textRequestMacros": "A macro makes a request to URL. Do you want to allow the request to the %1?" }, "Settings": { "advDRMOptions": "El fitxer està protegit", @@ -655,7 +656,8 @@ "textNavigation": "Navigation", "textEmptyScreens": "There are no headings in the document. Apply a headings style to the text so that it appeas in the table of cotents.", "textBeginningDocument": "Beginning of document", - "textEmptyHeading": "Empty Heading" + "textEmptyHeading": "Empty Heading", + "textPdfProducer": "PDF Producer" }, "Toolbar": { "dlgLeaveMsgText": "Tens canvis sense desar. Fes clic a \"Mantingueu-vos en aquesta pàgina\" per esperar al desament automàtic. Fes clic a \"Deixar aquesta pàgina\" per descartar tots els canvis no desats.", diff --git a/apps/documenteditor/mobile/locale/cs.json b/apps/documenteditor/mobile/locale/cs.json index 61e71709d..519778770 100644 --- a/apps/documenteditor/mobile/locale/cs.json +++ b/apps/documenteditor/mobile/locale/cs.json @@ -532,7 +532,8 @@ "warnLicenseUsersExceeded": "Došlo dosažení limitu %1 editorů v režimu spolupráce na úpravách. Ohledně podrobností se obraťte na svého správce.", "warnNoLicense": "Došlo k dosažení limitu souběžného připojení %1 editorů. Tento dokument bude otevřen pouze pro náhled. Pro rozšíření funkcí kontaktujte %1 obchodní oddělení.", "warnNoLicenseUsers": "Došlo k dosažení limitu %1 editorů. Pro rozšíření funkcí kontaktujte %1 obchodní oddělení.", - "warnProcessRightsChange": "Nemáte oprávnění pro úpravu tohoto dokumentu." + "warnProcessRightsChange": "Nemáte oprávnění pro úpravu tohoto dokumentu.", + "textRequestMacros": "A macro makes a request to URL. Do you want to allow the request to the %1?" }, "Settings": { "advDRMOptions": "Zabezpečený soubor", @@ -655,7 +656,8 @@ "textNavigation": "Navigation", "textEmptyScreens": "There are no headings in the document. Apply a headings style to the text so that it appeas in the table of cotents.", "textBeginningDocument": "Beginning of document", - "textEmptyHeading": "Empty Heading" + "textEmptyHeading": "Empty Heading", + "textPdfProducer": "PDF Producer" }, "Toolbar": { "dlgLeaveMsgText": "V tomto dokumentu máte neuložené změny. Klikněte na 'Zůstat na této stránce'. Klikněte na 'Opustit tuto stránku' pro zahození neuložených změn.", diff --git a/apps/documenteditor/mobile/locale/da.json b/apps/documenteditor/mobile/locale/da.json index cc3ee0c00..4542b418d 100644 --- a/apps/documenteditor/mobile/locale/da.json +++ b/apps/documenteditor/mobile/locale/da.json @@ -532,7 +532,8 @@ "warnProcessRightsChange": "You don't have permission to edit this file.", "textReplaceSuccess": "The search has been done. Occurrences replaced: {0}", "textReplaceSkipped": "The replacement has been made. {0} occurrences were skipped.", - "textNoTextFound": "Text not found" + "textNoTextFound": "Text not found", + "textRequestMacros": "A macro makes a request to URL. Do you want to allow the request to the %1?" }, "Settings": { "advDRMOptions": "Protected File", @@ -655,7 +656,8 @@ "textPdfTagged": "Tagged PDF", "textFastWV": "Fast Web View", "textYes": "Yes", - "textNo": "No" + "textNo": "No", + "textPdfProducer": "PDF Producer" }, "Toolbar": { "dlgLeaveMsgText": "You have unsaved changes. Click 'Stay on this Page' to wait for autosave. Click 'Leave this Page' to discard all the unsaved changes.", diff --git a/apps/documenteditor/mobile/locale/de.json b/apps/documenteditor/mobile/locale/de.json index 5428ce63a..8139f39d5 100644 --- a/apps/documenteditor/mobile/locale/de.json +++ b/apps/documenteditor/mobile/locale/de.json @@ -532,7 +532,8 @@ "warnLicenseUsersExceeded": "Sie haben das Benutzerlimit für %1-Editoren erreicht. Bitte wenden Sie sich an Ihren Administrator, um weitere Informationen zu erhalten.", "warnNoLicense": "Sie haben die maximale Anzahl von gleichzeitigen Verbindungen in %1-Editoren erreicht. Die Bearbeitung ist jetzt in diesem Dokument nicht verfügbar. Bitte kontaktieren Sie unser Verkaufsteam, um persönliche Upgrade-Bedingungen zu erhalten.", "warnNoLicenseUsers": "Sie haben das Benutzerlimit für %1-Editoren erreicht. Bitte kontaktieren Sie unser Verkaufsteam, um persönliche Upgrade-Bedingungen zu erhalten.", - "warnProcessRightsChange": "Sie können diese Datei nicht bearbeiten." + "warnProcessRightsChange": "Sie können diese Datei nicht bearbeiten.", + "textRequestMacros": "A macro makes a request to URL. Do you want to allow the request to the %1?" }, "Settings": { "advDRMOptions": "Geschützte Datei", @@ -655,7 +656,8 @@ "textNavigation": "Navigation", "textEmptyScreens": "There are no headings in the document. Apply a headings style to the text so that it appeas in the table of cotents.", "textBeginningDocument": "Beginning of document", - "textEmptyHeading": "Empty Heading" + "textEmptyHeading": "Empty Heading", + "textPdfProducer": "PDF-Ersteller" }, "Toolbar": { "dlgLeaveMsgText": "Sie haben nicht gespeicherte Änderungen. Klicken Sie auf \"Auf dieser Seite bleiben\" und warten Sie, bis die Datei automatisch gespeichert wird. Klicken Sie auf \"Die Seite verlassen\", um nicht gespeicherte Änderungen zu verwerfen.", diff --git a/apps/documenteditor/mobile/locale/el.json b/apps/documenteditor/mobile/locale/el.json index 4ed3c7ffe..71598ffee 100644 --- a/apps/documenteditor/mobile/locale/el.json +++ b/apps/documenteditor/mobile/locale/el.json @@ -532,7 +532,8 @@ "warnLicenseUsersExceeded": "Έχετε φτάσει το όριο χρήστη για συντάκτες %1.
    Επικοινωνήστε με τον διαχειριστή σας για περισσότερες πληροφορίες.", "warnNoLicense": "Φτάσατε το όριο ταυτόχρονων συνδέσεων σε %1 συντάκτες. Το έγγραφο θα ανοίξει μόνο για ανάγνωση. Επικοινωνήστε με την ομάδα πωλήσεων %1 για τους όρους αναβάθμισης.", "warnNoLicenseUsers": "Έχετε φτάσει το όριο χρήστη για συντάκτες %1.
    Επικοινωνήστε με την ομάδα πωλήσεων %1 για προσωπικούς όρους αναβάθμισης.", - "warnProcessRightsChange": "Δεν έχετε δικαίωμα επεξεργασίας αυτού του αρχείου." + "warnProcessRightsChange": "Δεν έχετε δικαίωμα επεξεργασίας αυτού του αρχείου.", + "textRequestMacros": "A macro makes a request to URL. Do you want to allow the request to the %1?" }, "Settings": { "advDRMOptions": "Προστατευμένο Αρχείο", @@ -655,7 +656,8 @@ "textNavigation": "Navigation", "textEmptyScreens": "There are no headings in the document. Apply a headings style to the text so that it appeas in the table of cotents.", "textBeginningDocument": "Beginning of document", - "textEmptyHeading": "Empty Heading" + "textEmptyHeading": "Empty Heading", + "textPdfProducer": "PDF Producer" }, "Toolbar": { "dlgLeaveMsgText": "Έχετε μη αποθηκευμένες αλλαγές. Πατήστε 'Παραμονή στη Σελίδα' για να περιμένετε την αυτόματη αποθήκευση. Πατήστε 'Έξοδος από τη Σελίδα' για να απορρίψετε όλες τις μη αποθηκευμένες αλλαγές.", diff --git a/apps/documenteditor/mobile/locale/en.json b/apps/documenteditor/mobile/locale/en.json index b54df1ffd..964d969d6 100644 --- a/apps/documenteditor/mobile/locale/en.json +++ b/apps/documenteditor/mobile/locale/en.json @@ -292,7 +292,14 @@ "textPageBreakBefore": "Page Break Before", "textPageNumbering": "Page Numbering", "textParagraph": "Paragraph", - "textParagraphStyles": "Paragraph Styles", + "textCreateTextStyle": "Create new text style", + "textDone": "Done", + "textTitle": "Title", + "textEnterTitleNewStyle": "Enter title of a new style", + "textNextParagraphStyle": "Next paragraph style", + "textSameCreatedNewStyle": "Same as created new style", + "del_textParagraphStyles": "Paragraph Styles", + "textParagraphStyle": "Paragraph Style", "textPictureFromLibrary": "Picture from Library", "textPictureFromURL": "Picture from URL", "textPt": "pt", @@ -532,7 +539,8 @@ "warnLicenseUsersExceeded": "You've reached the user limit for %1 editors. Contact your administrator to learn more.", "warnNoLicense": "You've reached the limit for simultaneous connections to %1 editors. This document will be opened for viewing only. Contact %1 sales team for personal upgrade terms.", "warnNoLicenseUsers": "You've reached the user limit for %1 editors. Contact %1 sales team for personal upgrade terms.", - "warnProcessRightsChange": "You don't have permission to edit this file." + "warnProcessRightsChange": "You don't have permission to edit this file.", + "textRequestMacros": "A macro makes a request to URL. Do you want to allow the request to the %1?" }, "Settings": { "advDRMOptions": "Protected File", @@ -608,6 +616,7 @@ "textParagraphs": "Paragraphs", "textPdfTagged": "Tagged PDF", "textPdfVer": "PDF Version", + "textPdfProducer": "PDF Producer", "textPoint": "Point", "textPortrait": "Portrait", "textPrint": "Print", diff --git a/apps/documenteditor/mobile/locale/es.json b/apps/documenteditor/mobile/locale/es.json index 285376d0e..e6f3fd0b6 100644 --- a/apps/documenteditor/mobile/locale/es.json +++ b/apps/documenteditor/mobile/locale/es.json @@ -532,7 +532,8 @@ "warnLicenseUsersExceeded": "Ha alcanzado el límite de usuarios para %1 editores. Póngase en contacto con su administrador para saber más.", "warnNoLicense": "Ha alcanzado el límite de conexiones simultáneas con %1 editores. Este documento se abrirá sólo para su visualización. Póngase en contacto con el equipo de ventas de %1 para conocer las condiciones de actualización personal.", "warnNoLicenseUsers": "Ha alcanzado el límite de usuarios para %1 editores. Póngase en contacto con el equipo de ventas de %1 para conocer las condiciones de actualización personal.", - "warnProcessRightsChange": "No tiene permiso para editar este archivo." + "warnProcessRightsChange": "No tiene permiso para editar este archivo.", + "textRequestMacros": "A macro makes a request to URL. Do you want to allow the request to the %1?" }, "Settings": { "advDRMOptions": "Archivo protegido", @@ -655,7 +656,8 @@ "textNavigation": "Navigation", "textEmptyScreens": "There are no headings in the document. Apply a headings style to the text so that it appeas in the table of cotents.", "textBeginningDocument": "Beginning of document", - "textEmptyHeading": "Empty Heading" + "textEmptyHeading": "Empty Heading", + "textPdfProducer": "Productor PDF" }, "Toolbar": { "dlgLeaveMsgText": "Tiene cambios sin guardar. Haga clic en \"Permanecer en esta página\" para esperar a que se guarde automáticamente. Haga clic en \"Salir de esta página\" para descartar todos los cambios no guardados.", diff --git a/apps/documenteditor/mobile/locale/fi.json b/apps/documenteditor/mobile/locale/fi.json index cc3ee0c00..4542b418d 100644 --- a/apps/documenteditor/mobile/locale/fi.json +++ b/apps/documenteditor/mobile/locale/fi.json @@ -532,7 +532,8 @@ "warnProcessRightsChange": "You don't have permission to edit this file.", "textReplaceSuccess": "The search has been done. Occurrences replaced: {0}", "textReplaceSkipped": "The replacement has been made. {0} occurrences were skipped.", - "textNoTextFound": "Text not found" + "textNoTextFound": "Text not found", + "textRequestMacros": "A macro makes a request to URL. Do you want to allow the request to the %1?" }, "Settings": { "advDRMOptions": "Protected File", @@ -655,7 +656,8 @@ "textPdfTagged": "Tagged PDF", "textFastWV": "Fast Web View", "textYes": "Yes", - "textNo": "No" + "textNo": "No", + "textPdfProducer": "PDF Producer" }, "Toolbar": { "dlgLeaveMsgText": "You have unsaved changes. Click 'Stay on this Page' to wait for autosave. Click 'Leave this Page' to discard all the unsaved changes.", diff --git a/apps/documenteditor/mobile/locale/fr.json b/apps/documenteditor/mobile/locale/fr.json index 4bbb151eb..25829e47c 100644 --- a/apps/documenteditor/mobile/locale/fr.json +++ b/apps/documenteditor/mobile/locale/fr.json @@ -532,7 +532,8 @@ "warnLicenseUsersExceeded": "Vous avez dépassé le nombre maximal d’utilisateurs des éditeurs %1. Pour en savoir plus, contactez votre administrateur.", "warnNoLicense": "Vous avez dépassé le nombre maximal de connexions simultanées aux éditeurs %1. Ce document sera ouvert en lecture seule. Contactez l’équipe des ventes %1 pour mettre à jour les termes de la licence.", "warnNoLicenseUsers": "Vous avez dépassé le nombre maximal d’utilisateurs des éditeurs %1. Contactez l’équipe des ventes %1 pour mettre à jour les termes de la licence.", - "warnProcessRightsChange": "Vous n'avez pas la permission de modifier ce fichier." + "warnProcessRightsChange": "Vous n'avez pas la permission de modifier ce fichier.", + "textRequestMacros": "A macro makes a request to URL. Do you want to allow the request to the %1?" }, "Settings": { "advDRMOptions": "Fichier protégé", @@ -655,7 +656,8 @@ "textNavigation": "Navigation", "textEmptyScreens": "There are no headings in the document. Apply a headings style to the text so that it appeas in the table of cotents.", "textBeginningDocument": "Beginning of document", - "textEmptyHeading": "Empty Heading" + "textEmptyHeading": "Empty Heading", + "textPdfProducer": "Producteur PDF" }, "Toolbar": { "dlgLeaveMsgText": "Vous avez des modifications non enregistrées dans ce document. Cliquez sur Rester sur cette page et attendez l'enregistrement automatique. Cliquez sur Quitter cette page pour annuler toutes les modifications non enregistrées.", diff --git a/apps/documenteditor/mobile/locale/gl.json b/apps/documenteditor/mobile/locale/gl.json index 25ac5103a..65b9eed8b 100644 --- a/apps/documenteditor/mobile/locale/gl.json +++ b/apps/documenteditor/mobile/locale/gl.json @@ -532,7 +532,8 @@ "warnLicenseUsersExceeded": "Alcanzou o límite de usuarios para os editores de %1. Por favor, contacte co se uadministrador para recibir máis información.", "warnNoLicense": "Alcanzou o límite de conexións simultáneas con %1 editores. Este documento abrirase para as úa visualización. Póñase en contacto co equipo de vendas de %1 para coñecer as condicións de actualización persoal.", "warnNoLicenseUsers": "Alcanzou o límite de usuarios para os editores de %1.
    Contacte co equipo de vendas de %1 para coñecer os termos de actualización persoal.", - "warnProcessRightsChange": "Non ten permiso para editar este ficheiro." + "warnProcessRightsChange": "Non ten permiso para editar este ficheiro.", + "textRequestMacros": "A macro makes a request to URL. Do you want to allow the request to the %1?" }, "Settings": { "advDRMOptions": "Ficheiro protexido", @@ -655,7 +656,8 @@ "textNavigation": "Navigation", "textEmptyScreens": "There are no headings in the document. Apply a headings style to the text so that it appeas in the table of cotents.", "textBeginningDocument": "Beginning of document", - "textEmptyHeading": "Empty Heading" + "textEmptyHeading": "Empty Heading", + "textPdfProducer": "PDF Producer" }, "Toolbar": { "dlgLeaveMsgText": "Ten cambios sen gardar. Prema en \"Permanecer nesta páxina\" para esperar a que se garde automaticamente. Prema en \"Saír desta páxina\" para descartar todos os cambios non gardados.", diff --git a/apps/documenteditor/mobile/locale/hu.json b/apps/documenteditor/mobile/locale/hu.json index 5d75465bb..2e800f3a2 100644 --- a/apps/documenteditor/mobile/locale/hu.json +++ b/apps/documenteditor/mobile/locale/hu.json @@ -532,7 +532,8 @@ "warnLicenseUsersExceeded": "Elérte a(z) %1 szerkesztőhöz tartozó felhasználói korlátját. További információért forduljon rendszergazdájához.", "warnNoLicense": "Elérte a(z) %1 szerkesztővel való egyidejű kapcsolódási korlátot. Ez a dokumentum csak megtekintésre nyílik meg. Lépjen kapcsolatba a(z) %1 értékesítési csapattal a személyes frissítés feltételekért.", "warnNoLicenseUsers": "Elérte a(z) %1 szerkesztőhöz tartozó felhasználói korlátját. Vegye fel a kapcsolatot a(z) %1 értékesítési csapattal a személyes frissítési feltételekért.", - "warnProcessRightsChange": "Nincs engedélye a fájl szerkesztésére." + "warnProcessRightsChange": "Nincs engedélye a fájl szerkesztésére.", + "textRequestMacros": "A macro makes a request to URL. Do you want to allow the request to the %1?" }, "Settings": { "advDRMOptions": "Védett fájl", @@ -655,7 +656,8 @@ "textNavigation": "Navigation", "textEmptyScreens": "There are no headings in the document. Apply a headings style to the text so that it appeas in the table of cotents.", "textBeginningDocument": "Beginning of document", - "textEmptyHeading": "Empty Heading" + "textEmptyHeading": "Empty Heading", + "textPdfProducer": "PDF Producer" }, "Toolbar": { "dlgLeaveMsgText": "Nem mentett módosításai vannak. Kattintson a „Maradj ezen az oldalon” gombra az automatikus mentés megvárásához. Kattintson a \"Hagyja el ezt az oldalt\" gombra az összes nem mentett módosítás elvetéséhez.", diff --git a/apps/documenteditor/mobile/locale/id.json b/apps/documenteditor/mobile/locale/id.json index 0195441eb..9353166c8 100644 --- a/apps/documenteditor/mobile/locale/id.json +++ b/apps/documenteditor/mobile/locale/id.json @@ -532,7 +532,8 @@ "warnLicenseUsersExceeded": "Anda sudah mencapai batas user untuk %1 editor. Hubungi admin Anda untuk mempelajari lebih lanjut.", "warnNoLicense": "Anda sudah mencapai batas untuk koneksi bersamaan ke %1 editor. Dokumen ini akan dibuka untuk dilihat saja. Hubungi %1 tim sales untuk syarat personal upgrade.", "warnNoLicenseUsers": "Anda sudah mencapai batas user untuk %1 editor. Hubungi %1 tim sales untuk syarat personal upgrade.", - "warnProcessRightsChange": "Anda tidak memiliki izin edit file ini." + "warnProcessRightsChange": "Anda tidak memiliki izin edit file ini.", + "textRequestMacros": "A macro makes a request to URL. Do you want to allow the request to the %1?" }, "Settings": { "advDRMOptions": "File yang Diproteksi", @@ -655,7 +656,8 @@ "textNavigation": "Navigation", "textEmptyScreens": "There are no headings in the document. Apply a headings style to the text so that it appeas in the table of cotents.", "textBeginningDocument": "Beginning of document", - "textEmptyHeading": "Empty Heading" + "textEmptyHeading": "Empty Heading", + "textPdfProducer": "PDF Producer" }, "Toolbar": { "dlgLeaveMsgText": "Anda memiliki perubahan yang belum tersimpan. Klik 'Tetap di Halaman Ini' untuk menunggu simpan otomatis. Klik ‘Tinggalkan Halaman Ini’ untuk membatalkan semua perubahan yang belum disimpan.", diff --git a/apps/documenteditor/mobile/locale/it.json b/apps/documenteditor/mobile/locale/it.json index e2df4e1a8..0862c2453 100644 --- a/apps/documenteditor/mobile/locale/it.json +++ b/apps/documenteditor/mobile/locale/it.json @@ -532,7 +532,8 @@ "warnLicenseUsersExceeded": "Hai raggiunto il limite degli utenti per gli editor %1. Ti preghiamo di contattare il tuo amministratore per maggior informazioni.", "warnNoLicense": "Hai raggiunto il limite delle connessioni simultanee agli editor %1. Questo documento sarà aperto solo in modalità di visualizzazione. Ti preghiamo di contattare il team di vendite di %1 per i termini di aggiornamento personali.", "warnNoLicenseUsers": "Hai raggiunto il limite degli utenti per gli editor %1. Ti preghiamo di contattare il team di vendite di %1 per i termini di aggiornamento personali.", - "warnProcessRightsChange": "Non hai il permesso di modificare questo file." + "warnProcessRightsChange": "Non hai il permesso di modificare questo file.", + "textRequestMacros": "A macro makes a request to URL. Do you want to allow the request to the %1?" }, "Settings": { "advDRMOptions": "File protetto", @@ -655,7 +656,8 @@ "textNavigation": "Navigation", "textEmptyScreens": "There are no headings in the document. Apply a headings style to the text so that it appeas in the table of cotents.", "textBeginningDocument": "Beginning of document", - "textEmptyHeading": "Empty Heading" + "textEmptyHeading": "Empty Heading", + "textPdfProducer": "Produttore PDF" }, "Toolbar": { "dlgLeaveMsgText": "Hai dei cambiamenti non salvati. Premi 'Rimanere sulla pagina' per attendere il salvataggio automatico. Premi 'Lasciare la pagina' per eliminare tutte le modifiche non salvate.", diff --git a/apps/documenteditor/mobile/locale/ja.json b/apps/documenteditor/mobile/locale/ja.json index 630c72a9e..2d44b48de 100644 --- a/apps/documenteditor/mobile/locale/ja.json +++ b/apps/documenteditor/mobile/locale/ja.json @@ -532,7 +532,8 @@ "warnLicenseUsersExceeded": "%1エディターのユーザー制限に達しました。 詳細についてはアドミニストレータを連絡してください。", "warnNoLicense": "%1エディター 時接続数の制限に達しました。この文書が見るだけのために開かれる。個人的なアップグレード条件については、%1営業チームを連絡してください。", "warnNoLicenseUsers": "%1エディターのユーザー制限に達しました。 個人的なアップグレード条件については、%1営業チームを連絡してください。", - "warnProcessRightsChange": "ファイルを編集する権限がありません!" + "warnProcessRightsChange": "ファイルを編集する権限がありません!", + "textRequestMacros": "A macro makes a request to URL. Do you want to allow the request to the %1?" }, "Settings": { "advDRMOptions": "保護されたファイル", @@ -655,7 +656,8 @@ "textNavigation": "Navigation", "textEmptyScreens": "There are no headings in the document. Apply a headings style to the text so that it appeas in the table of cotents.", "textBeginningDocument": "Beginning of document", - "textEmptyHeading": "Empty Heading" + "textEmptyHeading": "Empty Heading", + "textPdfProducer": "PDF Producer" }, "Toolbar": { "dlgLeaveMsgText": "保存されていない変更があります。自動保存を待つように「このページから移動しない」をクリックしてください。保存されていない変更を破棄ように「このページから移動する」をクリックしてください。", diff --git a/apps/documenteditor/mobile/locale/ko.json b/apps/documenteditor/mobile/locale/ko.json index 25b34b8e3..0be5ed6d5 100644 --- a/apps/documenteditor/mobile/locale/ko.json +++ b/apps/documenteditor/mobile/locale/ko.json @@ -532,7 +532,8 @@ "warnLicenseUsersExceeded": "편집자 사용자 한도인 %1명에 도달했습니다. 자세한 내용은 관리자에게 문의하십시오.", "warnNoLicense": "% 1 편집 연결 수 제한에 도달했습니다. 이 문서는 보기 모드로 열립니다. 개인적인 업그레이드 사항은 % 1 영업팀에 연락하십시오.", "warnNoLicenseUsers": "ONLYOFFICE 편집자의이 버전은 동시 사용자에게 일정한 제한이 있습니다.
    더 필요한 것이 있으면 현재 라이센스를 업그레이드하거나 상용 라이센스를 구입하십시오.", - "warnProcessRightsChange": "파일을 편집 할 권한이 없습니다." + "warnProcessRightsChange": "파일을 편집 할 권한이 없습니다.", + "textRequestMacros": "A macro makes a request to URL. Do you want to allow the request to the %1?" }, "Settings": { "advDRMOptions": "보호 된 파일", @@ -655,7 +656,8 @@ "textNavigation": "Navigation", "textEmptyScreens": "There are no headings in the document. Apply a headings style to the text so that it appeas in the table of cotents.", "textBeginningDocument": "Beginning of document", - "textEmptyHeading": "Empty Heading" + "textEmptyHeading": "Empty Heading", + "textPdfProducer": "PDF Producer" }, "Toolbar": { "dlgLeaveMsgText": "저장하지 않은 변경 사항이 있습니다. 자동 저장이 완료될 때까지 기다리려면 \"이 페이지에 머물기\"를 클릭하십시오. \"이 페이지에서 나가기\"를 클릭하면 저장되지 않은 모든 변경 사항이 삭제됩니다.", diff --git a/apps/documenteditor/mobile/locale/lo.json b/apps/documenteditor/mobile/locale/lo.json index 19f65ddac..780b73c5f 100644 --- a/apps/documenteditor/mobile/locale/lo.json +++ b/apps/documenteditor/mobile/locale/lo.json @@ -532,7 +532,8 @@ "warnLicenseUsersExceeded": "ຈໍານວນ ການເຊື່ອມຕໍ່ພ້ອມກັນກັບຜູ້ແກ້ໄຂ ແມ່ນເກີນກໍານົດ % 1. ຕິດຕໍ່ທີມບໍລິຫານເພື່ອຂໍ້ມູນເພີ່ມເຕີ່ມ", "warnNoLicense": "ທ່ານໄດ້ຖືກຈຳກັດສິດພຽງເທົ່ານີ້ສຳຫລັບການເຊື່່ອມພ້ອມກັນກັບເຄື່ອງມືແກ້ໄຂ %1 ແລ້ວເອກະສານນີ້ຈະເປີດໃຫ້ເບີ່ງເທົ່ານັ້ນ ຕິດຕໍ່ທີມຂາຍ %1 ສຳຫລັບເງື່ອນໄຂການອັບເກດສ່ວນບຸກຄົນ", "warnNoLicenseUsers": "ຈໍານວນການເຊື່ອມຕໍ່ພ້ອມກັນກັບບັນນາທິການ ແມ່ນເກີນກໍານົດ % 1. ຕິດຕໍ່ ທີມຂາຍ %1 ສຳລັບຂໍ້ກຳນົດການຍົກລະດັບສິດ", - "warnProcessRightsChange": "ທ່ານບໍ່ມີສິດໃນການແກ້ໄຂໄຟລ໌ນີ້." + "warnProcessRightsChange": "ທ່ານບໍ່ມີສິດໃນການແກ້ໄຂໄຟລ໌ນີ້.", + "textRequestMacros": "A macro makes a request to URL. Do you want to allow the request to the %1?" }, "Settings": { "advDRMOptions": "ເອກະສານທີ່ໄດ້ຮັບການປົກປ້ອງ", @@ -655,7 +656,8 @@ "textNavigation": "Navigation", "textEmptyScreens": "There are no headings in the document. Apply a headings style to the text so that it appeas in the table of cotents.", "textBeginningDocument": "Beginning of document", - "textEmptyHeading": "Empty Heading" + "textEmptyHeading": "Empty Heading", + "textPdfProducer": "PDF Producer" }, "Toolbar": { "dlgLeaveMsgText": "ທ່ານມີການປ່ຽນແປງທີ່ຍັງບໍ່ໄດ້ບັນທຶກໄວ້. ຄລິກທີ່ 'ຢູ່ໃນໜ້ານີ້' ເພື່ອລໍຖ້າການບັນທຶກອັດຕະໂນມັດ. ຄລິກ 'ອອກຈາກໜ້ານີ້' ເພື່ອຍົກເລີກການປ່ຽນແປງທີ່ບໍ່ໄດ້ບັນທຶກໄວ້ທັງໝົດ.", diff --git a/apps/documenteditor/mobile/locale/lv.json b/apps/documenteditor/mobile/locale/lv.json index cc3ee0c00..4542b418d 100644 --- a/apps/documenteditor/mobile/locale/lv.json +++ b/apps/documenteditor/mobile/locale/lv.json @@ -532,7 +532,8 @@ "warnProcessRightsChange": "You don't have permission to edit this file.", "textReplaceSuccess": "The search has been done. Occurrences replaced: {0}", "textReplaceSkipped": "The replacement has been made. {0} occurrences were skipped.", - "textNoTextFound": "Text not found" + "textNoTextFound": "Text not found", + "textRequestMacros": "A macro makes a request to URL. Do you want to allow the request to the %1?" }, "Settings": { "advDRMOptions": "Protected File", @@ -655,7 +656,8 @@ "textPdfTagged": "Tagged PDF", "textFastWV": "Fast Web View", "textYes": "Yes", - "textNo": "No" + "textNo": "No", + "textPdfProducer": "PDF Producer" }, "Toolbar": { "dlgLeaveMsgText": "You have unsaved changes. Click 'Stay on this Page' to wait for autosave. Click 'Leave this Page' to discard all the unsaved changes.", diff --git a/apps/documenteditor/mobile/locale/nb.json b/apps/documenteditor/mobile/locale/nb.json index cc3ee0c00..4542b418d 100644 --- a/apps/documenteditor/mobile/locale/nb.json +++ b/apps/documenteditor/mobile/locale/nb.json @@ -532,7 +532,8 @@ "warnProcessRightsChange": "You don't have permission to edit this file.", "textReplaceSuccess": "The search has been done. Occurrences replaced: {0}", "textReplaceSkipped": "The replacement has been made. {0} occurrences were skipped.", - "textNoTextFound": "Text not found" + "textNoTextFound": "Text not found", + "textRequestMacros": "A macro makes a request to URL. Do you want to allow the request to the %1?" }, "Settings": { "advDRMOptions": "Protected File", @@ -655,7 +656,8 @@ "textPdfTagged": "Tagged PDF", "textFastWV": "Fast Web View", "textYes": "Yes", - "textNo": "No" + "textNo": "No", + "textPdfProducer": "PDF Producer" }, "Toolbar": { "dlgLeaveMsgText": "You have unsaved changes. Click 'Stay on this Page' to wait for autosave. Click 'Leave this Page' to discard all the unsaved changes.", diff --git a/apps/documenteditor/mobile/locale/nl.json b/apps/documenteditor/mobile/locale/nl.json index 20b7f9a82..8557cbda1 100644 --- a/apps/documenteditor/mobile/locale/nl.json +++ b/apps/documenteditor/mobile/locale/nl.json @@ -532,7 +532,8 @@ "warnProcessRightsChange": "Je hebt geen toestemming om dit bestand te bewerken.", "textNoTextFound": "Text not found", "textReplaceSkipped": "The replacement has been made. {0} occurrences were skipped.", - "textReplaceSuccess": "The search has been done. Occurrences replaced: {0}" + "textReplaceSuccess": "The search has been done. Occurrences replaced: {0}", + "textRequestMacros": "A macro makes a request to URL. Do you want to allow the request to the %1?" }, "Settings": { "advDRMOptions": "Beveiligd bestand", @@ -655,7 +656,8 @@ "textNavigation": "Navigation", "textEmptyScreens": "There are no headings in the document. Apply a headings style to the text so that it appeas in the table of cotents.", "textBeginningDocument": "Beginning of document", - "textEmptyHeading": "Empty Heading" + "textEmptyHeading": "Empty Heading", + "textPdfProducer": "PDF Producer" }, "Toolbar": { "dlgLeaveMsgText": "U heeft nog niet opgeslagen wijzigingen. Klik op 'Blijf op deze pagina' om te wachten op automatisch opslaan. Klik op 'Verlaat deze pagina' om alle niet-opgeslagen wijzigingen te verwijderen.", diff --git a/apps/documenteditor/mobile/locale/pl.json b/apps/documenteditor/mobile/locale/pl.json index cc3ee0c00..4542b418d 100644 --- a/apps/documenteditor/mobile/locale/pl.json +++ b/apps/documenteditor/mobile/locale/pl.json @@ -532,7 +532,8 @@ "warnProcessRightsChange": "You don't have permission to edit this file.", "textReplaceSuccess": "The search has been done. Occurrences replaced: {0}", "textReplaceSkipped": "The replacement has been made. {0} occurrences were skipped.", - "textNoTextFound": "Text not found" + "textNoTextFound": "Text not found", + "textRequestMacros": "A macro makes a request to URL. Do you want to allow the request to the %1?" }, "Settings": { "advDRMOptions": "Protected File", @@ -655,7 +656,8 @@ "textPdfTagged": "Tagged PDF", "textFastWV": "Fast Web View", "textYes": "Yes", - "textNo": "No" + "textNo": "No", + "textPdfProducer": "PDF Producer" }, "Toolbar": { "dlgLeaveMsgText": "You have unsaved changes. Click 'Stay on this Page' to wait for autosave. Click 'Leave this Page' to discard all the unsaved changes.", diff --git a/apps/documenteditor/mobile/locale/pt-PT.json b/apps/documenteditor/mobile/locale/pt-PT.json index c95b65705..0fc936dc4 100644 --- a/apps/documenteditor/mobile/locale/pt-PT.json +++ b/apps/documenteditor/mobile/locale/pt-PT.json @@ -532,7 +532,8 @@ "warnLicenseUsersExceeded": "Atingiu o limite de %1 editores. Contacte o seu administrador para obter detalhes.", "warnNoLicense": "Atingiu o limite de ligações simultâneas a %1 editores. Este documento será aberto apenas para visualização. Contacte a %1 equipa de vendas para consultar os termos de atualização para si.", "warnNoLicenseUsers": "Atingiu o limite de %1 editores. Contacte a equipa comercial %1 para obter mais informações.", - "warnProcessRightsChange": "Não tem autorização para editar este ficheiro." + "warnProcessRightsChange": "Não tem autorização para editar este ficheiro.", + "textRequestMacros": "A macro makes a request to URL. Do you want to allow the request to the %1?" }, "Settings": { "advDRMOptions": "Ficheiro protegido", @@ -655,7 +656,8 @@ "textNavigation": "Navigation", "textEmptyScreens": "There are no headings in the document. Apply a headings style to the text so that it appeas in the table of cotents.", "textBeginningDocument": "Beginning of document", - "textEmptyHeading": "Empty Heading" + "textEmptyHeading": "Empty Heading", + "textPdfProducer": "PDF Producer" }, "Toolbar": { "dlgLeaveMsgText": "Existem alterações não guardadas. Clique 'Ficar na página' para guardar automaticamente. Clique 'Sair da página' para rejeitar todas as alterações.", diff --git a/apps/documenteditor/mobile/locale/pt.json b/apps/documenteditor/mobile/locale/pt.json index 5a8fff274..08e5d7ae2 100644 --- a/apps/documenteditor/mobile/locale/pt.json +++ b/apps/documenteditor/mobile/locale/pt.json @@ -532,7 +532,8 @@ "warnLicenseUsersExceeded": "Você atingiu o limite de usuários para editores %1. Entre em contato com seu administrador para saber mais.", "warnNoLicense": "Você atingiu o limite de conexões simultâneas para% 1 editores. Este documento será aberto apenas para visualização. Contate a equipe de vendas% 1 para termos de atualização pessoal.", "warnNoLicenseUsers": "Você atingiu o limite de usuários para editores %1.
    Entre em contato com a equipe de vendas da %1 para obter os termos de atualização pessoais.", - "warnProcessRightsChange": "Você não tem permissão para editar este arquivo." + "warnProcessRightsChange": "Você não tem permissão para editar este arquivo.", + "textRequestMacros": "A macro makes a request to URL. Do you want to allow the request to the %1?" }, "Settings": { "advDRMOptions": "Arquivo protegido", @@ -655,7 +656,8 @@ "textNavigation": "Navigation", "textEmptyScreens": "There are no headings in the document. Apply a headings style to the text so that it appeas in the table of cotents.", "textBeginningDocument": "Beginning of document", - "textEmptyHeading": "Empty Heading" + "textEmptyHeading": "Empty Heading", + "textPdfProducer": "PDF Producer" }, "Toolbar": { "dlgLeaveMsgText": "Você tem mudanças não salvas. Clique em 'Ficar nesta página' para esperar pela auto-salvar. Clique em 'Sair desta página' para descartar todas as mudanças não salvas.", diff --git a/apps/documenteditor/mobile/locale/ro.json b/apps/documenteditor/mobile/locale/ro.json index 54b830f03..4ea87ed3b 100644 --- a/apps/documenteditor/mobile/locale/ro.json +++ b/apps/documenteditor/mobile/locale/ro.json @@ -532,7 +532,8 @@ "warnLicenseUsersExceeded": "Ați atins numărul maxim de utilizatori ai %1 editoare. Pentru detalii, contactați administratorul dvs.", "warnNoLicense": "Ați atins numărul maxim de conexiuni simultane la %1 de editoare. Documentul este disponibil numai pentru vizualizare. Contactați %1 Departamentul de Vânzări pentru acordarea condițiilor personale de actualizare.", "warnNoLicenseUsers": "Ați atins numărul maxim de utilizatori ai %1 editoare. Contactați Grup Vânzări %1 pentru acordarea condițiilor personale de licențiere.", - "warnProcessRightsChange": "Nu aveți permisiunea de editare pentru fișier." + "warnProcessRightsChange": "Nu aveți permisiunea de editare pentru fișier.", + "textRequestMacros": "A macro makes a request to URL. Do you want to allow the request to the %1?" }, "Settings": { "advDRMOptions": "Fișierul protejat", @@ -655,7 +656,8 @@ "textNavigation": "Navigation", "textEmptyScreens": "There are no headings in the document. Apply a headings style to the text so that it appeas in the table of cotents.", "textBeginningDocument": "Beginning of document", - "textEmptyHeading": "Empty Heading" + "textEmptyHeading": "Empty Heading", + "textPdfProducer": "PDF Producer" }, "Toolbar": { "dlgLeaveMsgText": "Nu ați salvat modificările din documentul. Faceți clic pe Rămâi în pagină și așteptați la salvare automată. Faceți clic pe Părăsește aceasta pagina ca să renunțați la toate modificările nesalvate.", diff --git a/apps/documenteditor/mobile/locale/ru.json b/apps/documenteditor/mobile/locale/ru.json index e3f06219a..081d21f17 100644 --- a/apps/documenteditor/mobile/locale/ru.json +++ b/apps/documenteditor/mobile/locale/ru.json @@ -532,7 +532,8 @@ "warnLicenseUsersExceeded": "Вы достигли лимита на количество пользователей редакторов %1. Свяжитесь с администратором, чтобы узнать больше.", "warnNoLicense": "Вы достигли лимита на одновременные подключения к редакторам %1. Этот документ будет открыт на просмотр. Напишите в отдел продаж %1, чтобы обсудить индивидуальные условия обновления.", "warnNoLicenseUsers": "Вы достигли лимита на количество пользователей редакторов %1. Напишите в отдел продаж %1, чтобы обсудить индивидуальные условия обновления.", - "warnProcessRightsChange": "У вас нет прав на редактирование этого файла." + "warnProcessRightsChange": "У вас нет прав на редактирование этого файла.", + "textRequestMacros": "A macro makes a request to URL. Do you want to allow the request to the %1?" }, "Settings": { "advDRMOptions": "Защищенный файл", @@ -603,6 +604,7 @@ "textParagraphs": "Абзацы", "textPdfTagged": "PDF с тегами", "textPdfVer": "Версия PDF", + "textPdfProducer": "Производитель PDF", "textPoint": "Пункт", "textPortrait": "Книжная", "textPrint": "Печать", diff --git a/apps/documenteditor/mobile/locale/sk.json b/apps/documenteditor/mobile/locale/sk.json index a7d607ae7..f5c4992fc 100644 --- a/apps/documenteditor/mobile/locale/sk.json +++ b/apps/documenteditor/mobile/locale/sk.json @@ -532,7 +532,8 @@ "warnLicenseUsersExceeded": "Dosiahli ste limit %1 editora v režime spolupráce na úpravách. Ohľadne podrobnosti sa obráťte na svojho správcu. ", "warnNoLicense": "Dosiahli ste limit pre simultánne pripojenia k %1 editorom. Tento dokument sa otvorí iba na prezeranie. Kontaktujte predajný tím %1 pre osobné podmienky inovácie.", "warnNoLicenseUsers": "Dosiahli ste limit %1 editora. Pre rozšírenie funkcií kontaktujte %1 obchodné oddelenie.", - "warnProcessRightsChange": "Nemáte povolenie na úpravu tohto súboru." + "warnProcessRightsChange": "Nemáte povolenie na úpravu tohto súboru.", + "textRequestMacros": "A macro makes a request to URL. Do you want to allow the request to the %1?" }, "Settings": { "advDRMOptions": "Chránený súbor", @@ -655,7 +656,8 @@ "textNavigation": "Navigation", "textEmptyScreens": "There are no headings in the document. Apply a headings style to the text so that it appeas in the table of cotents.", "textBeginningDocument": "Beginning of document", - "textEmptyHeading": "Empty Heading" + "textEmptyHeading": "Empty Heading", + "textPdfProducer": "PDF Producer" }, "Toolbar": { "dlgLeaveMsgText": "Máte neuložené zmeny. Kliknite na „Zostať na tejto stránke“ a počkajte na automatické uloženie. Kliknutím na „Opustiť túto stránku“ zahodíte všetky neuložené zmeny.", diff --git a/apps/documenteditor/mobile/locale/sl.json b/apps/documenteditor/mobile/locale/sl.json index cc3ee0c00..4542b418d 100644 --- a/apps/documenteditor/mobile/locale/sl.json +++ b/apps/documenteditor/mobile/locale/sl.json @@ -532,7 +532,8 @@ "warnProcessRightsChange": "You don't have permission to edit this file.", "textReplaceSuccess": "The search has been done. Occurrences replaced: {0}", "textReplaceSkipped": "The replacement has been made. {0} occurrences were skipped.", - "textNoTextFound": "Text not found" + "textNoTextFound": "Text not found", + "textRequestMacros": "A macro makes a request to URL. Do you want to allow the request to the %1?" }, "Settings": { "advDRMOptions": "Protected File", @@ -655,7 +656,8 @@ "textPdfTagged": "Tagged PDF", "textFastWV": "Fast Web View", "textYes": "Yes", - "textNo": "No" + "textNo": "No", + "textPdfProducer": "PDF Producer" }, "Toolbar": { "dlgLeaveMsgText": "You have unsaved changes. Click 'Stay on this Page' to wait for autosave. Click 'Leave this Page' to discard all the unsaved changes.", diff --git a/apps/documenteditor/mobile/locale/sv.json b/apps/documenteditor/mobile/locale/sv.json index cc3ee0c00..4542b418d 100644 --- a/apps/documenteditor/mobile/locale/sv.json +++ b/apps/documenteditor/mobile/locale/sv.json @@ -532,7 +532,8 @@ "warnProcessRightsChange": "You don't have permission to edit this file.", "textReplaceSuccess": "The search has been done. Occurrences replaced: {0}", "textReplaceSkipped": "The replacement has been made. {0} occurrences were skipped.", - "textNoTextFound": "Text not found" + "textNoTextFound": "Text not found", + "textRequestMacros": "A macro makes a request to URL. Do you want to allow the request to the %1?" }, "Settings": { "advDRMOptions": "Protected File", @@ -655,7 +656,8 @@ "textPdfTagged": "Tagged PDF", "textFastWV": "Fast Web View", "textYes": "Yes", - "textNo": "No" + "textNo": "No", + "textPdfProducer": "PDF Producer" }, "Toolbar": { "dlgLeaveMsgText": "You have unsaved changes. Click 'Stay on this Page' to wait for autosave. Click 'Leave this Page' to discard all the unsaved changes.", diff --git a/apps/documenteditor/mobile/locale/tr.json b/apps/documenteditor/mobile/locale/tr.json index d147a198e..25d15d53f 100644 --- a/apps/documenteditor/mobile/locale/tr.json +++ b/apps/documenteditor/mobile/locale/tr.json @@ -532,7 +532,8 @@ "warnProcessRightsChange": "Bu dosyayı düzenleme izniniz yok.", "textNoTextFound": "Text not found", "textReplaceSkipped": "The replacement has been made. {0} occurrences were skipped.", - "textReplaceSuccess": "The search has been done. Occurrences replaced: {0}" + "textReplaceSuccess": "The search has been done. Occurrences replaced: {0}", + "textRequestMacros": "A macro makes a request to URL. Do you want to allow the request to the %1?" }, "Settings": { "advDRMOptions": "Korumalı dosya", @@ -655,7 +656,8 @@ "textNavigation": "Navigation", "textEmptyScreens": "There are no headings in the document. Apply a headings style to the text so that it appeas in the table of cotents.", "textBeginningDocument": "Beginning of document", - "textEmptyHeading": "Empty Heading" + "textEmptyHeading": "Empty Heading", + "textPdfProducer": "PDF Producer" }, "Toolbar": { "dlgLeaveMsgText": "Kaydedilmemiş değişiklikleriniz mevcut. Otomatik kaydetmeyi beklemek için 'Bu Sayfada Kal' seçeneğini tıklayın. Kaydedilmemiş tüm değişiklikleri atmak için 'Bu Sayfadan Ayrıl'ı tıklayın.", diff --git a/apps/documenteditor/mobile/locale/uk.json b/apps/documenteditor/mobile/locale/uk.json index 11705e78d..98ec8e1d9 100644 --- a/apps/documenteditor/mobile/locale/uk.json +++ b/apps/documenteditor/mobile/locale/uk.json @@ -532,7 +532,8 @@ "warnLicenseUsersExceeded": "Ви досягли ліміту на кількість користувачів редакторів %1.
    Зв'яжіться з адміністратором, щоб дізнатися більше.", "warnNoLicense": "Ви досягли ліміту на одночасне підключення до редакторів %1. Цей документ буде відкрито для перегляду. Напишіть у відділ продажу %1, щоб обговорити індивідуальні умови оновлення.", "warnNoLicenseUsers": "Ви досягли ліміту на одночасне підключення до редакторів %1.
    Напишіть у відділ продаж %1, для обговорення індивідуальних умов ліцензування.", - "warnProcessRightsChange": "У вас немає прав на редагування цього файлу." + "warnProcessRightsChange": "У вас немає прав на редагування цього файлу.", + "textRequestMacros": "A macro makes a request to URL. Do you want to allow the request to the %1?" }, "Settings": { "advDRMOptions": "Захищений файл", @@ -655,7 +656,8 @@ "textNavigation": "Navigation", "textEmptyScreens": "There are no headings in the document. Apply a headings style to the text so that it appeas in the table of cotents.", "textBeginningDocument": "Beginning of document", - "textEmptyHeading": "Empty Heading" + "textEmptyHeading": "Empty Heading", + "textPdfProducer": "PDF Producer" }, "Toolbar": { "dlgLeaveMsgText": "У документі є незбережені зміни. Натисніть 'Залишитись на сторінці', щоб дочекатися автозбереження. Натисніть 'Піти зі сторінки', щоб скинути всі незбережені зміни.", diff --git a/apps/documenteditor/mobile/locale/vi.json b/apps/documenteditor/mobile/locale/vi.json index cc3ee0c00..4542b418d 100644 --- a/apps/documenteditor/mobile/locale/vi.json +++ b/apps/documenteditor/mobile/locale/vi.json @@ -532,7 +532,8 @@ "warnProcessRightsChange": "You don't have permission to edit this file.", "textReplaceSuccess": "The search has been done. Occurrences replaced: {0}", "textReplaceSkipped": "The replacement has been made. {0} occurrences were skipped.", - "textNoTextFound": "Text not found" + "textNoTextFound": "Text not found", + "textRequestMacros": "A macro makes a request to URL. Do you want to allow the request to the %1?" }, "Settings": { "advDRMOptions": "Protected File", @@ -655,7 +656,8 @@ "textPdfTagged": "Tagged PDF", "textFastWV": "Fast Web View", "textYes": "Yes", - "textNo": "No" + "textNo": "No", + "textPdfProducer": "PDF Producer" }, "Toolbar": { "dlgLeaveMsgText": "You have unsaved changes. Click 'Stay on this Page' to wait for autosave. Click 'Leave this Page' to discard all the unsaved changes.", diff --git a/apps/documenteditor/mobile/locale/zh-TW.json b/apps/documenteditor/mobile/locale/zh-TW.json index e99160557..fd15d4e75 100644 --- a/apps/documenteditor/mobile/locale/zh-TW.json +++ b/apps/documenteditor/mobile/locale/zh-TW.json @@ -532,7 +532,8 @@ "warnLicenseUsersExceeded": "您已達到%1個編輯器的用戶限制。請與您的管理員聯繫以了解更多信息。", "warnNoLicense": "您已達到同時連接到 %1 編輯器的限制。此文件將只提供檢視。有關個人升級條款,請聯繫 %1 業務團隊。", "warnNoLicenseUsers": "您已達到%1個編輯器的用戶限制。與%1銷售團隊聯繫以了解個人升級條款。", - "warnProcessRightsChange": "您沒有編輯這個文件的權限。" + "warnProcessRightsChange": "您沒有編輯這個文件的權限。", + "textRequestMacros": "A macro makes a request to URL. Do you want to allow the request to the %1?" }, "Settings": { "advDRMOptions": "受保護的檔案", @@ -655,7 +656,8 @@ "textNavigation": "Navigation", "textEmptyScreens": "There are no headings in the document. Apply a headings style to the text so that it appeas in the table of cotents.", "textBeginningDocument": "Beginning of document", - "textEmptyHeading": "Empty Heading" + "textEmptyHeading": "Empty Heading", + "textPdfProducer": "PDF Producer" }, "Toolbar": { "dlgLeaveMsgText": "您有未儲存的變更。點擊“留在此頁面”以等待自動儲存。點擊“離開此頁面”以放棄所有未儲存的變更。", diff --git a/apps/documenteditor/mobile/locale/zh.json b/apps/documenteditor/mobile/locale/zh.json index 12028855c..6b102658c 100644 --- a/apps/documenteditor/mobile/locale/zh.json +++ b/apps/documenteditor/mobile/locale/zh.json @@ -532,7 +532,8 @@ "warnLicenseUsersExceeded": "你触发了 %1 编辑器的同时在线数限制。可联系管理员来了解更多信息。", "warnNoLicense": "你已经触发了 %1 编辑器的同时在线数限制. 该文档打开后,你将只能查看。请联系 %1 的销售团队,获取个人升级条款。", "warnNoLicenseUsers": "你触发了 %1 编辑器的同时在线数限制。请与 %1 的销售团队联系,以获取个人升级条款。", - "warnProcessRightsChange": "你没有编辑这个文件的权限。" + "warnProcessRightsChange": "你没有编辑这个文件的权限。", + "textRequestMacros": "A macro makes a request to URL. Do you want to allow the request to the %1?" }, "Settings": { "advDRMOptions": "受保护的文件", @@ -655,7 +656,8 @@ "textNavigation": "Navigation", "textEmptyScreens": "There are no headings in the document. Apply a headings style to the text so that it appeas in the table of cotents.", "textBeginningDocument": "Beginning of document", - "textEmptyHeading": "Empty Heading" + "textEmptyHeading": "Empty Heading", + "textPdfProducer": "PDF Producer" }, "Toolbar": { "dlgLeaveMsgText": "你有未保存的修改。点击“留在该页”可等待自动保存完成。点击“离开该页”将丢弃全部未经保存的修改。", diff --git a/apps/documenteditor/mobile/src/controller/ContextMenu.jsx b/apps/documenteditor/mobile/src/controller/ContextMenu.jsx index bf5727ed7..e92ef2281 100644 --- a/apps/documenteditor/mobile/src/controller/ContextMenu.jsx +++ b/apps/documenteditor/mobile/src/controller/ContextMenu.jsx @@ -242,7 +242,7 @@ class ContextMenu extends ContextMenuController { } else { const { t } = this.props; const _t = t("ContextMenu", {returnObjects: true}); - const { canViewComments, canCoAuthoring, canComments, dataDoc } = this.props; + const { canViewComments, canCoAuthoring, canComments } = this.props; const api = Common.EditorApi.get(); const inToc = api.asc_GetTableOfContentsPr(true); @@ -290,7 +290,7 @@ class ContextMenu extends ContextMenuController { }); } - if ( canFillForms && dataDoc.fileType !== 'oform' && !locked ) { + if ( canFillForms && canCopy && !locked ) { itemsIcon.push({ event: 'paste', icon: 'icon-paste' diff --git a/apps/documenteditor/mobile/src/controller/Main.jsx b/apps/documenteditor/mobile/src/controller/Main.jsx index ce6156a16..534840ae5 100644 --- a/apps/documenteditor/mobile/src/controller/Main.jsx +++ b/apps/documenteditor/mobile/src/controller/Main.jsx @@ -49,6 +49,7 @@ class MainController extends Component { }; this.defaultTitleText = __APP_TITLE_TEXT__; + this.stackMacrosRequests = []; const { t } = this.props; this._t = t('Main', {returnObjects:true}); @@ -99,6 +100,9 @@ class MainController extends Component { } this.props.storeApplicationSettings.changeMacrosSettings(value); + value = localStorage.getItem("de-mobile-allow-macros-request"); + this.props.storeApplicationSettings.changeMacrosRequest((value !== null) ? parseInt(value) : 0); + Common.Notifications.trigger('configOptionsFill'); }; @@ -112,6 +116,7 @@ class MainController extends Component { this.permissions = Object.assign(this.permissions, data.doc.permissions); const _permissions = Object.assign({}, data.doc.permissions); + const _options = Object.assign({}, data.doc.options, this.editorConfig.actionLink || {}); const _userOptions = this.props.storeAppOptions.user; const _user = new Asc.asc_CUserInfo(); _user.put_Id(_userOptions.id); @@ -124,7 +129,7 @@ class MainController extends Component { docInfo.put_Title(data.doc.title); docInfo.put_Format(data.doc.fileType); docInfo.put_VKey(data.doc.vkey); - docInfo.put_Options(data.doc.options); + docInfo.put_Options(_options); docInfo.put_UserInfo(_user); docInfo.put_CallbackUrl(this.editorConfig.callbackUrl); docInfo.put_Token(data.doc.token); @@ -159,6 +164,7 @@ class MainController extends Component { this.api.asc_registerCallback('asc_onGetEditorPermissions', onEditorPermissions); this.api.asc_registerCallback('asc_onDocumentContentReady', onDocumentContentReady); this.api.asc_registerCallback('asc_onLicenseChanged', this.onLicenseChanged.bind(this)); + this.api.asc_registerCallback('asc_onMacrosPermissionRequest', this.onMacrosPermissionRequest.bind(this)); this.api.asc_registerCallback('asc_onRunAutostartMacroses', this.onRunAutostartMacroses.bind(this)); this.api.asc_setDocInfo(docInfo); this.api.asc_getEditorPermissions(this.editorConfig.licenseUrl, this.editorConfig.customerId); @@ -704,7 +710,7 @@ class MainController extends Component { this.api.asc_registerCallback('asc_onGetDocInfoEnd', () => { clearTimeout(this.timerLoading); clearInterval(this.timerDocInfo); - storeDocumentInfo.switchIsLoaded(true); + storeDocumentInfo.changeCount(this.objectInfo); }); // Color Schemes @@ -1007,6 +1013,70 @@ class MainController extends Component { } } + onMacrosPermissionRequest (url, callback) { + if (url && callback) { + this.stackMacrosRequests.push({url: url, callback: callback}); + if (this.stackMacrosRequests.length>1) { + return; + } + } else if (this.stackMacrosRequests.length>0) { + url = this.stackMacrosRequests[0].url; + callback = this.stackMacrosRequests[0].callback; + } else + return; + + const value = this.props.storeApplicationSettings.macrosRequest; + if (value>0) { + callback && callback(value === 1); + this.stackMacrosRequests.shift(); + this.onMacrosPermissionRequest(); + } else { + const { t } = this.props; + const _t = t('Main', {returnObjects:true}); + f7.dialog.create({ + title: _t.notcriticalErrorTitle, + text: _t.textRequestMacros.replace('%1', url), + cssClass: 'dlg-macros-request', + content: `
    + + ${_t.textRemember} +
    `, + buttons: [{ + text: _t.textYes, + onClick: () => { + const dontshow = $$('input[name="checkbox-show-macros"]').prop('checked'); + if (dontshow) { + this.props.storeApplicationSettings.changeMacrosRequest(1); + LocalStorage.setItem("de-mobile-allow-macros-request", 1); + } + setTimeout(() => { + if (callback) callback(true); + this.stackMacrosRequests.shift(); + this.onMacrosPermissionRequest(); + }, 1); + }}, + { + text: _t.textNo, + onClick: () => { + const dontshow = $$('input[name="checkbox-show-macros"]').prop('checked'); + if (dontshow) { + this.props.storeApplicationSettings.changeMacrosRequest(2); + LocalStorage.setItem("de-mobile-allow-macros-request", 2); + } + setTimeout(() => { + if (callback) callback(false); + this.stackMacrosRequests.shift(); + this.onMacrosPermissionRequest(); + }, 1); + } + }] + }).open(); + } + } + render() { return ( diff --git a/apps/documenteditor/mobile/src/controller/edit/EditParagraph.jsx b/apps/documenteditor/mobile/src/controller/edit/EditParagraph.jsx index 20aabc0a4..a772d7fc9 100644 --- a/apps/documenteditor/mobile/src/controller/edit/EditParagraph.jsx +++ b/apps/documenteditor/mobile/src/controller/edit/EditParagraph.jsx @@ -6,7 +6,10 @@ class EditParagraphController extends Component { constructor (props) { super(props); props.storeParagraphSettings.setBackColor(undefined); + this.onStyleClick = this.onStyleClick.bind(this); + this.onSaveStyle = this.onSaveStyle.bind(this); + this.onStyleMenuDelete = this.onStyleMenuDelete.bind(this); } onStyleClick (name) { @@ -17,6 +20,22 @@ class EditParagraphController extends Component { } } + onSaveStyle(title, nextParagraphStyle) { + const api = Common.EditorApi.get(); + const style = api.asc_GetStyleFromFormatting(); + + style.put_Name(title); + style.put_Next(nextParagraphStyle ? nextParagraphStyle : null); + + api.asc_AddNewStyle(style); + this.props.storeParagraphSettings.changeParaStyleName(title); + } + + onStyleMenuDelete(styleName) { + const api = Common.EditorApi.get(); + api.asc_RemoveStyle(styleName); + } + onDistanceBefore (distance, isDecrement) { const api = Common.EditorApi.get(); if (api) { @@ -156,6 +175,8 @@ class EditParagraphController extends Component { onKeepTogether={this.onKeepTogether} onKeepNext={this.onKeepNext} onBackgroundColor={this.onBackgroundColor} + onSaveStyle={this.onSaveStyle} + onStyleMenuDelete={this.onStyleMenuDelete} /> ) } diff --git a/apps/documenteditor/mobile/src/controller/edit/EditText.jsx b/apps/documenteditor/mobile/src/controller/edit/EditText.jsx index 4b8e57998..ea74e99dd 100644 --- a/apps/documenteditor/mobile/src/controller/edit/EditText.jsx +++ b/apps/documenteditor/mobile/src/controller/edit/EditText.jsx @@ -193,6 +193,14 @@ class EditTextController extends Component { if (api) api.put_ListType(2, parseInt(type)); } + getIconsBulletsAndNumbers(arrayElements, type) { + const api = Common.EditorApi.get(); + const arr = []; + + arrayElements.forEach( item => arr.push(item.id)); + if (api) api.SetDrawImagePreviewBulletForMenu(arr, type); + } + onLineSpacing(value) { const api = Common.EditorApi.get(); if (api) { @@ -221,6 +229,7 @@ class EditTextController extends Component { onParagraphMove={this.onParagraphMove} onBullet={this.onBullet} onNumber={this.onNumber} + getIconsBulletsAndNumbers={this.getIconsBulletsAndNumbers} onMultiLevelList={this.onMultiLevelList} onLineSpacing={this.onLineSpacing} /> diff --git a/apps/documenteditor/mobile/src/controller/settings/DocumentInfo.jsx b/apps/documenteditor/mobile/src/controller/settings/DocumentInfo.jsx index 72ef0f16a..6f859d051 100644 --- a/apps/documenteditor/mobile/src/controller/settings/DocumentInfo.jsx +++ b/apps/documenteditor/mobile/src/controller/settings/DocumentInfo.jsx @@ -88,6 +88,9 @@ class DocumentInfoController extends Component { value = props.Version; if(value) this.docInfoObject.version = value; + value = props.Producer; + if(value) this.docInfoObject.producer = value; + value = props.Tagged; if (value !== undefined) this.docInfoObject.tagged = (value===true ? _t.textYes : _t.textNo); @@ -120,7 +123,7 @@ class DocumentInfoController extends Component { return appName || ''; } else if (this.pdfProps) { - appName = this.pdfProps ? this.pdfProps.Producer || '' : ''; + appName = this.pdfProps ? this.pdfProps.Creator || '' : ''; return appName; } } diff --git a/apps/documenteditor/mobile/src/index_dev.html b/apps/documenteditor/mobile/src/index_dev.html index 05790b92b..939932bab 100644 --- a/apps/documenteditor/mobile/src/index_dev.html +++ b/apps/documenteditor/mobile/src/index_dev.html @@ -2,7 +2,7 @@ - + diff --git a/apps/documenteditor/mobile/src/less/app.less b/apps/documenteditor/mobile/src/less/app.less index f78237403..8f9fb566d 100644 --- a/apps/documenteditor/mobile/src/less/app.less +++ b/apps/documenteditor/mobile/src/less/app.less @@ -137,14 +137,14 @@ .swiper-pagination-bullet-active{ background: @black; } - .multilevels { - li:not(:first-child){ - border:none; - .item-content { - min-height: 70px; - } - } - } + // .multilevels { + // li:not(:first-child){ + // border:none; + // .item-content { + // min-height: 70px; + // } + // } + // } } // Skeleton table @@ -315,3 +315,12 @@ border-top: 1px solid var(--background-menu-divider); } } + +.create-style-link { + .item-link .item-inner:before { + display: none; + } + .item-title { + color: @brandColor; + } +} diff --git a/apps/documenteditor/mobile/src/less/icons-material.less b/apps/documenteditor/mobile/src/less/icons-material.less index d1dbc3656..88b85795d 100644 --- a/apps/documenteditor/mobile/src/less/icons-material.less +++ b/apps/documenteditor/mobile/src/less/icons-material.less @@ -215,6 +215,11 @@ height: 22px; .encoded-svg-mask(''); } + &.icon-create-style { + width: 24px; + height: 24px; + .encoded-svg-mask('') + } // Presets of table borders &.icon-table-borders-all { width: 28px; diff --git a/apps/documenteditor/mobile/src/store/appOptions.js b/apps/documenteditor/mobile/src/store/appOptions.js index caf9cea01..794e650bd 100644 --- a/apps/documenteditor/mobile/src/store/appOptions.js +++ b/apps/documenteditor/mobile/src/store/appOptions.js @@ -114,15 +114,20 @@ export class storeAppOptions { this.canComments = this.canLicense && (permissions.comment === undefined ? this.isEdit : permissions.comment) && (this.config.mode !== 'view'); this.canComments = this.canComments && !((typeof (this.customization) == 'object') && this.customization.comments===false); this.canViewComments = this.canComments || !((typeof (this.customization) == 'object') && this.customization.comments===false); - this.canEditComments = this.isOffline || !(typeof (this.customization) == 'object' && this.customization.commentAuthorOnly); + this.canEditComments = this.isOffline || !permissions.editCommentAuthorOnly; this.canDeleteComments= this.isOffline || !permissions.deleteCommentAuthorOnly; + if ((typeof (this.customization) == 'object') && this.customization.commentAuthorOnly===true) { + console.log("Obsolete: The 'commentAuthorOnly' parameter of the 'customization' section is deprecated. Please use 'editCommentAuthorOnly' and 'deleteCommentAuthorOnly' parameters in the permissions instead."); + if (permissions.editCommentAuthorOnly===undefined && permissions.deleteCommentAuthorOnly===undefined) + this.canEditComments = this.canDeleteComments = this.isOffline; + } this.canChat = this.canLicense && !this.isOffline && (permissions.chat !== false); this.canEditStyles = this.canLicense && this.canEdit; this.canPrint = (permissions.print !== false); this.fileKey = document.key; const typeForm = /^(?:(oform))$/.exec(document.fileType); // can fill forms only in oform format this.canFillForms = this.canLicense && !!(typeForm && typeof typeForm[1] === 'string') && ((permissions.fillForms===undefined) ? this.isEdit : permissions.fillForms) && (this.config.mode !== 'view'); - this.isRestrictedEdit = !this.isEdit && (this.canComments || this.canFillForms); + this.isRestrictedEdit = !this.isEdit && (this.canComments || this.canFillForms) && isSupportEditFeature; if (this.isRestrictedEdit && this.canComments && this.canFillForms) // must be one restricted mode, priority for filling forms this.canComments = false; this.trialMode = params.asc_getLicenseMode(); diff --git a/apps/documenteditor/mobile/src/store/applicationSettings.js b/apps/documenteditor/mobile/src/store/applicationSettings.js index fb93e9a27..16649d877 100644 --- a/apps/documenteditor/mobile/src/store/applicationSettings.js +++ b/apps/documenteditor/mobile/src/store/applicationSettings.js @@ -11,7 +11,8 @@ export class storeApplicationSettings { isComments: observable, isResolvedComments: observable, macrosMode: observable, - changeSpellCheck: action, + macrosRequest: observable, + changeSpellCheck: action, changeUnitMeasurement: action, changeNoCharacters: action, changeShowTableEmptyLine: action, @@ -19,7 +20,8 @@ export class storeApplicationSettings { changeDisplayResolved: action, changeMacrosSettings: action, directionMode: observable, - changeDirectionMode: action + changeDirectionMode: action, + changeMacrosRequest: action }) } @@ -30,12 +32,15 @@ export class storeApplicationSettings { isComments = false; isResolvedComments = false; macrosMode = 0; + directionMode = LocalStorage.getItem('mode-direction') || 'ltr'; changeDirectionMode(value) { this.directionMode = value; } + macrosRequest = 0; + changeUnitMeasurement(value) { this.unitMeasurement = +value; } @@ -64,4 +69,8 @@ export class storeApplicationSettings { changeMacrosSettings(value) { this.macrosMode = +value; } + + changeMacrosRequest(value) { + this.macrosRequest = value; + } } \ No newline at end of file diff --git a/apps/documenteditor/mobile/src/view/edit/Edit.jsx b/apps/documenteditor/mobile/src/view/edit/Edit.jsx index 8cce09c6d..c568acec3 100644 --- a/apps/documenteditor/mobile/src/view/edit/Edit.jsx +++ b/apps/documenteditor/mobile/src/view/edit/Edit.jsx @@ -16,7 +16,7 @@ import EditHeaderController from "../../controller/edit/EditHeader"; import EditTableContentsController from "../../controller/edit/EditTableContents"; import {PageTextFonts, PageTextAddFormatting, PageTextBulletsAndNumbers, PageTextLineSpacing, PageTextFontColor, PageTextCustomFontColor, PageTextHighlightColor} from "./EditText"; -import {ParagraphAdvSettings, PageParagraphBackColor, PageParagraphCustomColor} from "./EditParagraph"; +import {ParagraphAdvSettings, PageParagraphBackColor, PageParagraphCustomColor, PageParagraphStyle, PageCreateTextStyle, PageChangeNextParagraphStyle} from "./EditParagraph"; import {PageShapeStyleNoFill, PageShapeStyle, PageShapeCustomFillColor, PageShapeBorderColor, PageShapeCustomBorderColor, PageWrap, PageReorder, PageReplace} from "./EditShape"; import {PageImageReorder, PageImageReplace, PageImageWrap, PageLinkSettings} from "./EditImage"; import {PageTableOptions, PageTableWrap, PageTableStyle, PageTableStyleOptions, PageTableCustomFillColor, PageTableBorderColor, PageTableCustomBorderColor} from "./EditTable"; @@ -66,6 +66,18 @@ const routes = [ path: '/edit-paragraph-custom-color/', component: PageParagraphCustomColor, }, + { + path: '/edit-paragraph-style/', + component: PageParagraphStyle + }, + { + path: '/create-text-style/', + component: PageCreateTextStyle + }, + { + path: '/change-next-paragraph-style/', + component: PageChangeNextParagraphStyle + }, //Edit shape { path: '/edit-shape-style/', diff --git a/apps/documenteditor/mobile/src/view/edit/EditParagraph.jsx b/apps/documenteditor/mobile/src/view/edit/EditParagraph.jsx index e3662f2bd..dd6b5764e 100644 --- a/apps/documenteditor/mobile/src/view/edit/EditParagraph.jsx +++ b/apps/documenteditor/mobile/src/view/edit/EditParagraph.jsx @@ -1,6 +1,6 @@ import React, {Fragment, useState} from 'react'; import {observer, inject} from "mobx-react"; -import {f7, List, ListItem, Icon, Button, Page, Navbar, NavRight, Segmented, BlockTitle, Toggle, Link} from 'framework7-react'; +import {f7, List, ListItem, Icon, Button, Page, Navbar, NavRight, Segmented, BlockTitle, Toggle, Link, NavLeft, NavTitle, ListInput} from 'framework7-react'; import { useTranslation } from 'react-i18next'; import {Device} from '../../../../../common/mobile/utils/device'; import { ThemeColorPalette, CustomColorPicker } from '../../../../../common/mobile/lib/component/ThemeColorPalette.jsx'; @@ -191,6 +191,7 @@ const EditParagraph = props => { const storeParagraphSettings = props.storeParagraphSettings; const paragraphStyles = storeParagraphSettings.paragraphStyles; const curStyleName = storeParagraphSettings.styleName; + const curStyle = paragraphStyles.find(style => style.name === curStyleName); const thumbSize = storeParagraphSettings.styleThumbSize; const paragraph = props.storeFocusObjects.paragraphObject; @@ -200,6 +201,18 @@ const EditParagraph = props => { return ( + {t('Edit.textParagraphStyle')} + + +
    +
    +
    { onKeepNext: props.onKeepNext }}> - {_t.textParagraphStyles} +
    + ) +}; + +const EditParagraphStyle = props => { + const { t } = useTranslation(); + const api = Common.EditorApi.get(); + const _t = t('Edit', {returnObjects: true}); + const storeParagraphSettings = props.storeParagraphSettings; + const paragraphStyles = storeParagraphSettings.paragraphStyles; + const curStyleName = storeParagraphSettings.styleName; + const thumbSize = storeParagraphSettings.styleThumbSize; + const activeStyle = Device.android ? 'link no-active-state' : 'no-active-state'; + + return ( + + + {Device.phone && + + + + + + } + + + + {Device.android && } + + {paragraphStyles.map((style, index) => ( { if(curStyleName !== style.name) { @@ -236,21 +281,122 @@ const EditParagraph = props => { }} >
    + {!api.asc_IsStyleDefault(style.name) && ( +
    + { + await storeParagraphSettings.changeParaStyleName('Normal'); + await props.onStyleMenuDelete(style.name); + }}> + + +
    + )} +
    + ))} +
    +
    + ) +} + +const CreateTextStyle = props => { + const { t } = useTranslation(); + const _t = t('Edit', {returnObjects: true}); + const [titleNewStyle, setTitle] = useState(''); + const [nextParagraphStyle, setParagraph] = useState(''); + + return ( + + + { + let title = titleNewStyle.trim(); + if(title) { + props.onSaveStyle(title, nextParagraphStyle); + props.f7router.back(); + } + }}>{t('Edit.textDone')} + + + { + setTitle(event.target.value) + }} + > + + {t('Edit.textNextParagraphStyle')} + + + + + ) +} + +const ChangeNextParagraphStyle = props => { + const { t } = useTranslation(); + const _t = t('Edit', {returnObjects: true}); + const nextParagraphStyle = props.nextParagraphStyle; + const storeParagraphSettings = props.storeParagraphSettings; + const paragraphStyles = storeParagraphSettings.paragraphStyles; + const thumbSize = storeParagraphSettings.styleThumbSize; + const activeStyle = Device.android ? 'link no-active-state' : 'no-active-state'; + const [newParagraph, setParagraph] = useState(nextParagraphStyle); + + return ( + + + + { + if(newParagraph) { + setParagraph(''); + props.setParagraph(''); + } + }} title={t('Edit.textSameCreatedNewStyle')}> + {paragraphStyles.map((style, index) => ( + { + if(newParagraph !== style.name) { + setParagraph(style.name); + props.setParagraph(style.name); + } + }} + > +
    ))}
    -
    + ) -}; + +} const EditParagraphContainer = inject("storeParagraphSettings", "storeFocusObjects")(observer(EditParagraph)); const ParagraphAdvSettings = inject("storeParagraphSettings", "storeFocusObjects")(observer(PageAdvancedSettings)); const PageParagraphBackColor = inject("storeParagraphSettings", "storePalette")(observer(PageBackgroundColor)); const PageParagraphCustomColor = inject("storeParagraphSettings", "storePalette")(observer(PageCustomBackColor)); +const PageParagraphStyle = inject("storeParagraphSettings")(observer(EditParagraphStyle)); +const PageCreateTextStyle = inject("storeParagraphSettings")(observer(CreateTextStyle)); +const PageChangeNextParagraphStyle = inject("storeParagraphSettings")(observer(ChangeNextParagraphStyle)); -export {EditParagraphContainer as EditParagraph, +export { + EditParagraphContainer as EditParagraph, ParagraphAdvSettings, PageParagraphBackColor, - PageParagraphCustomColor}; \ No newline at end of file + PageParagraphCustomColor, + PageParagraphStyle, + PageCreateTextStyle, + PageChangeNextParagraphStyle +}; \ No newline at end of file diff --git a/apps/documenteditor/mobile/src/view/edit/EditText.jsx b/apps/documenteditor/mobile/src/view/edit/EditText.jsx index 3e66e06a7..653bcb67d 100644 --- a/apps/documenteditor/mobile/src/view/edit/EditText.jsx +++ b/apps/documenteditor/mobile/src/view/edit/EditText.jsx @@ -181,70 +181,62 @@ const PageAdditionalFormatting = props => { }; const PageBullets = observer( props => { - const { t } = useTranslation(); - const bulletArrays = [ - [ - {type: -1, thumb: ''}, - {type: 1, thumb: 'bullet-01.png'}, - {type: 2, thumb: 'bullet-02.png'}, - {type: 3, thumb: 'bullet-03.png'} - ], - [ - {type: 4, thumb: 'bullet-04.png'}, - {type: 5, thumb: 'bullet-05.png'}, - {type: 6, thumb: 'bullet-06.png'}, - {type: 7, thumb: 'bullet-07.png'} - ] - ]; const storeTextSettings = props.storeTextSettings; const typeBullets = storeTextSettings.typeBullets; + const bulletArrays = [ + { type: 0, subtype: -1 }, + { type: 0, subtype: 1 }, + { type: 0, subtype: 2 }, + { type: 0, subtype: 3 }, + { type: 0, subtype: 4 }, + { type: 0, subtype: 5 }, + { type: 0, subtype: 6 }, + { type: 0, subtype: 7 } + ]; + + useEffect(() => { + props.getIconsBulletsAndNumbers($$('.item-marker'), 0); + }, []); return( - {bulletArrays.map((bullets, index) => ( - - {bullets.map((bullet) => ( - { - storeTextSettings.resetBullets(bullet.type); - props.onBullet(bullet.type); - }}> - {bullet.thumb.length < 1 ? - - - : - - } - - ))} - - ))} + + {bulletArrays.map( bullet => ( + { + storeTextSettings.resetBullets(bullet.subtype); + props.onBullet(bullet.subtype); + }}> +
    + +
    +
    + ))} +
    ) }); const PageNumbers = observer( props => { - const { t } = useTranslation(); - const numberArrays = [ - [ - {type: -1, thumb: ''}, - {type: 4, thumb: 'number-01.png'}, - {type: 5, thumb: 'number-02.png'}, - {type: 6, thumb: 'number-03.png'} - ], - [ - {type: 1, thumb: 'number-04.png'}, - {type: 2, thumb: 'number-05.png'}, - {type: 3, thumb: 'number-06.png'}, - {type: 7, thumb: 'number-07.png'} - ] - ]; - const storeTextSettings = props.storeTextSettings; const typeNumbers = storeTextSettings.typeNumbers; + const numberArrays = [ + { type: 1, subtype: -1}, + { type: 1, subtype: 4 }, + { type: 1, subtype: 5 }, + { type: 1, subtype: 6 }, + { type: 1, subtype: 1 }, + { type: 1, subtype: 2 }, + { type: 1, subtype: 3 }, + { type: 1, subtype: 7 } + ]; + + useEffect(() => { + props.getIconsBulletsAndNumbers($$('.item-number'), 1); + }, []); - return( + return ( {numberArrays.map((numbers, index) => ( @@ -266,37 +258,35 @@ const PageNumbers = observer( props => { ))} - ) + ); }); const PageMultiLevel = observer( props => { - const { t } = useTranslation(); - - const arrayMultiLevel = [ - {type: -1, thumb: ''}, - {type: 1, thumb: 'multi-bracket.png'}, - {type: 2, thumb: 'multi-dot.png'}, - {type: 3, thumb: 'multi-bullets.png'}, - ]; - const storeTextSettings = props.storeTextSettings; const typeMultiLevel = storeTextSettings.typeMultiLevel; + const arrayMultiLevel = [ + { type: 2, subtype: -1 }, + { type: 2, subtype: 1 }, + { type: 2, subtype: 2 }, + { type: 2, subtype: 3 }, + ]; + + useEffect(() => { + props.getIconsBulletsAndNumbers($$('.item-multilevellist'), 2); + }, []); return( {arrayMultiLevel.map((item) => ( props.onMultiLevelList(item.type)}> - {item.thumb.length < 1 ? - - - : - - } + key={'multi-level-' + item.subtype} + data-type={item.subtype} + className={item.subtype === typeMultiLevel && storeTextSettings.listType === -1 ? 'active' : ''} + onClick={() => props.onMultiLevelList(item.subtype)}> +
    + +
    ))}
    @@ -322,13 +312,25 @@ const PageBulletsAndNumbers = props => { - + - + - + @@ -604,7 +606,8 @@ const EditText = props => {
    {previewList}
    {!isAndroid && } diff --git a/apps/documenteditor/mobile/src/view/settings/ApplicationSettings.jsx b/apps/documenteditor/mobile/src/view/settings/ApplicationSettings.jsx index 28fadca2e..03ecb2f8b 100644 --- a/apps/documenteditor/mobile/src/view/settings/ApplicationSettings.jsx +++ b/apps/documenteditor/mobile/src/view/settings/ApplicationSettings.jsx @@ -94,7 +94,7 @@ const PageApplicationSettings = props => { {Themes.switchDarkTheme(!toggle), setIsThemeDark(!toggle)}}> + onToggleChange={() => {Themes.switchDarkTheme(!isThemeDark), setIsThemeDark(!isThemeDark)}}> diff --git a/apps/documenteditor/mobile/src/view/settings/DocumentInfo.jsx b/apps/documenteditor/mobile/src/view/settings/DocumentInfo.jsx index d45a1bf04..b414c41cd 100644 --- a/apps/documenteditor/mobile/src/view/settings/DocumentInfo.jsx +++ b/apps/documenteditor/mobile/src/view/settings/DocumentInfo.jsx @@ -28,6 +28,7 @@ const PageDocumentInfo = (props) => { modifyBy, modifyDate, author, + producer, version, tagged, fastWebView, @@ -145,9 +146,24 @@ const PageDocumentInfo = (props) => { ) : null} + {fileType === 'pdf' && author ? ( + + {t('Settings.textAuthor')} + + + + + ) : null} + { fileType === 'pdf' && producer ? ( + + {t('Settings.textPdfProducer')} + + + + + ) : null} { fileType === 'pdf' ? ( - diff --git a/apps/presentationeditor/main/app.js b/apps/presentationeditor/main/app.js index 1e11ca2c5..c8f5f8a77 100644 --- a/apps/presentationeditor/main/app.js +++ b/apps/presentationeditor/main/app.js @@ -171,6 +171,9 @@ require([ Common.Locale.apply(function(){ require([ + 'common/main/lib/util/LocalStorage', + 'common/main/lib/controller/Themes', + 'common/main/lib/controller/Desktop', 'presentationeditor/main/app/controller/Viewport', 'presentationeditor/main/app/controller/DocumentHolder', 'presentationeditor/main/app/controller/Toolbar', @@ -188,7 +191,6 @@ require([ 'presentationeditor/main/app/view/TextArtSettings', 'presentationeditor/main/app/view/SignatureSettings', 'common/main/lib/util/utils', - 'common/main/lib/util/LocalStorage', 'common/main/lib/controller/Fonts', 'common/main/lib/controller/History' /** coauthoring begin **/ @@ -201,8 +203,6 @@ require([ ,'common/main/lib/controller/ExternalOleEditor' ,'common/main/lib/controller/ReviewChanges' ,'common/main/lib/controller/Protection' - ,'common/main/lib/controller/Themes' - ,'common/main/lib/controller/Desktop' ,'presentationeditor/main/app/controller/Transitions' ,'presentationeditor/main/app/controller/Animation' ], function() { diff --git a/apps/presentationeditor/main/app/controller/Animation.js b/apps/presentationeditor/main/app/controller/Animation.js index 9e94feb01..eda06eca8 100644 --- a/apps/presentationeditor/main/app/controller/Animation.js +++ b/apps/presentationeditor/main/app/controller/Animation.js @@ -174,7 +174,7 @@ define([ handler : function(result, value) { if (result == 'ok') { if (me.api) { - me.addNewEffect(value.activeEffect, value.activeGroupValue, value.activeGroup, replace, undefined, !Common.Utils.InternalSettings.get("pe-animation-no-preview")); + me.addNewEffect(value.activeEffect, value.activeGroupValue, value.activeGroup, replace, undefined); } } } @@ -189,7 +189,7 @@ define([ addNewEffect: function (type, group, groupName, replace, parametr, preview) { var parameter = this.view.setMenuParameters(type, groupName, parametr); - this.api.asc_AddAnimation(group, type, (parameter != undefined)?parameter:0, replace, preview); + this.api.asc_AddAnimation(group, type, (parameter != undefined)?parameter:0, replace, !Common.Utils.InternalSettings.get("pe-animation-no-auto-preview")); }, onDurationChange: function(before,combo, record, e) { diff --git a/apps/presentationeditor/main/app/controller/DocumentHolder.js b/apps/presentationeditor/main/app/controller/DocumentHolder.js index f6be16df6..7956f8647 100644 --- a/apps/presentationeditor/main/app/controller/DocumentHolder.js +++ b/apps/presentationeditor/main/app/controller/DocumentHolder.js @@ -90,21 +90,221 @@ define([ ], initialize: function() { - // + this.addListeners({ + 'DocumentHolder': { + 'createdelayedelements': this.createDelayedElements, + 'equation:callback': this.equationCallback, + 'layout:change': this.onLayoutChange, + 'theme:change': this.onThemeChange + } + }); + + var me = this; + me.usertips = []; + me._TtHeight = 20; + me.fastcoauthtips = []; + me._state = {}; + me.mode = {}; + me._isDisabled = false; + + me.screenTip = { + toolTip: new Common.UI.Tooltip({ + owner: this, + html: true, + title: '
    Press Ctrl and click link' +// style: 'word-wrap: break-word;' + }), + strTip: '', + isHidden: true, + isVisible: false + }; + + me.userTooltip = true; + me.wrapEvents = { + userTipMousover: _.bind(me.userTipMousover, me), + userTipMousout: _.bind(me.userTipMousout, me) + }; + + // Hotkeys + // --------------------- + var keymap = {}; + me.hkComments = 'alt+h'; + keymap[me.hkComments] = function() { + if (me.api.can_AddQuotedComment()!==false && me.documentHolder.slidesCount>0) { + me.addComment(); + } + }; + + me.hkPreview = 'command+f5,ctrl+f5'; + keymap[me.hkPreview] = function(e) { + var isResized = false; + e.preventDefault(); + e.stopPropagation(); + if (me.documentHolder.slidesCount>0) { + Common.NotificationCenter.trigger('preview:start', 0); + } + }; + Common.util.Shortcuts.delegateShortcuts({shortcuts:keymap}); }, onLaunch: function() { this.documentHolder = this.createView('DocumentHolder').render(); this.documentHolder.el.tabIndex = -1; + this.onAfterRender(); + + var me = this; + Common.NotificationCenter.on({ + 'window:show': function(e){ + me.screenTip.toolTip.hide(); + me.screenTip.isVisible = false; + /** coauthoring begin **/ + me.userTipHide(); + /** coauthoring end **/ + me.mode && me.mode.isDesktopApp && me.api && me.api.asc_onShowPopupWindow(); + }, + 'modal:show': function(e){ + me.hideTips(); + }, + 'layout:changed': function(e){ + me.screenTip.toolTip.hide(); + me.screenTip.isVisible = false; + /** coauthoring begin **/ + me.userTipHide(); + /** coauthoring end **/ + me.hideTips(); + me.onDocumentHolderResize(); + }, + 'preview:show': function(e){ + me.isPreviewVisible = true; + me.screenTip && (me.screenTip.tipLength = -1); // redraw link tip + }, + 'preview:hide': function(e){ + me.isPreviewVisible = false; + me.screenTip && (me.screenTip.tipLength = -1); // redraw link tip + } + }); }, setApi: function(api) { this.api = api; + + var me = this; + if (me.api) { + me.api.asc_registerCallback('asc_onContextMenu', _.bind(me.onContextMenu, me)); + me.api.asc_registerCallback('asc_onMouseMoveStart', _.bind(me.onMouseMoveStart, me)); + me.api.asc_registerCallback('asc_onMouseMoveEnd', _.bind(me.onMouseMoveEnd, me)); + me.api.asc_registerCallback('asc_onPaintSlideNum', _.bind(me.onPaintSlideNum, me)); + me.api.asc_registerCallback('asc_onEndPaintSlideNum', _.bind(me.onEndPaintSlideNum, me)); + me.api.asc_registerCallback('asc_onCountPages', _.bind(me.onApiCountPages, me)); + me.api.asc_registerCallback('asc_onCurrentPage', _.bind(me.onApiCurrentPages, me)); + me.documentHolder.slidesCount = me.api.getCountPages(); + + //hyperlink + me.api.asc_registerCallback('asc_onHyperlinkClick', _.bind(me.onHyperlinkClick, me)); + me.api.asc_registerCallback('asc_onMouseMove', _.bind(me.onMouseMove, me)); + + if (me.mode.isEdit===true) { + me.api.asc_registerCallback('asc_onDialogAddHyperlink', _.bind(me.onDialogAddHyperlink, me)); + me.api.asc_registerCallback('asc_doubleClickOnChart', _.bind(me.editChartClick, me)); + me.api.asc_registerCallback('asc_doubleClickOnTableOleObject', _.bind(me.onDoubleClickOnTableOleObject, me)); + me.api.asc_registerCallback('asc_onSpellCheckVariantsFound', _.bind(me.onSpellCheckVariantsFound, me)); + me.api.asc_registerCallback('asc_onShowSpecialPasteOptions', _.bind(me.onShowSpecialPasteOptions, me)); + me.api.asc_registerCallback('asc_onHideSpecialPasteOptions', _.bind(me.onHideSpecialPasteOptions, me)); + me.api.asc_registerCallback('asc_ChangeCropState', _.bind(me.onChangeCropState, me)); + me.api.asc_registerCallback('asc_onHidePlaceholderActions', _.bind(me.onHidePlaceholderActions, me)); + me.api.asc_registerPlaceholderCallback(AscCommon.PlaceholderButtonType.Image, _.bind(me.onInsertImage, me, true)); + me.api.asc_registerPlaceholderCallback(AscCommon.PlaceholderButtonType.ImageUrl, _.bind(me.onInsertImageUrl, me, true)); + me.api.asc_registerPlaceholderCallback(AscCommon.PlaceholderButtonType.Chart, _.bind(me.onClickPlaceholderChart, me)); + me.api.asc_registerPlaceholderCallback(AscCommon.PlaceholderButtonType.Table, _.bind(me.onClickPlaceholderTable, me)); + me.api.asc_registerPlaceholderCallback(AscCommon.PlaceholderButtonType.Video, _.bind(me.onClickPlaceholder, me, AscCommon.PlaceholderButtonType.Video)); + me.api.asc_registerPlaceholderCallback(AscCommon.PlaceholderButtonType.Audio, _.bind(me.onClickPlaceholder, me, AscCommon.PlaceholderButtonType.Audio)); + } + me.api.asc_registerCallback('asc_onCoAuthoringDisconnect', _.bind(me.onCoAuthoringDisconnect, me)); + Common.NotificationCenter.on('api:disconnect', _.bind(me.onCoAuthoringDisconnect, me)); + me.api.asc_registerCallback('asc_onTextLanguage', _.bind(me.onTextLanguage, me)); + + me.api.asc_registerCallback('asc_onShowForeignCursorLabel', _.bind(me.onShowForeignCursorLabel, me)); + me.api.asc_registerCallback('asc_onHideForeignCursorLabel', _.bind(me.onHideForeignCursorLabel, me)); + me.api.asc_registerCallback('asc_onFocusObject', _.bind(me.onFocusObject, me)); + me.api.asc_registerCallback('asc_onUpdateThemeIndex', _.bind(me.onApiUpdateThemeIndex, me)); + me.api.asc_registerCallback('asc_onLockDocumentTheme', _.bind(me.onApiLockDocumentTheme, me)); + me.api.asc_registerCallback('asc_onUnLockDocumentTheme', _.bind(me.onApiUnLockDocumentTheme, me)); + me.api.asc_registerCallback('asc_onStartDemonstration', _.bind(me.onApiStartDemonstration)); + + me.documentHolder.setApi(me.api); + } + + return me; }, - createDelayedElements: function() { - var diagramEditor = this.getApplication().getController('Common.Controllers.ExternalDiagramEditor').getView('Common.Views.ExternalDiagramEditor'); + setMode: function(mode) { + var me = this; + me.mode = mode; + /** coauthoring begin **/ + !(me.mode.canCoAuthoring && me.mode.canComments) + ? Common.util.Shortcuts.suspendEvents(me.hkComments) + : Common.util.Shortcuts.resumeEvents(me.hkComments); + /** coauthoring end **/ + me.editorConfig = {user: mode.user}; + me.documentHolder.setMode(mode); + }, + + onAfterRender: function(ct){ + var me = this; + var meEl = me.documentHolder.cmpEl; + if (meEl) { + meEl.on('contextmenu', function(e) { + e.preventDefault(); + e.stopPropagation(); + return false; + }); + meEl.on('click', function(e){ + if (e.target.localName == 'canvas') { + if (me._preventClick) + me._preventClick = false; + else + meEl.focus(); + } + }); + meEl.on('mousedown', function(e){ + if (e.target.localName == 'canvas') + Common.UI.Menu.Manager.hideAll(); + }); + + //NOTE: set mouse wheel handler + + var addEvent = function( elem, type, fn ) { + elem.addEventListener ? elem.addEventListener( type, fn, false ) : elem.attachEvent( "on" + type, fn ); + }; + + var eventname=(/Firefox/i.test(navigator.userAgent))? 'DOMMouseScroll' : 'mousewheel'; + addEvent(me.documentHolder.el, eventname, _.bind(me.handleDocumentWheel, me)); + } + + !Common.Utils.isChrome ? $(document).on('mousewheel', _.bind(me.handleDocumentWheel, me)) : + document.addEventListener('mousewheel', _.bind(me.handleDocumentWheel, me), {passive: false}); + $(document).on('keydown', _.bind(me.handleDocumentKeyDown, me)); + $(window).on('resize', _.bind(me.onDocumentHolderResize, me)); + var viewport = me.getApplication().getController('Viewport').getView('Viewport'); + viewport.hlayout.on('layout:resizedrag', _.bind(me.onDocumentHolderResize, me)); + }, + + createDelayedElements: function(view, type) { + var me = this, + view = me.documentHolder; + + if (type=='view') { + view.menuViewCopy.on('click', _.bind(me.onCutCopyPaste, me)); + view.menuViewAddComment.on('click', _.bind(me.addComment, me)); + view.menuViewUndo.on('click', _.bind(me.onUndo, me)); + view.mnuPreview.on('click', _.bind(me.onPreview, me)); + view.mnuSelectAll.on('click', _.bind(me.onSelectAll, me)); + view.mnuPrintSelection.on('click', _.bind(me.onPrintSelection, me)); + return; + } + + var diagramEditor = this.getApplication().getController('Common.Controllers.ExternalDiagramEditor').getView('Common.Views.ExternalDiagramEditor'); if (diagramEditor) { diagramEditor.on('internalmessage', _.bind(function(cmp, message) { var command = message.data.command; @@ -122,7 +322,7 @@ define([ } var me = this; setTimeout(function(){ - me.documentHolder.fireEvent('editcomplete', me.documentHolder); + me.editComplete(); }, 10); }, this)); } @@ -143,10 +343,1688 @@ define([ } var me = this; setTimeout(function(){ - me.documentHolder.fireEvent('editcomplete', me.documentHolder); + me.editComplete(); }, 10); }, this)); } + + view.menuSlidePaste.on('click', _.bind(me.onCutCopyPaste, me)); + view.menuParaCopy.on('click', _.bind(me.onCutCopyPaste, me)); + view.menuParaPaste.on('click', _.bind(me.onCutCopyPaste, me)); + view.menuParaCut.on('click', _.bind(me.onCutCopyPaste, me)); + view.menuImgCopy.on('click', _.bind(me.onCutCopyPaste, me)); + view.menuImgPaste.on('click', _.bind(me.onCutCopyPaste, me)); + view.menuImgCut.on('click', _.bind(me.onCutCopyPaste, me)); + view.menuTableCopy.on('click', _.bind(me.onCutCopyPaste, me)); + view.menuTablePaste.on('click', _.bind(me.onCutCopyPaste, me)); + view.menuTableCut.on('click', _.bind(me.onCutCopyPaste, me)); + view.menuAddHyperlinkPara.on('click', _.bind(me.addHyperlink, me)); + view.menuAddHyperlinkTable.on('click', _.bind(me.addHyperlink, me)); + view.menuEditHyperlinkPara.on('click', _.bind(me.editHyperlink, me)); + view.menuEditHyperlinkTable.on('click', _.bind(me.editHyperlink, me)); + view.menuRemoveHyperlinkPara.on('click', _.bind(me.removeHyperlink, me)); + view.menuRemoveHyperlinkTable.on('click', _.bind(me.removeHyperlink, me)); + view.menuChartEdit.on('click', _.bind(me.editChartClick, me, undefined)); + view.menuAddCommentPara.on('click', _.bind(me.addComment, me)); + view.menuAddCommentTable.on('click', _.bind(me.addComment, me)); + view.menuAddCommentImg.on('click', _.bind(me.addComment, me)); + view.menuAddToLayoutImg.on('click', _.bind(me.addToLayout, me)); + view.menuAddToLayoutTable.on('click', _.bind(me.addToLayout, me)); + view.menuImgReplace.menu.on('item:click', _.bind(me.onImgReplace, me)); + view.langParaMenu.menu.on('item:click', _.bind(me.onLangMenu, me, 'para')); + view.langTableMenu.menu.on('item:click', _.bind(me.onLangMenu, me, 'table')); + view.mnuPreview.on('click', _.bind(me.onPreview, me)); + view.mnuSelectAll.on('click', _.bind(me.onSelectAll, me)); + view.mnuPrintSelection.on('click', _.bind(me.onPrintSelection, me)); + view.mnuNewSlide.on('click', _.bind(me.onNewSlide, me)); + view.mnuDuplicateSlide.on('click', _.bind(me.onDuplicateSlide, me)); + view.mnuDeleteSlide.on('click', _.bind(me.onDeleteSlide, me)); + view.mnuResetSlide.on('click', _.bind(me.onResetSlide, me)); + view.mnuMoveSlideToStart.on('click', _.bind(me.onMoveSlideToStart, me)); + view.mnuMoveSlideToEnd.on('click', _.bind(me.onMoveSlideToEnd, me)); + view.menuSlideSettings.on('click', _.bind(me.onSlideSettings, me)); + view.mnuSlideHide.on('click', _.bind(me.onSlideHide, me)); + view.mnuTableMerge.on('click', _.bind(me.onTableMerge, me)); + view.mnuTableSplit.on('click', _.bind(me.onTableSplit, me)); + view.menuTableCellAlign.menu.on('item:click', _.bind(me.tableCellsVAlign, me)); + view.menuTableDistRows.on('click', _.bind(me.onTableDistRows, me)); + view.menuTableDistCols.on('click', _.bind(me.onTableDistCols, me)); + view.menuIgnoreSpellTable.on('click', _.bind(me.onIgnoreSpell, me)); + view.menuIgnoreSpellPara.on('click', _.bind(me.onIgnoreSpell, me)); + view.menuIgnoreAllSpellTable.on('click', _.bind(me.onIgnoreSpell, me)); + view.menuIgnoreAllSpellPara.on('click', _.bind(me.onIgnoreSpell, me)); + view.menuToDictionaryTable.on('click', _.bind(me.onToDictionary, me)); + view.menuToDictionaryPara.on('click', _.bind(me.onToDictionary, me)); + view.menuTableAdvanced.on('click', _.bind(me.onTableAdvanced, me)); + view.menuImageAdvanced.on('click', _.bind(me.onImageAdvanced, me)); + view.menuImgOriginalSize.on('click', _.bind(me.onImgOriginalSize, me)); + view.menuImgShapeRotate.menu.items[0].on('click', _.bind(me.onImgRotate, me)); + view.menuImgShapeRotate.menu.items[1].on('click', _.bind(me.onImgRotate, me)); + view.menuImgShapeRotate.menu.items[3].on('click', _.bind(me.onImgFlip, me)); + view.menuImgShapeRotate.menu.items[4].on('click', _.bind(me.onImgFlip, me)); + view.menuImgCrop.menu.on('item:click', _.bind(me.onImgCrop, me)); + view.menuImgEditPoints.on('click', _.bind(me.onImgEditPoints, me)); + view.menuShapeAdvanced.on('click', _.bind(me.onShapeAdvanced, me)); + view.menuParagraphAdvanced.on('click', _.bind(me.onParagraphAdvanced, me)); + view.mnuGroupImg.on('click', _.bind(me.onGroupImg, me)); + view.mnuUnGroupImg.on('click', _.bind(me.onUnGroupImg, me)); + view.mnuArrangeFront.on('click', _.bind(me.onArrangeFront, me)); + view.mnuArrangeBack.on('click', _.bind(me.onArrangeBack, me)); + view.mnuArrangeForward.on('click', _.bind(me.onArrangeForward, me)); + view.mnuArrangeBackward.on('click', _.bind(me.onArrangeBackward, me)); + view.menuImgShapeAlign.menu.on('item:click', _.bind(me.onImgShapeAlign, me)); + view.menuParagraphVAlign.menu.on('item:click', _.bind(me.onParagraphVAlign, me)); + view.menuParagraphDirection.menu.on('item:click', _.bind(me.onParagraphDirection, me)); + view.menuTableSelectText.menu.on('item:click', _.bind(me.tableSelectText, me)); + view.menuTableInsertText.menu.on('item:click', _.bind(me.tableInsertText, me)); + view.menuTableDeleteText.menu.on('item:click', _.bind(me.tableDeleteText, me)); + }, + + getView: function (name) { + return !name ? + this.documentHolder : Backbone.Controller.prototype.getView.call() + }, + + showPopupMenu: function(menu, value, event, docElement, eOpts){ + var me = this; + if (!_.isUndefined(menu) && menu !== null){ + Common.UI.Menu.Manager.hideAll(); + + var showPoint = [event.get_X(), event.get_Y()], + menuContainer = $(me.documentHolder.el).find(Common.Utils.String.format('#menu-container-{0}', menu.id)); + + if (event.get_Type() == Asc.c_oAscContextMenuTypes.Thumbnails) { + showPoint[0] -= 3; + showPoint[1] -= 3; + } + + if (!menu.rendered) { + // Prepare menu container + if (menuContainer.length < 1) { + menuContainer = $(Common.Utils.String.format('', menu.id)); + $(me.documentHolder.el).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); + + me.documentHolder.currentMenu = menu; + } + }, + + fillMenuProps: function(selectedElements) { + if (!selectedElements || !_.isArray(selectedElements)) return; + var me = this, + documentHolder = this.documentHolder; + var menu_props = {}, + menu_to_show = null; + _.each(selectedElements, function(element, index) { + var elType = element.get_ObjectType(), + elValue = element.get_ObjectValue(); + + if (Asc.c_oAscTypeSelectElement.Image == elType) { + menu_to_show = documentHolder.pictureMenu; + menu_props.imgProps = {}; + menu_props.imgProps.value = elValue; + menu_props.imgProps.locked = (elValue) ? elValue.get_Locked() : false; + } else if (Asc.c_oAscTypeSelectElement.Table == elType) + { + menu_to_show = documentHolder.tableMenu; + menu_props.tableProps = {}; + menu_props.tableProps.value = elValue; + menu_props.tableProps.locked = (elValue) ? elValue.get_Locked() : false; + } else if (Asc.c_oAscTypeSelectElement.Hyperlink == elType) { + menu_props.hyperProps = {}; + menu_props.hyperProps.value = elValue; + } else if (Asc.c_oAscTypeSelectElement.Shape == elType) { // shape + menu_to_show = documentHolder.pictureMenu; + menu_props.shapeProps = {}; + menu_props.shapeProps.value = elValue; + menu_props.shapeProps.locked = (elValue) ? elValue.get_Locked() : false; + if (elValue.get_FromChart()) + menu_props.shapeProps.isChart = true; + } + else if (Asc.c_oAscTypeSelectElement.Chart == elType) { + menu_to_show = documentHolder.pictureMenu; + menu_props.chartProps = {}; + menu_props.chartProps.value = elValue; + menu_props.chartProps.locked = (elValue) ? elValue.get_Locked() : false; + } + else if (Asc.c_oAscTypeSelectElement.Slide == elType) { + menu_props.slideProps = {}; + menu_props.slideProps.value = elValue; + menu_props.slideProps.locked = (elValue) ? elValue.get_LockDelete() : false; + } else if (Asc.c_oAscTypeSelectElement.Paragraph == elType) { + menu_props.paraProps = {}; + menu_props.paraProps.value = elValue; + menu_props.paraProps.locked = (elValue) ? elValue.get_Locked() : false; + if ( (menu_props.shapeProps && menu_props.shapeProps.value || menu_props.chartProps && menu_props.chartProps.value)&& // text in shape, need to show paragraph menu with vertical align + _.isUndefined(menu_props.tableProps)) + menu_to_show = documentHolder.textMenu; + } else if (Asc.c_oAscTypeSelectElement.SpellCheck == elType) { + menu_props.spellProps = {}; + menu_props.spellProps.value = elValue; + documentHolder._currentSpellObj = elValue; + } else if (Asc.c_oAscTypeSelectElement.Math == elType) { + menu_props.mathProps = {}; + menu_props.mathProps.value = elValue; + documentHolder._currentMathObj = elValue; + } + }); + if (menu_to_show === null) { + if (!_.isUndefined(menu_props.paraProps)) + menu_to_show = documentHolder.textMenu; + else if (!_.isUndefined(menu_props.slideProps)) { + menu_to_show = documentHolder.slideMenu; + } + } + + return {menu_to_show: menu_to_show, menu_props: menu_props}; + }, + + fillViewMenuProps: function(selectedElements) { + if (!selectedElements || !_.isArray(selectedElements)) return; + + var me = this, + documentHolder = this.documentHolder; + if (!documentHolder.viewModeMenu) + documentHolder.createDelayedElementsViewer(); + + var menu_props = {}, + menu_to_show = null; + _.each(selectedElements, function(element, index) { + var elType = element.get_ObjectType(), + elValue = element.get_ObjectValue(); + + if (Asc.c_oAscTypeSelectElement.Image == elType || Asc.c_oAscTypeSelectElement.Table == elType || Asc.c_oAscTypeSelectElement.Shape == elType || + Asc.c_oAscTypeSelectElement.Chart == elType || Asc.c_oAscTypeSelectElement.Paragraph == elType) { + menu_to_show = documentHolder.viewModeMenu; + menu_props.locked = menu_props.locked || ((elValue) ? elValue.get_Locked() : false); + if (Asc.c_oAscTypeSelectElement.Chart == elType) + menu_props.isChart = true; + } + else if (Asc.c_oAscTypeSelectElement.Slide == elType) { + menu_props.locked = menu_props.locked || ((elValue) ? elValue.get_LockDelete() : false); + } + }); + + return (menu_to_show) ? {menu_to_show: menu_to_show, menu_props: menu_props} : null; + }, + + showObjectMenu: function(event, docElement, eOpts){ + var me = this; + if (me.api){ + var obj = (me.mode.isEdit && !me._isDisabled) ? me.fillMenuProps(me.api.getSelectedElements()) : me.fillViewMenuProps(me.api.getSelectedElements()); + if (obj) me.showPopupMenu(obj.menu_to_show, obj.menu_props, event, docElement, eOpts); + } + }, + + onContextMenu: function(event){ + if (Common.UI.HintManager.isHintVisible()) + Common.UI.HintManager.clearHints(); + var me = this; + _.delay(function(){ + if (event.get_Type() == Asc.c_oAscContextMenuTypes.Thumbnails) { + me.showPopupMenu.call(me, (me.mode.isEdit && !me._isDisabled) ? me.documentHolder.slideMenu : me.documentHolder.viewModeMenuSlide, {isSlideSelect: event.get_IsSlideSelect(), isSlideHidden: event.get_IsSlideHidden(), fromThumbs: true}, event); + } else { + me.showObjectMenu.call(me, event); + } + },10); + }, + + onFocusObject: function(selectedElements) { + var me = this, + currentMenu = me.documentHolder.currentMenu; + if (currentMenu && currentMenu.isVisible()){ + if (me.api.asc_getCurrentFocusObject() === 0 ){ // thumbnails + if (me.documentHolder.slideMenu===currentMenu && !me._isDisabled) { + var isHidden = false; + _.each(selectedElements, function(element, index) { + if (Asc.c_oAscTypeSelectElement.Slide == element.get_ObjectType()) { + isHidden = element.get_ObjectValue().get_IsHidden(); + } + }); + + currentMenu.options.initMenu({isSlideSelect: me.documentHolder.slideMenu.items[2].isVisible(), isSlideHidden: isHidden, fromThumbs: true}); + currentMenu.alignPosition(); + } + } else { + var obj = (me.mode.isEdit && !me._isDisabled) ? me.fillMenuProps(selectedElements) : me.fillViewMenuProps(selectedElements); + if (obj) { + if (obj.menu_to_show===currentMenu) { + currentMenu.options.initMenu(obj.menu_props); + currentMenu.alignPosition(); + } + } + } + } + }, + + handleDocumentWheel: function(event){ + var me = this; + if (me.api) { + var delta = (_.isUndefined(event.originalEvent)) ? event.wheelDelta : event.originalEvent.wheelDelta; + if (_.isUndefined(delta)) { + delta = event.deltaY; + } + + if ((event.ctrlKey || event.metaKey) && !event.altKey){ + if (delta < 0) + me.api.zoomOut(); + else if (delta > 0) + me.api.zoomIn(); + + event.preventDefault(); + event.stopPropagation(); + } + } + }, + + handleDocumentKeyDown: function(event){ + var me = this; + if (me.api){ + var key = event.keyCode; + if ((event.ctrlKey || event.metaKey) && !event.shiftKey && !event.altKey){ + if (key === Common.UI.Keys.NUM_PLUS || key === Common.UI.Keys.EQUALITY || (Common.Utils.isGecko && key === Common.UI.Keys.EQUALITY_FF) || (Common.Utils.isOpera && key == 43)){ + me.api.zoomIn(); + event.preventDefault(); + event.stopPropagation(); + return false; + } + else if (key === Common.UI.Keys.NUM_MINUS || key === Common.UI.Keys.MINUS || (Common.Utils.isGecko && key === Common.UI.Keys.MINUS_FF) || (Common.Utils.isOpera && key == 45)){ + me.api.zoomOut(); + event.preventDefault(); + event.stopPropagation(); + return false; + } else if (key === 48 || key === 96) {// 0 + me.api.zoomFitToPage(); + event.preventDefault(); + event.stopPropagation(); + return false; + } + } + if (me.documentHolder.currentMenu && me.documentHolder.currentMenu.isVisible()) { + if (key == Common.UI.Keys.UP || + key == Common.UI.Keys.DOWN) { + $('ul.dropdown-menu', me.documentHolder.currentMenu.el).focus(); + } + } + if (key == Common.UI.Keys.ESC) { + Common.UI.Menu.Manager.hideAll(); + if (!Common.UI.HintManager.isHintVisible()) + Common.NotificationCenter.trigger('leftmenu:change', 'hide'); + } + } + }, + + onDocumentHolderResize: function(){ + var me = this; + me._Height = me.documentHolder.cmpEl.height(); + me._Width = me.documentHolder.cmpEl.width(); + me._BodyWidth = $('body').width(); + me._XY = undefined; + + if (me.slideNumDiv) { + me.slideNumDiv.remove(); + me.slideNumDiv = undefined; + } + }, + + getUserName: function(id){ + var usersStore = PE.getCollection('Common.Collections.Users'); + if (usersStore){ + var rec = usersStore.findUser(id); + if (rec) + return AscCommon.UserInfoParser.getParsedName(rec.get('username')); + } + return this.documentHolder.guestText; + }, + + isUserVisible: function(id){ + var usersStore = PE.getCollection('Common.Collections.Users'); + if (usersStore){ + var rec = usersStore.findUser(id); + if (rec) + return !rec.get('hidden'); + } + return true; + }, + + userTipMousover: function (evt, el, opt) { + var me = this; + if (me.userTooltip===true) { + me.userTooltip = new Common.UI.Tooltip({ + owner: evt.currentTarget, + title: me.documentHolder.tipIsLocked + }); + + me.userTooltip.show(); + } + }, + + userTipHide: function () { + var me = this; + if (typeof me.userTooltip == 'object') { + me.userTooltip.hide(); + me.userTooltip = undefined; + + for (var i=0; i0) + window.open(url); + else + Common.UI.warning({ + msg: me.documentHolder.txtWarnUrl, + buttons: ['yes', 'no'], + primary: 'yes', + callback: function(btn) { + (btn == 'yes') && window.open(url); + } + }); + } + }, + + onMouseMoveStart: function() { + var me = this; + me.screenTip.isHidden = true; + /** coauthoring begin **/ + if (me.usertips.length>0) { + if (typeof me.userTooltip == 'object') { + me.userTooltip.hide(); + me.userTooltip = true; + } + _.each(me.usertips, function(item) { + item.remove(); + }); + } + me.usertips = []; + me.usertipcount = 0; + /** coauthoring end **/ + }, + + onMouseMoveEnd: function() { + if (this.screenTip.isHidden && this.screenTip.isVisible) { + this.screenTip.isVisible = false; + this.screenTip.toolTip.hide(); + } + }, + + onMouseMove: function(moveData) { + var me = this, + cmpEl = me.documentHolder.cmpEl, + screenTip = me.screenTip; + if (_.isUndefined(me._XY)) { + me._XY = [ + cmpEl.offset().left - $(window).scrollLeft(), + cmpEl.offset().top - $(window).scrollTop() + ]; + me._Width = cmpEl.width(); + me._Height = cmpEl.height(); + me._BodyWidth = $('body').width(); + } + + if (moveData) { + var showPoint, ToolTip; + + if (moveData.get_Type()==1) { // 1 - hyperlink + var hyperProps = moveData.get_Hyperlink(); + var recalc = false; + if (hyperProps) { + screenTip.isHidden = false; + + ToolTip = (_.isEmpty(hyperProps.get_ToolTip())) ? hyperProps.get_Value() : hyperProps.get_ToolTip(); + ToolTip = Common.Utils.String.htmlEncode(ToolTip); + if (ToolTip.length>256) + ToolTip = ToolTip.substr(0, 256) + '...'; + + if (screenTip.tipLength !== ToolTip.length || screenTip.strTip.indexOf(ToolTip)<0 ) { + screenTip.toolTip.setTitle(ToolTip + (me.isPreviewVisible ? '' : '
    ' + me.documentHolder.txtPressLink + '')); + screenTip.tipLength = ToolTip.length; + screenTip.strTip = ToolTip; + recalc = true; + } + + showPoint = [moveData.get_X(), moveData.get_Y()]; + showPoint[1] += ((me.isPreviewVisible ? 0 : me._XY[1])-15); + showPoint[0] += ((me.isPreviewVisible ? 0 : me._XY[0])+5); + + if (!screenTip.isVisible || recalc) { + screenTip.isVisible = true; + screenTip.toolTip.show([-10000, -10000]); + } + + if ( recalc ) { + screenTip.tipHeight = screenTip.toolTip.getBSTip().$tip.height(); + screenTip.tipWidth = screenTip.toolTip.getBSTip().$tip.width(); + } + showPoint[1] -= screenTip.tipHeight; + if (showPoint[1]<0) + showPoint[1] = 0; + if (showPoint[0] + screenTip.tipWidth > me._BodyWidth ) + showPoint[0] = me._BodyWidth - screenTip.tipWidth; + screenTip.toolTip.getBSTip().$tip.css({top: showPoint[1] + 'px', left: showPoint[0] + 'px'}); + } + } + /** coauthoring begin **/ + else if (moveData.get_Type()==2 && me.mode.isEdit && me.isUserVisible(moveData.get_UserId())) { // 2 - locked object + var src; + if (me.usertipcount >= me.usertips.length) { + src = $(document.createElement("div")); + src.addClass('username-tip'); + src.css({height: me._TtHeight + 'px', position: 'absolute', zIndex: '900', visibility: 'visible'}); + $(document.body).append(src); + if (me.userTooltip) { + src.on('mouseover', me.wrapEvents.userTipMousover); + src.on('mouseout', me.wrapEvents.userTipMousout); + } + + me.usertips.push(src); + } + src = me.usertips[me.usertipcount]; + me.usertipcount++; + + ToolTip = me.getUserName(moveData.get_UserId()); + + showPoint = [moveData.get_X()+me._XY[0], moveData.get_Y()+me._XY[1]]; + var maxwidth = showPoint[0]; + showPoint[0] = me._BodyWidth - showPoint[0]; + showPoint[1] -= ((moveData.get_LockedObjectType()==2) ? me._TtHeight : 0); + + if (showPoint[1] > me._XY[1] && showPoint[1]+me._TtHeight < me._XY[1]+me._Height) { + src.text(ToolTip); + src.css({visibility: 'visible', top: showPoint[1] + 'px', right: showPoint[0] + 'px', 'max-width': maxwidth + 'px'}); + } + } + /** coauthoring end **/ + } + }, + + onShowForeignCursorLabel: function(UserId, X, Y, color) { + if (!this.isUserVisible(UserId)) return; + + /** coauthoring begin **/ + var me = this; + var src; + for (var i=0; i0) { + Common.NotificationCenter.trigger('preview:start', 0, null, true); + } + }, + + onApiCountPages: function(count) { + this.documentHolder.slidesCount = count; + }, + + onApiCurrentPages: function(number) { + var me = this; + if (me.documentHolder.currentMenu && me.documentHolder.currentMenu.isVisible() && me._isFromSlideMenu !== true && me._isFromSlideMenu !== number) + setTimeout(function() { + me.documentHolder.currentMenu && me.documentHolder.currentMenu.hide(); + }, 1); + + me._isFromSlideMenu = number; + }, + + onApiUpdateThemeIndex: function(v) { + this._state.themeId = v; + }, + + onApiLockDocumentTheme: function() { + this.documentHolder && (this.documentHolder._state.themeLock = true); + }, + + onApiUnLockDocumentTheme: function() { + this.documentHolder && (this.documentHolder._state.themeLock = false); + }, + + onShowSpecialPasteOptions: function(specialPasteShowOptions) { + var me = this, + documentHolder = me.documentHolder; + var coord = specialPasteShowOptions.asc_getCellCoord(), + pasteContainer = documentHolder.cmpEl.find('#special-paste-container'), + pasteItems = specialPasteShowOptions.asc_getOptions(); + if (!pasteItems) return; + + // Prepare menu container + if (pasteContainer.length < 1) { + me._arrSpecialPaste = []; + me._arrSpecialPaste[Asc.c_oSpecialPasteProps.paste] = documentHolder.textPaste; + me._arrSpecialPaste[Asc.c_oSpecialPasteProps.keepTextOnly] = documentHolder.txtKeepTextOnly; + me._arrSpecialPaste[Asc.c_oSpecialPasteProps.picture] = documentHolder.txtPastePicture; + me._arrSpecialPaste[Asc.c_oSpecialPasteProps.sourceformatting] = documentHolder.txtPasteSourceFormat; + me._arrSpecialPaste[Asc.c_oSpecialPasteProps.destinationFormatting] = documentHolder.txtPasteDestFormat; + + + pasteContainer = $('
    '); + documentHolder.cmpEl.append(pasteContainer); + + me.btnSpecialPaste = new Common.UI.Button({ + parentEl: $('#id-document-holder-btn-special-paste'), + cls : 'btn-toolbar', + iconCls : 'toolbar__icon btn-paste', + menu : new Common.UI.Menu({items: []}) + }); + } + + if (pasteItems.length>0) { + var menu = me.btnSpecialPaste.menu; + for (var i = 0; i < menu.items.length; i++) { + menu.removeItem(menu.items[i]); + i--; + } + + var group_prev = -1; + _.each(pasteItems, function(menuItem, index) { + var mnu = new Common.UI.MenuItem({ + caption: me._arrSpecialPaste[menuItem], + value: menuItem, + checkable: true, + toggleGroup : 'specialPasteGroup' + }).on('click', function(item, e) { + me.api.asc_SpecialPaste(item.value); + setTimeout(function(){menu.hide();}, 100); + }); + menu.addItem(mnu); + }); + (menu.items.length>0) && menu.items[0].setChecked(true, true); + } + if (coord.asc_getX()<0 || coord.asc_getY()<0) { + if (pasteContainer.is(':visible')) pasteContainer.hide(); + } else { + var showPoint = [coord.asc_getX() + coord.asc_getWidth() + 3, coord.asc_getY() + coord.asc_getHeight() + 3]; + pasteContainer.css({left: showPoint[0], top : showPoint[1]}); + pasteContainer.show(); + } + }, + + onHideSpecialPasteOptions: function() { + var pasteContainer = this.documentHolder.cmpEl.find('#special-paste-container'); + if (pasteContainer.is(':visible')) + pasteContainer.hide(); + }, + + onChangeCropState: function(state) { + this.documentHolder.menuImgCrop.menu.items[0].setChecked(state, true); + }, + + onDoubleClickOnTableOleObject: function(chart) { + if (this.mode.isEdit && !this._isDisabled) { + var oleEditor = PE.getController('Common.Controllers.ExternalOleEditor').getView('Common.Views.ExternalOleEditor'); + if (oleEditor && chart) { + oleEditor.setEditMode(true); + oleEditor.show(); + oleEditor.setOleData(Asc.asc_putBinaryDataToFrameFromTableOleObject(chart)); + } + } + }, + + addHyperlink: function(item){ + var win, me = this; + if (me.api) { + var _arr = []; + for (var i=0; i
    ')} + ] + }); + // Prepare menu container + menuContainer = $(Common.Utils.String.format('', menu.id)); + this.documentHolder.cmpEl.append(menuContainer); + menu.render(menuContainer); + menu.cmpEl.attr({tabindex: "-1"}); + menu.on('hide:after', function(){ + if (!me._fromShowPlaceholder) + me.api.asc_uncheckPlaceholders(); + }); + + var picker = new Common.UI.DataView({ + el: $('#id-placeholder-menu-chart'), + parentMenu: menu, + showLast: false, + // restoreHeight: 421, + groups: new Common.UI.DataViewGroupStore(Common.define.chartData.getChartGroupData()), + store: new Common.UI.DataViewStore(Common.define.chartData.getChartData()), + itemTemplate: _.template('
    \">
    ') + }); + picker.on('item:click', function (picker, item, record, e) { + me.editChartClick(record.get('type'), me._state.placeholderObj); + }); + } + menuContainer.css({left: x, top : y}); + menuContainer.attr('data-value', 'prevent-canvas-click'); + this._preventClick = true; + menu.show(); + + menu.alignPosition(); + _.delay(function() { + menu.cmpEl.find('.dataview').focus(); + }, 10); + this._fromShowPlaceholder = false; + }, + + onClickPlaceholderTable: function(obj, x, y) { + if (!this.api) return; + + this._state.placeholderObj = obj; + var menu = this.placeholderMenuTable, + menuContainer = menu ? this.documentHolder.cmpEl.find(Common.Utils.String.format('#menu-container-{0}', menu.id)) : null, + me = this; + this._fromShowPlaceholder = true; + Common.UI.Menu.Manager.hideAll(); + + if (!menu) { + this.placeholderMenuTable = menu = new Common.UI.Menu({ + cls: 'shifted-left', + items: [ + {template: _.template('
    ')}, + {caption: me.mniCustomTable, value: 'custom'} + ] + }); + // Prepare menu container + menuContainer = $(Common.Utils.String.format('', menu.id)); + this.documentHolder.cmpEl.append(menuContainer); + menu.render(menuContainer); + menu.cmpEl.attr({tabindex: "-1"}); + menu.on('hide:after', function(){ + if (!me._fromShowPlaceholder) + me.api.asc_uncheckPlaceholders(); + }); + + var picker = new Common.UI.DimensionPicker({ + el: $('#id-placeholder-menu-tablepicker'), + minRows: 8, + minColumns: 10, + maxRows: 8, + maxColumns: 10 + }); + picker.on('select', function(picker, columns, rows){ + me.api.put_Table(columns, rows, me._state.placeholderObj); + me.editComplete(); + }); + menu.on('item:click', function(menu, item, e){ + if (item.value === 'custom') { + (new Common.Views.InsertTableDialog({ + handler: function(result, value) { + if (result == 'ok') + me.api.put_Table(value.columns, value.rows, me._state.placeholderObj); + me.editComplete(); + } + })).show(); + } + }); + } + menuContainer.css({left: x, top : y}); + menuContainer.attr('data-value', 'prevent-canvas-click'); + this._preventClick = true; + menu.show(); + + menu.alignPosition(); + _.delay(function() { + menu.cmpEl.focus(); + }, 10); + this._fromShowPlaceholder = false; + }, + + onHidePlaceholderActions: function() { + this.placeholderMenuChart && this.placeholderMenuChart.hide(); + this.placeholderMenuTable && this.placeholderMenuTable.hide(); + }, + + onClickPlaceholder: function(type, obj, x, y) { + if (!this.api) return; + if (type == AscCommon.PlaceholderButtonType.Video) { + this.api.asc_AddVideo(obj); + } else if (type == AscCommon.PlaceholderButtonType.Audio) { + this.api.asc_AddAudio(obj); + } + this.editComplete(); + }, + + onImgReplace: function(menu, item, e) { + var me = this; + if (item.value==1) { + me.onInsertImageUrl(false); + } else if (item.value==2) { + Common.NotificationCenter.trigger('storage:image-load', 'change'); + } else { + setTimeout(function(){ + me.onInsertImage(); + }, 10); + } + }, + + onLangMenu: function(type, menu, item){ + var me = this; + if (me.api){ + if (!_.isUndefined(item.langid)) + me.api.put_TextPrLang(item.langid); + + (type==='para') ? (me.documentHolder._currLang.paraid = item.langid) : (me.documentHolder._currLang.tableid = item.langid); + me.editComplete(); + } + }, + + onUndo: function () { + this.api.Undo(); + }, + + onPreview: function () { + var current = this.api.getCurrentPage(); + Common.NotificationCenter.trigger('preview:start', _.isNumber(current) ? current : 0); + }, + + onSelectAll: function () { + if (this.api){ + this.api.SelectAllSlides(); + + this.editComplete(); + Common.component.Analytics.trackEvent('DocumentHolder', 'Select All Slides'); + } + }, + + onPrintSelection: function () { + if (this.api){ + var printopt = new Asc.asc_CAdjustPrint(); + printopt.asc_setPrintType(Asc.c_oAscPrintType.Selection); + var opts = new Asc.asc_CDownloadOptions(null, Common.Utils.isChrome || Common.Utils.isOpera || Common.Utils.isGecko && Common.Utils.firefoxVersion>86); // if isChrome or isOpera == true use asc_onPrintUrl event + opts.asc_setAdvancedOptions(printopt); + this.api.asc_Print(opts); + this.editComplete(); + Common.component.Analytics.trackEvent('DocumentHolder', 'Print Selection'); + } + }, + + onNewSlide: function () { + if (this.api){ + this._isFromSlideMenu = true; + this.api.AddSlide(); + + this.editComplete(); + Common.component.Analytics.trackEvent('DocumentHolder', 'Add Slide'); + } + }, + + onDuplicateSlide: function () { + if (this.api){ + this._isFromSlideMenu = true; + this.api.DublicateSlide(); + + this.editComplete(); + Common.component.Analytics.trackEvent('DocumentHolder', 'Dublicate Slide'); + } + }, + + onDeleteSlide: function () { + if (this.api){ + this._isFromSlideMenu = true; + this.api.DeleteSlide(); + + this.editComplete(); + Common.component.Analytics.trackEvent('DocumentHolder', 'Delete Slide'); + } + }, + + onResetSlide: function () { + if (this.api){ + this.api.ResetSlide(); + + this.editComplete(); + Common.component.Analytics.trackEvent('DocumentHolder', 'Reset Slide'); + } + }, + + onMoveSlideToStart: function () { + if (this.api){ + this.api.asc_moveSelectedSlidesToStart(); + + this.editComplete(); + Common.component.Analytics.trackEvent('DocumentHolder', 'Move Slide to Start'); + } + }, + + onMoveSlideToEnd: function () { + if (this.api){ + this.api.asc_moveSelectedSlidesToEnd(); + + this.editComplete(); + Common.component.Analytics.trackEvent('DocumentHolder', 'Move Slide to End'); + } + }, + + onSlideSettings: function (item) { + PE.getController('RightMenu').onDoubleClickOnObject(item.options.value); + }, + + onSlideHide: function (item) { + if (this.api){ + this.api.asc_HideSlides(item.checked); + + this.editComplete(); + Common.component.Analytics.trackEvent('DocumentHolder', 'Hide Slides'); + } + }, + + onLayoutChange: function (record) { + if (this.api) { + this.api.ChangeLayout(record.get('data').idx); + this.editComplete(); + Common.component.Analytics.trackEvent('DocumentHolder', 'Change Layout'); + } + }, + + onThemeChange: function (record) { + if (this.api) { + this.api.ChangeTheme(record.get('themeId'), true); + this.editComplete(); + Common.component.Analytics.trackEvent('DocumentHolder', 'Change Layout'); + } + }, + + onTableMerge: function () { + this.api && this.api.MergeCells(); + }, + + onTableSplit: function () { + var me = this; + if (me.api) { + (new Common.Views.InsertTableDialog({ + split: true, + handler: function(result, value) { + if (result == 'ok') { + if (me.api) { + me.api.SplitCell(value.columns, value.rows); + } + Common.component.Analytics.trackEvent('DocumentHolder', 'Table Split'); + } + me.editComplete(); + } + })).show(); + } + }, + + tableCellsVAlign: function(menu, item, e) { + if (this.api) { + var properties = new Asc.CTableProp(); + properties.put_CellsVAlign(item.value); + this.api.tblApply(properties); + } + + this.editComplete(); + Common.component.Analytics.trackEvent('DocumentHolder', 'Table Cell Align'); + }, + + onTableDistRows: function () { + this.api && this.api.asc_DistributeTableCells(false); + this.editComplete(); + }, + + onTableDistCols: function () { + this.api && this.api.asc_DistributeTableCells(true); + this.editComplete(); + }, + + onIgnoreSpell: function(item, e){ + this.api && this.api.asc_ignoreMisspelledWord(this.documentHolder._currentSpellObj, !!item.value); + this.editComplete(); + }, + + onToDictionary: function(item, e){ + this.api && this.api.asc_spellCheckAddToDictionary(this.documentHolder._currentSpellObj); + this.editComplete(); + }, + + onTableAdvanced: function(item, e){ + var me = this; + if (me.api) { + var selectedElements = me.api.getSelectedElements(); + + if (selectedElements && selectedElements.length > 0){ + var elType, elValue; + for (var i = selectedElements.length - 1; i >= 0; i--) { + elType = selectedElements[i].get_ObjectType(); + elValue = selectedElements[i].get_ObjectValue(); + + if (Asc.c_oAscTypeSelectElement.Table == elType) { + (new PE.Views.TableSettingsAdvanced( + { + tableProps: elValue, + slideSize: PE.getController('Toolbar').currentPageSize, + handler: function(result, value) { + if (result == 'ok') { + if (me.api) { + me.api.tblApply(value.tableProps); + } + } + me.editComplete(); + Common.component.Analytics.trackEvent('DocumentHolder', 'Table Settings Advanced'); + } + })).show(); + break; + } + } + } + } + }, + + onImageAdvanced: function(item) { + var me = this; + if (me.api){ + var selectedElements = me.api.getSelectedElements(); + if (selectedElements && selectedElements.length>0){ + var elType, elValue; + + for (var i = selectedElements.length - 1; i >= 0; i--) { + elType = selectedElements[i].get_ObjectType(); + elValue = selectedElements[i].get_ObjectValue(); + + if (Asc.c_oAscTypeSelectElement.Image == elType) { + var imgsizeOriginal; + + if (!me.documentHolder.menuImgOriginalSize.isDisabled()) { + imgsizeOriginal = me.api.get_OriginalSizeImage(); + if (imgsizeOriginal) + imgsizeOriginal = {width:imgsizeOriginal.get_ImageWidth(), height:imgsizeOriginal.get_ImageHeight()}; + } + + (new PE.Views.ImageSettingsAdvanced( + { + imageProps: elValue, + sizeOriginal: imgsizeOriginal, + slideSize: PE.getController('Toolbar').currentPageSize, + handler: function(result, value) { + if (result == 'ok') { + if (me.api) { + me.api.ImgApply(value.imageProps); + } + } + me.editComplete(); + Common.component.Analytics.trackEvent('DocumentHolder', 'Image Settings Advanced'); + } + })).show(); + break; + } + } + } + } + }, + + onImgOriginalSize: function(item){ + var me = this; + if (me.api){ + var originalImageSize = me.api.get_OriginalSizeImage(); + + if (originalImageSize) { + var properties = new Asc.asc_CImgProperty(); + + properties.put_Width(originalImageSize.get_ImageWidth()); + properties.put_Height(originalImageSize.get_ImageHeight()); + properties.put_ResetCrop(true); + properties.put_Rot(0); + me.api.ImgApply(properties); + } + + me.editComplete(); + Common.component.Analytics.trackEvent('DocumentHolder', 'Set Image Original Size'); + } + }, + + onImgRotate: function(item) { + var properties = new Asc.asc_CShapeProperty(); + properties.asc_putRotAdd((item.value==1 ? 90 : 270) * 3.14159265358979 / 180); + this.api.ShapeApply(properties); + this.editComplete(); + }, + + onImgFlip: function(item) { + var properties = new Asc.asc_CShapeProperty(); + if (item.value==1) + properties.asc_putFlipHInvert(true); + else + properties.asc_putFlipVInvert(true); + this.api.ShapeApply(properties); + this.editComplete(); + }, + + onImgCrop: function(menu, item) { + if (item.value == 1) { + this.api.asc_cropFill(); + } else if (item.value == 2) { + this.api.asc_cropFit(); + } else { + item.checked ? this.api.asc_startEditCrop() : this.api.asc_endEditCrop(); + } + this.editComplete(); + }, + + onImgEditPoints: function(item) { + this.api && this.api.asc_editPointsGeometry(); + }, + + onShapeAdvanced: function(item) { + var me = this; + if (me.api){ + var selectedElements = me.api.getSelectedElements(); + if (selectedElements && selectedElements.length>0){ + var elType, elValue; + for (var i = selectedElements.length - 1; i >= 0; i--) { + elType = selectedElements[i].get_ObjectType(); + elValue = selectedElements[i].get_ObjectValue(); + if (Asc.c_oAscTypeSelectElement.Shape == elType) { + (new PE.Views.ShapeSettingsAdvanced( + { + shapeProps: elValue, + slideSize: PE.getController('Toolbar').currentPageSize, + handler: function(result, value) { + if (result == 'ok') { + if (me.api) { + me.api.ShapeApply(value.shapeProps); + } + } + me.editComplete(); + Common.component.Analytics.trackEvent('DocumentHolder', 'Image Shape Advanced'); + } + })).show(); + break; + } + } + } + } + }, + + onParagraphAdvanced: function(item) { + var me = this; + if (me.api){ + var selectedElements = me.api.getSelectedElements(); + + if (selectedElements && selectedElements.length > 0){ + var elType, elValue; + for (var i = selectedElements.length - 1; i >= 0; i--) { + elType = selectedElements[i].get_ObjectType(); + elValue = selectedElements[i].get_ObjectValue(); + + if (Asc.c_oAscTypeSelectElement.Paragraph == elType) { + (new PE.Views.ParagraphSettingsAdvanced( + { + paragraphProps: elValue, + api: me.api, + handler: function(result, value) { + if (result == 'ok') { + if (me.api) { + me.api.paraApply(value.paragraphProps); + } + } + me.editComplete(); + Common.component.Analytics.trackEvent('DocumentHolder', 'Image Paragraph Advanced'); + } + })).show(); + break; + } + } + } + } + }, + + onGroupImg: function(item) { + this.api && this.api.groupShapes(); + this.editComplete(); + Common.component.Analytics.trackEvent('DocumentHolder', 'Group Image'); + }, + + onUnGroupImg: function(item) { + this.api && this.api.unGroupShapes(); + this.editComplete(); + Common.component.Analytics.trackEvent('DocumentHolder', 'UnGroup Image'); + }, + + onArrangeFront: function(item) { + this.api && this.api.shapes_bringToFront(); + this.editComplete(); + Common.component.Analytics.trackEvent('DocumentHolder', 'Bring To Front'); + }, + + onArrangeBack: function(item) { + this.api && this.api.shapes_bringToBack(); + this.editComplete(); + Common.component.Analytics.trackEvent('DocumentHolder', 'Bring To Back'); + }, + + onArrangeForward: function(item) { + this.api && this.api.shapes_bringForward(); + this.editComplete(); + Common.component.Analytics.trackEvent('DocumentHolder', 'Send Forward'); + }, + + onArrangeBackward: function(item) { + this.api && this.api.shapes_bringBackward(); + this.editComplete(); + Common.component.Analytics.trackEvent('DocumentHolder', 'Send Backward'); + }, + + onImgShapeAlign: function (menu, item) { + var me = this; + if (me.api) { + var value = me.api.asc_getSelectedDrawingObjectsCount()<2 || Common.Utils.InternalSettings.get("pe-align-to-slide"); + value = value ? Asc.c_oAscObjectsAlignType.Slide : Asc.c_oAscObjectsAlignType.Selected; + if (item.value < 6) { + me.api.put_ShapesAlign(item.value, value); + Common.component.Analytics.trackEvent('DocumentHolder', 'Shape Align'); + } else if (item.value == 6) { + me.api.DistributeHorizontally(value); + Common.component.Analytics.trackEvent('DocumentHolder', 'Distribute Horizontally'); + } else if (item.value == 7){ + me.api.DistributeVertically(value); + Common.component.Analytics.trackEvent('DocumentHolder', 'Distribute Vertically'); + } + me.editComplete(); + } + }, + + onParagraphVAlign: function (menu, item) { + var me = this; + if (me.api) { + var properties = new Asc.asc_CShapeProperty(); + properties.put_VerticalTextAlign(item.value); + + me.api.ShapeApply(properties); + } + + me.editComplete(); + Common.component.Analytics.trackEvent('DocumentHolder', 'Text Vertical Align'); + }, + + onParagraphDirection: function(menu, item) { + var me = this; + if (me.api) { + var properties = new Asc.asc_CShapeProperty(); + properties.put_Vert(item.options.direction); + me.api.ShapeApply(properties); + } + me.editComplete(); + Common.component.Analytics.trackEvent('DocumentHolder', 'Text Direction'); + }, + + tableSelectText: function(menu, item) { + if (this.api) { + switch (item.value) { + case 0: + this.api.selectRow(); + break; + case 1: + this.api.selectColumn(); + break; + case 2: + this.api.selectCell(); + break; + case 3: + this.api.selectTable(); + break; + } + } + }, + + tableInsertText: function(menu, item) { + if (this.api) { + switch (item.value) { + case 0: + this.api.addColumnLeft(); + break; + case 1: + this.api.addColumnRight(); + break; + case 2: + this.api.addRowAbove(); + break; + case 3: + this.api.addRowBelow(); + break; + } + } + }, + + tableDeleteText: function(menu, item) { + if (this.api) { + switch (item.value) { + case 0: + this.api.remRow(); + break; + case 1: + this.api.remColumn(); + break; + case 2: + this.api.remTable(); + break; + } + } + }, + + + SetDisabled: function(state) { + this._isDisabled = state; + this.documentHolder.SetDisabled(state); + }, + + editComplete: function() { + this.documentHolder && this.documentHolder.fireEvent('editcomplete', this.documentHolder); } }); }); \ No newline at end of file diff --git a/apps/presentationeditor/main/app/controller/Main.js b/apps/presentationeditor/main/app/controller/Main.js index 9f12663c8..ecb54b58b 100644 --- a/apps/presentationeditor/main/app/controller/Main.js +++ b/apps/presentationeditor/main/app/controller/Main.js @@ -152,6 +152,7 @@ define([ strongCompare : function(obj1, obj2){return obj1.type === obj2.type;}, weakCompare : function(obj1, obj2){return obj1.type === obj2.type;} }); + this.stackMacrosRequests = []; // Initialize viewport if (!Common.Utils.isBrowserSupported()){ @@ -393,6 +394,9 @@ define([ value = parseInt(value); Common.Utils.InternalSettings.set("pe-macros-mode", value); + value = Common.localStorage.getItem("pe-allow-macros-request"); + Common.Utils.InternalSettings.set("pe-allow-macros-request", (value !== null) ? parseInt(value) : 0); + this.appOptions.wopi = this.editorConfig.wopi; Common.Controllers.Desktop.init(this.appOptions); @@ -443,6 +447,7 @@ define([ this.api.asc_registerCallback('asc_onGetEditorPermissions', _.bind(this.onEditorPermissions, this)); this.api.asc_registerCallback('asc_onLicenseChanged', _.bind(this.onLicenseChanged, this)); + this.api.asc_registerCallback('asc_onMacrosPermissionRequest', _.bind(this.onMacrosPermissionRequest, this)); this.api.asc_registerCallback('asc_onRunAutostartMacroses', _.bind(this.onRunAutostartMacroses, this)); this.api.asc_setDocInfo(docInfo); this.api.asc_getEditorPermissions(this.editorConfig.licenseUrl, this.editorConfig.customerId); @@ -586,7 +591,7 @@ define([ toolbarView.btnHighlightColor.toggle(false, false); } - application.getController('DocumentHolder').getView('DocumentHolder').focus(); + application.getController('DocumentHolder').getView().focus(); if (this.api && this.appOptions.isEdit && this.api.asc_isDocumentCanSave) { var cansave = this.api.asc_isDocumentCanSave(), forcesave = this.appOptions.forcesave, @@ -847,6 +852,9 @@ define([ Common.Utils.InternalSettings.set("pe-settings-inputmode", value); me.api.SetTextBoxInputMode(value); + value = Common.localStorage.getBool("pe-settings-use-alt-key", true); + Common.Utils.InternalSettings.set("pe-settings-use-alt-key", value); + /** coauthoring begin **/ me._state.fastCoauth = Common.Utils.InternalSettings.get("pe-settings-coauthmode"); me.api.asc_SetFastCollaborative(me._state.fastCoauth); @@ -875,7 +883,7 @@ define([ pluginsController.setApi(me.api); documentHolderController.setApi(me.api); - documentHolderController.createDelayedElements(); + // documentHolderController.createDelayedElements(); statusbarController.createDelayedElements(); leftmenuController.getView('LeftMenu').disableMenu('all',false); @@ -883,7 +891,7 @@ define([ if (me.appOptions.canBranding) me.getApplication().getController('LeftMenu').leftMenu.getMenu('about').setLicInfo(me.editorConfig.customization); - documentHolderController.getView('DocumentHolder').setApi(me.api).on('editcomplete', _.bind(me.onEditComplete, me)); + documentHolderController.getView().on('editcomplete', _.bind(me.onEditComplete, me)); // if (me.isThumbnailsShow) me.getMainMenu().onThumbnailsShow(me.isThumbnailsShow); application.getController('Viewport').getView('DocumentPreview').setApi(me.api).setMode(me.appOptions).on('editcomplete', _.bind(me.onEditComplete, me)); @@ -909,7 +917,7 @@ define([ toolbarController.createDelayedElements(); - documentHolderController.getView('DocumentHolder').createDelayedElements(); + documentHolderController.getView().createDelayedElements(); me.setLanguages(); me.api.asc_registerCallback('asc_onUpdateLayout', _.bind(me.fillLayoutsStore, me)); // slide layouts loading @@ -931,7 +939,7 @@ define([ } }, 50); } else { - documentHolderController.getView('DocumentHolder').createDelayedElementsViewer(); + documentHolderController.getView().createDelayedElementsViewer(); Common.NotificationCenter.trigger('document:ready', 'main'); me.applyLicense(); } @@ -1079,7 +1087,7 @@ define([ app.getController('Toolbar').DisableToolbar(disable, options.viewMode); } if (options.documentHolder) { - app.getController('DocumentHolder').getView('DocumentHolder').SetDisabled(disable); + app.getController('DocumentHolder').SetDisabled(disable); } if (options.leftMenu) { if (options.leftMenu.disable) @@ -1282,7 +1290,7 @@ define([ var app = this.getApplication(), viewport = app.getController('Viewport').getView('Viewport'), statusbarView = app.getController('Statusbar').getView('Statusbar'), - documentHolder = app.getController('DocumentHolder').getView('DocumentHolder'), + documentHolder = app.getController('DocumentHolder'), toolbarController = app.getController('Toolbar'); viewport && viewport.setMode(this.appOptions, true); @@ -1854,7 +1862,7 @@ define([ synchronizeChanges: function() { this.getApplication().getController('Statusbar').setStatusCaption(''); - this.getApplication().getController('DocumentHolder').getView('DocumentHolder').hideTips(); + this.getApplication().getController('DocumentHolder').hideTips(); /** coauthoring begin **/ this.getApplication().getController('Toolbar').getView('Toolbar').synchronizeChanges(); /** coauthoring end **/ @@ -2072,7 +2080,7 @@ define([ this.loadLanguages([]); } if (this.languages && this.languages.length>0) { - this.getApplication().getController('DocumentHolder').getView('DocumentHolder').setLanguages(this.languages); + this.getApplication().getController('DocumentHolder').getView().setLanguages(this.languages); this.getApplication().getController('Statusbar').setLanguages(this.languages); this.getApplication().getController('Common.Controllers.ReviewChanges').setLanguages(this.languages); } @@ -2277,6 +2285,47 @@ define([ } }, + onMacrosPermissionRequest: function(url, callback) { + if (url && callback) { + this.stackMacrosRequests.push({url: url, callback: callback}); + if (this.stackMacrosRequests.length>1) { + return; + } + } else if (this.stackMacrosRequests.length>0) { + url = this.stackMacrosRequests[0].url; + callback = this.stackMacrosRequests[0].callback; + } else + return; + + var me = this; + var value = Common.Utils.InternalSettings.get("pe-allow-macros-request"); + if (value>0) { + callback && callback(value === 1); + this.stackMacrosRequests.shift(); + this.onMacrosPermissionRequest(); + } else { + Common.UI.warning({ + msg: this.textRequestMacros.replace('%1', url), + buttons: ['yes', 'no'], + primary: 'yes', + dontshow: true, + textDontShow: this.textRememberMacros, + maxwidth: 600, + callback: function(btn, dontshow){ + if (dontshow) { + Common.Utils.InternalSettings.set("pe-allow-macros-request", (btn == 'yes') ? 1 : 2); + Common.localStorage.setItem("pe-allow-macros-request", (btn == 'yes') ? 1 : 2); + } + setTimeout(function() { + if (callback) callback(btn == 'yes'); + me.stackMacrosRequests.shift(); + me.onMacrosPermissionRequest(); + }, 1); + } + }); + } + }, + loadAutoCorrectSettings: function() { // autocorrection var me = this; @@ -2930,7 +2979,9 @@ define([ textConvertEquation: 'This equation was created with an old version of equation editor which is no longer supported. Converting this equation to Office Math ML format will make it editable.
    Do you want to convert this equation?', textApplyAll: 'Apply to all equations', textLearnMore: 'Learn More', - textReconnect: 'Connection is restored' + textReconnect: 'Connection is restored', + textRequestMacros: 'A macro makes a request to URL. Do you want to allow the request to the %1?', + textRememberMacros: 'Remember my choice for all macros' } })(), PE.Controllers.Main || {})) }); diff --git a/apps/presentationeditor/main/app/controller/Toolbar.js b/apps/presentationeditor/main/app/controller/Toolbar.js index c3c8b631a..a869ff4fb 100644 --- a/apps/presentationeditor/main/app/controller/Toolbar.js +++ b/apps/presentationeditor/main/app/controller/Toolbar.js @@ -503,20 +503,63 @@ define([ } }, + updateBulletTip: function(view, title) { + if (view) { + var tip = $(view.el).data('bs.tooltip'); + if (tip) { + tip.options.title = title; + tip.$tip.find('.tooltip-inner').text(title); + } + } + }, + onApiBullets: function(v) { - if (this._state.bullets.type != v.get_ListType() || this._state.bullets.subtype != v.get_ListSubType()) { + if (this._state.bullets.type !== v.get_ListType() || this._state.bullets.subtype !== v.get_ListSubType() || v.get_ListType()===0 && v.get_ListSubType()===0x1000) { this._state.bullets.type = v.get_ListType(); this._state.bullets.subtype = v.get_ListSubType(); + var rec = this.toolbar.mnuMarkersPicker.store.at(8), + drawDefBullet = (rec.get('data').subtype===0x1000) && (this._state.bullets.type===1 || this._state.bullets.subtype!==0x1000); + this._clearBullets(); switch(this._state.bullets.type) { case 0: + var idx; + if (this._state.bullets.subtype!==0x1000) + idx = this._state.bullets.subtype; + else { // custom + var bullet = v.asc_getListCustom(); + if (bullet) { + var type = bullet.asc_getType(); + if (type == Asc.asc_PreviewBulletType.char) { + var symbol = bullet.asc_getChar(); + if (symbol) { + rec.get('data').subtype = 0x1000; + rec.set('drawdata', {type: type, char: symbol, specialFont: bullet.asc_getSpecialFont()}); + rec.set('tip', ''); + this.toolbar.mnuMarkersPicker.dataViewItems && this.updateBulletTip(this.toolbar.mnuMarkersPicker.dataViewItems[8], ''); + drawDefBullet = false; + idx = 8; + } + } else if (type == Asc.asc_PreviewBulletType.image) { + var id = bullet.asc_getImageId(); + if (id) { + rec.get('data').subtype = 0x1000; + rec.set('drawdata', {type: type, imageId: id}); + rec.set('tip', ''); + this.toolbar.mnuMarkersPicker.dataViewItems && this.updateBulletTip(this.toolbar.mnuMarkersPicker.dataViewItems[8], ''); + drawDefBullet = false; + idx = 8; + } + } + } + } + (idx!==undefined) ? this.toolbar.mnuMarkersPicker.selectByIndex(idx, true) : + this.toolbar.mnuMarkersPicker.deselectAll(true); + this.toolbar.btnMarkers.toggle(true, true); - if (this._state.bullets.subtype!==undefined) - this.toolbar.mnuMarkersPicker.selectByIndex(this._state.bullets.subtype, true); - else - this.toolbar.mnuMarkersPicker.deselectAll(true); + this.toolbar.mnuNumbersPicker.deselectAll(true); break; case 1: var idx = 0; @@ -545,8 +588,15 @@ define([ } this.toolbar.btnNumbers.toggle(true, true); this.toolbar.mnuNumbersPicker.selectByIndex(idx, true); + this.toolbar.mnuMarkersPicker.deselectAll(true); break; } + if (drawDefBullet) { + rec.get('data').subtype = 8; + rec.set('drawdata', this.toolbar._markersArr[8]); + rec.set('tip', this.toolbar.tipMarkersDash); + this.toolbar.mnuMarkersPicker.dataViewItems && this.updateBulletTip(this.toolbar.mnuMarkersPicker.dataViewItems[8], this.toolbar.tipMarkersDash); + } } }, @@ -1247,6 +1297,7 @@ define([ api: me.api, props: props, type: type, + storage: me.mode.canRequestInsertImage || me.mode.fileChoiceUrl && me.mode.fileChoiceUrl.indexOf("{documentType}")>-1, interfaceLang: me.toolbar.mode.lang, handler: function(result, value) { if (result == 'ok') { @@ -1358,7 +1409,9 @@ define([ var store = picker.store; var arr = []; store.each(function(item){ - arr.push(item.get('id')); + var data = item.get('drawdata'); + data['divId'] = item.get('id'); + arr.push(data); }); if (this.api && this.api.SetDrawImagePreviewBulletForMenu) { this.api.SetDrawImagePreviewBulletForMenu(arr, type); @@ -1381,11 +1434,31 @@ define([ } if (btn) { - btn.toggle(rawData.data.subtype > -1, true); + btn.toggle(rawData.data.subtype !== -1, true); } - if (this.api) - this.api.put_ListType(rawData.data.type, rawData.data.subtype); + if (this.api){ + if (rawData.data.type===0 && rawData.data.subtype===0x1000) {// custom bullet + var bullet = new Asc.asc_CBullet(); + if (rawData.drawdata.type===Asc.asc_PreviewBulletType.char) { + bullet.asc_putSymbol(rawData.drawdata.char); + bullet.asc_putFont(rawData.drawdata.specialFont); + } else if (rawData.drawdata.type===Asc.asc_PreviewBulletType.image) + bullet.asc_fillBulletImage(rawData.drawdata.imageId); + var selectedElements = this.api.getSelectedElements(); + if (selectedElements && _.isArray(selectedElements)) { + for (var i = 0; i< selectedElements.length; i++) { + if (Asc.c_oAscTypeSelectElement.Paragraph == selectedElements[i].get_ObjectType()) { + var props = selectedElements[i].get_ObjectValue(); + props.asc_putBullet(bullet); + this.api.paraApply(props); + break; + } + } + } + } else + this.api.put_ListType(rawData.data.type, rawData.data.subtype); + } Common.NotificationCenter.trigger('edit:complete', this.toolbar); Common.component.Analytics.trackEvent('ToolBar', 'List Type'); @@ -2000,9 +2073,9 @@ define([ if (this._state.clrhighlight != -1) { this.toolbar.mnuHighlightTransparent.setChecked(true, true); - if (this.toolbar.mnuHighlightColorPicker.cmpEl) { + if (this.toolbar.mnuHighlightColorPicker) { this._state.clrhighlight = -1; - this.toolbar.mnuHighlightColorPicker.select(null, true); + this.toolbar.mnuHighlightColorPicker.clearSelection(); } } } else if (c !== null) { @@ -2010,13 +2083,13 @@ define([ this.toolbar.mnuHighlightTransparent.setChecked(false); this._state.clrhighlight = c.get_hex().toUpperCase(); - if ( _.contains(this.toolbar.mnuHighlightColorPicker.colors, this._state.clrhighlight) ) - this.toolbar.mnuHighlightColorPicker.select(this._state.clrhighlight, true); + if ( this.toolbar.mnuHighlightColorPicker && _.contains(this.toolbar.mnuHighlightColorPicker.colors, this._state.clrhighlight) ) + this.toolbar.mnuHighlightColorPicker.selectByRGB(this._state.clrhighlight, true); } } else { if ( this._state.clrhighlight !== c) { this.toolbar.mnuHighlightTransparent.setChecked(false, true); - this.toolbar.mnuHighlightColorPicker.select(null, true); + this.toolbar.mnuHighlightColorPicker && this.toolbar.mnuHighlightColorPicker.clearSelection(); this._state.clrhighlight = c; } } diff --git a/apps/presentationeditor/main/app/controller/ViewTab.js b/apps/presentationeditor/main/app/controller/ViewTab.js index 04e6e4469..4e2249cf4 100644 --- a/apps/presentationeditor/main/app/controller/ViewTab.js +++ b/apps/presentationeditor/main/app/controller/ViewTab.js @@ -85,7 +85,6 @@ define([ mode: mode, compactToolbar: this.toolbar.toolbar.isCompactView }); - this.addListeners({ 'ViewTab': { 'zoom:toslide': _.bind(this.onBtnZoomTo, this, 'toslide'), @@ -152,6 +151,10 @@ define([ })).then(function () { me.view.setEvents(); + if (!Common.UI.Themes.available()) { + me.view.btnInterfaceTheme.$el.closest('.group').remove(); + me.view.$el.find('.separator-theme').remove(); + } if (config.canBrandingExt && config.customization && config.customization.statusBar === false || !Common.UI.LayoutManager.isElementVisible('statusBar')) { me.view.chStatusbar.$el.remove(); @@ -173,24 +176,26 @@ define([ .on('combo:blur', _.bind(me.onComboBlur, me, false)); }); - var menuItems = [], - currentTheme = Common.UI.Themes.currentThemeId() || Common.UI.Themes.defaultThemeId(); - for (var t in Common.UI.Themes.map()) { - menuItems.push({ - value: t, - caption: Common.UI.Themes.get(t).text, - checked: t === currentTheme, - checkable: true, - toggleGroup: 'interface-theme' - }); - } + if (Common.UI.Themes.available()) { + var menuItems = [], + currentTheme = Common.UI.Themes.currentThemeId() || Common.UI.Themes.defaultThemeId(); + for (var t in Common.UI.Themes.map()) { + menuItems.push({ + value: t, + caption: Common.UI.Themes.get(t).text, + checked: t === currentTheme, + checkable: true, + toggleGroup: 'interface-theme' + }); + } - if (menuItems.length) { - this.view.btnInterfaceTheme.setMenu(new Common.UI.Menu({items: menuItems})); - this.view.btnInterfaceTheme.menu.on('item:click', _.bind(function (menu, item) { - var value = item.value; - Common.UI.Themes.setTheme(value); - }, this)); + if (menuItems.length) { + this.view.btnInterfaceTheme.setMenu(new Common.UI.Menu({items: menuItems})); + this.view.btnInterfaceTheme.menu.on('item:click', _.bind(function (menu, item) { + var value = item.value; + Common.UI.Themes.setTheme(value); + }, this)); + } } } }, @@ -220,7 +225,7 @@ define([ }, onThemeChanged: function () { - if (this.view) { + if (this.view && Common.UI.Themes.available()) { var current_theme = Common.UI.Themes.currentThemeId() || Common.UI.Themes.defaultThemeId(), menu_item = _.findWhere(this.view.btnInterfaceTheme.menu.items, {value: current_theme}); if ( !!menu_item ) { diff --git a/apps/presentationeditor/main/app/view/Animation.js b/apps/presentationeditor/main/app/view/Animation.js index 49092ef33..b17125654 100644 --- a/apps/presentationeditor/main/app/view/Animation.js +++ b/apps/presentationeditor/main/app/view/Animation.js @@ -76,6 +76,12 @@ define([ me.btnPreview.on('click', _.bind(function(btn) { me.fireEvent('animation:preview', [me.btnPreview]); }, me)); + me.btnPreview.menu.on('item:click', _.bind(function(menu, item, e) { + if (item.value === 'preview') + me.fireEvent('animation:preview', [me.btnPreview]); + else if (item.value === 'auto') + Common.Utils.InternalSettings.set("pe-animation-no-auto-preview", !item.checked); + }, me)); } if(me.cmbTrigger) @@ -240,7 +246,8 @@ define([ this.btnPreview = new Common.UI.Button({ cls: 'btn-toolbar x-huge icon-top', // x-huge icon-top', caption: this.txtPreview, - split: false, + split: true, + menu: true, iconCls: 'toolbar__icon animation-preview-start', lock: [_set.slideDeleted, _set.noSlides, _set.noAnimationPreview, _set.timingLock], dataHint: '1', @@ -350,7 +357,7 @@ define([ width: 55, value: '', defaultUnit: this.txtSec, - maxValue: 300, + maxValue: 60, minValue: 0, lock: [_set.slideDeleted, _set.noSlides, _set.noGraphic, _set.noAnimation, _set.timingLock], dataHint: '1', @@ -514,6 +521,15 @@ define([ me.btnAddAnimation.menu.setInnerMenu([{menu: picker, index: 0}]); }; me.btnAddAnimation.menu.on('show:before', onShowBefore); + + me.btnPreview.setMenu( new Common.UI.Menu({ + style: "min-width: auto;", + items: [ + {caption: me.txtPreview, value: 'preview'}, + {caption: me.textAutoPreview, value: 'auto', checkable: true, checked: !Common.Utils.InternalSettings.get("pe-animation-no-auto-preview")} + ] + })); + setEvents.call(me); }); }, @@ -626,7 +642,8 @@ define([ str3: '3 s (Slow)', str2: '2 s (Medium)', str1: '1 s (Fast)', - str0_5: '0.5 s (Very Fast)' + str0_5: '0.5 s (Very Fast)', + textAutoPreview: 'AutoPreview' } }()), PE.Views.Animation || {})); diff --git a/apps/presentationeditor/main/app/view/AnimationDialog.js b/apps/presentationeditor/main/app/view/AnimationDialog.js index d8f051f78..852c1b5b6 100644 --- a/apps/presentationeditor/main/app/view/AnimationDialog.js +++ b/apps/presentationeditor/main/app/view/AnimationDialog.js @@ -44,7 +44,7 @@ define([ PE.Views.AnimationDialog = Common.UI.Window.extend(_.extend({ options: { width: 350, - height: 426, + height: 396, header: true, cls: 'animation-dlg', buttons: ['ok', 'cancel'] @@ -57,8 +57,8 @@ define([ '
    ', '
    ', '
    ', - '
    ', - '
    ', + '
    ', + // '
    ', '
    ' ].join(''); this.allEffects = Common.define.effectData.getEffectFullData(); @@ -125,11 +125,11 @@ define([ }); this.lstEffectList.on('item:select', _.bind(this.onEffectListItem,this)); - this.chPreview = new Common.UI.CheckBox({ - el : $('#animation-setpreview'), - labelText : this.textPreviewEffect, - value: !Common.Utils.InternalSettings.get("pe-animation-no-preview") - }).on('change', _.bind(this.onPreviewChange, this)); + // this.chPreview = new Common.UI.CheckBox({ + // el : $('#animation-setpreview'), + // labelText : this.textPreviewEffect, + // value: !Common.Utils.InternalSettings.get("pe-animation-no-preview") + // }).on('change', _.bind(this.onPreviewChange, this)); this.cmbGroup.setValue(this._state.activeGroupValue); this.fillLevel(); @@ -138,7 +138,7 @@ define([ }, getFocusedComponents: function() { - return [ this.cmbGroup, this.cmbLevel, this.lstEffectList, this.chPreview]; + return [ this.cmbGroup, this.cmbLevel, this.lstEffectList/*, this.chPreview*/]; }, getDefaultFocusableComponent: function () { diff --git a/apps/presentationeditor/main/app/view/DocumentHolder.js b/apps/presentationeditor/main/app/view/DocumentHolder.js index dd7c39c9a..ebb431b4a 100644 --- a/apps/presentationeditor/main/app/view/DocumentHolder.js +++ b/apps/presentationeditor/main/app/view/DocumentHolder.js @@ -58,1614 +58,13 @@ define([ initialize: function () { var me = this; - me.usertips = []; - me._TtHeight = 20; me.slidesCount = 0; - me.fastcoauthtips = []; me._currentMathObj = undefined; me._currentParaObjDisabled = false; me._currentSpellObj = undefined; me._currLang = {}; me._state = {}; me._isDisabled = false; - - /** coauthoring begin **/ - var usersStore = PE.getCollection('Common.Collections.Users'); - /** coauthoring end **/ - - var showPopupMenu = function(menu, value, event, docElement, eOpts){ - if (!_.isUndefined(menu) && menu !== null){ - Common.UI.Menu.Manager.hideAll(); - - var showPoint = [event.get_X(), event.get_Y()], - menuContainer = $(me.el).find(Common.Utils.String.format('#menu-container-{0}', menu.id)); - - if (event.get_Type() == Asc.c_oAscContextMenuTypes.Thumbnails) { - showPoint[0] -= 3; - showPoint[1] -= 3; - } - - if (!menu.rendered) { - // Prepare menu container - if (menuContainer.length < 1) { - menuContainer = $(Common.Utils.String.format('', menu.id)); - $(me.el).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); - - me.currentMenu = menu; - } - }; - - var fillMenuProps = function(selectedElements) { - if (!selectedElements || !_.isArray(selectedElements)) return; - - var menu_props = {}, - menu_to_show = null; - _.each(selectedElements, function(element, index) { - var elType = element.get_ObjectType(), - elValue = element.get_ObjectValue(); - - if (Asc.c_oAscTypeSelectElement.Image == elType) { - menu_to_show = me.pictureMenu; - menu_props.imgProps = {}; - menu_props.imgProps.value = elValue; - menu_props.imgProps.locked = (elValue) ? elValue.get_Locked() : false; - } else if (Asc.c_oAscTypeSelectElement.Table == elType) - { - menu_to_show = me.tableMenu; - menu_props.tableProps = {}; - menu_props.tableProps.value = elValue; - menu_props.tableProps.locked = (elValue) ? elValue.get_Locked() : false; - } else if (Asc.c_oAscTypeSelectElement.Hyperlink == elType) { - menu_props.hyperProps = {}; - menu_props.hyperProps.value = elValue; - } else if (Asc.c_oAscTypeSelectElement.Shape == elType) { // shape - menu_to_show = me.pictureMenu; - menu_props.shapeProps = {}; - menu_props.shapeProps.value = elValue; - menu_props.shapeProps.locked = (elValue) ? elValue.get_Locked() : false; - if (elValue.get_FromChart()) - menu_props.shapeProps.isChart = true; - } - else if (Asc.c_oAscTypeSelectElement.Chart == elType) { - menu_to_show = me.pictureMenu; - menu_props.chartProps = {}; - menu_props.chartProps.value = elValue; - menu_props.chartProps.locked = (elValue) ? elValue.get_Locked() : false; - } - else if (Asc.c_oAscTypeSelectElement.Slide == elType) { - menu_props.slideProps = {}; - menu_props.slideProps.value = elValue; - menu_props.slideProps.locked = (elValue) ? elValue.get_LockDelete() : false; - } else if (Asc.c_oAscTypeSelectElement.Paragraph == elType) { - menu_props.paraProps = {}; - menu_props.paraProps.value = elValue; - menu_props.paraProps.locked = (elValue) ? elValue.get_Locked() : false; - if ( (menu_props.shapeProps && menu_props.shapeProps.value || menu_props.chartProps && menu_props.chartProps.value)&& // text in shape, need to show paragraph menu with vertical align - _.isUndefined(menu_props.tableProps)) - menu_to_show = me.textMenu; - } else if (Asc.c_oAscTypeSelectElement.SpellCheck == elType) { - menu_props.spellProps = {}; - menu_props.spellProps.value = elValue; - me._currentSpellObj = elValue; - } else if (Asc.c_oAscTypeSelectElement.Math == elType) { - menu_props.mathProps = {}; - menu_props.mathProps.value = elValue; - me._currentMathObj = elValue; - } - }); - if (menu_to_show === null) { - if (!_.isUndefined(menu_props.paraProps)) - menu_to_show = me.textMenu; - else if (!_.isUndefined(menu_props.slideProps)) { - menu_to_show = me.slideMenu; - } - } - - return {menu_to_show: menu_to_show, menu_props: menu_props}; - }; - - var fillViewMenuProps = function(selectedElements) { - if (!selectedElements || !_.isArray(selectedElements)) return; - - if (!me.viewModeMenu) - me.createDelayedElementsViewer(); - - var menu_props = {}, - menu_to_show = null; - _.each(selectedElements, function(element, index) { - var elType = element.get_ObjectType(), - elValue = element.get_ObjectValue(); - - if (Asc.c_oAscTypeSelectElement.Image == elType || Asc.c_oAscTypeSelectElement.Table == elType || Asc.c_oAscTypeSelectElement.Shape == elType || - Asc.c_oAscTypeSelectElement.Chart == elType || Asc.c_oAscTypeSelectElement.Paragraph == elType) { - menu_to_show = me.viewModeMenu; - menu_props.locked = menu_props.locked || ((elValue) ? elValue.get_Locked() : false); - if (Asc.c_oAscTypeSelectElement.Chart == elType) - menu_props.isChart = true; - } - else if (Asc.c_oAscTypeSelectElement.Slide == elType) { - menu_props.locked = menu_props.locked || ((elValue) ? elValue.get_LockDelete() : false); - } - }); - - return (menu_to_show) ? {menu_to_show: menu_to_show, menu_props: menu_props} : null; - }; - - var showObjectMenu = function(event, docElement, eOpts){ - if (me.api){ - var obj = (me.mode.isEdit && !me._isDisabled) ? fillMenuProps(me.api.getSelectedElements()) : fillViewMenuProps(me.api.getSelectedElements()); - if (obj) showPopupMenu(obj.menu_to_show, obj.menu_props, event, docElement, eOpts); - } - }; - - var onContextMenu = function(event){ - if (Common.UI.HintManager.isHintVisible()) - Common.UI.HintManager.clearHints(); - _.delay(function(){ - if (event.get_Type() == Asc.c_oAscContextMenuTypes.Thumbnails) { - showPopupMenu.call(me, (me.mode.isEdit && !me._isDisabled) ? me.slideMenu : me.viewModeMenuSlide, {isSlideSelect: event.get_IsSlideSelect(), isSlideHidden: event.get_IsSlideHidden(), fromThumbs: true}, event); - } else { - showObjectMenu.call(me, event); - } - },10); - }; - - var onFocusObject = function(selectedElements) { - if (me.currentMenu && me.currentMenu.isVisible()){ - if (me.api.asc_getCurrentFocusObject() === 0 ){ // thumbnails - if (me.slideMenu===me.currentMenu && !me._isDisabled) { - var isHidden = false; - _.each(selectedElements, function(element, index) { - if (Asc.c_oAscTypeSelectElement.Slide == element.get_ObjectType()) { - isHidden = element.get_ObjectValue().get_IsHidden(); - } - }); - - me.currentMenu.options.initMenu({isSlideSelect: me.slideMenu.items[2].isVisible(), isSlideHidden: isHidden, fromThumbs: true}); - me.currentMenu.alignPosition(); - } - } else { - var obj = (me.mode.isEdit && !me._isDisabled) ? fillMenuProps(selectedElements) : fillViewMenuProps(selectedElements); - if (obj) { - if (obj.menu_to_show===me.currentMenu) { - me.currentMenu.options.initMenu(obj.menu_props); - me.currentMenu.alignPosition(); - } - } - } - } - }; - - var handleDocumentWheel = function(event){ - if (me.api) { - var delta = (_.isUndefined(event.originalEvent)) ? event.wheelDelta : event.originalEvent.wheelDelta; - if (_.isUndefined(delta)) { - delta = event.deltaY; - } - - if ((event.ctrlKey || event.metaKey) && !event.altKey){ - if (delta < 0) - me.api.zoomOut(); - else if (delta > 0) - me.api.zoomIn(); - - event.preventDefault(); - event.stopPropagation(); - } - } - }; - - var handleDocumentKeyDown = function(event){ - if (me.api){ - var key = event.keyCode; - if ((event.ctrlKey || event.metaKey) && !event.shiftKey && !event.altKey){ - if (key === Common.UI.Keys.NUM_PLUS || key === Common.UI.Keys.EQUALITY || (Common.Utils.isGecko && key === Common.UI.Keys.EQUALITY_FF) || (Common.Utils.isOpera && key == 43)){ - me.api.zoomIn(); - event.preventDefault(); - event.stopPropagation(); - return false; - } - else if (key === Common.UI.Keys.NUM_MINUS || key === Common.UI.Keys.MINUS || (Common.Utils.isGecko && key === Common.UI.Keys.MINUS_FF) || (Common.Utils.isOpera && key == 45)){ - me.api.zoomOut(); - event.preventDefault(); - event.stopPropagation(); - return false; - } else if (key === 48 || key === 96) {// 0 - me.api.zoomFitToPage(); - event.preventDefault(); - event.stopPropagation(); - return false; - } - } - if (me.currentMenu && me.currentMenu.isVisible()) { - if (key == Common.UI.Keys.UP || - key == Common.UI.Keys.DOWN) { - $('ul.dropdown-menu', me.currentMenu.el).focus(); - } - } - if (key == Common.UI.Keys.ESC) { - Common.UI.Menu.Manager.hideAll(); - if (!Common.UI.HintManager.isHintVisible()) - Common.NotificationCenter.trigger('leftmenu:change', 'hide'); - } - } - }; - - var onDocumentHolderResize = function(){ - me._Height = me.cmpEl.height(); - me._Width = me.cmpEl.width(); - me._BodyWidth = $('body').width(); - me._XY = undefined; - - if (me.slideNumDiv) { - me.slideNumDiv.remove(); - me.slideNumDiv = undefined; - } - }; - - var onAfterRender = function(ct){ - var meEl = me.cmpEl; - if (meEl) { - meEl.on('contextmenu', function(e) { - e.preventDefault(); - e.stopPropagation(); - return false; - }); - meEl.on('click', function(e){ - if (e.target.localName == 'canvas') { - if (me._preventClick) - me._preventClick = false; - else - meEl.focus(); - } - }); - meEl.on('mousedown', function(e){ - if (e.target.localName == 'canvas') - Common.UI.Menu.Manager.hideAll(); - }); - - //NOTE: set mouse wheel handler - - var addEvent = function( elem, type, fn ) { - elem.addEventListener ? elem.addEventListener( type, fn, false ) : elem.attachEvent( "on" + type, fn ); - }; - - var eventname=(/Firefox/i.test(navigator.userAgent))? 'DOMMouseScroll' : 'mousewheel'; - addEvent(me.el, eventname, handleDocumentWheel); - } - - !Common.Utils.isChrome ? $(document).on('mousewheel', handleDocumentWheel) : - document.addEventListener('mousewheel', handleDocumentWheel, {passive: false}); - $(document).on('keydown', handleDocumentKeyDown); - $(window).on('resize', onDocumentHolderResize); - var viewport = PE.getController('Viewport').getView('Viewport'); - viewport.hlayout.on('layout:resizedrag', onDocumentHolderResize); - }; - - /** coauthoring begin **/ - var getUserName = function(id){ - if (usersStore){ - var rec = usersStore.findUser(id); - if (rec) - return AscCommon.UserInfoParser.getParsedName(rec.get('username')); - } - return me.guestText; - }; - var isUserVisible = function(id){ - if (usersStore){ - var rec = usersStore.findUser(id); - if (rec) - return !rec.get('hidden'); - } - return true; - }; - /** coauthoring end **/ - - var screenTip = { - toolTip: new Common.UI.Tooltip({ - owner: this, - html: true, - title: '
    Press Ctrl and click link' -// style: 'word-wrap: break-word;' - }), - strTip: '', - isHidden: true, - isVisible: false - }; - - /** coauthoring begin **/ - var userTooltip = true; - - var userTipMousover = function (evt, el, opt) { - if (userTooltip===true) { - userTooltip = new Common.UI.Tooltip({ - owner: evt.currentTarget, - title: me.tipIsLocked - }); - - userTooltip.show(); - } - }; - - var userTipHide = function () { - if (typeof userTooltip == 'object') { - userTooltip.hide(); - userTooltip = undefined; - - for (var i=0; i0) - window.open(url); - else - Common.UI.warning({ - msg: me.txtWarnUrl, - buttons: ['yes', 'no'], - primary: 'yes', - callback: function(btn) { - (btn == 'yes') && window.open(url); - } - }); - } - }; - - var onMouseMoveStart = function() { - screenTip.isHidden = true; - /** coauthoring begin **/ - if (me.usertips.length>0) { - if (typeof userTooltip == 'object') { - userTooltip.hide(); - userTooltip = true; - } - _.each(me.usertips, function(item) { - item.remove(); - }); - } - me.usertips = []; - me.usertipcount = 0; - /** coauthoring end **/ - }; - - var onMouseMoveEnd = function() { - if (screenTip.isHidden && screenTip.isVisible) { - screenTip.isVisible = false; - screenTip.toolTip.hide(); - } - }; - - var onMouseMove = function(moveData) { - if (_.isUndefined(me._XY)) { - me._XY = [ - me.cmpEl.offset().left - $(window).scrollLeft(), - me.cmpEl.offset().top - $(window).scrollTop() - ]; - me._Width = me.cmpEl.width(); - me._Height = me.cmpEl.height(); - me._BodyWidth = $('body').width(); - } - - if (moveData) { - var showPoint, ToolTip; - - if (moveData.get_Type()==1) { // 1 - hyperlink - var hyperProps = moveData.get_Hyperlink(); - var recalc = false; - if (hyperProps) { - screenTip.isHidden = false; - - ToolTip = (_.isEmpty(hyperProps.get_ToolTip())) ? hyperProps.get_Value() : hyperProps.get_ToolTip(); - ToolTip = Common.Utils.String.htmlEncode(ToolTip); - if (ToolTip.length>256) - ToolTip = ToolTip.substr(0, 256) + '...'; - - if (screenTip.tipLength !== ToolTip.length || screenTip.strTip.indexOf(ToolTip)<0 ) { - screenTip.toolTip.setTitle(ToolTip + (me.isPreviewVisible ? '' : '
    ' + me.txtPressLink + '')); - screenTip.tipLength = ToolTip.length; - screenTip.strTip = ToolTip; - recalc = true; - } - - showPoint = [moveData.get_X(), moveData.get_Y()]; - showPoint[1] += ((me.isPreviewVisible ? 0 : me._XY[1])-15); - showPoint[0] += ((me.isPreviewVisible ? 0 : me._XY[0])+5); - - if (!screenTip.isVisible || recalc) { - screenTip.isVisible = true; - screenTip.toolTip.show([-10000, -10000]); - } - - if ( recalc ) { - screenTip.tipHeight = screenTip.toolTip.getBSTip().$tip.height(); - screenTip.tipWidth = screenTip.toolTip.getBSTip().$tip.width(); - } - showPoint[1] -= screenTip.tipHeight; - if (showPoint[1]<0) - showPoint[1] = 0; - if (showPoint[0] + screenTip.tipWidth > me._BodyWidth ) - showPoint[0] = me._BodyWidth - screenTip.tipWidth; - screenTip.toolTip.getBSTip().$tip.css({top: showPoint[1] + 'px', left: showPoint[0] + 'px'}); - } - } - /** coauthoring begin **/ - else if (moveData.get_Type()==2 && me.mode.isEdit && isUserVisible(moveData.get_UserId())) { // 2 - locked object - var src; - if (me.usertipcount >= me.usertips.length) { - src = $(document.createElement("div")); - src.addClass('username-tip'); - src.css({height: me._TtHeight + 'px', position: 'absolute', zIndex: '900', visibility: 'visible'}); - $(document.body).append(src); - if (userTooltip) { - src.on('mouseover', userTipMousover); - src.on('mouseout', userTipMousout); - } - - me.usertips.push(src); - } - src = me.usertips[me.usertipcount]; - me.usertipcount++; - - ToolTip = getUserName(moveData.get_UserId()); - - showPoint = [moveData.get_X()+me._XY[0], moveData.get_Y()+me._XY[1]]; - var maxwidth = showPoint[0]; - showPoint[0] = me._BodyWidth - showPoint[0]; - showPoint[1] -= ((moveData.get_LockedObjectType()==2) ? me._TtHeight : 0); - - if (showPoint[1] > me._XY[1] && showPoint[1]+me._TtHeight < me._XY[1]+me._Height) { - src.text(ToolTip); - src.css({visibility: 'visible', top: showPoint[1] + 'px', right: showPoint[0] + 'px', 'max-width': maxwidth + 'px'}); - } - } - /** coauthoring end **/ - } - }; - - var onShowForeignCursorLabel = function(UserId, X, Y, color) { - if (!isUserVisible(UserId)) return; - - /** coauthoring begin **/ - var src; - for (var i=0; i-1) && !menu.items[index].checked && menu.setChecked(index, true); - } - }; - - var onSpellCheckVariantsFound = function() { - var selectedElements = me.api.getSelectedElements(true); - var props; - if (selectedElements && _.isArray(selectedElements)){ - for (var i = 0; i 0) { - moreMenu.setVisible(variants.length > 3); - moreMenu.setDisabled(me._currentParaObjDisabled); - - _.each(variants, function(variant, index) { - var mnu = new Common.UI.MenuItem({ - caption : variant, - spellword : true, - disabled : me._currentParaObjDisabled - }).on('click', function(item, e) { - if (me.api) { - me.api.asc_replaceMisspelledWord(item.caption, me._currentSpellObj); - me.fireEvent('editcomplete', me); - } - }); - - (index < 3) ? arr.push(mnu) : arrMore.push(mnu); - }); - - if (arr.length > 0) { - if (isParagraph) { - _.each(arr, function(variant, index){ - me.textMenu.insertItem(index, variant); - }) - } else { - _.each(arr, function(variant, index){ - me.menuSpellCheckTable.menu.insertItem(index, variant); - }) - } - } - - if (arrMore.length > 0) { - _.each(arrMore, function(variant, index){ - moreMenu.menu.addItem(variant); - }); - } - - spellMenu.setVisible(false); - } else { - moreMenu.setVisible(false); - spellMenu.setVisible(true); - spellMenu.setCaption(me.noSpellVariantsText, true); - } - }; - - this.clearWordVariants = function(isParagraph) { - var spellMenu = (isParagraph) ? me.textMenu : me.menuSpellCheckTable.menu; - - for (var i = 0; i < spellMenu.items.length; i++) { - if (spellMenu.items[i].options.spellword) { - if (spellMenu.checkeditem == spellMenu.items[i]) { - spellMenu.checkeditem = undefined; - spellMenu.activeItem = undefined; - } - - spellMenu.removeItem(spellMenu.items[i]); - i--; - } - } - (isParagraph) ? me.menuSpellMorePara.menu.removeAll() : me.menuSpellMoreTable.menu.removeAll(); - - me.menuSpellMorePara.menu.checkeditem = undefined; - me.menuSpellMorePara.menu.activeItem = undefined; - me.menuSpellMoreTable.menu.checkeditem = undefined; - me.menuSpellMoreTable.menu.activeItem = undefined; - }; - - this.initEquationMenu = function() { - if (!me._currentMathObj) return; - var type = me._currentMathObj.get_Type(), - value = me._currentMathObj, - mnu, arr = []; - - switch (type) { - case Asc.c_oAscMathInterfaceType.Accent: - mnu = new Common.UI.MenuItem({ - caption : me.txtRemoveAccentChar, - equation : true, - disabled : me._currentParaObjDisabled, - equationProps: {type: type, callback: 'remove_AccentCharacter'} - }); - arr.push(mnu); - break; - case Asc.c_oAscMathInterfaceType.BorderBox: - mnu = new Common.UI.MenuItem({ - caption : me.txtBorderProps, - equation : true, - disabled : me._currentParaObjDisabled, - menu : new Common.UI.Menu({ - cls: 'shifted-right', - menuAlign: 'tl-tr', - items : [ - { - caption: value.get_HideTop() ? me.txtAddTop : me.txtHideTop, - equationProps: {type: type, callback: 'put_HideTop', value: !value.get_HideTop()} - }, - { - caption: value.get_HideBottom() ? me.txtAddBottom : me.txtHideBottom, - equationProps: {type: type, callback: 'put_HideBottom', value: !value.get_HideBottom()} - }, - { - caption: value.get_HideLeft() ? me.txtAddLeft : me.txtHideLeft, - equationProps: {type: type, callback: 'put_HideLeft', value: !value.get_HideLeft()} - }, - { - caption: value.get_HideRight() ? me.txtAddRight : me.txtHideRight, - equationProps: {type: type, callback: 'put_HideRight', value: !value.get_HideRight()} - }, - { - caption: value.get_HideHor() ? me.txtAddHor : me.txtHideHor, - equationProps: {type: type, callback: 'put_HideHor', value: !value.get_HideHor()} - }, - { - caption: value.get_HideVer() ? me.txtAddVer : me.txtHideVer, - equationProps: {type: type, callback: 'put_HideVer', value: !value.get_HideVer()} - }, - { - caption: value.get_HideTopLTR() ? me.txtAddLT : me.txtHideLT, - equationProps: {type: type, callback: 'put_HideTopLTR', value: !value.get_HideTopLTR()} - }, - { - caption: value.get_HideTopRTL() ? me.txtAddLB : me.txtHideLB, - equationProps: {type: type, callback: 'put_HideTopRTL', value: !value.get_HideTopRTL()} - } - ] - }) - }); - arr.push(mnu); - break; - case Asc.c_oAscMathInterfaceType.Bar: - mnu = new Common.UI.MenuItem({ - caption : me.txtRemoveBar, - equation : true, - disabled : me._currentParaObjDisabled, - equationProps: {type: type, callback: 'remove_Bar'} - }); - arr.push(mnu); - mnu = new Common.UI.MenuItem({ - caption : (value.get_Pos()==Asc.c_oAscMathInterfaceBarPos.Top) ? me.txtUnderbar : me.txtOverbar, - equation : true, - disabled : me._currentParaObjDisabled, - equationProps: {type: type, callback: 'put_Pos', value: (value.get_Pos()==Asc.c_oAscMathInterfaceBarPos.Top) ? Asc.c_oAscMathInterfaceBarPos.Bottom : Asc.c_oAscMathInterfaceBarPos.Top} - }); - arr.push(mnu); - break; - case Asc.c_oAscMathInterfaceType.Script: - var scripttype = value.get_ScriptType(); - if (scripttype == Asc.c_oAscMathInterfaceScript.PreSubSup) { - mnu = new Common.UI.MenuItem({ - caption : me.txtScriptsAfter, - equation : true, - disabled : me._currentParaObjDisabled, - equationProps: {type: type, callback: 'put_ScriptType', value: Asc.c_oAscMathInterfaceScript.SubSup} - }); - arr.push(mnu); - mnu = new Common.UI.MenuItem({ - caption : me.txtRemScripts, - equation : true, - disabled : me._currentParaObjDisabled, - equationProps: {type: type, callback: 'put_ScriptType', value: Asc.c_oAscMathInterfaceScript.None} - }); - arr.push(mnu); - } else { - if (scripttype == Asc.c_oAscMathInterfaceScript.SubSup) { - mnu = new Common.UI.MenuItem({ - caption : me.txtScriptsBefore, - equation : true, - disabled : me._currentParaObjDisabled, - equationProps: {type: type, callback: 'put_ScriptType', value: Asc.c_oAscMathInterfaceScript.PreSubSup} - }); - arr.push(mnu); - } - if (scripttype == Asc.c_oAscMathInterfaceScript.SubSup || scripttype == Asc.c_oAscMathInterfaceScript.Sub ) { - mnu = new Common.UI.MenuItem({ - caption : me.txtRemSubscript, - equation : true, - disabled : me._currentParaObjDisabled, - equationProps: {type: type, callback: 'put_ScriptType', value: (scripttype == Asc.c_oAscMathInterfaceScript.SubSup) ? Asc.c_oAscMathInterfaceScript.Sup : Asc.c_oAscMathInterfaceScript.None } - }); - arr.push(mnu); - } - if (scripttype == Asc.c_oAscMathInterfaceScript.SubSup || scripttype == Asc.c_oAscMathInterfaceScript.Sup ) { - mnu = new Common.UI.MenuItem({ - caption : me.txtRemSuperscript, - equation : true, - disabled : me._currentParaObjDisabled, - equationProps: {type: type, callback: 'put_ScriptType', value: (scripttype == Asc.c_oAscMathInterfaceScript.SubSup) ? Asc.c_oAscMathInterfaceScript.Sub : Asc.c_oAscMathInterfaceScript.None } - }); - arr.push(mnu); - } - } - break; - case Asc.c_oAscMathInterfaceType.Fraction: - var fraction = value.get_FractionType(); - if (fraction==Asc.c_oAscMathInterfaceFraction.Skewed || fraction==Asc.c_oAscMathInterfaceFraction.Linear) { - mnu = new Common.UI.MenuItem({ - caption : me.txtFractionStacked, - equation : true, - disabled : me._currentParaObjDisabled, - equationProps: {type: type, callback: 'put_FractionType', value: Asc.c_oAscMathInterfaceFraction.Bar} - }); - arr.push(mnu); - } - if (fraction==Asc.c_oAscMathInterfaceFraction.Bar || fraction==Asc.c_oAscMathInterfaceFraction.Linear) { - mnu = new Common.UI.MenuItem({ - caption : me.txtFractionSkewed, - equation : true, - disabled : me._currentParaObjDisabled, - equationProps: {type: type, callback: 'put_FractionType', value: Asc.c_oAscMathInterfaceFraction.Skewed} - }); - arr.push(mnu); - } - if (fraction==Asc.c_oAscMathInterfaceFraction.Bar || fraction==Asc.c_oAscMathInterfaceFraction.Skewed) { - mnu = new Common.UI.MenuItem({ - caption : me.txtFractionLinear, - equation : true, - disabled : me._currentParaObjDisabled, - equationProps: {type: type, callback: 'put_FractionType', value: Asc.c_oAscMathInterfaceFraction.Linear} - }); - arr.push(mnu); - } - if (fraction==Asc.c_oAscMathInterfaceFraction.Bar || fraction==Asc.c_oAscMathInterfaceFraction.NoBar) { - mnu = new Common.UI.MenuItem({ - caption : (fraction==Asc.c_oAscMathInterfaceFraction.Bar) ? me.txtRemFractionBar : me.txtAddFractionBar, - equation : true, - disabled : me._currentParaObjDisabled, - equationProps: {type: type, callback: 'put_FractionType', value: (fraction==Asc.c_oAscMathInterfaceFraction.Bar) ? Asc.c_oAscMathInterfaceFraction.NoBar : Asc.c_oAscMathInterfaceFraction.Bar} - }); - arr.push(mnu); - } - break; - case Asc.c_oAscMathInterfaceType.Limit: - mnu = new Common.UI.MenuItem({ - caption : (value.get_Pos()==Asc.c_oAscMathInterfaceLimitPos.Top) ? me.txtLimitUnder : me.txtLimitOver, - equation : true, - disabled : me._currentParaObjDisabled, - equationProps: {type: type, callback: 'put_Pos', value: (value.get_Pos()==Asc.c_oAscMathInterfaceLimitPos.Top) ? Asc.c_oAscMathInterfaceLimitPos.Bottom : Asc.c_oAscMathInterfaceLimitPos.Top} - }); - arr.push(mnu); - mnu = new Common.UI.MenuItem({ - caption : me.txtRemLimit, - equation : true, - disabled : me._currentParaObjDisabled, - equationProps: {type: type, callback: 'put_Pos', value: Asc.c_oAscMathInterfaceLimitPos.None} - }); - arr.push(mnu); - break; - case Asc.c_oAscMathInterfaceType.Matrix: - mnu = new Common.UI.MenuItem({ - caption : value.get_HidePlaceholder() ? me.txtShowPlaceholder : me.txtHidePlaceholder, - equation : true, - disabled : me._currentParaObjDisabled, - equationProps: {type: type, callback: 'put_HidePlaceholder', value: !value.get_HidePlaceholder()} - }); - arr.push(mnu); - mnu = new Common.UI.MenuItem({ - caption : me.insertText, - equation : true, - disabled : me._currentParaObjDisabled, - menu : new Common.UI.Menu({ - cls: 'shifted-right', - menuAlign: 'tl-tr', - items : [ - { - caption: me.insertRowAboveText, - equationProps: {type: type, callback: 'insert_MatrixRow', value: true} - }, - { - caption: me.insertRowBelowText, - equationProps: {type: type, callback: 'insert_MatrixRow', value: false} - }, - { - caption: me.insertColumnLeftText, - equationProps: {type: type, callback: 'insert_MatrixColumn', value: true} - }, - { - caption: me.insertColumnRightText, - equationProps: {type: type, callback: 'insert_MatrixColumn', value: false} - } - ] - }) - }); - arr.push(mnu); - mnu = new Common.UI.MenuItem({ - caption : me.deleteText, - equation : true, - disabled : me._currentParaObjDisabled, - menu : new Common.UI.Menu({ - cls: 'shifted-right', - menuAlign: 'tl-tr', - items : [ - { - caption: me.deleteRowText, - equationProps: {type: type, callback: 'delete_MatrixRow'} - }, - { - caption: me.deleteColumnText, - equationProps: {type: type, callback: 'delete_MatrixColumn'} - } - ] - }) - }); - arr.push(mnu); - mnu = new Common.UI.MenuItem({ - caption : me.txtMatrixAlign, - equation : true, - disabled : me._currentParaObjDisabled, - menu : new Common.UI.Menu({ - cls: 'shifted-right', - menuAlign: 'tl-tr', - items : [ - { - caption: me.txtTop, - checkable : true, - checked : (value.get_MatrixAlign()==Asc.c_oAscMathInterfaceMatrixMatrixAlign.Top), - equationProps: {type: type, callback: 'put_MatrixAlign', value: Asc.c_oAscMathInterfaceMatrixMatrixAlign.Top} - }, - { - caption: me.centerText, - checkable : true, - checked : (value.get_MatrixAlign()==Asc.c_oAscMathInterfaceMatrixMatrixAlign.Center), - equationProps: {type: type, callback: 'put_MatrixAlign', value: Asc.c_oAscMathInterfaceMatrixMatrixAlign.Center} - }, - { - caption: me.txtBottom, - checkable : true, - checked : (value.get_MatrixAlign()==Asc.c_oAscMathInterfaceMatrixMatrixAlign.Bottom), - equationProps: {type: type, callback: 'put_MatrixAlign', value: Asc.c_oAscMathInterfaceMatrixMatrixAlign.Bottom} - } - ] - }) - }); - arr.push(mnu); - mnu = new Common.UI.MenuItem({ - caption : me.txtColumnAlign, - equation : true, - disabled : me._currentParaObjDisabled, - menu : new Common.UI.Menu({ - cls: 'shifted-right', - menuAlign: 'tl-tr', - items : [ - { - caption: me.leftText, - checkable : true, - checked : (value.get_ColumnAlign()==Asc.c_oAscMathInterfaceMatrixColumnAlign.Left), - equationProps: {type: type, callback: 'put_ColumnAlign', value: Asc.c_oAscMathInterfaceMatrixColumnAlign.Left} - }, - { - caption: me.centerText, - checkable : true, - checked : (value.get_ColumnAlign()==Asc.c_oAscMathInterfaceMatrixColumnAlign.Center), - equationProps: {type: type, callback: 'put_ColumnAlign', value: Asc.c_oAscMathInterfaceMatrixColumnAlign.Center} - }, - { - caption: me.rightText, - checkable : true, - checked : (value.get_ColumnAlign()==Asc.c_oAscMathInterfaceMatrixColumnAlign.Right), - equationProps: {type: type, callback: 'put_ColumnAlign', value: Asc.c_oAscMathInterfaceMatrixColumnAlign.Right} - } - ] - }) - }); - arr.push(mnu); - break; - case Asc.c_oAscMathInterfaceType.EqArray: - mnu = new Common.UI.MenuItem({ - caption : me.txtInsertEqBefore, - equation : true, - disabled : me._currentParaObjDisabled, - equationProps: {type: type, callback: 'insert_Equation', value: true} - }); - arr.push(mnu); - mnu = new Common.UI.MenuItem({ - caption : me.txtInsertEqAfter, - equation : true, - disabled : me._currentParaObjDisabled, - equationProps: {type: type, callback: 'insert_Equation', value: false} - }); - arr.push(mnu); - mnu = new Common.UI.MenuItem({ - caption : me.txtDeleteEq, - equation : true, - disabled : me._currentParaObjDisabled, - equationProps: {type: type, callback: 'delete_Equation'} - }); - arr.push(mnu); - mnu = new Common.UI.MenuItem({ - caption : me.alignmentText, - equation : true, - disabled : me._currentParaObjDisabled, - menu : new Common.UI.Menu({ - cls: 'shifted-right', - menuAlign: 'tl-tr', - items : [ - { - caption: me.txtTop, - checkable : true, - checked : (value.get_Align()==Asc.c_oAscMathInterfaceEqArrayAlign.Top), - equationProps: {type: type, callback: 'put_Align', value: Asc.c_oAscMathInterfaceEqArrayAlign.Top} - }, - { - caption: me.centerText, - checkable : true, - checked : (value.get_Align()==Asc.c_oAscMathInterfaceEqArrayAlign.Center), - equationProps: {type: type, callback: 'put_Align', value: Asc.c_oAscMathInterfaceEqArrayAlign.Center} - }, - { - caption: me.txtBottom, - checkable : true, - checked : (value.get_Align()==Asc.c_oAscMathInterfaceEqArrayAlign.Bottom), - equationProps: {type: type, callback: 'put_Align', value: Asc.c_oAscMathInterfaceEqArrayAlign.Bottom} - } - ] - }) - }); - arr.push(mnu); - break; - case Asc.c_oAscMathInterfaceType.LargeOperator: - mnu = new Common.UI.MenuItem({ - caption : me.txtLimitChange, - equation : true, - disabled : me._currentParaObjDisabled, - equationProps: {type: type, callback: 'put_LimitLocation', value: (value.get_LimitLocation() == Asc.c_oAscMathInterfaceNaryLimitLocation.UndOvr) ? Asc.c_oAscMathInterfaceNaryLimitLocation.SubSup : Asc.c_oAscMathInterfaceNaryLimitLocation.UndOvr} - }); - arr.push(mnu); - if (value.get_HideUpper() !== undefined) { - mnu = new Common.UI.MenuItem({ - caption : value.get_HideUpper() ? me.txtShowTopLimit : me.txtHideTopLimit, - equation : true, - disabled : me._currentParaObjDisabled, - equationProps: {type: type, callback: 'put_HideUpper', value: !value.get_HideUpper()} - }); - arr.push(mnu); - } - if (value.get_HideLower() !== undefined) { - mnu = new Common.UI.MenuItem({ - caption : value.get_HideLower() ? me.txtShowBottomLimit : me.txtHideBottomLimit, - equation : true, - disabled : me._currentParaObjDisabled, - equationProps: {type: type, callback: 'put_HideLower', value: !value.get_HideLower()} - }); - arr.push(mnu); - } - break; - case Asc.c_oAscMathInterfaceType.Delimiter: - mnu = new Common.UI.MenuItem({ - caption : me.txtInsertArgBefore, - equation : true, - disabled : me._currentParaObjDisabled, - equationProps: {type: type, callback: 'insert_DelimiterArgument', value: true} - }); - arr.push(mnu); - mnu = new Common.UI.MenuItem({ - caption : me.txtInsertArgAfter, - equation : true, - disabled : me._currentParaObjDisabled, - equationProps: {type: type, callback: 'insert_DelimiterArgument', value: false} - }); - arr.push(mnu); - if (value.can_DeleteArgument()) { - mnu = new Common.UI.MenuItem({ - caption : me.txtDeleteArg, - equation : true, - disabled : me._currentParaObjDisabled, - equationProps: {type: type, callback: 'delete_DelimiterArgument'} - }); - arr.push(mnu); - } - mnu = new Common.UI.MenuItem({ - caption : value.has_Separators() ? me.txtDeleteCharsAndSeparators : me.txtDeleteChars, - equation : true, - disabled : me._currentParaObjDisabled, - equationProps: {type: type, callback: 'remove_DelimiterCharacters'} - }); - arr.push(mnu); - mnu = new Common.UI.MenuItem({ - caption : value.get_HideOpeningBracket() ? me.txtShowOpenBracket : me.txtHideOpenBracket, - equation : true, - disabled : me._currentParaObjDisabled, - equationProps: {type: type, callback: 'put_HideOpeningBracket', value: !value.get_HideOpeningBracket()} - }); - arr.push(mnu); - mnu = new Common.UI.MenuItem({ - caption : value.get_HideClosingBracket() ? me.txtShowCloseBracket : me.txtHideCloseBracket, - equation : true, - disabled : me._currentParaObjDisabled, - equationProps: {type: type, callback: 'put_HideClosingBracket', value: !value.get_HideClosingBracket()} - }); - arr.push(mnu); - mnu = new Common.UI.MenuItem({ - caption : me.txtStretchBrackets, - equation : true, - disabled : me._currentParaObjDisabled, - checkable : true, - checked : value.get_StretchBrackets(), - equationProps: {type: type, callback: 'put_StretchBrackets', value: !value.get_StretchBrackets()} - }); - arr.push(mnu); - mnu = new Common.UI.MenuItem({ - caption : me.txtMatchBrackets, - equation : true, - disabled : (!value.get_StretchBrackets() || me._currentParaObjDisabled), - checkable : true, - checked : value.get_StretchBrackets() && value.get_MatchBrackets(), - equationProps: {type: type, callback: 'put_MatchBrackets', value: !value.get_MatchBrackets()} - }); - arr.push(mnu); - break; - case Asc.c_oAscMathInterfaceType.GroupChar: - if (value.can_ChangePos()) { - mnu = new Common.UI.MenuItem({ - caption : (value.get_Pos()==Asc.c_oAscMathInterfaceGroupCharPos.Top) ? me.txtGroupCharUnder : me.txtGroupCharOver, - equation : true, - disabled : me._currentParaObjDisabled, - equationProps: {type: type, callback: 'put_Pos', value: (value.get_Pos()==Asc.c_oAscMathInterfaceGroupCharPos.Top) ? Asc.c_oAscMathInterfaceGroupCharPos.Bottom : Asc.c_oAscMathInterfaceGroupCharPos.Top} - }); - arr.push(mnu); - mnu = new Common.UI.MenuItem({ - caption : me.txtDeleteGroupChar, - equation : true, - disabled : me._currentParaObjDisabled, - equationProps: {type: type, callback: 'put_Pos', value: Asc.c_oAscMathInterfaceGroupCharPos.None} - }); - arr.push(mnu); - } - break; - case Asc.c_oAscMathInterfaceType.Radical: - if (value.get_HideDegree() !== undefined) { - mnu = new Common.UI.MenuItem({ - caption : value.get_HideDegree() ? me.txtShowDegree : me.txtHideDegree, - equation : true, - disabled : me._currentParaObjDisabled, - equationProps: {type: type, callback: 'put_HideDegree', value: !value.get_HideDegree()} - }); - arr.push(mnu); - } - mnu = new Common.UI.MenuItem({ - caption : me.txtDeleteRadical, - equation : true, - disabled : me._currentParaObjDisabled, - equationProps: {type: type, callback: 'remove_Radical'} - }); - arr.push(mnu); - break; - } - if (value.can_IncreaseArgumentSize()) { - mnu = new Common.UI.MenuItem({ - caption : me.txtIncreaseArg, - equation : true, - disabled : me._currentParaObjDisabled, - equationProps: {type: type, callback: 'increase_ArgumentSize'} - }); - arr.push(mnu); - } - if (value.can_DecreaseArgumentSize()) { - mnu = new Common.UI.MenuItem({ - caption : me.txtDecreaseArg, - equation : true, - disabled : me._currentParaObjDisabled, - equationProps: {type: type, callback: 'decrease_ArgumentSize'} - }); - arr.push(mnu); - } - if (value.can_InsertManualBreak()) { - mnu = new Common.UI.MenuItem({ - caption : me.txtInsertBreak, - equation : true, - disabled : me._currentParaObjDisabled, - equationProps: {type: type, callback: 'insert_ManualBreak'} - }); - arr.push(mnu); - } - if (value.can_DeleteManualBreak()) { - mnu = new Common.UI.MenuItem({ - caption : me.txtDeleteBreak, - equation : true, - disabled : me._currentParaObjDisabled, - equationProps: {type: type, callback: 'delete_ManualBreak'} - }); - arr.push(mnu); - } - if (value.can_AlignToCharacter()) { - mnu = new Common.UI.MenuItem({ - caption : me.txtAlignToChar, - equation : true, - disabled : me._currentParaObjDisabled, - equationProps: {type: type, callback: 'align_ToCharacter'} - }); - arr.push(mnu); - } - return arr; - }; - - this.addEquationMenu = function(isParagraph, insertIdx) { - if (_.isUndefined(isParagraph)) { - isParagraph = me.textMenu.isVisible(); - } - - me.clearEquationMenu(isParagraph, insertIdx); - - var equationMenu = (isParagraph) ? me.textMenu : me.tableMenu, - menuItems = me.initEquationMenu(); - - if (menuItems.length > 0) { - _.each(menuItems, function(menuItem, index) { - if (menuItem.menu) { - _.each(menuItem.menu.items, function(item) { - item.on('click', _.bind(me.equationCallback, me, item.options.equationProps)); - }); - } else - menuItem.on('click', _.bind(me.equationCallback, me, menuItem.options.equationProps)); - equationMenu.insertItem(insertIdx, menuItem); - insertIdx++; - }); - } - return menuItems.length; - }; - - this.clearEquationMenu = function(isParagraph, insertIdx) { - var equationMenu = (isParagraph) ? me.textMenu : me.tableMenu; - for (var i = insertIdx; i < equationMenu.items.length; i++) { - if (equationMenu.items[i].options.equation) { - if (equationMenu.items[i].menu) { - _.each(equationMenu.items[i].menu.items, function(item) { - item.off('click'); - }); - } else - equationMenu.items[i].off('click'); - equationMenu.removeItem(equationMenu.items[i]); - i--; - } else - break; - } - }; - - this.equationCallback = function(eqProps) { - if (eqProps) { - var eqObj; - switch (eqProps.type) { - case Asc.c_oAscMathInterfaceType.Accent: - eqObj = new CMathMenuAccent(); - break; - case Asc.c_oAscMathInterfaceType.BorderBox: - eqObj = new CMathMenuBorderBox(); - break; - case Asc.c_oAscMathInterfaceType.Box: - eqObj = new CMathMenuBox(); - break; - case Asc.c_oAscMathInterfaceType.Bar: - eqObj = new CMathMenuBar(); - break; - case Asc.c_oAscMathInterfaceType.Script: - eqObj = new CMathMenuScript(); - break; - case Asc.c_oAscMathInterfaceType.Fraction: - eqObj = new CMathMenuFraction(); - break; - case Asc.c_oAscMathInterfaceType.Limit: - eqObj = new CMathMenuLimit(); - break; - case Asc.c_oAscMathInterfaceType.Matrix: - eqObj = new CMathMenuMatrix(); - break; - case Asc.c_oAscMathInterfaceType.EqArray: - eqObj = new CMathMenuEqArray(); - break; - case Asc.c_oAscMathInterfaceType.LargeOperator: - eqObj = new CMathMenuNary(); - break; - case Asc.c_oAscMathInterfaceType.Delimiter: - eqObj = new CMathMenuDelimiter(); - break; - case Asc.c_oAscMathInterfaceType.GroupChar: - eqObj = new CMathMenuGroupCharacter(); - break; - case Asc.c_oAscMathInterfaceType.Radical: - eqObj = new CMathMenuRadical(); - break; - case Asc.c_oAscMathInterfaceType.Common: - eqObj = new CMathMenuBase(); - break; - } - if (eqObj) { - eqObj[eqProps.callback](eqProps.value); - me.api.asc_SetMathProps(eqObj); - } - } - me.fireEvent('editcomplete', me); - }; - - this.changePosition = function() { - me._XY = [ - me.cmpEl.offset().left - $(window).scrollLeft(), - me.cmpEl.offset().top - $(window).scrollTop() - ]; - onMouseMoveStart(); - }; - - this.hideTips = function() { - /** coauthoring begin **/ - if (typeof userTooltip == 'object') { - userTooltip.hide(); - userTooltip = true; - } - _.each(me.usertips, function(item) { - item.remove(); - }); - me.usertips = []; - me.usertipcount = 0; - /** coauthoring end **/ - }; - - /** coauthoring begin **/ - // Hotkeys - // --------------------- - var keymap = {}; - var hkComments = 'alt+h'; - keymap[hkComments] = function() { - if (me.api.can_AddQuotedComment()!==false && me.slidesCount>0) { - me.addComment(); - } - }; - - var hkPreview = 'command+f5,ctrl+f5'; - keymap[hkPreview] = function(e) { - var isResized = false; - e.preventDefault(); - e.stopPropagation(); - if (me.slidesCount>0) { - Common.NotificationCenter.trigger('preview:start', 0); - } - }; - Common.util.Shortcuts.delegateShortcuts({shortcuts:keymap}); - - var onApiStartDemonstration = function() { - if (me.slidesCount>0) { - Common.NotificationCenter.trigger('preview:start', 0, null, true); - } - }; - - /** coauthoring end **/ - - var onApiCountPages = function(count) { - me.slidesCount = count; - }; - - var onApiCurrentPages = function(number) { - if (me.currentMenu && me.currentMenu.isVisible() && me._isFromSlideMenu !== true && me._isFromSlideMenu !== number) - setTimeout(function() { - me.currentMenu && me.currentMenu.hide(); - }, 1); - - me._isFromSlideMenu = number; - }; - - var onApiUpdateThemeIndex = function(v) { - me._state.themeId = v; - }; - - var onApiLockDocumentTheme = function() { - me._state.themeLock = true; - }; - - var onApiUnLockDocumentTheme = function() { - me._state.themeLock = false; - }; - - var onShowSpecialPasteOptions = function(specialPasteShowOptions) { - var coord = specialPasteShowOptions.asc_getCellCoord(), - pasteContainer = me.cmpEl.find('#special-paste-container'), - pasteItems = specialPasteShowOptions.asc_getOptions(); - if (!pasteItems) return; - - // Prepare menu container - if (pasteContainer.length < 1) { - me._arrSpecialPaste = []; - me._arrSpecialPaste[Asc.c_oSpecialPasteProps.paste] = me.textPaste; - me._arrSpecialPaste[Asc.c_oSpecialPasteProps.keepTextOnly] = me.txtKeepTextOnly; - me._arrSpecialPaste[Asc.c_oSpecialPasteProps.picture] = me.txtPastePicture; - me._arrSpecialPaste[Asc.c_oSpecialPasteProps.sourceformatting] = me.txtPasteSourceFormat; - me._arrSpecialPaste[Asc.c_oSpecialPasteProps.destinationFormatting] = me.txtPasteDestFormat; - - - pasteContainer = $('
    '); - me.cmpEl.append(pasteContainer); - - me.btnSpecialPaste = new Common.UI.Button({ - parentEl: $('#id-document-holder-btn-special-paste'), - cls : 'btn-toolbar', - iconCls : 'toolbar__icon btn-paste', - menu : new Common.UI.Menu({items: []}) - }); - } - - if (pasteItems.length>0) { - var menu = me.btnSpecialPaste.menu; - for (var i = 0; i < menu.items.length; i++) { - menu.removeItem(menu.items[i]); - i--; - } - - var group_prev = -1; - _.each(pasteItems, function(menuItem, index) { - var mnu = new Common.UI.MenuItem({ - caption: me._arrSpecialPaste[menuItem], - value: menuItem, - checkable: true, - toggleGroup : 'specialPasteGroup' - }).on('click', function(item, e) { - me.api.asc_SpecialPaste(item.value); - setTimeout(function(){menu.hide();}, 100); - }); - menu.addItem(mnu); - }); - (menu.items.length>0) && menu.items[0].setChecked(true, true); - } - if (coord.asc_getX()<0 || coord.asc_getY()<0) { - if (pasteContainer.is(':visible')) pasteContainer.hide(); - } else { - var showPoint = [coord.asc_getX() + coord.asc_getWidth() + 3, coord.asc_getY() + coord.asc_getHeight() + 3]; - pasteContainer.css({left: showPoint[0], top : showPoint[1]}); - pasteContainer.show(); - } - }; - - var onHideSpecialPasteOptions = function() { - var pasteContainer = me.cmpEl.find('#special-paste-container'); - if (pasteContainer.is(':visible')) - pasteContainer.hide(); - }; - - var onChangeCropState = function(state) { - this.menuImgCrop.menu.items[0].setChecked(state, true); - }; - - this.setApi = function(o) { - me.api = o; - - if (me.api) { - me.api.asc_registerCallback('asc_onContextMenu', _.bind(onContextMenu, me)); - me.api.asc_registerCallback('asc_onMouseMoveStart', _.bind(onMouseMoveStart, me)); - me.api.asc_registerCallback('asc_onMouseMoveEnd', _.bind(onMouseMoveEnd, me)); - me.api.asc_registerCallback('asc_onPaintSlideNum', _.bind(onPaintSlideNum, me)); - me.api.asc_registerCallback('asc_onEndPaintSlideNum', _.bind(onEndPaintSlideNum, me)); - me.api.asc_registerCallback('asc_onCountPages', _.bind(onApiCountPages, me)); - me.api.asc_registerCallback('asc_onCurrentPage', _.bind(onApiCurrentPages, me)); - me.slidesCount = me.api.getCountPages(); - - //hyperlink - me.api.asc_registerCallback('asc_onHyperlinkClick', _.bind(onHyperlinkClick, me)); - me.api.asc_registerCallback('asc_onMouseMove', _.bind(onMouseMove, me)); - - if (me.mode.isEdit===true) { - me.api.asc_registerCallback('asc_onDialogAddHyperlink', _.bind(onDialogAddHyperlink, me)); - me.api.asc_registerCallback('asc_doubleClickOnChart', _.bind(me.editChartClick, me)); - me.api.asc_registerCallback('asc_doubleClickOnTableOleObject', _.bind(me.onDoubleClickOnTableOleObject, me)); - me.api.asc_registerCallback('asc_onSpellCheckVariantsFound', _.bind(onSpellCheckVariantsFound, me)); - me.api.asc_registerCallback('asc_onShowSpecialPasteOptions', _.bind(onShowSpecialPasteOptions, me)); - me.api.asc_registerCallback('asc_onHideSpecialPasteOptions', _.bind(onHideSpecialPasteOptions, me)); - me.api.asc_registerCallback('asc_ChangeCropState', _.bind(onChangeCropState, me)); - me.api.asc_registerCallback('asc_onHidePlaceholderActions', _.bind(me.onHidePlaceholderActions, me)); - me.api.asc_registerPlaceholderCallback(AscCommon.PlaceholderButtonType.Image, _.bind(me.onInsertImage, me, true)); - me.api.asc_registerPlaceholderCallback(AscCommon.PlaceholderButtonType.ImageUrl, _.bind(me.onInsertImageUrl, me, true)); - me.api.asc_registerPlaceholderCallback(AscCommon.PlaceholderButtonType.Chart, _.bind(me.onClickPlaceholderChart, me)); - me.api.asc_registerPlaceholderCallback(AscCommon.PlaceholderButtonType.Table, _.bind(me.onClickPlaceholderTable, me)); - me.api.asc_registerPlaceholderCallback(AscCommon.PlaceholderButtonType.Video, _.bind(me.onClickPlaceholder, me, AscCommon.PlaceholderButtonType.Video)); - me.api.asc_registerPlaceholderCallback(AscCommon.PlaceholderButtonType.Audio, _.bind(me.onClickPlaceholder, me, AscCommon.PlaceholderButtonType.Audio)); - } - me.api.asc_registerCallback('asc_onCoAuthoringDisconnect', _.bind(onCoAuthoringDisconnect, me)); - Common.NotificationCenter.on('api:disconnect', _.bind(onCoAuthoringDisconnect, me)); - me.api.asc_registerCallback('asc_onTextLanguage', _.bind(onTextLanguage, me)); - - me.api.asc_registerCallback('asc_onShowForeignCursorLabel', _.bind(onShowForeignCursorLabel, me)); - me.api.asc_registerCallback('asc_onHideForeignCursorLabel', _.bind(onHideForeignCursorLabel, me)); - me.api.asc_registerCallback('asc_onFocusObject', _.bind(onFocusObject, me)); - me.api.asc_registerCallback('asc_onUpdateThemeIndex', _.bind(onApiUpdateThemeIndex, me)); - me.api.asc_registerCallback('asc_onLockDocumentTheme', _.bind(onApiLockDocumentTheme, me)); - me.api.asc_registerCallback('asc_onUnLockDocumentTheme', _.bind(onApiUnLockDocumentTheme, me)); - me.api.asc_registerCallback('asc_onStartDemonstration', _.bind(onApiStartDemonstration)); - } - - return me; - }; - - this.mode = {}; - - this.setMode = function(mode) { - me.mode = mode; - /** coauthoring begin **/ - !(me.mode.canCoAuthoring && me.mode.canComments) - ? Common.util.Shortcuts.suspendEvents(hkComments) - : Common.util.Shortcuts.resumeEvents(hkComments); - /** coauthoring end **/ - - me.editorConfig = {user: mode.user}; - }; - - me.on('render:after', onAfterRender, me); }, render: function () { @@ -1677,125 +76,693 @@ define([ return this; }, + setApi: function(o) { + this.api = o; + return this; + }, + + setMode: function(m) { + this.mode = m; + return this; + }, + focus: function() { var me = this; _.defer(function(){ me.cmpEl.focus(); }, 50); }, - addHyperlink: function(item){ - var win, me = this; - if (me.api) { - var _arr = []; - for (var i=0; i-1) && !menu.items[index].checked && menu.setChecked(index, true); + } + }, + + addWordVariants: function(isParagraph) { + var me = this; + if (!me.textMenu || !me.textMenu.isVisible() && !me.tableMenu.isVisible()) return; + + if (_.isUndefined(isParagraph)) { + isParagraph = me.textMenu.isVisible(); + } + + me.clearWordVariants(isParagraph); + + var moreMenu = (isParagraph) ? me.menuSpellMorePara : me.menuSpellMoreTable; + var spellMenu = (isParagraph) ? me.menuSpellPara : me.menuSpellTable; + var arr = [], + arrMore = []; + var variants = me._currentSpellObj.get_Variants(); + + if (variants.length > 0) { + moreMenu.setVisible(variants.length > 3); + moreMenu.setDisabled(me._currentParaObjDisabled); + + _.each(variants, function(variant, index) { + var mnu = new Common.UI.MenuItem({ + caption : variant, + spellword : true, + disabled : me._currentParaObjDisabled + }).on('click', function(item, e) { + if (me.api) { + me.api.asc_replaceMisspelledWord(item.caption, me._currentSpellObj); + me.fireEvent('editcomplete', me); + } + }); + + (index < 3) ? arr.push(mnu) : arrMore.push(mnu); + }); + + if (arr.length > 0) { + if (isParagraph) { + _.each(arr, function(variant, index){ + me.textMenu.insertItem(index, variant); + }) + } else { + _.each(arr, function(variant, index){ + me.menuSpellCheckTable.menu.insertItem(index, variant); + }) } } + + if (arrMore.length > 0) { + _.each(arrMore, function(variant, index){ + moreMenu.menu.addItem(variant); + }); + } + + spellMenu.setVisible(false); + } else { + moreMenu.setVisible(false); + spellMenu.setVisible(true); + spellMenu.setCaption(me.noSpellVariantsText, true); + } + }, + + clearWordVariants: function(isParagraph) { + var me = this; + var spellMenu = (isParagraph) ? me.textMenu : me.menuSpellCheckTable.menu; + + for (var i = 0; i < spellMenu.items.length; i++) { + if (spellMenu.items[i].options.spellword) { + if (spellMenu.checkeditem == spellMenu.items[i]) { + spellMenu.checkeditem = undefined; + spellMenu.activeItem = undefined; + } + + spellMenu.removeItem(spellMenu.items[i]); + i--; + } + } + (isParagraph) ? me.menuSpellMorePara.menu.removeAll() : me.menuSpellMoreTable.menu.removeAll(); + + me.menuSpellMorePara.menu.checkeditem = undefined; + me.menuSpellMorePara.menu.activeItem = undefined; + me.menuSpellMoreTable.menu.checkeditem = undefined; + me.menuSpellMoreTable.menu.activeItem = undefined; + }, + + initEquationMenu: function() { + var me = this; + if (!me._currentMathObj) return; + var type = me._currentMathObj.get_Type(), + value = me._currentMathObj, + mnu, arr = []; + + switch (type) { + case Asc.c_oAscMathInterfaceType.Accent: + mnu = new Common.UI.MenuItem({ + caption : me.txtRemoveAccentChar, + equation : true, + disabled : me._currentParaObjDisabled, + equationProps: {type: type, callback: 'remove_AccentCharacter'} + }); + arr.push(mnu); + break; + case Asc.c_oAscMathInterfaceType.BorderBox: + mnu = new Common.UI.MenuItem({ + caption : me.txtBorderProps, + equation : true, + disabled : me._currentParaObjDisabled, + menu : new Common.UI.Menu({ + cls: 'shifted-right', + menuAlign: 'tl-tr', + items : [ + { + caption: value.get_HideTop() ? me.txtAddTop : me.txtHideTop, + equationProps: {type: type, callback: 'put_HideTop', value: !value.get_HideTop()} + }, + { + caption: value.get_HideBottom() ? me.txtAddBottom : me.txtHideBottom, + equationProps: {type: type, callback: 'put_HideBottom', value: !value.get_HideBottom()} + }, + { + caption: value.get_HideLeft() ? me.txtAddLeft : me.txtHideLeft, + equationProps: {type: type, callback: 'put_HideLeft', value: !value.get_HideLeft()} + }, + { + caption: value.get_HideRight() ? me.txtAddRight : me.txtHideRight, + equationProps: {type: type, callback: 'put_HideRight', value: !value.get_HideRight()} + }, + { + caption: value.get_HideHor() ? me.txtAddHor : me.txtHideHor, + equationProps: {type: type, callback: 'put_HideHor', value: !value.get_HideHor()} + }, + { + caption: value.get_HideVer() ? me.txtAddVer : me.txtHideVer, + equationProps: {type: type, callback: 'put_HideVer', value: !value.get_HideVer()} + }, + { + caption: value.get_HideTopLTR() ? me.txtAddLT : me.txtHideLT, + equationProps: {type: type, callback: 'put_HideTopLTR', value: !value.get_HideTopLTR()} + }, + { + caption: value.get_HideTopRTL() ? me.txtAddLB : me.txtHideLB, + equationProps: {type: type, callback: 'put_HideTopRTL', value: !value.get_HideTopRTL()} + } + ] + }) + }); + arr.push(mnu); + break; + case Asc.c_oAscMathInterfaceType.Bar: + mnu = new Common.UI.MenuItem({ + caption : me.txtRemoveBar, + equation : true, + disabled : me._currentParaObjDisabled, + equationProps: {type: type, callback: 'remove_Bar'} + }); + arr.push(mnu); + mnu = new Common.UI.MenuItem({ + caption : (value.get_Pos()==Asc.c_oAscMathInterfaceBarPos.Top) ? me.txtUnderbar : me.txtOverbar, + equation : true, + disabled : me._currentParaObjDisabled, + equationProps: {type: type, callback: 'put_Pos', value: (value.get_Pos()==Asc.c_oAscMathInterfaceBarPos.Top) ? Asc.c_oAscMathInterfaceBarPos.Bottom : Asc.c_oAscMathInterfaceBarPos.Top} + }); + arr.push(mnu); + break; + case Asc.c_oAscMathInterfaceType.Script: + var scripttype = value.get_ScriptType(); + if (scripttype == Asc.c_oAscMathInterfaceScript.PreSubSup) { + mnu = new Common.UI.MenuItem({ + caption : me.txtScriptsAfter, + equation : true, + disabled : me._currentParaObjDisabled, + equationProps: {type: type, callback: 'put_ScriptType', value: Asc.c_oAscMathInterfaceScript.SubSup} + }); + arr.push(mnu); + mnu = new Common.UI.MenuItem({ + caption : me.txtRemScripts, + equation : true, + disabled : me._currentParaObjDisabled, + equationProps: {type: type, callback: 'put_ScriptType', value: Asc.c_oAscMathInterfaceScript.None} + }); + arr.push(mnu); + } else { + if (scripttype == Asc.c_oAscMathInterfaceScript.SubSup) { + mnu = new Common.UI.MenuItem({ + caption : me.txtScriptsBefore, + equation : true, + disabled : me._currentParaObjDisabled, + equationProps: {type: type, callback: 'put_ScriptType', value: Asc.c_oAscMathInterfaceScript.PreSubSup} + }); + arr.push(mnu); + } + if (scripttype == Asc.c_oAscMathInterfaceScript.SubSup || scripttype == Asc.c_oAscMathInterfaceScript.Sub ) { + mnu = new Common.UI.MenuItem({ + caption : me.txtRemSubscript, + equation : true, + disabled : me._currentParaObjDisabled, + equationProps: {type: type, callback: 'put_ScriptType', value: (scripttype == Asc.c_oAscMathInterfaceScript.SubSup) ? Asc.c_oAscMathInterfaceScript.Sup : Asc.c_oAscMathInterfaceScript.None } + }); + arr.push(mnu); + } + if (scripttype == Asc.c_oAscMathInterfaceScript.SubSup || scripttype == Asc.c_oAscMathInterfaceScript.Sup ) { + mnu = new Common.UI.MenuItem({ + caption : me.txtRemSuperscript, + equation : true, + disabled : me._currentParaObjDisabled, + equationProps: {type: type, callback: 'put_ScriptType', value: (scripttype == Asc.c_oAscMathInterfaceScript.SubSup) ? Asc.c_oAscMathInterfaceScript.Sub : Asc.c_oAscMathInterfaceScript.None } + }); + arr.push(mnu); + } + } + break; + case Asc.c_oAscMathInterfaceType.Fraction: + var fraction = value.get_FractionType(); + if (fraction==Asc.c_oAscMathInterfaceFraction.Skewed || fraction==Asc.c_oAscMathInterfaceFraction.Linear) { + mnu = new Common.UI.MenuItem({ + caption : me.txtFractionStacked, + equation : true, + disabled : me._currentParaObjDisabled, + equationProps: {type: type, callback: 'put_FractionType', value: Asc.c_oAscMathInterfaceFraction.Bar} + }); + arr.push(mnu); + } + if (fraction==Asc.c_oAscMathInterfaceFraction.Bar || fraction==Asc.c_oAscMathInterfaceFraction.Linear) { + mnu = new Common.UI.MenuItem({ + caption : me.txtFractionSkewed, + equation : true, + disabled : me._currentParaObjDisabled, + equationProps: {type: type, callback: 'put_FractionType', value: Asc.c_oAscMathInterfaceFraction.Skewed} + }); + arr.push(mnu); + } + if (fraction==Asc.c_oAscMathInterfaceFraction.Bar || fraction==Asc.c_oAscMathInterfaceFraction.Skewed) { + mnu = new Common.UI.MenuItem({ + caption : me.txtFractionLinear, + equation : true, + disabled : me._currentParaObjDisabled, + equationProps: {type: type, callback: 'put_FractionType', value: Asc.c_oAscMathInterfaceFraction.Linear} + }); + arr.push(mnu); + } + if (fraction==Asc.c_oAscMathInterfaceFraction.Bar || fraction==Asc.c_oAscMathInterfaceFraction.NoBar) { + mnu = new Common.UI.MenuItem({ + caption : (fraction==Asc.c_oAscMathInterfaceFraction.Bar) ? me.txtRemFractionBar : me.txtAddFractionBar, + equation : true, + disabled : me._currentParaObjDisabled, + equationProps: {type: type, callback: 'put_FractionType', value: (fraction==Asc.c_oAscMathInterfaceFraction.Bar) ? Asc.c_oAscMathInterfaceFraction.NoBar : Asc.c_oAscMathInterfaceFraction.Bar} + }); + arr.push(mnu); + } + break; + case Asc.c_oAscMathInterfaceType.Limit: + mnu = new Common.UI.MenuItem({ + caption : (value.get_Pos()==Asc.c_oAscMathInterfaceLimitPos.Top) ? me.txtLimitUnder : me.txtLimitOver, + equation : true, + disabled : me._currentParaObjDisabled, + equationProps: {type: type, callback: 'put_Pos', value: (value.get_Pos()==Asc.c_oAscMathInterfaceLimitPos.Top) ? Asc.c_oAscMathInterfaceLimitPos.Bottom : Asc.c_oAscMathInterfaceLimitPos.Top} + }); + arr.push(mnu); + mnu = new Common.UI.MenuItem({ + caption : me.txtRemLimit, + equation : true, + disabled : me._currentParaObjDisabled, + equationProps: {type: type, callback: 'put_Pos', value: Asc.c_oAscMathInterfaceLimitPos.None} + }); + arr.push(mnu); + break; + case Asc.c_oAscMathInterfaceType.Matrix: + mnu = new Common.UI.MenuItem({ + caption : value.get_HidePlaceholder() ? me.txtShowPlaceholder : me.txtHidePlaceholder, + equation : true, + disabled : me._currentParaObjDisabled, + equationProps: {type: type, callback: 'put_HidePlaceholder', value: !value.get_HidePlaceholder()} + }); + arr.push(mnu); + mnu = new Common.UI.MenuItem({ + caption : me.insertText, + equation : true, + disabled : me._currentParaObjDisabled, + menu : new Common.UI.Menu({ + cls: 'shifted-right', + menuAlign: 'tl-tr', + items : [ + { + caption: me.insertRowAboveText, + equationProps: {type: type, callback: 'insert_MatrixRow', value: true} + }, + { + caption: me.insertRowBelowText, + equationProps: {type: type, callback: 'insert_MatrixRow', value: false} + }, + { + caption: me.insertColumnLeftText, + equationProps: {type: type, callback: 'insert_MatrixColumn', value: true} + }, + { + caption: me.insertColumnRightText, + equationProps: {type: type, callback: 'insert_MatrixColumn', value: false} + } + ] + }) + }); + arr.push(mnu); + mnu = new Common.UI.MenuItem({ + caption : me.deleteText, + equation : true, + disabled : me._currentParaObjDisabled, + menu : new Common.UI.Menu({ + cls: 'shifted-right', + menuAlign: 'tl-tr', + items : [ + { + caption: me.deleteRowText, + equationProps: {type: type, callback: 'delete_MatrixRow'} + }, + { + caption: me.deleteColumnText, + equationProps: {type: type, callback: 'delete_MatrixColumn'} + } + ] + }) + }); + arr.push(mnu); + mnu = new Common.UI.MenuItem({ + caption : me.txtMatrixAlign, + equation : true, + disabled : me._currentParaObjDisabled, + menu : new Common.UI.Menu({ + cls: 'shifted-right', + menuAlign: 'tl-tr', + items : [ + { + caption: me.txtTop, + checkable : true, + checked : (value.get_MatrixAlign()==Asc.c_oAscMathInterfaceMatrixMatrixAlign.Top), + equationProps: {type: type, callback: 'put_MatrixAlign', value: Asc.c_oAscMathInterfaceMatrixMatrixAlign.Top} + }, + { + caption: me.centerText, + checkable : true, + checked : (value.get_MatrixAlign()==Asc.c_oAscMathInterfaceMatrixMatrixAlign.Center), + equationProps: {type: type, callback: 'put_MatrixAlign', value: Asc.c_oAscMathInterfaceMatrixMatrixAlign.Center} + }, + { + caption: me.txtBottom, + checkable : true, + checked : (value.get_MatrixAlign()==Asc.c_oAscMathInterfaceMatrixMatrixAlign.Bottom), + equationProps: {type: type, callback: 'put_MatrixAlign', value: Asc.c_oAscMathInterfaceMatrixMatrixAlign.Bottom} + } + ] + }) + }); + arr.push(mnu); + mnu = new Common.UI.MenuItem({ + caption : me.txtColumnAlign, + equation : true, + disabled : me._currentParaObjDisabled, + menu : new Common.UI.Menu({ + cls: 'shifted-right', + menuAlign: 'tl-tr', + items : [ + { + caption: me.leftText, + checkable : true, + checked : (value.get_ColumnAlign()==Asc.c_oAscMathInterfaceMatrixColumnAlign.Left), + equationProps: {type: type, callback: 'put_ColumnAlign', value: Asc.c_oAscMathInterfaceMatrixColumnAlign.Left} + }, + { + caption: me.centerText, + checkable : true, + checked : (value.get_ColumnAlign()==Asc.c_oAscMathInterfaceMatrixColumnAlign.Center), + equationProps: {type: type, callback: 'put_ColumnAlign', value: Asc.c_oAscMathInterfaceMatrixColumnAlign.Center} + }, + { + caption: me.rightText, + checkable : true, + checked : (value.get_ColumnAlign()==Asc.c_oAscMathInterfaceMatrixColumnAlign.Right), + equationProps: {type: type, callback: 'put_ColumnAlign', value: Asc.c_oAscMathInterfaceMatrixColumnAlign.Right} + } + ] + }) + }); + arr.push(mnu); + break; + case Asc.c_oAscMathInterfaceType.EqArray: + mnu = new Common.UI.MenuItem({ + caption : me.txtInsertEqBefore, + equation : true, + disabled : me._currentParaObjDisabled, + equationProps: {type: type, callback: 'insert_Equation', value: true} + }); + arr.push(mnu); + mnu = new Common.UI.MenuItem({ + caption : me.txtInsertEqAfter, + equation : true, + disabled : me._currentParaObjDisabled, + equationProps: {type: type, callback: 'insert_Equation', value: false} + }); + arr.push(mnu); + mnu = new Common.UI.MenuItem({ + caption : me.txtDeleteEq, + equation : true, + disabled : me._currentParaObjDisabled, + equationProps: {type: type, callback: 'delete_Equation'} + }); + arr.push(mnu); + mnu = new Common.UI.MenuItem({ + caption : me.alignmentText, + equation : true, + disabled : me._currentParaObjDisabled, + menu : new Common.UI.Menu({ + cls: 'shifted-right', + menuAlign: 'tl-tr', + items : [ + { + caption: me.txtTop, + checkable : true, + checked : (value.get_Align()==Asc.c_oAscMathInterfaceEqArrayAlign.Top), + equationProps: {type: type, callback: 'put_Align', value: Asc.c_oAscMathInterfaceEqArrayAlign.Top} + }, + { + caption: me.centerText, + checkable : true, + checked : (value.get_Align()==Asc.c_oAscMathInterfaceEqArrayAlign.Center), + equationProps: {type: type, callback: 'put_Align', value: Asc.c_oAscMathInterfaceEqArrayAlign.Center} + }, + { + caption: me.txtBottom, + checkable : true, + checked : (value.get_Align()==Asc.c_oAscMathInterfaceEqArrayAlign.Bottom), + equationProps: {type: type, callback: 'put_Align', value: Asc.c_oAscMathInterfaceEqArrayAlign.Bottom} + } + ] + }) + }); + arr.push(mnu); + break; + case Asc.c_oAscMathInterfaceType.LargeOperator: + mnu = new Common.UI.MenuItem({ + caption : me.txtLimitChange, + equation : true, + disabled : me._currentParaObjDisabled, + equationProps: {type: type, callback: 'put_LimitLocation', value: (value.get_LimitLocation() == Asc.c_oAscMathInterfaceNaryLimitLocation.UndOvr) ? Asc.c_oAscMathInterfaceNaryLimitLocation.SubSup : Asc.c_oAscMathInterfaceNaryLimitLocation.UndOvr} + }); + arr.push(mnu); + if (value.get_HideUpper() !== undefined) { + mnu = new Common.UI.MenuItem({ + caption : value.get_HideUpper() ? me.txtShowTopLimit : me.txtHideTopLimit, + equation : true, + disabled : me._currentParaObjDisabled, + equationProps: {type: type, callback: 'put_HideUpper', value: !value.get_HideUpper()} + }); + arr.push(mnu); + } + if (value.get_HideLower() !== undefined) { + mnu = new Common.UI.MenuItem({ + caption : value.get_HideLower() ? me.txtShowBottomLimit : me.txtHideBottomLimit, + equation : true, + disabled : me._currentParaObjDisabled, + equationProps: {type: type, callback: 'put_HideLower', value: !value.get_HideLower()} + }); + arr.push(mnu); + } + break; + case Asc.c_oAscMathInterfaceType.Delimiter: + mnu = new Common.UI.MenuItem({ + caption : me.txtInsertArgBefore, + equation : true, + disabled : me._currentParaObjDisabled, + equationProps: {type: type, callback: 'insert_DelimiterArgument', value: true} + }); + arr.push(mnu); + mnu = new Common.UI.MenuItem({ + caption : me.txtInsertArgAfter, + equation : true, + disabled : me._currentParaObjDisabled, + equationProps: {type: type, callback: 'insert_DelimiterArgument', value: false} + }); + arr.push(mnu); + if (value.can_DeleteArgument()) { + mnu = new Common.UI.MenuItem({ + caption : me.txtDeleteArg, + equation : true, + disabled : me._currentParaObjDisabled, + equationProps: {type: type, callback: 'delete_DelimiterArgument'} + }); + arr.push(mnu); + } + mnu = new Common.UI.MenuItem({ + caption : value.has_Separators() ? me.txtDeleteCharsAndSeparators : me.txtDeleteChars, + equation : true, + disabled : me._currentParaObjDisabled, + equationProps: {type: type, callback: 'remove_DelimiterCharacters'} + }); + arr.push(mnu); + mnu = new Common.UI.MenuItem({ + caption : value.get_HideOpeningBracket() ? me.txtShowOpenBracket : me.txtHideOpenBracket, + equation : true, + disabled : me._currentParaObjDisabled, + equationProps: {type: type, callback: 'put_HideOpeningBracket', value: !value.get_HideOpeningBracket()} + }); + arr.push(mnu); + mnu = new Common.UI.MenuItem({ + caption : value.get_HideClosingBracket() ? me.txtShowCloseBracket : me.txtHideCloseBracket, + equation : true, + disabled : me._currentParaObjDisabled, + equationProps: {type: type, callback: 'put_HideClosingBracket', value: !value.get_HideClosingBracket()} + }); + arr.push(mnu); + mnu = new Common.UI.MenuItem({ + caption : me.txtStretchBrackets, + equation : true, + disabled : me._currentParaObjDisabled, + checkable : true, + checked : value.get_StretchBrackets(), + equationProps: {type: type, callback: 'put_StretchBrackets', value: !value.get_StretchBrackets()} + }); + arr.push(mnu); + mnu = new Common.UI.MenuItem({ + caption : me.txtMatchBrackets, + equation : true, + disabled : (!value.get_StretchBrackets() || me._currentParaObjDisabled), + checkable : true, + checked : value.get_StretchBrackets() && value.get_MatchBrackets(), + equationProps: {type: type, callback: 'put_MatchBrackets', value: !value.get_MatchBrackets()} + }); + arr.push(mnu); + break; + case Asc.c_oAscMathInterfaceType.GroupChar: + if (value.can_ChangePos()) { + mnu = new Common.UI.MenuItem({ + caption : (value.get_Pos()==Asc.c_oAscMathInterfaceGroupCharPos.Top) ? me.txtGroupCharUnder : me.txtGroupCharOver, + equation : true, + disabled : me._currentParaObjDisabled, + equationProps: {type: type, callback: 'put_Pos', value: (value.get_Pos()==Asc.c_oAscMathInterfaceGroupCharPos.Top) ? Asc.c_oAscMathInterfaceGroupCharPos.Bottom : Asc.c_oAscMathInterfaceGroupCharPos.Top} + }); + arr.push(mnu); + mnu = new Common.UI.MenuItem({ + caption : me.txtDeleteGroupChar, + equation : true, + disabled : me._currentParaObjDisabled, + equationProps: {type: type, callback: 'put_Pos', value: Asc.c_oAscMathInterfaceGroupCharPos.None} + }); + arr.push(mnu); + } + break; + case Asc.c_oAscMathInterfaceType.Radical: + if (value.get_HideDegree() !== undefined) { + mnu = new Common.UI.MenuItem({ + caption : value.get_HideDegree() ? me.txtShowDegree : me.txtHideDegree, + equation : true, + disabled : me._currentParaObjDisabled, + equationProps: {type: type, callback: 'put_HideDegree', value: !value.get_HideDegree()} + }); + arr.push(mnu); + } + mnu = new Common.UI.MenuItem({ + caption : me.txtDeleteRadical, + equation : true, + disabled : me._currentParaObjDisabled, + equationProps: {type: type, callback: 'remove_Radical'} + }); + arr.push(mnu); + break; + } + if (value.can_IncreaseArgumentSize()) { + mnu = new Common.UI.MenuItem({ + caption : me.txtIncreaseArg, + equation : true, + disabled : me._currentParaObjDisabled, + equationProps: {type: type, callback: 'increase_ArgumentSize'} + }); + arr.push(mnu); + } + if (value.can_DecreaseArgumentSize()) { + mnu = new Common.UI.MenuItem({ + caption : me.txtDecreaseArg, + equation : true, + disabled : me._currentParaObjDisabled, + equationProps: {type: type, callback: 'decrease_ArgumentSize'} + }); + arr.push(mnu); + } + if (value.can_InsertManualBreak()) { + mnu = new Common.UI.MenuItem({ + caption : me.txtInsertBreak, + equation : true, + disabled : me._currentParaObjDisabled, + equationProps: {type: type, callback: 'insert_ManualBreak'} + }); + arr.push(mnu); + } + if (value.can_DeleteManualBreak()) { + mnu = new Common.UI.MenuItem({ + caption : me.txtDeleteBreak, + equation : true, + disabled : me._currentParaObjDisabled, + equationProps: {type: type, callback: 'delete_ManualBreak'} + }); + arr.push(mnu); + } + if (value.can_AlignToCharacter()) { + mnu = new Common.UI.MenuItem({ + caption : me.txtAlignToChar, + equation : true, + disabled : me._currentParaObjDisabled, + equationProps: {type: type, callback: 'align_ToCharacter'} + }); + arr.push(mnu); + } + return arr; + }, + + addEquationMenu: function(isParagraph, insertIdx) { + var me = this; + if (_.isUndefined(isParagraph)) { + isParagraph = me.textMenu.isVisible(); + } + + me.clearEquationMenu(isParagraph, insertIdx); + + var equationMenu = (isParagraph) ? me.textMenu : me.tableMenu, + menuItems = me.initEquationMenu(); + + if (menuItems.length > 0) { + _.each(menuItems, function(menuItem, index) { + if (menuItem.menu) { + _.each(menuItem.menu.items, function(item) { + item.on('click', _.bind(me.equationCallback, me, item.options.equationProps)); + }); + } else + menuItem.on('click', _.bind(me.equationCallback, me, menuItem.options.equationProps)); + equationMenu.insertItem(insertIdx, menuItem); + insertIdx++; + }); + } + return menuItems.length; + }, + + equationCallback: function(eqProps) { + this.fireEvent('equation:callback', [eqProps]); + }, + + clearEquationMenu: function(isParagraph, insertIdx) { + var me = this; + var equationMenu = (isParagraph) ? me.textMenu : me.tableMenu; + for (var i = insertIdx; i < equationMenu.items.length; i++) { + if (equationMenu.items[i].options.equation) { + if (equationMenu.items[i].menu) { + _.each(equationMenu.items[i].menu.items, function(item) { + item.off('click'); + }); + } else + equationMenu.items[i].off('click'); + equationMenu.removeItem(equationMenu.items[i]); + i--; + } else + break; } - me.fireEvent('editcomplete', me); }, onSlidePickerShowAfter: function(picker) { if (!picker._needRecalcSlideLayout) return; - + if (picker.cmpEl && picker.dataViewItems.length>0) { var dataViewItems = picker.dataViewItems, el = $(dataViewItems[0].el), @@ -1821,50 +788,43 @@ define([ } }, - addToLayout: function() { - if (this.api) - this.api.asc_AddToLayout(); - }, - createDelayedElementsViewer: function() { var me = this; - var menuViewCopy = new Common.UI.MenuItem({ + me.menuViewCopy = new Common.UI.MenuItem({ iconCls: 'menu__icon btn-copy', caption: me.textCopy, value: 'copy' - }).on('click', _.bind(me.onCutCopyPaste, me)); + }); - var menuViewUndo = new Common.UI.MenuItem({ + me.menuViewUndo = new Common.UI.MenuItem({ iconCls: 'menu__icon btn-undo', caption: me.textUndo - }).on('click', function () { - me.api.Undo(); }); var menuViewCopySeparator = new Common.UI.MenuItem({ caption: '--' }); - var menuViewAddComment = new Common.UI.MenuItem({ + me.menuViewAddComment = new Common.UI.MenuItem({ iconCls: 'menu__icon btn-menu-comments', caption: me.addCommentText - }).on('click', _.bind(me.addComment, me)); + }); this.viewModeMenu = new Common.UI.Menu({ cls: 'shifted-right', initMenu: function (value) { - menuViewUndo.setVisible(me.mode.canCoAuthoring && me.mode.canComments && !me._isDisabled); - menuViewUndo.setDisabled(!me.api.asc_getCanUndo() && !me._isDisabled); + me.menuViewUndo.setVisible(me.mode.canCoAuthoring && me.mode.canComments && !me._isDisabled); + me.menuViewUndo.setDisabled(!me.api.asc_getCanUndo()); menuViewCopySeparator.setVisible(!value.isChart && me.api.can_AddQuotedComment() !== false && me.mode.canCoAuthoring && me.mode.canComments && !me._isDisabled); - menuViewAddComment.setVisible(!value.isChart && me.api.can_AddQuotedComment() !== false && me.mode.canCoAuthoring && me.mode.canComments && !me._isDisabled); - menuViewAddComment.setDisabled(value.locked); + me.menuViewAddComment.setVisible(!value.isChart && me.api.can_AddQuotedComment() !== false && me.mode.canCoAuthoring && me.mode.canComments && !me._isDisabled); + me.menuViewAddComment.setDisabled(value.locked); }, items: [ - menuViewCopy, - menuViewUndo, + me.menuViewCopy, + me.menuViewUndo, menuViewCopySeparator, - menuViewAddComment + me.menuViewAddComment ] }).on('hide:after', function (menu, e, isFromInputControl) { if (me.suppressEditComplete) { @@ -1876,53 +836,33 @@ define([ me.currentMenu = null; }); - var mnuPreview = new Common.UI.MenuItem({ + me.mnuPreview = new Common.UI.MenuItem({ iconCls: 'menu__icon btn-preview', caption : me.txtPreview - }).on('click', function(item) { - var current = me.api.getCurrentPage(); - Common.NotificationCenter.trigger('preview:start', _.isNumber(current) ? current : 0); }); - var mnuSelectAll = new Common.UI.MenuItem({ + me.mnuSelectAll = new Common.UI.MenuItem({ caption : me.txtSelectAll - }).on('click', function(item){ - if (me.api){ - me.api.SelectAllSlides(); - - me.fireEvent('editcomplete', me); - Common.component.Analytics.trackEvent('DocumentHolder', 'Select All Slides'); - } }); - var mnuPrintSelection = new Common.UI.MenuItem({ + me.mnuPrintSelection = new Common.UI.MenuItem({ iconCls: 'menu__icon btn-print', caption : me.txtPrintSelection - }).on('click', function(item){ - if (me.api){ - var printopt = new Asc.asc_CAdjustPrint(); - printopt.asc_setPrintType(Asc.c_oAscPrintType.Selection); - var opts = new Asc.asc_CDownloadOptions(null, Common.Utils.isChrome || Common.Utils.isOpera || Common.Utils.isGecko && Common.Utils.firefoxVersion>86); // if isChrome or isOpera == true use asc_onPrintUrl event - opts.asc_setAdvancedOptions(printopt); - me.api.asc_Print(opts); - me.fireEvent('editcomplete', me); - Common.component.Analytics.trackEvent('DocumentHolder', 'Print Selection'); - } }); this.viewModeMenuSlide = new Common.UI.Menu({ cls: 'shifted-right', initMenu: function (value) { - mnuSelectAll.setDisabled(me.slidesCount<2); - mnuPrintSelection.setVisible(me.mode.canPrint && value.fromThumbs===true); - mnuPrintSelection.setDisabled(me.slidesCount<1); - mnuPreview.setDisabled(me.slidesCount<1); + me.mnuSelectAll.setDisabled(me.slidesCount<2); + me.mnuPrintSelection.setVisible(me.mode.canPrint && value.fromThumbs===true); + me.mnuPrintSelection.setDisabled(me.slidesCount<1); + me.mnuPreview.setDisabled(me.slidesCount<1); }, items: [ - mnuSelectAll, - mnuPrintSelection, + me.mnuSelectAll, + me.mnuPrintSelection, {caption: '--'}, - mnuPreview + me.mnuPreview ] }).on('hide:after', function (menu, e, isFromInputControl) { if (me.suppressEditComplete) { @@ -1933,24 +873,18 @@ define([ if (!isFromInputControl) me.fireEvent('editcomplete', me); me.currentMenu = null; }); + + this.fireEvent('createdelayedelements', [this, 'view']); }, createDelayedElements: function(){ var me = this; - var mnuDeleteSlide = new Common.UI.MenuItem({ + me.mnuDeleteSlide = new Common.UI.MenuItem({ caption : me.txtDeleteSlide - }).on('click', function(item) { - if (me.api){ - me._isFromSlideMenu = true; - me.api.DeleteSlide(); - - me.fireEvent('editcomplete', me); - Common.component.Analytics.trackEvent('DocumentHolder', 'Delete Slide'); - } }); - var mnuChangeSlide = new Common.UI.MenuItem({ + me.mnuChangeSlide = new Common.UI.MenuItem({ iconCls: 'menu__icon btn-changeslide', caption : me.txtChangeLayout, menu : new Common.UI.Menu({ @@ -1961,15 +895,16 @@ define([ }) }); - var mnuResetSlide = new Common.UI.MenuItem({ + me.mnuResetSlide = new Common.UI.MenuItem({ caption : me.txtResetLayout - }).on('click', function(item) { - if (me.api){ - me.api.ResetSlide(); + }); - me.fireEvent('editcomplete', me); - Common.component.Analytics.trackEvent('DocumentHolder', 'Reset Slide'); - } + me.mnuNewSlide = new Common.UI.MenuItem({ + caption : me.txtNewSlide + }); + + me.mnuDuplicateSlide = new Common.UI.MenuItem({ + caption : me.txtDuplicateSlide }); var mnuChangeTheme = new Common.UI.MenuItem({ @@ -1982,112 +917,67 @@ define([ }) }); - var mnuPreview = new Common.UI.MenuItem({ + me.mnuPreview = new Common.UI.MenuItem({ iconCls: 'menu__icon btn-preview', caption : me.txtPreview - }).on('click', function(item) { - var current = me.api.getCurrentPage(); - Common.NotificationCenter.trigger('preview:start', _.isNumber(current) ? current : 0); }); - var mnuSelectAll = new Common.UI.MenuItem({ + me.mnuSelectAll = new Common.UI.MenuItem({ caption : me.txtSelectAll - }).on('click', function(item){ - if (me.api){ - me.api.SelectAllSlides(); - - me.fireEvent('editcomplete', me); - Common.component.Analytics.trackEvent('DocumentHolder', 'Select All Slides'); - } }); - var mnuPrintSelection = new Common.UI.MenuItem({ + me.mnuPrintSelection = new Common.UI.MenuItem({ iconCls: 'menu__icon btn-print', caption : me.txtPrintSelection - }).on('click', function(item){ - if (me.api){ - var printopt = new Asc.asc_CAdjustPrint(); - printopt.asc_setPrintType(Asc.c_oAscPrintType.Selection); - var opts = new Asc.asc_CDownloadOptions(null, Common.Utils.isChrome || Common.Utils.isOpera || Common.Utils.isGecko && Common.Utils.firefoxVersion>86); // if isChrome or isOpera == true use asc_onPrintUrl event - opts.asc_setAdvancedOptions(printopt); - me.api.asc_Print(opts); - me.fireEvent('editcomplete', me); - Common.component.Analytics.trackEvent('DocumentHolder', 'Print Selection'); - } }); - var mnuMoveSlideToStart = new Common.UI.MenuItem({ + me.mnuMoveSlideToStart = new Common.UI.MenuItem({ caption: me.txtMoveSlidesToStart - }).on('click', function(item){ - if (me.api) { - me.api.asc_moveSelectedSlidesToStart(); - - me.fireEvent('editcomplete', me); - Common.component.Analytics.trackEvent('DocumentHolder', 'Move Slide to Start'); - } }); - var mnuMoveSlideToEnd = new Common.UI.MenuItem({ + me.mnuMoveSlideToEnd = new Common.UI.MenuItem({ caption: me.txtMoveSlidesToEnd - }).on('click', function(item){ - if (me.api) { - me.api.asc_moveSelectedSlidesToEnd(); - - me.fireEvent('editcomplete', me); - Common.component.Analytics.trackEvent('DocumentHolder', 'Move Slide to End'); - } }); - var menuSlidePaste = new Common.UI.MenuItem({ + me.menuSlidePaste = new Common.UI.MenuItem({ iconCls: 'menu__icon btn-paste', caption : me.textPaste, value : 'paste' - }).on('click', _.bind(me.onCutCopyPaste, me)); + }); - var menuSlideSettings = new Common.UI.MenuItem({ + me.menuSlideSettings = new Common.UI.MenuItem({ iconCls: 'menu__icon btn-menu-slide', caption : me.textSlideSettings, value : null - }).on('click', function(item){ - PE.getController('RightMenu').onDoubleClickOnObject(item.options.value); }); - var mnuSlideHide = new Common.UI.MenuItem({ + me.mnuSlideHide = new Common.UI.MenuItem({ caption : me.txtSlideHide, checkable: true, checked: false - }).on('click', function(item){ - if (me.api){ - me.api.asc_HideSlides(item.checked); - - me.fireEvent('editcomplete', me); - Common.component.Analytics.trackEvent('DocumentHolder', 'Hide Slides'); - } }); - - me.slideMenu = new Common.UI.Menu({ cls: 'shifted-right', restoreHeightAndTop: true, initMenu: function(value) { var selectedLast = me.api.asc_IsLastSlideSelected(), selectedFirst = me.api.asc_IsFirstSlideSelected(); - menuSlidePaste.setVisible(value.fromThumbs!==true); + me.menuSlidePaste.setVisible(value.fromThumbs!==true); me.slideMenu.items[1].setVisible(value.fromThumbs===true); // New Slide me.slideMenu.items[2].setVisible(value.isSlideSelect===true); // Duplicate Slide - mnuDeleteSlide.setVisible(value.isSlideSelect===true); - mnuSlideHide.setVisible(value.isSlideSelect===true); - mnuSlideHide.setChecked(value.isSlideHidden===true); + me.mnuDeleteSlide.setVisible(value.isSlideSelect===true); + me.mnuSlideHide.setVisible(value.isSlideSelect===true); + me.mnuSlideHide.setChecked(value.isSlideHidden===true); me.slideMenu.items[5].setVisible(value.isSlideSelect===true || value.fromThumbs!==true); - mnuChangeSlide.setVisible(value.isSlideSelect===true || value.fromThumbs!==true); - mnuResetSlide.setVisible(value.isSlideSelect===true || value.fromThumbs!==true); + me.mnuChangeSlide.setVisible(value.isSlideSelect===true || value.fromThumbs!==true); + me.mnuResetSlide.setVisible(value.isSlideSelect===true || value.fromThumbs!==true); mnuChangeTheme.setVisible(value.isSlideSelect===true || value.fromThumbs!==true); - menuSlideSettings.setVisible(value.isSlideSelect===true || value.fromThumbs!==true); - menuSlideSettings.options.value = null; + me.menuSlideSettings.setVisible(value.isSlideSelect===true || value.fromThumbs!==true); + me.menuSlideSettings.options.value = null; me.slideMenu.items[13].setVisible((!selectedLast || !selectedFirst) && value.isSlideSelect===true); - mnuMoveSlideToEnd.setVisible(!selectedLast && value.isSlideSelect===true); - mnuMoveSlideToStart.setVisible(!selectedFirst && value.isSlideSelect===true); + me.mnuMoveSlideToEnd.setVisible(!selectedLast && value.isSlideSelect===true); + me.mnuMoveSlideToStart.setVisible(!selectedFirst && value.isSlideSelect===true); me.slideMenu.items[16].setVisible(value.fromThumbs===true); me.slideMenu.items[17].setVisible(value.fromThumbs===true); @@ -2095,7 +985,7 @@ define([ me.slideMenu.items[i].setVisible(value.fromThumbs===true); } - mnuPrintSelection.setVisible(me.mode.canPrint && value.fromThumbs===true); + me.mnuPrintSelection.setVisible(me.mode.canPrint && value.fromThumbs===true); var selectedElements = me.api.getSelectedElements(), locked = false, @@ -2108,7 +998,7 @@ define([ locked = elValue.get_LockDelete(); lockedDeleted = elValue.get_LockRemove(); lockedLayout = elValue.get_LockLayout(); - menuSlideSettings.options.value = element; + me.menuSlideSettings.options.value = element; me.slideLayoutMenu.options.layout_index = elValue.get_LayoutIndex(); return false; } @@ -2117,54 +1007,34 @@ define([ for (var i = 0; i < 3; i++) { me.slideMenu.items[i].setDisabled(locked); } - mnuPreview.setDisabled(me.slidesCount<1); - mnuSelectAll.setDisabled(me.slidesCount<2); - mnuDeleteSlide.setDisabled(lockedDeleted || locked); - mnuChangeSlide.setDisabled(lockedLayout || locked); - mnuResetSlide.setDisabled(lockedLayout || locked); + me.mnuPreview.setDisabled(me.slidesCount<1); + me.mnuSelectAll.setDisabled(me.slidesCount<2); + me.mnuDeleteSlide.setDisabled(lockedDeleted || locked); + me.mnuChangeSlide.setDisabled(lockedLayout || locked); + me.mnuResetSlide.setDisabled(lockedLayout || locked); mnuChangeTheme.setDisabled(me._state.themeLock || locked ); - mnuSlideHide.setDisabled(lockedLayout || locked); - mnuPrintSelection.setDisabled(me.slidesCount<1); + me.mnuSlideHide.setDisabled(lockedLayout || locked); + me.mnuPrintSelection.setDisabled(me.slidesCount<1); }, items: [ - menuSlidePaste, - new Common.UI.MenuItem({ - caption : me.txtNewSlide - }).on('click', function(item) { - if (me.api) { - me._isFromSlideMenu = true; - me.api.AddSlide(); - - me.fireEvent('editcomplete', me); - Common.component.Analytics.trackEvent('DocumentHolder', 'Add Slide'); - } - }), - new Common.UI.MenuItem({ - caption : me.txtDuplicateSlide - }).on('click', function(item){ - if (me.api) { - me._isFromSlideMenu = true; - me.api.DublicateSlide(); - - me.fireEvent('editcomplete', me); - Common.component.Analytics.trackEvent('DocumentHolder', 'Dublicate Hyperlink'); - } - }), - mnuDeleteSlide, - mnuSlideHide, + me.menuSlidePaste, + me.mnuNewSlide, + me.mnuDuplicateSlide, + me.mnuDeleteSlide, + me.mnuSlideHide, {caption: '--'}, - mnuChangeSlide, - mnuResetSlide, + me.mnuChangeSlide, + me.mnuResetSlide, mnuChangeTheme, - menuSlideSettings, + me.menuSlideSettings, {caption: '--'}, - mnuSelectAll, - mnuPrintSelection, + me.mnuSelectAll, + me.mnuPrintSelection, {caption: '--'}, - mnuMoveSlideToStart, - mnuMoveSlideToEnd, + me.mnuMoveSlideToStart, + me.mnuMoveSlideToEnd, {caption: '--'}, - mnuPreview + me.mnuPreview ] }).on('hide:after', function(menu, e, isFromInputControl) { if (me.suppressEditComplete) { @@ -2177,7 +1047,7 @@ define([ }).on('render:after', function(cmp) { me.slideLayoutMenu = new Common.UI.DataView({ el : $('#id-docholder-menu-changeslide'), - parentMenu : mnuChangeSlide.menu, + parentMenu : me.mnuChangeSlide.menu, style: 'max-height: 300px;', restoreWidth: 302, store : PE.getCollection('SlideLayouts'), @@ -2188,17 +1058,13 @@ define([ '
    ' ].join('')) }).on('item:click', function(picker, item, record, e) { - if (me.api) { - me.api.ChangeLayout(record.get('data').idx); - if (e.type !== 'click') - me.slideMenu.hide(); - me.fireEvent('editcomplete', me); - Common.component.Analytics.trackEvent('DocumentHolder', 'Change Layout'); - } + if (e.type !== 'click') + me.slideMenu.hide(); + me.fireEvent('layout:change', [record]); }); if (me.slideMenu) { - mnuChangeSlide.menu.on('show:after', function (menu) { + me.mnuChangeSlide.menu.on('show:after', function (menu) { me.onSlidePickerShowAfter(me.slideLayoutMenu); me.slideLayoutMenu.scroller.update({alwaysVisibleY: true}); @@ -2226,13 +1092,9 @@ define([ '
    ' ].join('')) }).on('item:click', function(picker, item, record, e) { - if (me.api) { - me.api.ChangeTheme(record.get('themeId'), true); - if (e.type !== 'click') - me.slideMenu.hide(); - me.fireEvent('editcomplete', me); - Common.component.Analytics.trackEvent('DocumentHolder', 'Change Theme'); - } + if (e.type !== 'click') + me.slideMenu.hide(); + me.fireEvent('theme:change', [record]); }); if (me.slideMenu) { @@ -2246,96 +1108,134 @@ define([ } }); - var mnuTableMerge = new Common.UI.MenuItem({ + me.mnuTableMerge = new Common.UI.MenuItem({ iconCls: 'menu__icon btn-merge-cells', caption : me.mergeCellsText - }).on('click', function(item) { - if (me.api) - me.api.MergeCells(); }); - var mnuTableSplit = new Common.UI.MenuItem({ + me.mnuTableSplit = new Common.UI.MenuItem({ caption : me.splitCellsText - }).on('click', function(item) { - if (me.api) { - (new Common.Views.InsertTableDialog({ - split: true, - handler: function(result, value) { - if (result == 'ok') { - if (me.api) { - me.api.SplitCell(value.columns, value.rows); - } - Common.component.Analytics.trackEvent('DocumentHolder', 'Table Split'); - } - me.fireEvent('editcomplete', me); - } - })).show(); - } }); - var menuTableCellAlign = new Common.UI.MenuItem({ + me.menuTableCellAlign = new Common.UI.MenuItem({ iconCls: 'menu__icon btn-align-top', - caption : me.cellAlignText, - menu : (function(){ - function onItemClick(item, e) { - if (me.api) { - var properties = new Asc.CTableProp(); - properties.put_CellsVAlign(item.value); - me.api.tblApply(properties); - } - - me.fireEvent('editcomplete', me); - Common.component.Analytics.trackEvent('DocumentHolder', 'Table Cell Align'); - } - - return new Common.UI.Menu({ - cls: 'shifted-right', - menuAlign: 'tl-tr', - items: [ - me.menuTableCellTop = new Common.UI.MenuItem({ - iconCls: 'menu__icon btn-align-top', - caption : me.textShapeAlignTop, - checkable : true, - checkmark : false, - toggleGroup : 'popuptablecellalign', - value : Asc.c_oAscVertAlignJc.Top - }).on('click', _.bind(onItemClick, me)), - me.menuTableCellCenter = new Common.UI.MenuItem({ - iconCls: 'menu__icon btn-align-middle', - caption : me.textShapeAlignMiddle, - checkable : true, - checkmark : false, - toggleGroup : 'popuptablecellalign', - value : Asc.c_oAscVertAlignJc.Center - }).on('click', _.bind(onItemClick, me)), - me.menuTableCellBottom = new Common.UI.MenuItem({ - iconCls: 'menu__icon btn-align-bottom', - caption : me.textShapeAlignBottom, - checkable : true, - checkmark : false, - toggleGroup : 'popuptablecellalign', - value : Asc.c_oAscVertAlignJc.Bottom - }).on('click', _.bind(onItemClick, me)) - ] - }) - })() + caption : me.cellAlignText, + menu : new Common.UI.Menu({ + cls: 'shifted-right', + menuAlign: 'tl-tr', + items: [ + me.menuTableCellTop = new Common.UI.MenuItem({ + iconCls: 'menu__icon btn-align-top', + caption : me.textShapeAlignTop, + checkable : true, + checkmark : false, + toggleGroup : 'popuptablecellalign', + value : Asc.c_oAscVertAlignJc.Top + }), + me.menuTableCellCenter = new Common.UI.MenuItem({ + iconCls: 'menu__icon btn-align-middle', + caption : me.textShapeAlignMiddle, + checkable : true, + checkmark : false, + toggleGroup : 'popuptablecellalign', + value : Asc.c_oAscVertAlignJc.Center + }), + me.menuTableCellBottom = new Common.UI.MenuItem({ + iconCls: 'menu__icon btn-align-bottom', + caption : me.textShapeAlignBottom, + checkable : true, + checkmark : false, + toggleGroup : 'popuptablecellalign', + value : Asc.c_oAscVertAlignJc.Bottom + }) + ] + }) }); - var menuTableDistRows = new Common.UI.MenuItem({ + me.menuTableDistRows = new Common.UI.MenuItem({ caption : me.textDistributeRows - }).on('click', _.bind(function(){ - if (me.api) - me.api.asc_DistributeTableCells(false); - me.fireEvent('editcomplete', me); - }, me)); + }); - var menuTableDistCols = new Common.UI.MenuItem({ + me.menuTableDistCols = new Common.UI.MenuItem({ caption : me.textDistributeCols - }).on('click', _.bind(function(){ - if (me.api) - me.api.asc_DistributeTableCells(true); - me.fireEvent('editcomplete', me); - }, me)); + }); + + me.menuTableSelectText = new Common.UI.MenuItem({ + caption : me.selectText, + menu : new Common.UI.Menu({ + cls: 'shifted-right', + menuAlign: 'tl-tr', + items: [ + new Common.UI.MenuItem({ + caption : me.rowText, + value: 0 + }), + new Common.UI.MenuItem({ + caption : me.columnText, + value: 1 + }), + new Common.UI.MenuItem({ + caption : me.cellText, + value: 2 + }), + new Common.UI.MenuItem({ + caption : me.tableText, + value: 3 + }) + ] + }) + }); + + me.menuTableInsertText = new Common.UI.MenuItem({ + iconCls: 'menu__icon btn-addcell', + caption : me.insertText, + menu : new Common.UI.Menu({ + cls: 'shifted-right', + menuAlign: 'tl-tr', + style : 'width: 100px', + items : [ + new Common.UI.MenuItem({ + caption: me.insertColumnLeftText, + value: 0 + }), + new Common.UI.MenuItem({ + caption: me.insertColumnRightText, + value: 1 + }), + new Common.UI.MenuItem({ + caption: me.insertRowAboveText, + value: 2 + }), + new Common.UI.MenuItem({ + caption: me.insertRowBelowText, + value: 3 + }) + ] + }) + }); + + me.menuTableDeleteText = new Common.UI.MenuItem({ + iconCls: 'menu__icon btn-delcell', + caption : me.deleteText, + menu : new Common.UI.Menu({ + cls: 'shifted-right', + menuAlign: 'tl-tr', + items: [ + new Common.UI.MenuItem({ + caption : me.rowText, + value: 0 + }), + new Common.UI.MenuItem({ + caption : me.columnText, + value: 1 + }), + new Common.UI.MenuItem({ + caption : me.tableText, + value: 2 + }) + ] + }) + }); me.menuSpellTable = new Common.UI.MenuItem({ caption : me.loadSpellText, @@ -2372,29 +1272,18 @@ define([ }) }); - var menuIgnoreSpellTable = new Common.UI.MenuItem({ - caption : me.ignoreSpellText - }).on('click', function(item) { - if (me.api) { - me.api.asc_ignoreMisspelledWord(me._currentSpellObj, false); - me.fireEvent('editcomplete', me); - } + me.menuIgnoreSpellTable = new Common.UI.MenuItem({ + caption : me.ignoreSpellText, + value: false }); - var menuIgnoreAllSpellTable = new Common.UI.MenuItem({ - caption : me.ignoreAllSpellText - }).on('click', function(menu) { - if (me.api) { - me.api.asc_ignoreMisspelledWord(me._currentSpellObj, true); - me.fireEvent('editcomplete', me); - } + me.menuIgnoreAllSpellTable = new Common.UI.MenuItem({ + caption : me.ignoreAllSpellText, + value: true }); - var menuToDictionaryTable = new Common.UI.MenuItem({ + me.menuToDictionaryTable = new Common.UI.MenuItem({ caption : me.toDictionaryText - }).on('click', function(item, e) { - me.api.asc_spellCheckAddToDictionary(me._currentSpellObj); - me.fireEvent('editcomplete', me); }); var menuIgnoreSpellTableSeparator = new Common.UI.MenuItem({ @@ -2415,9 +1304,9 @@ define([ me.menuSpellTable, me.menuSpellMoreTable, menuIgnoreSpellTableSeparator, - menuIgnoreSpellTable, - menuIgnoreAllSpellTable, - menuToDictionaryTable, + me.menuIgnoreSpellTable, + me.menuIgnoreAllSpellTable, + me.menuToDictionaryTable, { caption: '--' }, me.langTableMenu ] @@ -2452,25 +1341,18 @@ define([ }) }); - var menuIgnoreSpellPara = new Common.UI.MenuItem({ - caption : me.ignoreSpellText - }).on('click', function(item, e) { - me.api.asc_ignoreMisspelledWord(me._currentSpellObj, false); - me.fireEvent('editcomplete', me); + me.menuIgnoreSpellPara = new Common.UI.MenuItem({ + caption : me.ignoreSpellText, + value: false }); - var menuIgnoreAllSpellPara = new Common.UI.MenuItem({ - caption : me.ignoreAllSpellText - }).on('click', function(item, e) { - me.api.asc_ignoreMisspelledWord(me._currentSpellObj, true); - me.fireEvent('editcomplete', me); + me.menuIgnoreAllSpellPara = new Common.UI.MenuItem({ + caption : me.ignoreAllSpellText, + value: true }); - var menuToDictionaryPara = new Common.UI.MenuItem({ + me.menuToDictionaryPara = new Common.UI.MenuItem({ caption : me.toDictionaryText - }).on('click', function(item, e) { - me.api.asc_spellCheckAddToDictionary(me._currentSpellObj); - me.fireEvent('editcomplete', me); }); var menuIgnoreSpellParaSeparator = new Common.UI.MenuItem({ @@ -2481,175 +1363,41 @@ define([ caption : '--' }); - var menuTableAdvanced = new Common.UI.MenuItem({ + me.menuTableAdvanced = new Common.UI.MenuItem({ iconCls: 'menu__icon btn-menu-table', caption : me.advancedTableText - }).on('click', function(item) { - if (me.api) { - var selectedElements = me.api.getSelectedElements(); - - if (selectedElements && selectedElements.length > 0){ - var elType, elValue; - for (var i = selectedElements.length - 1; i >= 0; i--) { - elType = selectedElements[i].get_ObjectType(); - elValue = selectedElements[i].get_ObjectValue(); - - if (Asc.c_oAscTypeSelectElement.Table == elType) { - (new PE.Views.TableSettingsAdvanced( - { - tableProps: elValue, - slideSize: PE.getController('Toolbar').currentPageSize, - handler: function(result, value) { - if (result == 'ok') { - if (me.api) { - me.api.tblApply(value.tableProps); - } - } - me.fireEvent('editcomplete', me); - Common.component.Analytics.trackEvent('DocumentHolder', 'Table Settings Advanced'); - } - })).show(); - break; - } - } - } - } }); - var menuImageAdvanced = new Common.UI.MenuItem({ + me.menuImageAdvanced = new Common.UI.MenuItem({ iconCls: 'menu__icon btn-menu-image', caption : me.advancedImageText - }).on('click', function(item) { - if (me.api){ - var selectedElements = me.api.getSelectedElements(); - if (selectedElements && selectedElements.length>0){ - var elType, elValue; - - for (var i = selectedElements.length - 1; i >= 0; i--) { - elType = selectedElements[i].get_ObjectType(); - elValue = selectedElements[i].get_ObjectValue(); - - if (Asc.c_oAscTypeSelectElement.Image == elType) { - var imgsizeOriginal; - - if (!menuImgOriginalSize.isDisabled()) { - imgsizeOriginal = me.api.get_OriginalSizeImage(); - if (imgsizeOriginal) - imgsizeOriginal = {width:imgsizeOriginal.get_ImageWidth(), height:imgsizeOriginal.get_ImageHeight()}; - } - - (new PE.Views.ImageSettingsAdvanced( - { - imageProps: elValue, - sizeOriginal: imgsizeOriginal, - slideSize: PE.getController('Toolbar').currentPageSize, - handler: function(result, value) { - if (result == 'ok') { - if (me.api) { - me.api.ImgApply(value.imageProps); - } - } - me.fireEvent('editcomplete', me); - Common.component.Analytics.trackEvent('DocumentHolder', 'Image Settings Advanced'); - } - })).show(); - break; - } - } - } - } }); - var menuShapeAdvanced = new Common.UI.MenuItem({ + me.menuShapeAdvanced = new Common.UI.MenuItem({ iconCls: 'menu__icon btn-menu-shape', caption : me.advancedShapeText - }).on('click', function(item) { - if (me.api){ - var selectedElements = me.api.getSelectedElements(); - if (selectedElements && selectedElements.length>0){ - var elType, elValue; - for (var i = selectedElements.length - 1; i >= 0; i--) { - elType = selectedElements[i].get_ObjectType(); - elValue = selectedElements[i].get_ObjectValue(); - if (Asc.c_oAscTypeSelectElement.Shape == elType) { - (new PE.Views.ShapeSettingsAdvanced( - { - shapeProps: elValue, - slideSize: PE.getController('Toolbar').currentPageSize, - handler: function(result, value) { - if (result == 'ok') { - if (me.api) { - me.api.ShapeApply(value.shapeProps); - } - } - me.fireEvent('editcomplete', me); - Common.component.Analytics.trackEvent('DocumentHolder', 'Image Shape Advanced'); - } - })).show(); - break; - } - } - } - } }); - var menuParagraphAdvanced = new Common.UI.MenuItem({ + me.menuParagraphAdvanced = new Common.UI.MenuItem({ iconCls: 'menu__icon btn-paragraph', caption : me.advancedParagraphText - }).on('click', function(item) { - if (me.api){ - var selectedElements = me.api.getSelectedElements(); - - if (selectedElements && selectedElements.length > 0){ - var elType, elValue; - for (var i = selectedElements.length - 1; i >= 0; i--) { - elType = selectedElements[i].get_ObjectType(); - elValue = selectedElements[i].get_ObjectValue(); - - if (Asc.c_oAscTypeSelectElement.Paragraph == elType) { - (new PE.Views.ParagraphSettingsAdvanced( - { - paragraphProps: elValue, - api: me.api, - handler: function(result, value) { - if (result == 'ok') { - if (me.api) { - me.api.paraApply(value.paragraphProps); - } - } - me.fireEvent('editcomplete', me); - Common.component.Analytics.trackEvent('DocumentHolder', 'Image Paragraph Advanced'); - } - })).show(); - break; - } - } - } - } }); var menuCommentParaSeparator = new Common.UI.MenuItem({ caption : '--' }); - var menuAddHyperlinkPara = new Common.UI.MenuItem({ + me.menuAddHyperlinkPara = new Common.UI.MenuItem({ iconCls: 'menu__icon btn-inserthyperlink', caption : me.hyperlinkText - }).on('click', _.bind(me.addHyperlink, me)); + }); - var menuEditHyperlinkPara = new Common.UI.MenuItem({ + me.menuEditHyperlinkPara = new Common.UI.MenuItem({ caption : me.editHyperlinkText - }).on('click', _.bind(me.editHyperlink, me)); + }); - var menuRemoveHyperlinkPara = new Common.UI.MenuItem({ + me.menuRemoveHyperlinkPara = new Common.UI.MenuItem({ caption : me.removeHyperlinkText - }).on('click', function(item) { - if (me.api){ - me.api.remove_Hyperlink(); - } - - me.fireEvent('editcomplete', me); - Common.component.Analytics.trackEvent('DocumentHolder', 'Remove Hyperlink'); }); var menuHyperlinkPara = new Common.UI.MenuItem({ @@ -2659,30 +1407,23 @@ define([ cls: 'shifted-right', menuAlign: 'tl-tr', items: [ - menuEditHyperlinkPara, - menuRemoveHyperlinkPara + me.menuEditHyperlinkPara, + me.menuRemoveHyperlinkPara ] }) }); - var menuAddHyperlinkTable = new Common.UI.MenuItem({ + me.menuAddHyperlinkTable = new Common.UI.MenuItem({ iconCls: 'menu__icon btn-inserthyperlink', caption : me.hyperlinkText - }).on('click', _.bind(me.addHyperlink, me)); + }); - var menuEditHyperlinkTable = new Common.UI.MenuItem({ + me.menuEditHyperlinkTable = new Common.UI.MenuItem({ caption : me.editHyperlinkText - }).on('click', _.bind(me.editHyperlink, me)); + }); - var menuRemoveHyperlinkTable = new Common.UI.MenuItem({ + me.menuRemoveHyperlinkTable = new Common.UI.MenuItem({ caption : me.removeHyperlinkText - }).on('click', function(item) { - if (me.api){ - me.api.remove_Hyperlink(); - } - - me.fireEvent('editcomplete', me); - Common.component.Analytics.trackEvent('DocumentHolder', 'Remove Hyperlink Table'); }); var menuHyperlinkTable = new Common.UI.MenuItem({ @@ -2692,8 +1433,8 @@ define([ cls: 'shifted-right', menuAlign: 'tl-tr', items: [ - menuEditHyperlinkTable, - menuRemoveHyperlinkTable + me.menuEditHyperlinkTable, + me.menuRemoveHyperlinkTable ] }) }); @@ -2702,76 +1443,34 @@ define([ caption : '--' }); - var mnuGroupImg = new Common.UI.MenuItem({ + me.mnuGroupImg = new Common.UI.MenuItem({ caption : this.txtGroup, iconCls : 'menu__icon shape-group' - }).on('click', function(item) { - if (me.api) { - me.api.groupShapes(); - } - - me.fireEvent('editcomplete', this); - Common.component.Analytics.trackEvent('DocumentHolder', 'Group Image'); }); - var mnuUnGroupImg = new Common.UI.MenuItem({ + me.mnuUnGroupImg = new Common.UI.MenuItem({ caption : this.txtUngroup, iconCls : 'menu__icon shape-ungroup' - }).on('click', function(item) { - if (me.api) { - me.api.unGroupShapes(); - } - - me.fireEvent('editcomplete', this); - Common.component.Analytics.trackEvent('DocumentHolder', 'Ungroup Image'); }); - var mnuArrangeFront = new Common.UI.MenuItem({ + me.mnuArrangeFront = new Common.UI.MenuItem({ caption : this.textArrangeFront, iconCls : 'menu__icon arrange-front' - }).on('click', function(item) { - if (me.api) { - me.api.shapes_bringToFront(); - } - - me.fireEvent('editcomplete', me); - Common.component.Analytics.trackEvent('DocumentHolder', 'Bring To Front'); }); - var mnuArrangeBack = new Common.UI.MenuItem({ + me.mnuArrangeBack = new Common.UI.MenuItem({ caption : this.textArrangeBack, iconCls : 'menu__icon arrange-back' - }).on('click', function(item) { - if (me.api) { - me.api.shapes_bringToBack(); - } - - me.fireEvent('editcomplete', me); - Common.component.Analytics.trackEvent('DocumentHolder', 'Bring To Back'); }); - var mnuArrangeForward = new Common.UI.MenuItem({ + me.mnuArrangeForward = new Common.UI.MenuItem({ caption : this.textArrangeForward, iconCls : 'menu__icon arrange-forward' - }).on('click', function(item) { - if (me.api) { - me.api.shapes_bringForward(); - } - - me.fireEvent('editcomplete', me); - Common.component.Analytics.trackEvent('DocumentHolder', 'Send Forward'); }); - var mnuArrangeBackward = new Common.UI.MenuItem({ + me.mnuArrangeBackward = new Common.UI.MenuItem({ caption : this.textArrangeBackward, iconCls : 'menu__icon arrange-backward' - }).on('click', function(item) { - if (me.api) { - me.api.shapes_bringBackward(); - } - - me.fireEvent('editcomplete', me); - Common.component.Analytics.trackEvent('DocumentHolder', 'Send Backward'); }); var menuImgShapeArrange = new Common.UI.MenuItem({ @@ -2780,153 +1479,109 @@ define([ cls: 'shifted-right', menuAlign: 'tl-tr', items: [ - mnuArrangeFront, - mnuArrangeBack, - mnuArrangeForward, - mnuArrangeBackward, + me.mnuArrangeFront, + me.mnuArrangeBack, + me.mnuArrangeForward, + me.mnuArrangeBackward, {caption: '--'}, - mnuGroupImg, - mnuUnGroupImg + me.mnuGroupImg, + me.mnuUnGroupImg ] }) }); - var menuImgShapeAlign = new Common.UI.MenuItem({ + me.menuImgShapeAlign = new Common.UI.MenuItem({ caption : me.txtAlign, - menu : (function(){ - function onItemClick(item) { - if (me.api) { - var value = me.api.asc_getSelectedDrawingObjectsCount()<2 || Common.Utils.InternalSettings.get("pe-align-to-slide"); - value = value ? Asc.c_oAscObjectsAlignType.Slide : Asc.c_oAscObjectsAlignType.Selected; - if (item.value < 6) { - me.api.put_ShapesAlign(item.value, value); - Common.component.Analytics.trackEvent('DocumentHolder', 'Shape Align'); - } else if (item.value == 6) { - me.api.DistributeHorizontally(value); - Common.component.Analytics.trackEvent('DocumentHolder', 'Distribute Horizontally'); - } else if (item.value == 7){ - me.api.DistributeVertically(value); - Common.component.Analytics.trackEvent('DocumentHolder', 'Distribute Vertically'); - } - } - me.fireEvent('editcomplete', me); - } - - return new Common.UI.Menu({ - cls: 'shifted-right', - menuAlign: 'tl-tr', - items: [ - new Common.UI.MenuItem({ - caption : me.textShapeAlignLeft, - iconCls : 'menu__icon shape-align-left', - value : Asc.c_oAscAlignShapeType.ALIGN_LEFT - }).on('click', _.bind(onItemClick, me)), - new Common.UI.MenuItem({ - caption : me.textShapeAlignCenter, - iconCls : 'menu__icon shape-align-center', - value : Asc.c_oAscAlignShapeType.ALIGN_CENTER - }).on('click', _.bind(onItemClick, me)), - new Common.UI.MenuItem({ - caption : me.textShapeAlignRight, - iconCls : 'menu__icon shape-align-right', - value : Asc.c_oAscAlignShapeType.ALIGN_RIGHT - }).on('click', _.bind(onItemClick, me)), - new Common.UI.MenuItem({ - caption : me.textShapeAlignTop, - iconCls : 'menu__icon shape-align-top', - value : Asc.c_oAscAlignShapeType.ALIGN_TOP - }).on('click', _.bind(onItemClick, me)), - new Common.UI.MenuItem({ - caption : me.textShapeAlignMiddle, - iconCls : 'menu__icon shape-align-middle', - value : Asc.c_oAscAlignShapeType.ALIGN_MIDDLE - }).on('click', _.bind(onItemClick, me)), - new Common.UI.MenuItem({ - caption : me.textShapeAlignBottom, - iconCls : 'menu__icon shape-align-bottom', - value : Asc.c_oAscAlignShapeType.ALIGN_BOTTOM - }).on('click', _.bind(onItemClick, me)), - {caption : '--'}, - new Common.UI.MenuItem({ - caption : me.txtDistribHor, - iconCls : 'menu__icon shape-distribute-hor', - value : 6 - }).on('click', _.bind(onItemClick, me)), - new Common.UI.MenuItem({ - caption : me.txtDistribVert, - iconCls : 'menu__icon shape-distribute-vert', - value : 7 - }).on('click', _.bind(onItemClick, me)) - ] - }) - })() + menu : new Common.UI.Menu({ + cls: 'shifted-right', + menuAlign: 'tl-tr', + items: [ + new Common.UI.MenuItem({ + caption : me.textShapeAlignLeft, + iconCls : 'menu__icon shape-align-left', + value : Asc.c_oAscAlignShapeType.ALIGN_LEFT + }), + new Common.UI.MenuItem({ + caption : me.textShapeAlignCenter, + iconCls : 'menu__icon shape-align-center', + value : Asc.c_oAscAlignShapeType.ALIGN_CENTER + }), + new Common.UI.MenuItem({ + caption : me.textShapeAlignRight, + iconCls : 'menu__icon shape-align-right', + value : Asc.c_oAscAlignShapeType.ALIGN_RIGHT + }), + new Common.UI.MenuItem({ + caption : me.textShapeAlignTop, + iconCls : 'menu__icon shape-align-top', + value : Asc.c_oAscAlignShapeType.ALIGN_TOP + }), + new Common.UI.MenuItem({ + caption : me.textShapeAlignMiddle, + iconCls : 'menu__icon shape-align-middle', + value : Asc.c_oAscAlignShapeType.ALIGN_MIDDLE + }), + new Common.UI.MenuItem({ + caption : me.textShapeAlignBottom, + iconCls : 'menu__icon shape-align-bottom', + value : Asc.c_oAscAlignShapeType.ALIGN_BOTTOM + }), + {caption : '--'}, + new Common.UI.MenuItem({ + caption : me.txtDistribHor, + iconCls : 'menu__icon shape-distribute-hor', + value : 6 + }), + new Common.UI.MenuItem({ + caption : me.txtDistribVert, + iconCls : 'menu__icon shape-distribute-vert', + value : 7 + }) + ] + }) }); - var menuChartEdit = new Common.UI.MenuItem({ + me.menuChartEdit = new Common.UI.MenuItem({ iconCls: 'menu__icon btn-menu-chart', caption : me.editChartText - }).on('click', _.bind(me.editChartClick, me, undefined)); - - var menuParagraphVAlign = new Common.UI.MenuItem({ - iconCls: 'menu__icon btn-align-top', - caption : me.vertAlignText, - menu : (function(){ - function onItemClick(item) { - if (me.api) { - var properties = new Asc.asc_CShapeProperty(); - properties.put_VerticalTextAlign(item.value); - - me.api.ShapeApply(properties); - } - - me.fireEvent('editcomplete', me); - Common.component.Analytics.trackEvent('DocumentHolder', 'Text Vertical Align'); - } - - return new Common.UI.Menu({ - cls: 'shifted-right', - menuAlign: 'tl-tr', - items: [ - me.menuParagraphTop = new Common.UI.MenuItem({ - iconCls: 'menu__icon btn-align-top', - caption : me.textShapeAlignTop, - checkable : true, - checkmark : false, - toggleGroup : 'popupparagraphvalign', - value : Asc.c_oAscVAlign.Top - }).on('click', _.bind(onItemClick, me)), - me.menuParagraphCenter = new Common.UI.MenuItem({ - iconCls: 'menu__icon btn-align-middle', - caption : me.textShapeAlignMiddle, - checkable : true, - checkmark : false, - toggleGroup : 'popupparagraphvalign', - value : Asc.c_oAscVAlign.Center - }).on('click', _.bind(onItemClick, me)), - me.menuParagraphBottom = new Common.UI.MenuItem({ - iconCls: 'menu__icon btn-align-bottom', - caption : me.textShapeAlignBottom, - checkable : true, - checkmark : false, - toggleGroup : 'popupparagraphvalign', - value : Asc.c_oAscVAlign.Bottom - }).on('click', _.bind(onItemClick, me)) - ] - }) - })() }); - var paragraphDirection = function(item, e) { - if (me.api) { - var properties = new Asc.asc_CShapeProperty(); - properties.put_Vert(item.options.direction); - me.api.ShapeApply(properties); - } - me.fireEvent('editcomplete', me); - Common.component.Analytics.trackEvent('DocumentHolder', 'Text Direction'); - }; + me.menuParagraphVAlign = new Common.UI.MenuItem({ + iconCls: 'menu__icon btn-align-top', + caption : me.vertAlignText, + menu : new Common.UI.Menu({ + cls: 'shifted-right', + menuAlign: 'tl-tr', + items: [ + me.menuParagraphTop = new Common.UI.MenuItem({ + iconCls: 'menu__icon btn-align-top', + caption : me.textShapeAlignTop, + checkable : true, + checkmark : false, + toggleGroup : 'popupparagraphvalign', + value : Asc.c_oAscVAlign.Top + }), + me.menuParagraphCenter = new Common.UI.MenuItem({ + iconCls: 'menu__icon btn-align-middle', + caption : me.textShapeAlignMiddle, + checkable : true, + checkmark : false, + toggleGroup : 'popupparagraphvalign', + value : Asc.c_oAscVAlign.Center + }), + me.menuParagraphBottom = new Common.UI.MenuItem({ + iconCls: 'menu__icon btn-align-bottom', + caption : me.textShapeAlignBottom, + checkable : true, + checkmark : false, + toggleGroup : 'popupparagraphvalign', + value : Asc.c_oAscVAlign.Bottom + }) + ] + }) + }); - var menuParagraphDirection = new Common.UI.MenuItem({ + me.menuParagraphDirection = new Common.UI.MenuItem({ iconCls: 'menu__icon text-orient-hor', caption : me.directionText, menu : new Common.UI.Menu({ @@ -2941,7 +1596,7 @@ define([ checked : false, toggleGroup : 'popupparagraphdirect', direction : Asc.c_oAscVertDrawingText.normal - }).on('click', _.bind(paragraphDirection, me)), + }), me.menuParagraphDirect90 = new Common.UI.MenuItem({ caption : me.direct90Text, iconCls : 'menu__icon text-orient-rdown', @@ -2950,7 +1605,7 @@ define([ checked : false, toggleGroup : 'popupparagraphdirect', direction : Asc.c_oAscVertDrawingText.vert - }).on('click', _.bind(paragraphDirection, me)), + }), me.menuParagraphDirect270 = new Common.UI.MenuItem({ caption : me.direct270Text, iconCls : 'menu__icon text-orient-rup', @@ -2959,7 +1614,7 @@ define([ checked : false, toggleGroup : 'popupparagraphdirect', direction : Asc.c_oAscVertDrawingText.vert270 - }).on('click', _.bind(paragraphDirection, me)) + }) ] }) }); @@ -2968,70 +1623,33 @@ define([ caption : '--' }); - var menuImgOriginalSize = new Common.UI.MenuItem({ + me.menuImgOriginalSize = new Common.UI.MenuItem({ caption : me.originalSizeText - }).on('click', function(item){ - if (me.api){ - var originalImageSize = me.api.get_OriginalSizeImage(); - - if (originalImageSize) { - var properties = new Asc.asc_CImgProperty(); - - properties.put_Width(originalImageSize.get_ImageWidth()); - properties.put_Height(originalImageSize.get_ImageHeight()); - properties.put_ResetCrop(true); - properties.put_Rot(0); - me.api.ImgApply(properties); - } - - me.fireEvent('editcomplete', me); - Common.component.Analytics.trackEvent('DocumentHolder', 'Set Image Original Size'); - } }); - var menuImgReplace = new Common.UI.MenuItem({ + me.menuImgReplace = new Common.UI.MenuItem({ caption : me.textReplace, menu : new Common.UI.Menu({ cls: 'shifted-right', menuAlign: 'tl-tr', items: [ new Common.UI.MenuItem({ - caption : this.textFromFile - }).on('click', function(item) { - setTimeout(function(){ - me.onInsertImage(); - }, 10); + caption : this.textFromFile, + value: 0 }), new Common.UI.MenuItem({ - caption : this.textFromUrl - }).on('click', _.bind(me.onInsertImageUrl, me, false)), + caption : this.textFromUrl, + value: 1 + }), new Common.UI.MenuItem({ - caption : this.textFromStorage - }).on('click', function(item) { - Common.NotificationCenter.trigger('storage:image-load', 'change'); + caption : this.textFromStorage, + value: 2 }) ] }) }); - var onImgRotate = function(item) { - var properties = new Asc.asc_CShapeProperty(); - properties.asc_putRotAdd((item.value==1 ? 90 : 270) * 3.14159265358979 / 180); - me.api.ShapeApply(properties); - me.fireEvent('editcomplete', me); - }; - - var onImgFlip = function(item) { - var properties = new Asc.asc_CShapeProperty(); - if (item.value==1) - properties.asc_putFlipHInvert(true); - else - properties.asc_putFlipVInvert(true); - me.api.ShapeApply(properties); - me.fireEvent('editcomplete', me); - }; - - var menuImgShapeRotate = new Common.UI.MenuItem({ + me.menuImgShapeRotate = new Common.UI.MenuItem({ caption : me.textRotate, menu : new Common.UI.Menu({ cls: 'shifted-right', @@ -3041,38 +1659,27 @@ define([ iconCls: 'menu__icon btn-rotate-90', caption: me.textRotate90, value : 1 - }).on('click', _.bind(onImgRotate, me)), + }), new Common.UI.MenuItem({ iconCls: 'menu__icon btn-rotate-270', caption: me.textRotate270, value : 0 - }).on('click', _.bind(onImgRotate, me)), + }), { caption: '--' }, new Common.UI.MenuItem({ iconCls: 'menu__icon btn-flip-hor', caption: me.textFlipH, value : 1 - }).on('click', _.bind(onImgFlip, me)), + }), new Common.UI.MenuItem({ iconCls: 'menu__icon btn-flip-vert', caption: me.textFlipV, value : 0 - }).on('click', _.bind(onImgFlip, me)) + }) ] }) }); - var onImgCrop = function(item) { - if (item.value == 1) { - me.api.asc_cropFill(); - } else if (item.value == 2) { - me.api.asc_cropFit(); - } else { - item.checked ? me.api.asc_startEditCrop() : me.api.asc_endEditCrop(); - } - me.fireEvent('editcomplete', me); - }; - me.menuImgCrop = new Common.UI.MenuItem({ caption : me.textCrop, menu : new Common.UI.Menu({ @@ -3084,101 +1691,101 @@ define([ checkable: true, allowDepress: true, value : 0 - }).on('click', _.bind(onImgCrop, me)), + }), new Common.UI.MenuItem({ caption: me.textCropFill, value : 1 - }).on('click', _.bind(onImgCrop, me)), + }), new Common.UI.MenuItem({ caption: me.textCropFit, value : 2 - }).on('click', _.bind(onImgCrop, me)) + }) ] }) }); /** coauthoring begin **/ - var menuAddCommentPara = new Common.UI.MenuItem({ + me.menuAddCommentPara = new Common.UI.MenuItem({ iconCls: 'menu__icon btn-menu-comments', caption : me.addCommentText - }).on('click', _.bind(me.addComment, me)); - menuAddCommentPara.hide(); + }); + me.menuAddCommentPara.hide(); - var menuAddCommentTable = new Common.UI.MenuItem({ + me.menuAddCommentTable = new Common.UI.MenuItem({ iconCls: 'menu__icon btn-menu-comments', caption : me.addCommentText - }).on('click', _.bind(me.addComment, me)); - menuAddCommentTable.hide(); + }); + me.menuAddCommentTable.hide(); var menuCommentSeparatorImg = new Common.UI.MenuItem({ caption : '--' }); menuCommentSeparatorImg.hide(); - var menuAddCommentImg = new Common.UI.MenuItem({ + me.menuAddCommentImg = new Common.UI.MenuItem({ iconCls: 'menu__icon btn-menu-comments', caption : me.addCommentText - }).on('click', _.bind(me.addComment, me)); - menuAddCommentImg.hide(); + }); + me.menuAddCommentImg.hide(); /** coauthoring end **/ - var menuAddToLayoutImg = new Common.UI.MenuItem({ + me.menuAddToLayoutImg = new Common.UI.MenuItem({ caption : me.addToLayoutText - }).on('click', _.bind(me.addToLayout, me)); + }); - var menuParaCopy = new Common.UI.MenuItem({ + me.menuParaCopy = new Common.UI.MenuItem({ iconCls: 'menu__icon btn-copy', caption : me.textCopy, value : 'copy' - }).on('click', _.bind(me.onCutCopyPaste, me)); + }); - var menuParaPaste = new Common.UI.MenuItem({ + me.menuParaPaste = new Common.UI.MenuItem({ iconCls: 'menu__icon btn-paste', caption : me.textPaste, value : 'paste' - }).on('click', _.bind(me.onCutCopyPaste, me)); + }); - var menuParaCut = new Common.UI.MenuItem({ + me.menuParaCut = new Common.UI.MenuItem({ iconCls: 'menu__icon btn-cut', caption : me.textCut, value : 'cut' - }).on('click', _.bind(me.onCutCopyPaste, me)); + }); - var menuImgCopy = new Common.UI.MenuItem({ + me.menuImgCopy = new Common.UI.MenuItem({ iconCls: 'menu__icon btn-copy', caption : me.textCopy, value : 'copy' - }).on('click', _.bind(me.onCutCopyPaste, me)); + }); - var menuImgPaste = new Common.UI.MenuItem({ + me.menuImgPaste = new Common.UI.MenuItem({ iconCls: 'menu__icon btn-paste', caption : me.textPaste, value : 'paste' - }).on('click', _.bind(me.onCutCopyPaste, me)); + }); - var menuImgCut = new Common.UI.MenuItem({ + me.menuImgCut = new Common.UI.MenuItem({ iconCls: 'menu__icon btn-cut', caption : me.textCut, value : 'cut' - }).on('click', _.bind(me.onCutCopyPaste, me)); + }); - var menuTableCopy = new Common.UI.MenuItem({ + me.menuTableCopy = new Common.UI.MenuItem({ iconCls: 'menu__icon btn-copy', caption : me.textCopy, value : 'copy' - }).on('click', _.bind(me.onCutCopyPaste, me)); + }); - var menuTablePaste = new Common.UI.MenuItem({ + me.menuTablePaste = new Common.UI.MenuItem({ iconCls: 'menu__icon btn-paste', caption : me.textPaste, value : 'paste' - }).on('click', _.bind(me.onCutCopyPaste, me)); + }); - var menuTableCut = new Common.UI.MenuItem({ + me.menuTableCut = new Common.UI.MenuItem({ iconCls: 'menu__icon btn-cut', caption : me.textCut, value : 'cut' - }).on('click', _.bind(me.onCutCopyPaste, me)); + }); var menuEquationSeparator = new Common.UI.MenuItem({ caption : '--' @@ -3188,14 +1795,12 @@ define([ caption : '--' }); - var menuAddToLayoutTable = new Common.UI.MenuItem({ + me.menuAddToLayoutTable = new Common.UI.MenuItem({ caption : me.addToLayoutText - }).on('click', _.bind(me.addToLayout, me)); + }); - var menuImgEditPoints = new Common.UI.MenuItem({ + me.menuImgEditPoints = new Common.UI.MenuItem({ caption: me.textEditPoints - }).on('click', function(item) { - me.api && me.api.asc_editPointsGeometry(); }); var menuImgEditPointsSeparator = new Common.UI.MenuItem({ @@ -3214,8 +1819,8 @@ define([ var isEquation= (value.mathProps && value.mathProps.value); me._currentParaObjDisabled = disabled; - menuParagraphVAlign.setVisible(isInShape && !isInChart && !isEquation); // после того, как заголовок можно будет растягивать по вертикали, вернуть "|| isInChart" !! - menuParagraphDirection.setVisible(isInShape && !isInChart && !isEquation); // после того, как заголовок можно будет растягивать по вертикали, вернуть "|| isInChart" !! + me.menuParagraphVAlign.setVisible(isInShape && !isInChart && !isEquation); // после того, как заголовок можно будет растягивать по вертикали, вернуть "|| isInChart" !! + me.menuParagraphDirection.setVisible(isInShape && !isInChart && !isEquation); // после того, как заголовок можно будет растягивать по вертикали, вернуть "|| isInChart" !! if (isInShape || isInChart) { var align = value.shapeProps.value.get_VerticalTextAlign(); var cls = ''; @@ -3230,7 +1835,7 @@ define([ cls = 'menu__icon btn-align-bottom'; break; } - menuParagraphVAlign.setIconCls(cls); + me.menuParagraphVAlign.setIconCls(cls); me.menuParagraphTop.setChecked(align == Asc.c_oAscVAlign.Top); me.menuParagraphCenter.setChecked(align == Asc.c_oAscVAlign.Center); me.menuParagraphBottom.setChecked(align == Asc.c_oAscVAlign.Bottom); @@ -3248,16 +1853,16 @@ define([ cls = 'menu__icon text-orient-rup'; break; } - menuParagraphDirection.setIconCls(cls); + me.menuParagraphDirection.setIconCls(cls); me.menuParagraphDirectH.setChecked(dir == Asc.c_oAscVertDrawingText.normal); me.menuParagraphDirect90.setChecked(dir == Asc.c_oAscVertDrawingText.vert); me.menuParagraphDirect270.setChecked(dir == Asc.c_oAscVertDrawingText.vert270); } else { - menuParagraphVAlign.setIconCls(''); - menuParagraphDirection.setIconCls(''); + me.menuParagraphVAlign.setIconCls(''); + me.menuParagraphDirection.setIconCls(''); } - menuParagraphVAlign.setDisabled(disabled); - menuParagraphDirection.setDisabled(disabled); + me.menuParagraphVAlign.setDisabled(disabled); + me.menuParagraphDirection.setDisabled(disabled); var text = null; @@ -3265,40 +1870,40 @@ define([ text = me.api.can_AddHyperlink(); } - menuAddHyperlinkPara.setVisible(value.hyperProps===undefined && text!==false); + me.menuAddHyperlinkPara.setVisible(value.hyperProps===undefined && text!==false); menuHyperlinkPara.setVisible(value.hyperProps!==undefined); - menuEditHyperlinkPara.hyperProps = value.hyperProps; + me.menuEditHyperlinkPara.hyperProps = value.hyperProps; if (text!==false) { - menuAddHyperlinkPara.hyperProps = {}; - menuAddHyperlinkPara.hyperProps.value = new Asc.CHyperlinkProperty(); - menuAddHyperlinkPara.hyperProps.value.put_Text(text); + me.menuAddHyperlinkPara.hyperProps = {}; + me.menuAddHyperlinkPara.hyperProps.value = new Asc.CHyperlinkProperty(); + me.menuAddHyperlinkPara.hyperProps.value.put_Text(text); } /** coauthoring begin **/ - menuAddCommentPara.setVisible(!isInChart && isInShape && me.api.can_AddQuotedComment()!==false && me.mode.canCoAuthoring && me.mode.canComments); + me.menuAddCommentPara.setVisible(!isInChart && isInShape && me.api.can_AddQuotedComment()!==false && me.mode.canCoAuthoring && me.mode.canComments); /** coauthoring end **/ - menuCommentParaSeparator.setVisible(/** coauthoring begin **/ menuAddCommentPara.isVisible() || /** coauthoring end **/ menuAddHyperlinkPara.isVisible() || menuHyperlinkPara.isVisible()); - menuAddHyperlinkPara.setDisabled(disabled); + menuCommentParaSeparator.setVisible(/** coauthoring begin **/ me.menuAddCommentPara.isVisible() || /** coauthoring end **/ me.menuAddHyperlinkPara.isVisible() || menuHyperlinkPara.isVisible()); + me.menuAddHyperlinkPara.setDisabled(disabled); menuHyperlinkPara.setDisabled(disabled); /** coauthoring begin **/ - menuAddCommentPara.setDisabled(disabled); + me.menuAddCommentPara.setDisabled(disabled); /** coauthoring end **/ - menuParagraphAdvanced.setDisabled(disabled); - menuParaCut.setDisabled(disabled); - menuParaPaste.setDisabled(disabled); + me.menuParagraphAdvanced.setDisabled(disabled); + me.menuParaCut.setDisabled(disabled); + me.menuParaPaste.setDisabled(disabled); // spellCheck var spell = (value.spellProps!==undefined && value.spellProps.value.get_Checked()===false); me.menuSpellPara.setVisible(spell); menuSpellcheckParaSeparator.setVisible(spell); - menuIgnoreSpellPara.setVisible(spell); - menuIgnoreAllSpellPara.setVisible(spell); - menuToDictionaryPara.setVisible(spell && me.mode.isDesktopApp); + me.menuIgnoreSpellPara.setVisible(spell); + me.menuIgnoreAllSpellPara.setVisible(spell); + me.menuToDictionaryPara.setVisible(spell && me.mode.isDesktopApp); me.langParaMenu.setVisible(spell); me.langParaMenu.setDisabled(disabled); menuIgnoreSpellParaSeparator.setVisible(spell); @@ -3327,24 +1932,24 @@ define([ me.menuSpellPara, me.menuSpellMorePara, menuSpellcheckParaSeparator, - menuIgnoreSpellPara, - menuIgnoreAllSpellPara, - menuToDictionaryPara, + me.menuIgnoreSpellPara, + me.menuIgnoreAllSpellPara, + me.menuToDictionaryPara, me.langParaMenu, menuIgnoreSpellParaSeparator, - menuParaCut, - menuParaCopy, - menuParaPaste, + me.menuParaCut, + me.menuParaCopy, + me.menuParaPaste, menuEquationSeparator, { caption: '--' }, - menuParagraphVAlign, - menuParagraphDirection, - menuParagraphAdvanced, + me.menuParagraphVAlign, + me.menuParagraphDirection, + me.menuParagraphAdvanced, menuCommentParaSeparator, /** coauthoring begin **/ - menuAddCommentPara, + me.menuAddCommentPara, /** coauthoring end **/ - menuAddHyperlinkPara, + me.menuAddHyperlinkPara, menuHyperlinkPara ] }).on('hide:after', function(menu, e, isFromInputControl) { @@ -3385,25 +1990,25 @@ define([ cls = 'menu__icon btn-align-bottom'; break; } - menuTableCellAlign.setIconCls(cls); + me.menuTableCellAlign.setIconCls(cls); me.menuTableCellTop.setChecked(align == Asc.c_oAscVertAlignJc.Top); me.menuTableCellCenter.setChecked(align == Asc.c_oAscVertAlignJc.Center); me.menuTableCellBottom.setChecked(align == Asc.c_oAscVertAlignJc.Bottom); if (me.api) { - mnuTableMerge.setDisabled(value.tableProps.locked || disabled || !me.api.CheckBeforeMergeCells()); - mnuTableSplit.setDisabled(value.tableProps.locked || disabled || !me.api.CheckBeforeSplitCells()); + me.mnuTableMerge.setDisabled(value.tableProps.locked || disabled || !me.api.CheckBeforeMergeCells()); + me.mnuTableSplit.setDisabled(value.tableProps.locked || disabled || !me.api.CheckBeforeSplitCells()); } - menuTableDistRows.setDisabled(value.tableProps.locked || disabled); - menuTableDistCols.setDisabled(value.tableProps.locked || disabled); + me.menuTableDistRows.setDisabled(value.tableProps.locked || disabled); + me.menuTableDistCols.setDisabled(value.tableProps.locked || disabled); me.tableMenu.items[7].setDisabled(value.tableProps.locked || disabled); me.tableMenu.items[8].setDisabled(value.tableProps.locked || disabled); - menuTableCellAlign.setDisabled(value.tableProps.locked || disabled); - menuTableAdvanced.setDisabled(value.tableProps.locked || disabled); - menuTableCut.setDisabled(value.tableProps.locked || disabled); - menuTablePaste.setDisabled(value.tableProps.locked || disabled); + me.menuTableCellAlign.setDisabled(value.tableProps.locked || disabled); + me.menuTableAdvanced.setDisabled(value.tableProps.locked || disabled); + me.menuTableCut.setDisabled(value.tableProps.locked || disabled); + me.menuTablePaste.setDisabled(value.tableProps.locked || disabled); // hyperlink properties var text = null; @@ -3412,30 +2017,30 @@ define([ text = me.api.can_AddHyperlink(); } - menuAddHyperlinkTable.setVisible(!_.isUndefined(value.paraProps) && _.isUndefined(value.hyperProps) && text!==false); + me.menuAddHyperlinkTable.setVisible(!_.isUndefined(value.paraProps) && _.isUndefined(value.hyperProps) && text!==false); menuHyperlinkTable.setVisible(!_.isUndefined(value.paraProps) && !_.isUndefined(value.hyperProps)); - menuEditHyperlinkTable.hyperProps = value.hyperProps; + me.menuEditHyperlinkTable.hyperProps = value.hyperProps; if (text!==false) { - menuAddHyperlinkTable.hyperProps = {}; - menuAddHyperlinkTable.hyperProps.value = new Asc.CHyperlinkProperty(); - menuAddHyperlinkTable.hyperProps.value.put_Text(text); + me.menuAddHyperlinkTable.hyperProps = {}; + me.menuAddHyperlinkTable.hyperProps.value = new Asc.CHyperlinkProperty(); + me.menuAddHyperlinkTable.hyperProps.value.put_Text(text); } if (!_.isUndefined(value.paraProps)) { - menuAddHyperlinkTable.setDisabled(value.paraProps.locked || disabled); + me.menuAddHyperlinkTable.setDisabled(value.paraProps.locked || disabled); menuHyperlinkTable.setDisabled(value.paraProps.locked || disabled); me._currentParaObjDisabled = value.paraProps.locked || disabled; } /** coauthoring begin **/ - menuAddCommentTable.setVisible(me.api.can_AddQuotedComment()!==false && me.mode.canCoAuthoring && me.mode.canComments); - menuAddCommentTable.setDisabled(!_.isUndefined(value.paraProps) && value.paraProps.locked || disabled); + me.menuAddCommentTable.setVisible(me.api.can_AddQuotedComment()!==false && me.mode.canCoAuthoring && me.mode.canComments); + me.menuAddCommentTable.setDisabled(!_.isUndefined(value.paraProps) && value.paraProps.locked || disabled); /** coauthoring end **/ - menuHyperlinkSeparator.setVisible(menuAddHyperlinkTable.isVisible() || menuHyperlinkTable.isVisible() /** coauthoring begin **/|| menuAddCommentTable.isVisible()/** coauthoring end **/); + menuHyperlinkSeparator.setVisible(me.menuAddHyperlinkTable.isVisible() || menuHyperlinkTable.isVisible() /** coauthoring begin **/|| me.menuAddCommentTable.isVisible()/** coauthoring end **/); me.menuSpellCheckTable.setVisible(value.spellProps!==undefined && value.spellProps.value.get_Checked()===false); - menuToDictionaryTable.setVisible(me.mode.isDesktopApp); + me.menuToDictionaryTable.setVisible(me.mode.isDesktopApp); menuSpellcheckTableSeparator.setVisible(value.spellProps!==undefined && value.spellProps.value.get_Checked()===false); me.langTableMenu.setDisabled(disabled); @@ -3463,103 +2068,31 @@ define([ items: [ me.menuSpellCheckTable, menuSpellcheckTableSeparator, - menuTableCut, - menuTableCopy, - menuTablePaste, + me.menuTableCut, + me.menuTableCopy, + me.menuTablePaste, { caption: '--' }, - new Common.UI.MenuItem({ - caption : me.selectText, - menu : new Common.UI.Menu({ - cls: 'shifted-right', - menuAlign: 'tl-tr', - items: [ - new Common.UI.MenuItem({ - caption : me.rowText - }).on('click', function() {if (me.api) me.api.selectRow()}), - new Common.UI.MenuItem({ - caption : me.columnText - }).on('click', function() {if (me.api) me.api.selectColumn()}), - new Common.UI.MenuItem({ - caption : me.cellText - }).on('click', function() {if (me.api) me.api.selectCell()}), - new Common.UI.MenuItem({ - caption : me.tableText - }).on('click', function() {if (me.api) me.api.selectTable()}) - ] - }) - }), - { - iconCls: 'menu__icon btn-addcell', - caption : me.insertText, - menu : new Common.UI.Menu({ - cls: 'shifted-right', - menuAlign: 'tl-tr', - style : 'width: 100px', - items : [ - new Common.UI.MenuItem({ - caption: me.insertColumnLeftText - }).on('click', function(item) { - if (me.api) - me.api.addColumnLeft(); - }), - new Common.UI.MenuItem({ - caption: me.insertColumnRightText - }).on('click', function(item) { - if (me.api) - me.api.addColumnRight(); - }), - new Common.UI.MenuItem({ - caption: me.insertRowAboveText - }).on('click', function(item) { - if (me.api) - me.api.addRowAbove(); - }), - new Common.UI.MenuItem({ - caption: me.insertRowBelowText - }).on('click', function(item) { - if (me.api) - me.api.addRowBelow(); - }) - ] - }) - }, - new Common.UI.MenuItem({ - iconCls: 'menu__icon btn-delcell', - caption : me.deleteText, - menu : new Common.UI.Menu({ - cls: 'shifted-right', - menuAlign: 'tl-tr', - items: [ - new Common.UI.MenuItem({ - caption : me.rowText - }).on('click', function() {if (me.api) me.api.remRow()}), - new Common.UI.MenuItem({ - caption : me.columnText - }).on('click', function() {if (me.api) me.api.remColumn()}), - new Common.UI.MenuItem({ - caption : me.tableText - }).on('click', function() {if (me.api) me.api.remTable()}) - ] - }) - }), + me.menuTableSelectText, + me.menuTableInsertText, + me.menuTableDeleteText, { caption: '--' }, - mnuTableMerge, - mnuTableSplit, + me.mnuTableMerge, + me.mnuTableSplit, { caption: '--' }, - menuTableDistRows, - menuTableDistCols, + me.menuTableDistRows, + me.menuTableDistCols, { caption: '--' }, - menuTableCellAlign, + me.menuTableCellAlign, { caption: '--' }, - menuTableAdvanced, + me.menuTableAdvanced, menuHyperlinkSeparator, /** coauthoring begin **/ - menuAddCommentTable, + me.menuAddCommentTable, /** coauthoring end **/ - menuAddHyperlinkTable, + me.menuAddHyperlinkTable, menuHyperlinkTable, { caption: '--' }, - menuAddToLayoutTable + me.menuAddToLayoutTable ] }).on('hide:after', function(menu, e, isFromInputControl) { if (me.suppressEditComplete) { @@ -3576,8 +2109,8 @@ define([ restoreHeightAndTop: true, initMenu: function(value){ if (me.api) { - mnuUnGroupImg.setDisabled(!me.api.canUnGroup()); - mnuGroupImg.setDisabled(!me.api.canGroup()); + me.mnuUnGroupImg.setDisabled(!me.api.canUnGroup()); + me.mnuGroupImg.setDisabled(!me.api.canGroup()); } var isimage = (_.isUndefined(value.shapeProps) || value.shapeProps.value.get_FromImage()) && _.isUndefined(value.chartProps), @@ -3588,86 +2121,86 @@ define([ pluginGuid = (value.imgProps) ? value.imgProps.value.asc_getPluginGuid() : null, inSmartartInternal = value.shapeProps && value.shapeProps.value.get_FromSmartArtInternal(); - mnuArrangeFront.setDisabled(inSmartartInternal); - mnuArrangeBack.setDisabled(inSmartartInternal); - mnuArrangeForward.setDisabled(inSmartartInternal); - mnuArrangeBackward.setDisabled(inSmartartInternal); + me.mnuArrangeFront.setDisabled(inSmartartInternal); + me.mnuArrangeBack.setDisabled(inSmartartInternal); + me.mnuArrangeForward.setDisabled(inSmartartInternal); + me.mnuArrangeBackward.setDisabled(inSmartartInternal); - menuImgShapeRotate.setVisible(_.isUndefined(value.chartProps) && (pluginGuid===null || pluginGuid===undefined)); - if (menuImgShapeRotate.isVisible()) { - menuImgShapeRotate.setDisabled(disabled || (value.shapeProps && value.shapeProps.value.get_FromSmartArt())); - menuImgShapeRotate.menu.items[3].setDisabled(inSmartartInternal); - menuImgShapeRotate.menu.items[4].setDisabled(inSmartartInternal); + me.menuImgShapeRotate.setVisible(_.isUndefined(value.chartProps) && (pluginGuid===null || pluginGuid===undefined)); + if (me.menuImgShapeRotate.isVisible()) { + me.menuImgShapeRotate.setDisabled(disabled || (value.shapeProps && value.shapeProps.value.get_FromSmartArt())); + me.menuImgShapeRotate.menu.items[3].setDisabled(inSmartartInternal); + me.menuImgShapeRotate.menu.items[4].setDisabled(inSmartartInternal); } // image properties - menuImgOriginalSize.setVisible(isimage); - if (menuImgOriginalSize.isVisible()) - menuImgOriginalSize.setDisabled(disabled || _.isNull(value.imgProps.value.get_ImageUrl()) || _.isUndefined(value.imgProps.value.get_ImageUrl())); + me.menuImgOriginalSize.setVisible(isimage); + if (me.menuImgOriginalSize.isVisible()) + me.menuImgOriginalSize.setDisabled(disabled || _.isNull(value.imgProps.value.get_ImageUrl()) || _.isUndefined(value.imgProps.value.get_ImageUrl())); - menuImgReplace.setVisible(isimage && (pluginGuid===null || pluginGuid===undefined)); - if (menuImgReplace.isVisible()) - menuImgReplace.setDisabled(disabled || pluginGuid===null); - menuImgReplace.menu.items[2].setVisible(me.mode.canRequestInsertImage || me.mode.fileChoiceUrl && me.mode.fileChoiceUrl.indexOf("{documentType}")>-1); + me.menuImgReplace.setVisible(isimage && (pluginGuid===null || pluginGuid===undefined)); + if (me.menuImgReplace.isVisible()) + me.menuImgReplace.setDisabled(disabled || pluginGuid===null); + me.menuImgReplace.menu.items[2].setVisible(me.mode.canRequestInsertImage || me.mode.fileChoiceUrl && me.mode.fileChoiceUrl.indexOf("{documentType}")>-1); me.menuImgCrop.setVisible(me.api.asc_canEditCrop()); if (me.menuImgCrop.isVisible()) me.menuImgCrop.setDisabled(disabled); var canEditPoints = me.api && me.api.asc_canEditGeometry(); - menuImgEditPoints.setVisible(canEditPoints); + me.menuImgEditPoints.setVisible(canEditPoints); menuImgEditPointsSeparator.setVisible(canEditPoints); - canEditPoints && menuImgEditPoints.setDisabled(disabled); + canEditPoints && me.menuImgEditPoints.setDisabled(disabled); - menuImageAdvanced.setVisible(isimage); - menuShapeAdvanced.setVisible(_.isUndefined(value.imgProps) && _.isUndefined(value.chartProps)); - menuChartEdit.setVisible(_.isUndefined(value.imgProps) && !_.isUndefined(value.chartProps) && (_.isUndefined(value.shapeProps) || value.shapeProps.isChart)); - menuImgShapeSeparator.setVisible(menuImageAdvanced.isVisible() || menuShapeAdvanced.isVisible() || menuChartEdit.isVisible()); + me.menuImageAdvanced.setVisible(isimage); + me.menuShapeAdvanced.setVisible(_.isUndefined(value.imgProps) && _.isUndefined(value.chartProps)); + me.menuChartEdit.setVisible(_.isUndefined(value.imgProps) && !_.isUndefined(value.chartProps) && (_.isUndefined(value.shapeProps) || value.shapeProps.isChart)); + menuImgShapeSeparator.setVisible(me.menuImageAdvanced.isVisible() || me.menuShapeAdvanced.isVisible() || me.menuChartEdit.isVisible()); /** coauthoring begin **/ - menuAddCommentImg.setVisible(me.api.can_AddQuotedComment()!==false && me.mode.canCoAuthoring && me.mode.canComments); - menuCommentSeparatorImg.setVisible(menuAddCommentImg.isVisible()); - menuAddCommentImg.setDisabled(disabled); + me.menuAddCommentImg.setVisible(me.api.can_AddQuotedComment()!==false && me.mode.canCoAuthoring && me.mode.canComments); + menuCommentSeparatorImg.setVisible(me.menuAddCommentImg.isVisible()); + me.menuAddCommentImg.setDisabled(disabled); /** coauthoring end **/ - menuImgShapeAlign.setDisabled(disabled); + me.menuImgShapeAlign.setDisabled(disabled); if (!disabled) { var objcount = me.api.asc_getSelectedDrawingObjectsCount(), slide_checked = Common.Utils.InternalSettings.get("pe-align-to-slide") || false; - menuImgShapeAlign.menu.items[7].setDisabled(objcount==2 && !slide_checked); - menuImgShapeAlign.menu.items[8].setDisabled(objcount==2 && !slide_checked); + me.menuImgShapeAlign.menu.items[7].setDisabled(objcount==2 && !slide_checked); + me.menuImgShapeAlign.menu.items[8].setDisabled(objcount==2 && !slide_checked); } - menuImageAdvanced.setDisabled(disabled); - menuShapeAdvanced.setDisabled(disabled); - if (menuChartEdit.isVisible()) - menuChartEdit.setDisabled(disabled); + me.menuImageAdvanced.setDisabled(disabled); + me.menuShapeAdvanced.setDisabled(disabled); + if (me.menuChartEdit.isVisible()) + me.menuChartEdit.setDisabled(disabled); - menuImgCut.setDisabled(disabled); - menuImgPaste.setDisabled(disabled); + me.menuImgCut.setDisabled(disabled); + me.menuImgPaste.setDisabled(disabled); menuImgShapeArrange.setDisabled(disabled); - menuAddToLayoutImg.setDisabled(disabled); + me.menuAddToLayoutImg.setDisabled(disabled); }, items: [ - menuImgCut, - menuImgCopy, - menuImgPaste, + me.menuImgCut, + me.menuImgCopy, + me.menuImgPaste, { caption: '--' }, - menuImgEditPoints, + me.menuImgEditPoints, menuImgEditPointsSeparator, menuImgShapeArrange, - menuImgShapeAlign, - menuImgShapeRotate, + me.menuImgShapeAlign, + me.menuImgShapeRotate, menuImgShapeSeparator, me.menuImgCrop, - menuImgOriginalSize, - menuImgReplace, - menuImageAdvanced, - menuShapeAdvanced - ,menuChartEdit + me.menuImgOriginalSize, + me.menuImgReplace, + me.menuImageAdvanced, + me.menuShapeAdvanced + ,me.menuChartEdit /** coauthoring begin **/ ,menuCommentSeparatorImg, - menuAddCommentImg, + me.menuAddCommentImg, /** coauthoring end **/ { caption: '--' }, - menuAddToLayoutImg + me.menuAddToLayoutImg ] }).on('hide:after', function(menu, e, isFromInputControl) { if (me.suppressEditComplete) { @@ -3692,6 +2225,8 @@ define([ title : me.textPrevPage + Common.Utils.String.platformKey('PgUp'), placement : 'top-right' }); + + this.fireEvent('createdelayedelements', [this, 'edit']); }, setLanguages: function(langs){ @@ -3711,26 +2246,6 @@ define([ }); me.langParaMenu.menu.resetItems(arrPara); me.langTableMenu.menu.resetItems(arrTable); - - me.langParaMenu.menu.on('item:click', function(menu, item){ - if (me.api){ - if (!_.isUndefined(item.langid)) - me.api.put_TextPrLang(item.langid); - - me._currLang.paraid = item.langid; - me.fireEvent('editcomplete', me); - } - }); - - me.langTableMenu.menu.on('item:click', function(menu, item, e){ - if (me.api){ - if (!_.isUndefined(item.langid)) - me.api.put_TextPrLang(item.langid); - - me._currLang.tableid = item.langid; - me.fireEvent('editcomplete', me); - } - }); } }, @@ -3738,165 +2253,6 @@ define([ this._isDisabled = state; }, - onInsertImage: function(placeholder, obj, x, y) { - if (this.api) - (placeholder) ? this.api.asc_addImage(obj) : this.api.ChangeImageFromFile(); - this.fireEvent('editcomplete', this); - }, - - onInsertImageUrl: function(placeholder, obj, x, y) { - var me = this; - (new Common.Views.ImageFromUrlDialog({ - handler: function(result, value) { - if (result == 'ok') { - if (me.api) { - var checkUrl = value.replace(/ /g, ''); - if (!_.isEmpty(checkUrl)) { - if (placeholder) - me.api.AddImageUrl([checkUrl], undefined, undefined, obj); - else { - var props = new Asc.asc_CImgProperty(); - props.put_ImageUrl(checkUrl); - me.api.ImgApply(props, obj); - } - } - } - } - me.fireEvent('editcomplete', me); - } - })).show(); - }, - - onClickPlaceholderChart: function(obj, x, y) { - if (!this.api) return; - - this._state.placeholderObj = obj; - var menu = this.placeholderMenuChart, - menuContainer = menu ? this.cmpEl.find(Common.Utils.String.format('#menu-container-{0}', menu.id)) : null, - me = this; - this._fromShowPlaceholder = true; - Common.UI.Menu.Manager.hideAll(); - - if (!menu) { - this.placeholderMenuChart = menu = new Common.UI.Menu({ - style: 'width: 364px;padding-top: 12px;', - items: [ - {template: _.template('')} - ] - }); - // Prepare menu container - menuContainer = $(Common.Utils.String.format('', menu.id)); - this.cmpEl.append(menuContainer); - menu.render(menuContainer); - menu.cmpEl.attr({tabindex: "-1"}); - menu.on('hide:after', function(){ - if (!me._fromShowPlaceholder) - me.api.asc_uncheckPlaceholders(); - }); - - var picker = new Common.UI.DataView({ - el: $('#id-placeholder-menu-chart'), - parentMenu: menu, - showLast: false, - // restoreHeight: 421, - groups: new Common.UI.DataViewGroupStore(Common.define.chartData.getChartGroupData()), - store: new Common.UI.DataViewStore(Common.define.chartData.getChartData()), - itemTemplate: _.template('
    \">
    ') - }); - picker.on('item:click', function (picker, item, record, e) { - me.editChartClick(record.get('type'), me._state.placeholderObj); - }); - } - menuContainer.css({left: x, top : y}); - menuContainer.attr('data-value', 'prevent-canvas-click'); - this._preventClick = true; - menu.show(); - - menu.alignPosition(); - _.delay(function() { - menu.cmpEl.find('.dataview').focus(); - }, 10); - this._fromShowPlaceholder = false; - }, - - onClickPlaceholderTable: function(obj, x, y) { - if (!this.api) return; - - this._state.placeholderObj = obj; - var menu = this.placeholderMenuTable, - menuContainer = menu ? this.cmpEl.find(Common.Utils.String.format('#menu-container-{0}', menu.id)) : null, - me = this; - this._fromShowPlaceholder = true; - Common.UI.Menu.Manager.hideAll(); - - if (!menu) { - this.placeholderMenuTable = menu = new Common.UI.Menu({ - cls: 'shifted-left', - items: [ - {template: _.template('
    ')}, - {caption: me.mniCustomTable, value: 'custom'} - ] - }); - // Prepare menu container - menuContainer = $(Common.Utils.String.format('', menu.id)); - this.cmpEl.append(menuContainer); - menu.render(menuContainer); - menu.cmpEl.attr({tabindex: "-1"}); - menu.on('hide:after', function(){ - if (!me._fromShowPlaceholder) - me.api.asc_uncheckPlaceholders(); - }); - - var picker = new Common.UI.DimensionPicker({ - el: $('#id-placeholder-menu-tablepicker'), - minRows: 8, - minColumns: 10, - maxRows: 8, - maxColumns: 10 - }); - picker.on('select', function(picker, columns, rows){ - me.api.put_Table(columns, rows, me._state.placeholderObj); - me.fireEvent('editcomplete', me); - }); - menu.on('item:click', function(menu, item, e){ - if (item.value === 'custom') { - (new Common.Views.InsertTableDialog({ - handler: function(result, value) { - if (result == 'ok') - me.api.put_Table(value.columns, value.rows, me._state.placeholderObj); - me.fireEvent('editcomplete', me); - } - })).show(); - } - }); - } - menuContainer.css({left: x, top : y}); - menuContainer.attr('data-value', 'prevent-canvas-click'); - this._preventClick = true; - menu.show(); - - menu.alignPosition(); - _.delay(function() { - menu.cmpEl.focus(); - }, 10); - this._fromShowPlaceholder = false; - }, - - onHidePlaceholderActions: function() { - this.placeholderMenuChart && this.placeholderMenuChart.hide(); - this.placeholderMenuTable && this.placeholderMenuTable.hide(); - }, - - onClickPlaceholder: function(type, obj, x, y) { - if (!this.api) return; - if (type == AscCommon.PlaceholderButtonType.Video) { - this.api.asc_AddVideo(obj); - } else if (type == AscCommon.PlaceholderButtonType.Audio) { - this.api.asc_AddAudio(obj); - } - this.fireEvent('editcomplete', this); - }, - insertRowAboveText : 'Row Above', insertRowBelowText : 'Row Below', insertColumnLeftText : 'Column Left', diff --git a/apps/presentationeditor/main/app/view/FileMenuPanels.js b/apps/presentationeditor/main/app/view/FileMenuPanels.js index a620192a0..770749a44 100644 --- a/apps/presentationeditor/main/app/view/FileMenuPanels.js +++ b/apps/presentationeditor/main/app/view/FileMenuPanels.js @@ -266,6 +266,9 @@ define([ '', '
    ', '', + '', + '
    ', + '', '', '', @@ -349,6 +352,14 @@ define([ dataHintOffset: 'small' }); + this.chUseAltKey = new Common.UI.CheckBox({ + el: $markup.findById('#fms-chb-use-alt-key'), + labelText: Common.Utils.isMac ? this.txtUseOptionKey : this.txtUseAltKey, + dataHint: '2', + dataHintDirection: 'left', + dataHintOffset: 'small' + }); + this.cmbZoom = new Common.UI.ComboBox({ el : $markup.findById('#fms-cmb-zoom'), style : 'width: 160px;', @@ -616,6 +627,8 @@ define([ this.chInputMode.setValue(Common.Utils.InternalSettings.get("pe-settings-inputmode")); + this.chUseAltKey.setValue(Common.Utils.InternalSettings.get("pe-settings-use-alt-key")); + var value = Common.Utils.InternalSettings.get("pe-settings-zoom"); value = (value!==null) ? parseInt(value) : (this.mode.customization && this.mode.customization.zoom ? parseInt(this.mode.customization.zoom) : -1); var item = this.cmbZoom.store.findWhere({value: value}); @@ -678,6 +691,8 @@ define([ Common.localStorage.setBool("pe-spellcheck-ignore-numbers-words", this.chIgnoreNumbers.isChecked()); } Common.localStorage.setItem("pe-settings-inputmode", this.chInputMode.isChecked() ? 1 : 0); + Common.localStorage.setItem("pe-settings-use-alt-key", this.chUseAltKey.isChecked() ? 1 : 0); + Common.Utils.InternalSettings.set("pe-settings-use-alt-key", Common.localStorage.getBool("pe-settings-use-alt-key")); Common.localStorage.setItem("pe-settings-zoom", this.cmbZoom.getValue()); Common.Utils.InternalSettings.set("pe-settings-zoom", Common.localStorage.getItem("pe-settings-zoom")); /** coauthoring begin **/ @@ -773,6 +788,8 @@ define([ txtCollaboration: 'Collaboration', txtWorkspace: 'Workspace', txtHieroglyphs: 'Hieroglyphs', + txtUseAltKey: 'Use Alt key to navigate the user interface using the keyboard', + txtUseOptionKey: 'Use Option key to navigate the user interface using the keyboard', txtFastTip: 'Real-time co-editing. All changes are saved automatically', txtStrictTip: 'Use the \'Save\' button to sync the changes you and others make', strIgnoreWordsInUPPERCASE: 'Ignore words in UPPERCASE', diff --git a/apps/presentationeditor/main/app/view/ShapeSettingsAdvanced.js b/apps/presentationeditor/main/app/view/ShapeSettingsAdvanced.js index 345c0fa80..d7eda7afd 100644 --- a/apps/presentationeditor/main/app/view/ShapeSettingsAdvanced.js +++ b/apps/presentationeditor/main/app/view/ShapeSettingsAdvanced.js @@ -629,6 +629,7 @@ define([ 'text!presentationeditor/main/app/template/ShapeSettingsAdvanced.tem this.radioFit.setDisabled(true); this.chFlipHor.setDisabled(true); this.chFlipVert.setDisabled(true); + this.btnsCategory[0].setDisabled(true); } this.spnWidth.setValue(Common.Utils.Metric.fnRecalcFromMM(props.asc_getWidth()).toFixed(2), true); @@ -638,7 +639,8 @@ define([ 'text!presentationeditor/main/app/template/ShapeSettingsAdvanced.tem this._nRatio = props.asc_getWidth()/props.asc_getHeight(); var value = props.asc_getLockAspect(); - this.btnRatio.toggle(value); + this.btnRatio.toggle(value || props.get_FromSmartArt()); + this.btnRatio.setDisabled(!!props.get_FromSmartArt()); // can resize smart art only proportionately this.cmbFromX.setValue('left'); this.cmbFromY.setValue('left'); diff --git a/apps/presentationeditor/main/app/view/Toolbar.js b/apps/presentationeditor/main/app/view/Toolbar.js index 330f02d09..42006a9c2 100644 --- a/apps/presentationeditor/main/app/view/Toolbar.js +++ b/apps/presentationeditor/main/app/view/Toolbar.js @@ -414,7 +414,7 @@ define([ menu: new Common.UI.Menu({ style: 'min-width: 100px;', items: [ - {template: _.template('
    ')}, + {template: _.template('
    ')}, {caption: '--'}, me.mnuHighlightTransparent = new Common.UI.MenuItem({ caption: me.strMenuNoFill, @@ -1458,6 +1458,17 @@ define([ // set dataviews + this._markersArr = [ + {type: Asc.asc_PreviewBulletType.text, text: 'None'}, + {type: Asc.asc_PreviewBulletType.char, char: String.fromCharCode(0x00B7), specialFont: 'Symbol'}, + {type: Asc.asc_PreviewBulletType.char, char: 'o', specialFont: 'Courier New'}, + {type: Asc.asc_PreviewBulletType.char, char: String.fromCharCode(0x00A7), specialFont: 'Wingdings'}, + {type: Asc.asc_PreviewBulletType.char, char: String.fromCharCode(0x0076), specialFont: 'Wingdings'}, + {type: Asc.asc_PreviewBulletType.char, char: String.fromCharCode(0x00D8), specialFont: 'Wingdings'}, + {type: Asc.asc_PreviewBulletType.char, char: String.fromCharCode(0x00FC), specialFont: 'Wingdings'}, + {type: Asc.asc_PreviewBulletType.char, char: String.fromCharCode(0x00A8), specialFont: 'Symbol'}, + {type: Asc.asc_PreviewBulletType.char, char: String.fromCharCode(0x2013), specialFont: 'Arial'} + ]; var _conf = this.mnuMarkersPicker.conf; this.mnuMarkersPicker = new Common.UI.DataView({ el: $('#id-toolbar-menu-markers'), @@ -1467,15 +1478,15 @@ define([ allowScrollbar: false, delayRenderTips: true, store: new Common.UI.DataViewStore([ - {id: 'id-markers-' + Common.UI.getId(), data: {type: 0, subtype: -1}, skipRenderOnChange: true, tip: this.tipNone}, - {id: 'id-markers-' + Common.UI.getId(), data: {type: 0, subtype: 1}, skipRenderOnChange: true, tip: this.tipMarkersFRound}, - {id: 'id-markers-' + Common.UI.getId(), data: {type: 0, subtype: 2}, skipRenderOnChange: true, tip: this.tipMarkersHRound}, - {id: 'id-markers-' + Common.UI.getId(), data: {type: 0, subtype: 3}, skipRenderOnChange: true, tip: this.tipMarkersFSquare}, - {id: 'id-markers-' + Common.UI.getId(), data: {type: 0, subtype: 4}, skipRenderOnChange: true, tip: this.tipMarkersStar}, - {id: 'id-markers-' + Common.UI.getId(), data: {type: 0, subtype: 5}, skipRenderOnChange: true, tip: this.tipMarkersArrow}, - {id: 'id-markers-' + Common.UI.getId(), data: {type: 0, subtype: 6}, skipRenderOnChange: true, tip: this.tipMarkersCheckmark}, - {id: 'id-markers-' + Common.UI.getId(), data: {type: 0, subtype: 7}, skipRenderOnChange: true, tip: this.tipMarkersFRhombus}, - {id: 'id-markers-' + Common.UI.getId(), data: {type: 0, subtype: 8}, skipRenderOnChange: true, tip: this.tipMarkersDash} + {id: 'id-markers-' + Common.UI.getId(), data: {type: 0, subtype: -1},drawdata: this._markersArr[0], skipRenderOnChange: true, tip: this.tipNone}, + {id: 'id-markers-' + Common.UI.getId(), data: {type: 0, subtype: 1}, drawdata: this._markersArr[1], skipRenderOnChange: true, tip: this.tipMarkersFRound}, + {id: 'id-markers-' + Common.UI.getId(), data: {type: 0, subtype: 2}, drawdata: this._markersArr[2], skipRenderOnChange: true, tip: this.tipMarkersHRound}, + {id: 'id-markers-' + Common.UI.getId(), data: {type: 0, subtype: 3}, drawdata: this._markersArr[3], skipRenderOnChange: true, tip: this.tipMarkersFSquare}, + {id: 'id-markers-' + Common.UI.getId(), data: {type: 0, subtype: 4}, drawdata: this._markersArr[4], skipRenderOnChange: true, tip: this.tipMarkersStar}, + {id: 'id-markers-' + Common.UI.getId(), data: {type: 0, subtype: 5}, drawdata: this._markersArr[5], skipRenderOnChange: true, tip: this.tipMarkersArrow}, + {id: 'id-markers-' + Common.UI.getId(), data: {type: 0, subtype: 6}, drawdata: this._markersArr[6], skipRenderOnChange: true, tip: this.tipMarkersCheckmark}, + {id: 'id-markers-' + Common.UI.getId(), data: {type: 0, subtype: 7}, drawdata: this._markersArr[7], skipRenderOnChange: true, tip: this.tipMarkersFRhombus}, + {id: 'id-markers-' + Common.UI.getId(), data: {type: 0, subtype: 8}, drawdata: this._markersArr[8], skipRenderOnChange: true, tip: this.tipMarkersDash} ]), itemTemplate: _.template('
    ') }); @@ -1491,14 +1502,14 @@ define([ allowScrollbar: false, delayRenderTips: true, store: new Common.UI.DataViewStore([ - {id: 'id-numbers-' + Common.UI.getId(), data: {type: 1, subtype: -1}, skipRenderOnChange: true, tip: this.tipNone}, - {id: 'id-numbers-' + Common.UI.getId(), data: {type: 1, subtype: 4}, skipRenderOnChange: true, tip: this.tipNumCapitalLetters}, - {id: 'id-numbers-' + Common.UI.getId(), data: {type: 1, subtype: 5}, skipRenderOnChange: true, tip: this.tipNumLettersParentheses}, - {id: 'id-numbers-' + Common.UI.getId(), data: {type: 1, subtype: 6}, skipRenderOnChange: true, tip: this.tipNumLettersPoints}, - {id: 'id-numbers-' + Common.UI.getId(), data: {type: 1, subtype: 1}, skipRenderOnChange: true, tip: this.tipNumNumbersPoint}, - {id: 'id-numbers-' + Common.UI.getId(), data: {type: 1, subtype: 2}, skipRenderOnChange: true, tip: this.tipNumNumbersParentheses}, - {id: 'id-numbers-' + Common.UI.getId(), data: {type: 1, subtype: 3}, skipRenderOnChange: true, tip: this.tipNumRoman}, - {id: 'id-numbers-' + Common.UI.getId(), data: {type: 1, subtype: 7}, skipRenderOnChange: true, tip: this.tipNumRomanSmall} + {id: 'id-numbers-' + Common.UI.getId(), data: {type: 1, subtype: -1},drawdata: {type: Asc.asc_PreviewBulletType.text, text: 'None'}, skipRenderOnChange: true, tip: this.tipNone}, + {id: 'id-numbers-' + Common.UI.getId(), data: {type: 1, subtype: 4}, drawdata: {type: Asc.asc_PreviewBulletType.number, numberingType: Asc.asc_oAscNumberingLevel.UpperLetterDot_Left}, skipRenderOnChange: true, tip: this.tipNumCapitalLetters}, + {id: 'id-numbers-' + Common.UI.getId(), data: {type: 1, subtype: 5}, drawdata: {type: Asc.asc_PreviewBulletType.number, numberingType: Asc.asc_oAscNumberingLevel.LowerLetterBracket_Left}, skipRenderOnChange: true, tip: this.tipNumLettersParentheses}, + {id: 'id-numbers-' + Common.UI.getId(), data: {type: 1, subtype: 6}, drawdata: {type: Asc.asc_PreviewBulletType.number, numberingType: Asc.asc_oAscNumberingLevel.LowerLetterDot_Left}, skipRenderOnChange: true, tip: this.tipNumLettersPoints}, + {id: 'id-numbers-' + Common.UI.getId(), data: {type: 1, subtype: 1}, drawdata: {type: Asc.asc_PreviewBulletType.number, numberingType: Asc.asc_oAscNumberingLevel.DecimalDot_Right}, skipRenderOnChange: true, tip: this.tipNumNumbersPoint}, + {id: 'id-numbers-' + Common.UI.getId(), data: {type: 1, subtype: 2}, drawdata: {type: Asc.asc_PreviewBulletType.number, numberingType: Asc.asc_oAscNumberingLevel.DecimalBracket_Right}, skipRenderOnChange: true, tip: this.tipNumNumbersParentheses}, + {id: 'id-numbers-' + Common.UI.getId(), data: {type: 1, subtype: 3}, drawdata: {type: Asc.asc_PreviewBulletType.number, numberingType: Asc.asc_oAscNumberingLevel.UpperRomanDot_Right}, skipRenderOnChange: true, tip: this.tipNumRoman}, + {id: 'id-numbers-' + Common.UI.getId(), data: {type: 1, subtype: 7}, drawdata: {type: Asc.asc_PreviewBulletType.number, numberingType: Asc.asc_oAscNumberingLevel.LowerRomanDot_Right}, skipRenderOnChange: true, tip: this.tipNumRomanSmall} ]), itemTemplate: _.template('
    ') }); @@ -1535,15 +1546,19 @@ define([ if (this.btnHighlightColor.cmpEl) { this.btnHighlightColor.currentColor = 'FFFF00'; this.btnHighlightColor.setColor(this.btnHighlightColor.currentColor); - this.mnuHighlightColorPicker = new Common.UI.ColorPalette({ + this.mnuHighlightColorPicker = new Common.UI.ThemeColorPalette({ el: $('#id-toolbar-menu-highlight'), colors: [ 'FFFF00', '00FF00', '00FFFF', 'FF00FF', '0000FF', 'FF0000', '00008B', '008B8B', '006400', '800080', '8B0000', '808000', 'FFFFFF', 'D3D3D3', 'A9A9A9', '000000' - ] + ], + value: 'FFFF00', + dynamiccolors: 0, + columns: 4, + outerMenu: {menu: this.btnHighlightColor.menu, index: 0, focusOnShow: true} }); - this.mnuHighlightColorPicker.select('FFFF00'); this.btnHighlightColor.setPicker(this.mnuHighlightColorPicker); + this.btnHighlightColor.menu.setInnerMenu([{menu: this.mnuHighlightColorPicker, index: 0}]); } }, diff --git a/apps/presentationeditor/main/app/view/ViewTab.js b/apps/presentationeditor/main/app/view/ViewTab.js index eb85507a4..45ea8deae 100644 --- a/apps/presentationeditor/main/app/view/ViewTab.js +++ b/apps/presentationeditor/main/app/view/ViewTab.js @@ -68,7 +68,7 @@ define([ '
    ' + '' + '
    ' + - '
    ' + + '
    ' + '
    ' + '
    ' + '' + diff --git a/apps/presentationeditor/main/app_dev.js b/apps/presentationeditor/main/app_dev.js index d14b880a3..6662dc02b 100644 --- a/apps/presentationeditor/main/app_dev.js +++ b/apps/presentationeditor/main/app_dev.js @@ -162,6 +162,9 @@ require([ Common.Locale.apply(function(){ require([ + 'common/main/lib/util/LocalStorage', + 'common/main/lib/controller/Themes', + 'common/main/lib/controller/Desktop', 'presentationeditor/main/app/controller/Viewport', 'presentationeditor/main/app/controller/DocumentHolder', 'presentationeditor/main/app/controller/Toolbar', @@ -179,7 +182,6 @@ require([ 'presentationeditor/main/app/view/TextArtSettings', 'presentationeditor/main/app/view/SignatureSettings', 'common/main/lib/util/utils', - 'common/main/lib/util/LocalStorage', 'common/main/lib/controller/Fonts', 'common/main/lib/controller/History' /** coauthoring begin **/ @@ -192,8 +194,6 @@ require([ ,'common/main/lib/controller/ExternalOleEditor' ,'common/main/lib/controller/ReviewChanges' ,'common/main/lib/controller/Protection' - ,'common/main/lib/controller/Themes' - ,'common/main/lib/controller/Desktop' ,'presentationeditor/main/app/controller/Transitions' ,'presentationeditor/main/app/controller/Animation' ], function() { diff --git a/apps/presentationeditor/main/index.html b/apps/presentationeditor/main/index.html index ee876897f..9011ca82b 100644 --- a/apps/presentationeditor/main/index.html +++ b/apps/presentationeditor/main/index.html @@ -270,8 +270,10 @@ window.frameEditorId = params["frameEditorId"]; window.parentOrigin = params["parentOrigin"]; - if(/MSIE \d|Trident.*rv:/.test(navigator.userAgent)) + if(/MSIE \d|Trident.*rv:/.test(navigator.userAgent)) { document.write(' diff --git a/apps/presentationeditor/main/locale/ca.json b/apps/presentationeditor/main/locale/ca.json index 358759a01..fc6c116aa 100644 --- a/apps/presentationeditor/main/locale/ca.json +++ b/apps/presentationeditor/main/locale/ca.json @@ -1303,6 +1303,7 @@ "PE.Views.Animation.strRewind": "Rebobina", "PE.Views.Animation.strStart": "Inici", "PE.Views.Animation.strTrigger": "Disparador", + "PE.Views.Animation.textAutoPreview": "Visualització prèvia automàtica", "PE.Views.Animation.textMoreEffects": "Mostra més efectes", "PE.Views.Animation.textMoveEarlier": "Abans", "PE.Views.Animation.textMoveLater": "Després", diff --git a/apps/presentationeditor/main/locale/cs.json b/apps/presentationeditor/main/locale/cs.json index 69aa2349f..68f172fc5 100644 --- a/apps/presentationeditor/main/locale/cs.json +++ b/apps/presentationeditor/main/locale/cs.json @@ -1303,6 +1303,7 @@ "PE.Views.Animation.strRewind": "Vrátit na začátek", "PE.Views.Animation.strStart": "Spustit", "PE.Views.Animation.strTrigger": "Spouštěč", + "PE.Views.Animation.textAutoPreview": "Automatický náhled", "PE.Views.Animation.textMoreEffects": "Zobrazit další efekty", "PE.Views.Animation.textMoveEarlier": "Přesunout dřívější", "PE.Views.Animation.textMoveLater": "Přesunout pozdější", diff --git a/apps/presentationeditor/main/locale/de.json b/apps/presentationeditor/main/locale/de.json index 7ec1d6b25..bdedaf5eb 100644 --- a/apps/presentationeditor/main/locale/de.json +++ b/apps/presentationeditor/main/locale/de.json @@ -1288,6 +1288,7 @@ "PE.Views.Animation.strRewind": "Zurückspulen", "PE.Views.Animation.strStart": "Start", "PE.Views.Animation.strTrigger": "Trigger", + "PE.Views.Animation.textAutoPreview": "AutoVorschau", "PE.Views.Animation.textMoreEffects": "Mehr Effekte anzeigen", "PE.Views.Animation.textMoveEarlier": "Früher", "PE.Views.Animation.textMoveLater": "Später", diff --git a/apps/presentationeditor/main/locale/el.json b/apps/presentationeditor/main/locale/el.json index 2b03aa53f..3c94702bf 100644 --- a/apps/presentationeditor/main/locale/el.json +++ b/apps/presentationeditor/main/locale/el.json @@ -1291,6 +1291,7 @@ "PE.Views.Animation.strRewind": "Επανάληψη", "PE.Views.Animation.strStart": "Εκκίνηση", "PE.Views.Animation.strTrigger": "Ενεργοποίηση", + "PE.Views.Animation.textAutoPreview": "Αυτόματη προεπισκόπηση", "PE.Views.Animation.textMoreEffects": "Εμφάνιση Περισσότερων Εφφέ", "PE.Views.Animation.textMoveEarlier": "Μετακίνησε Νωρίτερα", "PE.Views.Animation.textMoveLater": "Μετακίνησε Αργότερα", diff --git a/apps/presentationeditor/main/locale/en.json b/apps/presentationeditor/main/locale/en.json index b979b7167..66d8d0598 100644 --- a/apps/presentationeditor/main/locale/en.json +++ b/apps/presentationeditor/main/locale/en.json @@ -270,6 +270,7 @@ "Common.UI.SearchDialog.txtBtnReplaceAll": "Replace All", "Common.UI.SynchronizeTip.textDontShow": "Don't show this message again", "Common.UI.SynchronizeTip.textSynchronize": "The document has been changed by another user.
    Please click to save your changes and reload the updates.", + "Common.UI.ThemeColorPalette.textRecentColors": "Recent Colors", "Common.UI.ThemeColorPalette.textStandartColors": "Standard Colors", "Common.UI.ThemeColorPalette.textThemeColors": "Theme Colors", "Common.UI.Themes.txtThemeClassicLight": "Classic Light", @@ -679,6 +680,7 @@ "PE.Controllers.Main.textPaidFeature": "Paid feature", "PE.Controllers.Main.textReconnect": "Connection is restored", "PE.Controllers.Main.textRemember": "Remember my choice for all files", + "PE.Controllers.Main.textRememberMacros": "Remember my choice for all macros", "PE.Controllers.Main.textRenameError": "User name must not be empty.", "PE.Controllers.Main.textRenameLabel": "Enter a name to be used for collaboration", "PE.Controllers.Main.textShape": "Shape", @@ -959,6 +961,7 @@ "PE.Controllers.Main.warnNoLicense": "You've reached the limit for simultaneous connections to %1 editors. This document will be opened for viewing only.
    Contact %1 sales team for personal upgrade terms.", "PE.Controllers.Main.warnNoLicenseUsers": "You've reached the user limit for %1 editors. Contact %1 sales team for personal upgrade terms.", "PE.Controllers.Main.warnProcessRightsChange": "You have been denied the right to edit the file.", + "PE.Controllers.Main.textRequestMacros": "A macro makes a request to URL. Do you want to allow the request to the %1?", "PE.Controllers.Statusbar.textDisconnect": "Connection is lost
    Trying to connect. Please check connection settings.", "PE.Controllers.Statusbar.zoomText": "Zoom {0}%", "PE.Controllers.Toolbar.confirmAddFontName": "The font you are going to save is not available on the current device.
    The text style will be displayed using one of the system fonts, the saved font will be used when it is available.
    Do you want to continue?", @@ -1308,6 +1311,7 @@ "PE.Views.Animation.strRewind": "Rewind", "PE.Views.Animation.strStart": "Start", "PE.Views.Animation.strTrigger": "Trigger", + "PE.Views.Animation.textAutoPreview": "AutoPreview", "PE.Views.Animation.textMoreEffects": "Show More Effects", "PE.Views.Animation.textMoveEarlier": "Move Earlier", "PE.Views.Animation.textMoveLater": "Move Later", @@ -1643,6 +1647,8 @@ "PE.Views.FileMenuPanels.Settings.txtFitSlide": "Fit to Slide", "PE.Views.FileMenuPanels.Settings.txtFitWidth": "Fit to Width", "PE.Views.FileMenuPanels.Settings.txtHieroglyphs": "Hieroglyphs", + "PE.Views.FileMenuPanels.Settings.txtUseAltKey": "Use Alt key to navigate the user interface using the keyboard", + "PE.Views.FileMenuPanels.Settings.txtUseOptionKey": "Use Option key to navigate the user interface using the keyboard", "PE.Views.FileMenuPanels.Settings.txtInch": "Inch", "PE.Views.FileMenuPanels.Settings.txtInput": "Alternate Input", "PE.Views.FileMenuPanels.Settings.txtLast": "View Last", diff --git a/apps/presentationeditor/main/locale/es.json b/apps/presentationeditor/main/locale/es.json index ef376c92f..0a3217fcc 100644 --- a/apps/presentationeditor/main/locale/es.json +++ b/apps/presentationeditor/main/locale/es.json @@ -1303,6 +1303,7 @@ "PE.Views.Animation.strRewind": "Rebobinar", "PE.Views.Animation.strStart": "Iniciar", "PE.Views.Animation.strTrigger": "Desencadenador", + "PE.Views.Animation.textAutoPreview": "Vista previa automática", "PE.Views.Animation.textMoreEffects": "Mostrar más efectos", "PE.Views.Animation.textMoveEarlier": "Mover antes", "PE.Views.Animation.textMoveLater": "Mover después", diff --git a/apps/presentationeditor/main/locale/fr.json b/apps/presentationeditor/main/locale/fr.json index 8aaedf8cb..9b4623071 100644 --- a/apps/presentationeditor/main/locale/fr.json +++ b/apps/presentationeditor/main/locale/fr.json @@ -1303,6 +1303,7 @@ "PE.Views.Animation.strRewind": "Rembobiner", "PE.Views.Animation.strStart": "Démarrer", "PE.Views.Animation.strTrigger": "Déclencheur", + "PE.Views.Animation.textAutoPreview": "Aperçu partiel", "PE.Views.Animation.textMoreEffects": "Afficher plus d'effets", "PE.Views.Animation.textMoveEarlier": "Déplacer avant", "PE.Views.Animation.textMoveLater": "Déplacer après", diff --git a/apps/presentationeditor/main/locale/hu.json b/apps/presentationeditor/main/locale/hu.json index 64503a9d3..78bd2b90b 100644 --- a/apps/presentationeditor/main/locale/hu.json +++ b/apps/presentationeditor/main/locale/hu.json @@ -1120,6 +1120,7 @@ "PE.Views.Animation.str20": "20 s (rendkívül lassú)", "PE.Views.Animation.str3": "3 s (lassú)", "PE.Views.Animation.str5": "5 s (nagyon lassú)", + "PE.Views.Animation.textAutoPreview": "AutoElőnézet", "PE.Views.Animation.textNoRepeat": "(nincs)", "PE.Views.Animation.textStartAfterPrevious": "Az előző után", "PE.Views.Animation.txtAddEffect": "Animáció hozzáadása", diff --git a/apps/presentationeditor/main/locale/it.json b/apps/presentationeditor/main/locale/it.json index 774fbcc08..d13bbd772 100644 --- a/apps/presentationeditor/main/locale/it.json +++ b/apps/presentationeditor/main/locale/it.json @@ -1290,6 +1290,7 @@ "PE.Views.Animation.strRewind": "Riavvolgere", "PE.Views.Animation.strStart": "Avvio", "PE.Views.Animation.strTrigger": "Grilletto", + "PE.Views.Animation.textAutoPreview": "Anteprima automatica", "PE.Views.Animation.textMoreEffects": "Mostrare più effetti", "PE.Views.Animation.textMoveEarlier": "Spostare avanti", "PE.Views.Animation.textMoveLater": "Spostare di seguito", diff --git a/apps/presentationeditor/main/locale/ja.json b/apps/presentationeditor/main/locale/ja.json index 4bac24f89..0465d0016 100644 --- a/apps/presentationeditor/main/locale/ja.json +++ b/apps/presentationeditor/main/locale/ja.json @@ -1303,6 +1303,7 @@ "PE.Views.Animation.strRewind": "巻き戻し", "PE.Views.Animation.strStart": "開始", "PE.Views.Animation.strTrigger": "トリガー", + "PE.Views.Animation.textAutoPreview": "オートプレビュー", "PE.Views.Animation.textMoreEffects": "その他の効果", "PE.Views.Animation.textMoveEarlier": "順番を早くする", "PE.Views.Animation.textMoveLater": "順番を遅くする", diff --git a/apps/presentationeditor/main/locale/ko.json b/apps/presentationeditor/main/locale/ko.json index dbd86d1b6..be65671ea 100644 --- a/apps/presentationeditor/main/locale/ko.json +++ b/apps/presentationeditor/main/locale/ko.json @@ -1303,6 +1303,7 @@ "PE.Views.Animation.strRewind": "되감기", "PE.Views.Animation.strStart": "시작", "PE.Views.Animation.strTrigger": "트리거", + "PE.Views.Animation.textAutoPreview": "자동 미리보기", "PE.Views.Animation.textMoreEffects": "더 많은 효과 표시", "PE.Views.Animation.textMoveEarlier": "더 일찍 이동", "PE.Views.Animation.textMoveLater": "나중에 이동", diff --git a/apps/presentationeditor/main/locale/lo.json b/apps/presentationeditor/main/locale/lo.json index 91ec52946..42899c5b1 100644 --- a/apps/presentationeditor/main/locale/lo.json +++ b/apps/presentationeditor/main/locale/lo.json @@ -1591,6 +1591,7 @@ "PE.Views.FileMenuPanels.Settings.strFast": "ໄວ", "PE.Views.FileMenuPanels.Settings.strFontRender": "ຕົວອັກສອນມົວ ບໍ່ເເຈ້ງ", "PE.Views.FileMenuPanels.Settings.strForcesave": "ເພີ່ມເວີຊັນໃສ່ບ່ອນເກັບຂໍ້ມູນ ຫຼັງຈາກຄລິກບັນທຶກ ຫຼື Ctrl+S", + "PE.Views.FileMenuPanels.Settings.strInputMode": "ເປີດກາຟີຣກ", "PE.Views.FileMenuPanels.Settings.strMacrosSettings": "ການຕັ້ງຄ່າ Macros", "PE.Views.FileMenuPanels.Settings.strPaste": "ຕັດ, ສຳເນົາ ແລະ ວາງ", "PE.Views.FileMenuPanels.Settings.strPasteButton": "ສະແດງປຸ່ມເລືອກວາງ ເມື່ອເນື້ອຫາໄດ້ຖືກຄັດຕິດ", diff --git a/apps/presentationeditor/main/locale/pt.json b/apps/presentationeditor/main/locale/pt.json index ba72fbaa6..9dfa47259 100644 --- a/apps/presentationeditor/main/locale/pt.json +++ b/apps/presentationeditor/main/locale/pt.json @@ -1291,6 +1291,7 @@ "PE.Views.Animation.strRewind": "Retroceder", "PE.Views.Animation.strStart": "Iniciar", "PE.Views.Animation.strTrigger": "Acionar", + "PE.Views.Animation.textAutoPreview": "AutoVisualização", "PE.Views.Animation.textMoreEffects": "Mostrar mais efeitos", "PE.Views.Animation.textMoveEarlier": "Mudança Anterior", "PE.Views.Animation.textMoveLater": "Mover-se depois", diff --git a/apps/presentationeditor/main/locale/ro.json b/apps/presentationeditor/main/locale/ro.json index 812cc89cf..76d52d52a 100644 --- a/apps/presentationeditor/main/locale/ro.json +++ b/apps/presentationeditor/main/locale/ro.json @@ -1303,6 +1303,7 @@ "PE.Views.Animation.strRewind": "Derulare înapoi", "PE.Views.Animation.strStart": "Pornire", "PE.Views.Animation.strTrigger": "Trigger", + "PE.Views.Animation.textAutoPreview": "Examinare automată", "PE.Views.Animation.textMoreEffects": "Mai multe efecte", "PE.Views.Animation.textMoveEarlier": "Mutare mai devreme", "PE.Views.Animation.textMoveLater": "Mutare mai târziu", diff --git a/apps/presentationeditor/main/locale/ru.json b/apps/presentationeditor/main/locale/ru.json index 2755ba2e8..0a0f5fe23 100644 --- a/apps/presentationeditor/main/locale/ru.json +++ b/apps/presentationeditor/main/locale/ru.json @@ -1303,6 +1303,7 @@ "PE.Views.Animation.strRewind": "Перемотка назад", "PE.Views.Animation.strStart": "Запуск", "PE.Views.Animation.strTrigger": "Триггер", + "PE.Views.Animation.textAutoPreview": "Автопросмотр", "PE.Views.Animation.textMoreEffects": "Показать больше эффектов", "PE.Views.Animation.textMoveEarlier": "Переместить назад", "PE.Views.Animation.textMoveLater": "Переместить вперед", diff --git a/apps/presentationeditor/main/locale/zh.json b/apps/presentationeditor/main/locale/zh.json index 1776cc865..06244e0d0 100644 --- a/apps/presentationeditor/main/locale/zh.json +++ b/apps/presentationeditor/main/locale/zh.json @@ -1303,6 +1303,7 @@ "PE.Views.Animation.strRewind": "后退", "PE.Views.Animation.strStart": "开始", "PE.Views.Animation.strTrigger": "触发器", + "PE.Views.Animation.textAutoPreview": "自动预览", "PE.Views.Animation.textMoreEffects": "显示其他效果", "PE.Views.Animation.textMoveEarlier": "向前移动", "PE.Views.Animation.textMoveLater": "向后移动", diff --git a/apps/presentationeditor/main/resources/less/leftmenu.less b/apps/presentationeditor/main/resources/less/leftmenu.less index c17b701a1..01adcd9e7 100644 --- a/apps/presentationeditor/main/resources/less/leftmenu.less +++ b/apps/presentationeditor/main/resources/less/leftmenu.less @@ -41,34 +41,34 @@ .svg-format- { &pptx { - background: ~"url(../../../apps/common/main/resources/img/doc-formats/pptx.svg) no-repeat center"; + background: ~"url('@{common-image-const-path}/doc-formats/pptx.svg') no-repeat center"; } &pdf { - background: ~"url(../../../apps/common/main/resources/img/doc-formats/pdf.svg) no-repeat center"; + background: ~"url('@{common-image-const-path}/doc-formats/pdf.svg') no-repeat center"; } &odp { - background: ~"url(../../../apps/common/main/resources/img/doc-formats/odp.svg) no-repeat center"; + background: ~"url('@{common-image-const-path}/doc-formats/odp.svg') no-repeat center"; } &potx { - background: ~"url(../../../apps/common/main/resources/img/doc-formats/potx.svg) no-repeat center"; + background: ~"url('@{common-image-const-path}/doc-formats/potx.svg') no-repeat center"; } &pdfa { - background: ~"url(../../../apps/common/main/resources/img/doc-formats/pdfa.svg) no-repeat center"; + background: ~"url('@{common-image-const-path}/doc-formats/pdfa.svg') no-repeat center"; } &otp { - background: ~"url(../../../apps/common/main/resources/img/doc-formats/otp.svg) no-repeat center"; + background: ~"url('@{common-image-const-path}/doc-formats/otp.svg') no-repeat center"; } &ppsx { - background: ~"url(../../../apps/common/main/resources/img/doc-formats/ppsx.svg) no-repeat center"; + background: ~"url('@{common-image-const-path}/doc-formats/ppsx.svg') no-repeat center"; } &png { - background: ~"url(../../../apps/common/main/resources/img/doc-formats/png.svg) no-repeat center"; + background: ~"url('@{common-image-const-path}/doc-formats/png.svg') no-repeat center"; } &jpg { - background: ~"url(../../../apps/common/main/resources/img/doc-formats/jpg.svg) no-repeat center"; + background: ~"url('@{common-image-const-path}/doc-formats/jpg.svg') no-repeat center"; } &pptm { - background: ~"url(../../../apps/common/main/resources/img/doc-formats/pptm.svg) no-repeat center"; + background: ~"url('@{common-image-const-path}/doc-formats/pptm.svg') no-repeat center"; } } @@ -89,10 +89,10 @@ cursor: pointer; .svg-format-blank { - background: ~"url(../../../apps/common/main/resources/img/doc-formats/blank.svg) no-repeat center" ; + background: ~"url(@{common-image-const-path}/doc-formats/blank.svg) no-repeat center" ; } .svg-file-template{ - background: ~"url(resources/img/file-template.svg) no-repeat center" ; + background: ~"url(@{app-image-const-path}/file-template.svg) no-repeat center" ; } div { @@ -123,6 +123,7 @@ background-color: @highlight-button-pressed; > a { + color: @text-normal-pressed-ie; color: @text-normal-pressed; } } @@ -361,7 +362,7 @@ width: 100%; height: 100%; .svg-file-recent { - background: ~"url(resources/img/recent-file.svg) no-repeat top"; + background: ~"url(@{app-image-const-path}/recent-file.svg) no-repeat top"; } } } diff --git a/apps/presentationeditor/mobile/locale/az.json b/apps/presentationeditor/mobile/locale/az.json index bc5c0c962..9d3767baa 100644 --- a/apps/presentationeditor/mobile/locale/az.json +++ b/apps/presentationeditor/mobile/locale/az.json @@ -126,7 +126,8 @@ "warnProcessRightsChange": "Faylı redaktə etmək icazəniz yoxdur.", "textNoTextFound": "Text not found", "textReplaceSkipped": "The replacement has been made. {0} occurrences were skipped.", - "textReplaceSuccess": "The search has been done. Occurrences replaced: {0}" + "textReplaceSuccess": "The search has been done. Occurrences replaced: {0}", + "textRequestMacros": "A macro makes a request to URL. Do you want to allow the request to the %1?" } }, "Error": { diff --git a/apps/presentationeditor/mobile/locale/be.json b/apps/presentationeditor/mobile/locale/be.json index f0a657856..7c8064ea2 100644 --- a/apps/presentationeditor/mobile/locale/be.json +++ b/apps/presentationeditor/mobile/locale/be.json @@ -126,7 +126,8 @@ "warnLicenseUsersExceeded": "You've reached the user limit for %1 editors. Contact your administrator to learn more.", "warnNoLicense": "You've reached the limit for simultaneous connections to %1 editors. This document will be opened for viewing only. Contact %1 sales team for personal upgrade terms.", "warnNoLicenseUsers": "You've reached the user limit for %1 editors. Contact %1 sales team for personal upgrade terms.", - "warnProcessRightsChange": "You don't have permission to edit the file." + "warnProcessRightsChange": "You don't have permission to edit the file.", + "textRequestMacros": "A macro makes a request to URL. Do you want to allow the request to the %1?" } }, "Error": { diff --git a/apps/presentationeditor/mobile/locale/bg.json b/apps/presentationeditor/mobile/locale/bg.json index 263ce07ec..796b4db4b 100644 --- a/apps/presentationeditor/mobile/locale/bg.json +++ b/apps/presentationeditor/mobile/locale/bg.json @@ -126,7 +126,8 @@ "warnProcessRightsChange": "You don't have permission to edit the file.", "textReplaceSuccess": "The search has been done. Occurrences replaced: {0}", "textReplaceSkipped": "The replacement has been made. {0} occurrences were skipped.", - "textNoTextFound": "Text not found" + "textNoTextFound": "Text not found", + "textRequestMacros": "A macro makes a request to URL. Do you want to allow the request to the %1?" } }, "Error": { diff --git a/apps/presentationeditor/mobile/locale/ca.json b/apps/presentationeditor/mobile/locale/ca.json index 3de0ffab8..de1b4d506 100644 --- a/apps/presentationeditor/mobile/locale/ca.json +++ b/apps/presentationeditor/mobile/locale/ca.json @@ -126,7 +126,8 @@ "warnLicenseUsersExceeded": "Heu arribat al límit d'usuari per a %1 editors. Contacteu amb l'administrador per a més informació.", "warnNoLicense": "Heu arribat al límit de connexions simultànies a %1 editors. Aquest document només s'obrirà en mode lectura. Contacteu amb l'equip de vendes %1 per conèixer les condicions d'actualització personal.", "warnNoLicenseUsers": "Heu arribat al límit d'usuaris per a %1 editors. Contacteu amb l'equip de vendes de %1 per obtenir les condicions de millora personals dels vostres serveis.", - "warnProcessRightsChange": "No teniu permís per editar el fitxer." + "warnProcessRightsChange": "No teniu permís per editar el fitxer.", + "textRequestMacros": "A macro makes a request to URL. Do you want to allow the request to the %1?" } }, "Error": { diff --git a/apps/presentationeditor/mobile/locale/cs.json b/apps/presentationeditor/mobile/locale/cs.json index c9761b300..6ac01e37a 100644 --- a/apps/presentationeditor/mobile/locale/cs.json +++ b/apps/presentationeditor/mobile/locale/cs.json @@ -126,7 +126,8 @@ "warnLicenseUsersExceeded": "Došlo dosažení limitu %1 editorů v režimu spolupráce na úpravách. Ohledně podrobností se obraťte na svého správce.", "warnNoLicense": "Došlo k dosažení limitu souběžného připojení %1 editorů. Tento dokument bude otevřen pouze pro náhled. Pro rozšíření funkcí kontaktujte %1 obchodní oddělení.", "warnNoLicenseUsers": "Došlo k dosažení limitu %1 editorů. Pro rozšíření funkcí kontaktujte %1 obchodní oddělení.", - "warnProcessRightsChange": "Nemáte oprávnění pro úpravu tohoto dokumentu." + "warnProcessRightsChange": "Nemáte oprávnění pro úpravu tohoto dokumentu.", + "textRequestMacros": "A macro makes a request to URL. Do you want to allow the request to the %1?" } }, "Error": { diff --git a/apps/presentationeditor/mobile/locale/de.json b/apps/presentationeditor/mobile/locale/de.json index c58f75a15..3dd421391 100644 --- a/apps/presentationeditor/mobile/locale/de.json +++ b/apps/presentationeditor/mobile/locale/de.json @@ -126,7 +126,8 @@ "warnLicenseUsersExceeded": "Sie haben das Benutzerlimit für %1-Editoren erreicht. Bitte wenden Sie sich an Ihren Administrator, um weitere Informationen zu erhalten.", "warnNoLicense": "Sie haben die maximale Anzahl von gleichzeitigen Verbindungen in %1-Editoren erreicht. Die Bearbeitung ist jetzt in diesem Dokument nicht verfügbar. Bitte kontaktieren Sie unser Verkaufsteam, um persönliche Upgrade-Bedingungen zu erhalten.", "warnNoLicenseUsers": "Sie haben das Benutzerlimit für %1-Editoren erreicht. Bitte kontaktieren Sie unser Verkaufsteam, um persönliche Upgrade-Bedingungen zu erhalten.", - "warnProcessRightsChange": "Sie können diese Datei nicht bearbeiten." + "warnProcessRightsChange": "Sie können diese Datei nicht bearbeiten.", + "textRequestMacros": "A macro makes a request to URL. Do you want to allow the request to the %1?" } }, "Error": { diff --git a/apps/presentationeditor/mobile/locale/el.json b/apps/presentationeditor/mobile/locale/el.json index 4d2b0cb62..e7b9712d5 100644 --- a/apps/presentationeditor/mobile/locale/el.json +++ b/apps/presentationeditor/mobile/locale/el.json @@ -126,7 +126,8 @@ "warnLicenseUsersExceeded": "Έχετε φτάσει το όριο χρήστη για συντάκτες %1.
    Επικοινωνήστε με τον διαχειριστή σας για περισσότερες πληροφορίες.", "warnNoLicense": "Φτάσατε το όριο ταυτόχρονων συνδέσεων σε %1 συντάκτες. Το έγγραφο θα ανοίξει μόνο για ανάγνωση. Επικοινωνήστε με την ομάδα πωλήσεων %1 για τους όρους αναβάθμισης.", "warnNoLicenseUsers": "Έχετε φτάσει το όριο χρήστη για συντάκτες %1.
    Επικοινωνήστε με την ομάδα πωλήσεων %1 για προσωπικούς όρους αναβάθμισης.", - "warnProcessRightsChange": "Δεν έχετε δικαίωμα επεξεργασίας του αρχείου." + "warnProcessRightsChange": "Δεν έχετε δικαίωμα επεξεργασίας του αρχείου.", + "textRequestMacros": "A macro makes a request to URL. Do you want to allow the request to the %1?" } }, "Error": { diff --git a/apps/presentationeditor/mobile/locale/en.json b/apps/presentationeditor/mobile/locale/en.json index 24c2e3e4d..6d6459902 100644 --- a/apps/presentationeditor/mobile/locale/en.json +++ b/apps/presentationeditor/mobile/locale/en.json @@ -126,7 +126,8 @@ "warnLicenseUsersExceeded": "You've reached the user limit for %1 editors. Contact your administrator to learn more.", "warnNoLicense": "You've reached the limit for simultaneous connections to %1 editors. This document will be opened for viewing only. Contact %1 sales team for personal upgrade terms.", "warnNoLicenseUsers": "You've reached the user limit for %1 editors. Contact %1 sales team for personal upgrade terms.", - "warnProcessRightsChange": "You don't have permission to edit the file." + "warnProcessRightsChange": "You don't have permission to edit the file.", + "textRequestMacros": "A macro makes a request to URL. Do you want to allow the request to the %1?" } }, "Error": { diff --git a/apps/presentationeditor/mobile/locale/es.json b/apps/presentationeditor/mobile/locale/es.json index 9e67ba067..47b6f7a15 100644 --- a/apps/presentationeditor/mobile/locale/es.json +++ b/apps/presentationeditor/mobile/locale/es.json @@ -126,7 +126,8 @@ "warnLicenseUsersExceeded": "Ha alcanzado el límite de usuarios para los editores de %1. Contacte con su administrador para recibir más información.", "warnNoLicense": "Ha alcanzado el límite de conexiones simultáneas con %1 editores. Este documento se abrirá sólo para su visualización. Póngase en contacto con el equipo de ventas de %1 para conocer las condiciones de actualización personal.", "warnNoLicenseUsers": "Ha alcanzado el límite de usuarios para los editores de %1.
    Contacte con el equipo de ventas de %1 para conocer los términos de actualización personal.", - "warnProcessRightsChange": "No tiene permiso para editar el archivo." + "warnProcessRightsChange": "No tiene permiso para editar el archivo.", + "textRequestMacros": "A macro makes a request to URL. Do you want to allow the request to the %1?" } }, "Error": { diff --git a/apps/presentationeditor/mobile/locale/fr.json b/apps/presentationeditor/mobile/locale/fr.json index 770e592c6..a07c8040a 100644 --- a/apps/presentationeditor/mobile/locale/fr.json +++ b/apps/presentationeditor/mobile/locale/fr.json @@ -126,7 +126,8 @@ "warnLicenseUsersExceeded": "Vous avez dépassé le nombre maximal d’utilisateurs des éditeurs %1. Pour en savoir plus, contactez votre administrateur.", "warnNoLicense": "Vous avez dépassé le nombre maximal de connexions simultanées aux éditeurs %1. Ce document sera ouvert en lecture seule. Contactez l’équipe des ventes %1 pour mettre à jour les termes de la licence.", "warnNoLicenseUsers": "Vous avez dépassé le nombre maximal d’utilisateurs des éditeurs %1. Contactez l’équipe des ventes %1 pour mettre à jour les termes de la licence.", - "warnProcessRightsChange": "Vous n'avez pas la permission de modifier ce fichier." + "warnProcessRightsChange": "Vous n'avez pas la permission de modifier ce fichier.", + "textRequestMacros": "A macro makes a request to URL. Do you want to allow the request to the %1?" } }, "Error": { diff --git a/apps/presentationeditor/mobile/locale/gl.json b/apps/presentationeditor/mobile/locale/gl.json index a7a971f54..33eb9cbfa 100644 --- a/apps/presentationeditor/mobile/locale/gl.json +++ b/apps/presentationeditor/mobile/locale/gl.json @@ -126,7 +126,8 @@ "warnLicenseUsersExceeded": "Alcanzou o límite de usuarios para os editores de %1. Por favor, contacte co se uadministrador para recibir máis información.", "warnNoLicense": "Alcanzou o límite de conexións simultáneas con %1 editores. Este documento abrirase para as úa visualización. Póñase en contacto co equipo de vendas de %1 para coñecer as condicións de actualización persoal.", "warnNoLicenseUsers": "Alcanzou o límite de usuarios para os editores de %1.
    Contacte co equipo de vendas de %1 para coñecer os termos de actualización persoal.", - "warnProcessRightsChange": "Non ten permiso para editar o ficheiro." + "warnProcessRightsChange": "Non ten permiso para editar o ficheiro.", + "textRequestMacros": "A macro makes a request to URL. Do you want to allow the request to the %1?" } }, "Error": { diff --git a/apps/presentationeditor/mobile/locale/hu.json b/apps/presentationeditor/mobile/locale/hu.json index 760897efa..b5162d55d 100644 --- a/apps/presentationeditor/mobile/locale/hu.json +++ b/apps/presentationeditor/mobile/locale/hu.json @@ -126,7 +126,8 @@ "warnLicenseUsersExceeded": "Elérte a(z) %1 szerkesztőhöz tartozó felhasználói korlátját. További információért forduljon rendszergazdájához.", "warnNoLicense": "Elérte a(z) %1 szerkesztővel való egyidejű kapcsolódási korlátot. Ez a dokumentum csak megtekintésre nyílik meg. Lépjen kapcsolatba a(z) %1 értékesítési csapattal a személyes frissítés feltételekért.", "warnNoLicenseUsers": "Elérte a(z) %1 szerkesztőhöz tartozó felhasználói korlátját. Vegye fel a kapcsolatot a(z) %1 értékesítési csapattal a személyes frissítési feltételekért.", - "warnProcessRightsChange": "Nincs engedélye a fájl szerkesztésére." + "warnProcessRightsChange": "Nincs engedélye a fájl szerkesztésére.", + "textRequestMacros": "A macro makes a request to URL. Do you want to allow the request to the %1?" } }, "Error": { diff --git a/apps/presentationeditor/mobile/locale/id.json b/apps/presentationeditor/mobile/locale/id.json index c1e902b36..211d6701e 100644 --- a/apps/presentationeditor/mobile/locale/id.json +++ b/apps/presentationeditor/mobile/locale/id.json @@ -126,7 +126,8 @@ "warnLicenseUsersExceeded": "Anda sudah mencapai batas user untuk %1 editor. Hubungi admin Anda untuk mempelajari lebih lanjut.", "warnNoLicense": "Anda sudah mencapai batas untuk koneksi bersamaan ke %1 editor. Dokumen ini akan dibuka untuk dilihat saja. Hubungi %1 tim sales untuk syarat personal upgrade.", "warnNoLicenseUsers": "Anda sudah mencapai batas user untuk %1 editor. Hubungi %1 tim sales untuk syarat personal upgrade.", - "warnProcessRightsChange": "Anda tidak memiliki izin edit file ini." + "warnProcessRightsChange": "Anda tidak memiliki izin edit file ini.", + "textRequestMacros": "A macro makes a request to URL. Do you want to allow the request to the %1?" } }, "Error": { diff --git a/apps/presentationeditor/mobile/locale/it.json b/apps/presentationeditor/mobile/locale/it.json index 9efb1e4bd..a034a6a2b 100644 --- a/apps/presentationeditor/mobile/locale/it.json +++ b/apps/presentationeditor/mobile/locale/it.json @@ -126,7 +126,8 @@ "warnLicenseUsersExceeded": "Hai raggiunto il limite degli utenti per gli editor %1. Ti preghiamo di contattare il tuo amministratore per maggior informazioni.", "warnNoLicense": "Hai raggiunto il limite delle connessioni simultanee agli editor %1. Questo documento sarà aperto solo in modalità di visualizzazione. Ti preghiamo di contattare il team di vendite di %1 per i termini di aggiornamento personali.", "warnNoLicenseUsers": "Hai raggiunto il limite degli utenti per gli editor %1. Ti preghiamo di contattare il team di vendite di %1 per i termini di aggiornamento personali.", - "warnProcessRightsChange": "Non hai il permesso di modificare il file." + "warnProcessRightsChange": "Non hai il permesso di modificare il file.", + "textRequestMacros": "A macro makes a request to URL. Do you want to allow the request to the %1?" } }, "Error": { diff --git a/apps/presentationeditor/mobile/locale/ja.json b/apps/presentationeditor/mobile/locale/ja.json index 0e20acb99..daddc2959 100644 --- a/apps/presentationeditor/mobile/locale/ja.json +++ b/apps/presentationeditor/mobile/locale/ja.json @@ -126,7 +126,8 @@ "warnLicenseUsersExceeded": "%1エディターのユーザー制限に達しました。 詳細についてはアドミニストレータを連絡してください。", "warnNoLicense": "%1エディター 時接続数の制限に達しました。この文書が見るだけのために開かれる。個人的なアップグレード条件については、%1営業チームを連絡してください。", "warnNoLicenseUsers": "%1エディターのユーザー制限に達しました。 個人的なアップグレード条件については、%1営業チームを連絡してください。", - "warnProcessRightsChange": "ファイルを編集する権限がありません!" + "warnProcessRightsChange": "ファイルを編集する権限がありません!", + "textRequestMacros": "A macro makes a request to URL. Do you want to allow the request to the %1?" } }, "Error": { diff --git a/apps/presentationeditor/mobile/locale/ko.json b/apps/presentationeditor/mobile/locale/ko.json index 9edcda3be..ce085ca61 100644 --- a/apps/presentationeditor/mobile/locale/ko.json +++ b/apps/presentationeditor/mobile/locale/ko.json @@ -126,7 +126,8 @@ "warnLicenseUsersExceeded": "편집자 사용자 한도인 %1명에 도달했습니다. 자세한 내용은 관리자에게 문의하십시오.", "warnNoLicense": "% 1 편집 연결 수 제한에 도달했습니다. 이 문서는 보기 모드로 열립니다. 개인적인 업그레이드 사항은 % 1 영업팀에 연락하십시오.", "warnNoLicenseUsers": "ONLYOFFICE 편집자의이 버전은 동시 사용자에게 일정한 제한이 있습니다.
    더 필요한 것이 있으면 현재 라이센스를 업그레이드하거나 상용 라이센스를 구입하십시오.", - "warnProcessRightsChange": "파일을 수정할 수 있는 권한이 없습니다." + "warnProcessRightsChange": "파일을 수정할 수 있는 권한이 없습니다.", + "textRequestMacros": "A macro makes a request to URL. Do you want to allow the request to the %1?" } }, "Error": { diff --git a/apps/presentationeditor/mobile/locale/lo.json b/apps/presentationeditor/mobile/locale/lo.json index dcaecb5fe..a9333171d 100644 --- a/apps/presentationeditor/mobile/locale/lo.json +++ b/apps/presentationeditor/mobile/locale/lo.json @@ -126,7 +126,8 @@ "warnLicenseUsersExceeded": "ຈໍານວນ ການເຊື່ອມຕໍ່ພ້ອມກັນກັບຜູ້ແກ້ໄຂ ແມ່ນເກີນກໍານົດ % 1. ຕິດຕໍ່ທີມບໍລິຫານເພື່ອຂໍ້ມູນເພີ່ມເຕີ່ມ", "warnNoLicense": "ທ່ານໄດ້ຖືກຈຳກັດສິດພຽງເທົ່ານີ້ສຳຫລັບການເຊື່່ອມພ້ອມກັນກັບເຄື່ອງມືແກ້ໄຂ %1 ແລ້ວເອກະສານນີ້ຈະເປີດໃຫ້ເບີ່ງເທົ່ານັ້ນ ຕິດຕໍ່ທີມຂາຍ %1 ສຳຫລັບເງື່ອນໄຂການອັບເກດສ່ວນບຸກຄົນ", "warnNoLicenseUsers": "ຈໍານວນການເຊື່ອມຕໍ່ພ້ອມກັນກັບບັນນາທິການ ແມ່ນເກີນກໍານົດ % 1. ຕິດຕໍ່ ທີມຂາຍ %1 ສຳລັບຂໍ້ກຳນົດການຍົກລະດັບສິດ", - "warnProcessRightsChange": "ທ່ານບໍ່ມີສິດໃນການແກ້ໄຂໄຟລ໌ນີ້." + "warnProcessRightsChange": "ທ່ານບໍ່ມີສິດໃນການແກ້ໄຂໄຟລ໌ນີ້.", + "textRequestMacros": "A macro makes a request to URL. Do you want to allow the request to the %1?" } }, "Error": { diff --git a/apps/presentationeditor/mobile/locale/lv.json b/apps/presentationeditor/mobile/locale/lv.json index 263ce07ec..796b4db4b 100644 --- a/apps/presentationeditor/mobile/locale/lv.json +++ b/apps/presentationeditor/mobile/locale/lv.json @@ -126,7 +126,8 @@ "warnProcessRightsChange": "You don't have permission to edit the file.", "textReplaceSuccess": "The search has been done. Occurrences replaced: {0}", "textReplaceSkipped": "The replacement has been made. {0} occurrences were skipped.", - "textNoTextFound": "Text not found" + "textNoTextFound": "Text not found", + "textRequestMacros": "A macro makes a request to URL. Do you want to allow the request to the %1?" } }, "Error": { diff --git a/apps/presentationeditor/mobile/locale/nb.json b/apps/presentationeditor/mobile/locale/nb.json index 263ce07ec..796b4db4b 100644 --- a/apps/presentationeditor/mobile/locale/nb.json +++ b/apps/presentationeditor/mobile/locale/nb.json @@ -126,7 +126,8 @@ "warnProcessRightsChange": "You don't have permission to edit the file.", "textReplaceSuccess": "The search has been done. Occurrences replaced: {0}", "textReplaceSkipped": "The replacement has been made. {0} occurrences were skipped.", - "textNoTextFound": "Text not found" + "textNoTextFound": "Text not found", + "textRequestMacros": "A macro makes a request to URL. Do you want to allow the request to the %1?" } }, "Error": { diff --git a/apps/presentationeditor/mobile/locale/nl.json b/apps/presentationeditor/mobile/locale/nl.json index c042aa342..ef25e9ce8 100644 --- a/apps/presentationeditor/mobile/locale/nl.json +++ b/apps/presentationeditor/mobile/locale/nl.json @@ -126,7 +126,8 @@ "warnNoLicenseUsers": "U heeft de gebruikerslimiet voor %1 gelijktijdige gebruikers bereikt. Neem contact op met de verkoopafdeling voor persoonlijke upgradevoorwaarden.", "warnProcessRightsChange": "Je hebt geen toestemming om het bestand te bewerken.", "textReplaceSkipped": "The replacement has been made. {0} occurrences were skipped.", - "textReplaceSuccess": "The search has been done. Occurrences replaced: {0}" + "textReplaceSuccess": "The search has been done. Occurrences replaced: {0}", + "textRequestMacros": "A macro makes a request to URL. Do you want to allow the request to the %1?" } }, "Error": { diff --git a/apps/presentationeditor/mobile/locale/pl.json b/apps/presentationeditor/mobile/locale/pl.json index 263ce07ec..796b4db4b 100644 --- a/apps/presentationeditor/mobile/locale/pl.json +++ b/apps/presentationeditor/mobile/locale/pl.json @@ -126,7 +126,8 @@ "warnProcessRightsChange": "You don't have permission to edit the file.", "textReplaceSuccess": "The search has been done. Occurrences replaced: {0}", "textReplaceSkipped": "The replacement has been made. {0} occurrences were skipped.", - "textNoTextFound": "Text not found" + "textNoTextFound": "Text not found", + "textRequestMacros": "A macro makes a request to URL. Do you want to allow the request to the %1?" } }, "Error": { diff --git a/apps/presentationeditor/mobile/locale/pt-PT.json b/apps/presentationeditor/mobile/locale/pt-PT.json index 3a82e9de6..8a482d860 100644 --- a/apps/presentationeditor/mobile/locale/pt-PT.json +++ b/apps/presentationeditor/mobile/locale/pt-PT.json @@ -126,7 +126,8 @@ "warnLicenseUsersExceeded": "Atingiu o limite de %1 editores. Contacte o seu administrador para obter detalhes.", "warnNoLicense": "Atingiu o limite de ligações simultâneas a %1 editores. Este documento será aberto apenas para visualização. Contacte a %1 equipa de vendas para consultar os termos de atualização para si.", "warnNoLicenseUsers": "Atingiu o limite de %1 editores. Contacte a equipa comercial %1 para obter mais informações.", - "warnProcessRightsChange": "Não tem autorização para editar este ficheiro." + "warnProcessRightsChange": "Não tem autorização para editar este ficheiro.", + "textRequestMacros": "A macro makes a request to URL. Do you want to allow the request to the %1?" } }, "Error": { diff --git a/apps/presentationeditor/mobile/locale/pt.json b/apps/presentationeditor/mobile/locale/pt.json index 8cd58a9a6..da6679f98 100644 --- a/apps/presentationeditor/mobile/locale/pt.json +++ b/apps/presentationeditor/mobile/locale/pt.json @@ -126,7 +126,8 @@ "warnLicenseUsersExceeded": "Você atingiu o limite de usuários para editores %1. Entre em contato com seu administrador para saber mais.", "warnNoLicense": "Você atingiu o limite de conexões simultâneas para% 1 editores. Este documento será aberto apenas para visualização. Contate a equipe de vendas% 1 para termos de atualização pessoal.", "warnNoLicenseUsers": "Você atingiu o limite de usuários para editores %1.
    Entre em contato com a equipe de vendas da %1 para obter os termos de atualização pessoais.", - "warnProcessRightsChange": "Você não tem permissão para editar o arquivo." + "warnProcessRightsChange": "Você não tem permissão para editar o arquivo.", + "textRequestMacros": "A macro makes a request to URL. Do you want to allow the request to the %1?" } }, "Error": { diff --git a/apps/presentationeditor/mobile/locale/ro.json b/apps/presentationeditor/mobile/locale/ro.json index 6d6ab4cb6..3dd6cf550 100644 --- a/apps/presentationeditor/mobile/locale/ro.json +++ b/apps/presentationeditor/mobile/locale/ro.json @@ -126,7 +126,8 @@ "warnLicenseUsersExceeded": "Ați atins numărul maxim de utilizatori ai %1 editoare. Pentru detalii, contactați administratorul dvs.", "warnNoLicense": "Ați atins numărul maxim de conexiuni simultane la %1 de editoare. Documentul este disponibil numai pentru vizualizare. Contactați %1 Departamentul de Vânzări pentru acordarea condițiilor personale de actualizare.", "warnNoLicenseUsers": "Ați atins numărul maxim de utilizatori ai %1 editoare. Contactați Grup Vânzări %1 pentru acordarea condițiilor personale de licențiere.", - "warnProcessRightsChange": "Nu aveți permisiunea de editare pentru fișier." + "warnProcessRightsChange": "Nu aveți permisiunea de editare pentru fișier.", + "textRequestMacros": "A macro makes a request to URL. Do you want to allow the request to the %1?" } }, "Error": { diff --git a/apps/presentationeditor/mobile/locale/ru.json b/apps/presentationeditor/mobile/locale/ru.json index 0fa3213ec..1565248d5 100644 --- a/apps/presentationeditor/mobile/locale/ru.json +++ b/apps/presentationeditor/mobile/locale/ru.json @@ -126,7 +126,8 @@ "warnLicenseUsersExceeded": "Вы достигли лимита на количество пользователей редакторов %1. Свяжитесь с администратором, чтобы узнать больше.", "warnNoLicense": "Вы достигли лимита на одновременные подключения к редакторам %1. Этот документ будет открыт на просмотр. Напишите в отдел продаж %1, чтобы обсудить индивидуальные условия обновления.", "warnNoLicenseUsers": "Вы достигли лимита на количество пользователей редакторов %1. Напишите в отдел продаж %1, чтобы обсудить индивидуальные условия обновления.", - "warnProcessRightsChange": "У вас нет прав на редактирование этого файла." + "warnProcessRightsChange": "У вас нет прав на редактирование этого файла.", + "textRequestMacros": "A macro makes a request to URL. Do you want to allow the request to the %1?" } }, "Error": { diff --git a/apps/presentationeditor/mobile/locale/sk.json b/apps/presentationeditor/mobile/locale/sk.json index b6a1304d2..0410c4f7a 100644 --- a/apps/presentationeditor/mobile/locale/sk.json +++ b/apps/presentationeditor/mobile/locale/sk.json @@ -126,7 +126,8 @@ "warnLicenseUsersExceeded": "Dosiahli ste limit %1 editora v režime spolupráce na úpravách. Ohľadne podrobnosti sa obráťte na svojho správcu. ", "warnNoLicense": "Dosiahli ste limit pre simultánne pripojenia k %1 editorom. Tento dokument sa otvorí iba na prezeranie. Kontaktujte predajný tím %1 pre osobné podmienky inovácie.", "warnNoLicenseUsers": "Dosiahli ste limit %1 editora. Pre rozšírenie funkcií kontaktujte %1 obchodné oddelenie.", - "warnProcessRightsChange": "Nemáte povolenie na úpravu súboru." + "warnProcessRightsChange": "Nemáte povolenie na úpravu súboru.", + "textRequestMacros": "A macro makes a request to URL. Do you want to allow the request to the %1?" } }, "Error": { diff --git a/apps/presentationeditor/mobile/locale/sl.json b/apps/presentationeditor/mobile/locale/sl.json index f1677d1ab..4c808d654 100644 --- a/apps/presentationeditor/mobile/locale/sl.json +++ b/apps/presentationeditor/mobile/locale/sl.json @@ -398,7 +398,8 @@ "warnLicenseUsersExceeded": "You've reached the user limit for %1 editors. Contact your administrator to learn more.", "warnNoLicense": "You've reached the limit for simultaneous connections to %1 editors. This document will be opened for viewing only. Contact %1 sales team for personal upgrade terms.", "warnNoLicenseUsers": "You've reached the user limit for %1 editors. Contact %1 sales team for personal upgrade terms.", - "warnProcessRightsChange": "You don't have permission to edit the file." + "warnProcessRightsChange": "You don't have permission to edit the file.", + "textRequestMacros": "A macro makes a request to URL. Do you want to allow the request to the %1?" } }, "Error": { diff --git a/apps/presentationeditor/mobile/locale/tr.json b/apps/presentationeditor/mobile/locale/tr.json index 569865e35..0ccc92ef6 100644 --- a/apps/presentationeditor/mobile/locale/tr.json +++ b/apps/presentationeditor/mobile/locale/tr.json @@ -126,7 +126,8 @@ "warnProcessRightsChange": "Dosyayı düzenleme izniniz yok.", "textNoTextFound": "Text not found", "textReplaceSkipped": "The replacement has been made. {0} occurrences were skipped.", - "textReplaceSuccess": "The search has been done. Occurrences replaced: {0}" + "textReplaceSuccess": "The search has been done. Occurrences replaced: {0}", + "textRequestMacros": "A macro makes a request to URL. Do you want to allow the request to the %1?" } }, "Error": { diff --git a/apps/presentationeditor/mobile/locale/uk.json b/apps/presentationeditor/mobile/locale/uk.json index 098e48b70..195909e73 100644 --- a/apps/presentationeditor/mobile/locale/uk.json +++ b/apps/presentationeditor/mobile/locale/uk.json @@ -126,7 +126,8 @@ "warnLicenseUsersExceeded": "You've reached the user limit for %1 editors. Contact your administrator to learn more.", "warnNoLicense": "You've reached the limit for simultaneous connections to %1 editors. This document will be opened for viewing only. Contact %1 sales team for personal upgrade terms.", "warnNoLicenseUsers": "You've reached the user limit for %1 editors. Contact %1 sales team for personal upgrade terms.", - "warnProcessRightsChange": "You don't have permission to edit the file." + "warnProcessRightsChange": "You don't have permission to edit the file.", + "textRequestMacros": "A macro makes a request to URL. Do you want to allow the request to the %1?" } }, "Error": { diff --git a/apps/presentationeditor/mobile/locale/vi.json b/apps/presentationeditor/mobile/locale/vi.json index 263ce07ec..796b4db4b 100644 --- a/apps/presentationeditor/mobile/locale/vi.json +++ b/apps/presentationeditor/mobile/locale/vi.json @@ -126,7 +126,8 @@ "warnProcessRightsChange": "You don't have permission to edit the file.", "textReplaceSuccess": "The search has been done. Occurrences replaced: {0}", "textReplaceSkipped": "The replacement has been made. {0} occurrences were skipped.", - "textNoTextFound": "Text not found" + "textNoTextFound": "Text not found", + "textRequestMacros": "A macro makes a request to URL. Do you want to allow the request to the %1?" } }, "Error": { diff --git a/apps/presentationeditor/mobile/locale/zh-TW.json b/apps/presentationeditor/mobile/locale/zh-TW.json index 619916023..fe7cbf700 100644 --- a/apps/presentationeditor/mobile/locale/zh-TW.json +++ b/apps/presentationeditor/mobile/locale/zh-TW.json @@ -126,7 +126,8 @@ "warnLicenseUsersExceeded": "您已達到%1個編輯器的用戶限制。請與您的管理員聯繫以了解更多信息。", "warnNoLicense": "您已達到同時連接到 %1 編輯器的限制。此文件將只提供檢視。有關個人升級條款,請聯繫 %1 業務團隊。", "warnNoLicenseUsers": "您已達到%1個編輯器的用戶限制。與%1銷售團隊聯繫以了解個人升級條款。", - "warnProcessRightsChange": "您沒有編輯此文件的權限。" + "warnProcessRightsChange": "您沒有編輯此文件的權限。", + "textRequestMacros": "A macro makes a request to URL. Do you want to allow the request to the %1?" } }, "Error": { diff --git a/apps/presentationeditor/mobile/locale/zh.json b/apps/presentationeditor/mobile/locale/zh.json index 07a68a2aa..23e5f5190 100644 --- a/apps/presentationeditor/mobile/locale/zh.json +++ b/apps/presentationeditor/mobile/locale/zh.json @@ -126,7 +126,8 @@ "warnLicenseUsersExceeded": "你触发了 %1 编辑器的同时在线数限制。可联系管理员来了解更多信息。", "warnNoLicense": "你已经触发了 %1 编辑器的同时在线数限制. 该文档打开后,你将只能查看。请联系 %1 的销售团队,获取个人升级条款。", "warnNoLicenseUsers": "你触发了 %1 编辑器的同时在线数限制。可联系管理员来了解更多信息。", - "warnProcessRightsChange": "你没有编辑文件的权限。" + "warnProcessRightsChange": "你没有编辑文件的权限。", + "textRequestMacros": "A macro makes a request to URL. Do you want to allow the request to the %1?" } }, "Error": { diff --git a/apps/presentationeditor/mobile/src/controller/Main.jsx b/apps/presentationeditor/mobile/src/controller/Main.jsx index 77ddc83a4..ae81d1619 100644 --- a/apps/presentationeditor/mobile/src/controller/Main.jsx +++ b/apps/presentationeditor/mobile/src/controller/Main.jsx @@ -44,6 +44,7 @@ class MainController extends Component { }; this.defaultTitleText = __APP_TITLE_TEXT__; + this.stackMacrosRequests = []; const { t } = this.props; this._t = t('Controller.Main', {returnObjects:true}); @@ -92,6 +93,9 @@ class MainController extends Component { value = parseInt(value); } this.props.storeApplicationSettings.changeMacrosSettings(value); + + value = localStorage.getItem("pe-mobile-allow-macros-request"); + this.props.storeApplicationSettings.changeMacrosRequest((value !== null) ? parseInt(value) : 0); }; const loadDocument = data => { @@ -104,6 +108,7 @@ class MainController extends Component { this.permissions = Object.assign(this.permissions, data.doc.permissions); const _permissions = Object.assign({}, data.doc.permissions); + const _options = Object.assign({}, data.doc.options, this.editorConfig.actionLink || {}); const _user = new Asc.asc_CUserInfo(); const _userOptions = this.props.storeAppOptions.user; _user.put_Id(_userOptions.id); @@ -116,7 +121,7 @@ class MainController extends Component { docInfo.put_Title(data.doc.title); docInfo.put_Format(data.doc.fileType); docInfo.put_VKey(data.doc.vkey); - docInfo.put_Options(data.doc.options); + docInfo.put_Options(_options); docInfo.put_UserInfo(_user); docInfo.put_CallbackUrl(this.editorConfig.callbackUrl); docInfo.put_Token(data.doc.token); @@ -138,6 +143,7 @@ class MainController extends Component { this.api.asc_registerCallback('asc_onGetEditorPermissions', onEditorPermissions); this.api.asc_registerCallback('asc_onLicenseChanged', this.onLicenseChanged.bind(this)); + this.api.asc_registerCallback('asc_onMacrosPermissionRequest', this.onMacrosPermissionRequest.bind(this)); this.api.asc_registerCallback('asc_onRunAutostartMacroses', this.onRunAutostartMacroses.bind(this)); this.api.asc_setDocInfo(docInfo); this.api.asc_getEditorPermissions(this.editorConfig.licenseUrl, this.editorConfig.customerId); @@ -818,6 +824,70 @@ class MainController extends Component { } } + onMacrosPermissionRequest (url, callback) { + if (url && callback) { + this.stackMacrosRequests.push({url: url, callback: callback}); + if (this.stackMacrosRequests.length>1) { + return; + } + } else if (this.stackMacrosRequests.length>0) { + url = this.stackMacrosRequests[0].url; + callback = this.stackMacrosRequests[0].callback; + } else + return; + + const value = this.props.storeApplicationSettings.macrosRequest; + if (value>0) { + callback && callback(value === 1); + this.stackMacrosRequests.shift(); + this.onMacrosPermissionRequest(); + } else { + const { t } = this.props; + const _t = t('Controller.Main', {returnObjects:true}); + f7.dialog.create({ + title: _t.notcriticalErrorTitle, + text: _t.textRequestMacros.replace('%1', url), + cssClass: 'dlg-macros-request', + content: `
    + + ${_t.textRemember} +
    `, + buttons: [{ + text: _t.textYes, + onClick: () => { + const dontshow = $$('input[name="checkbox-show-macros"]').prop('checked'); + if (dontshow) { + this.props.storeApplicationSettings.changeMacrosRequest(1); + LocalStorage.setItem("pe-mobile-allow-macros-request", 1); + } + setTimeout(() => { + if (callback) callback(true); + this.stackMacrosRequests.shift(); + this.onMacrosPermissionRequest(); + }, 1); + }}, + { + text: _t.textNo, + onClick: () => { + const dontshow = $$('input[name="checkbox-show-macros"]').prop('checked'); + if (dontshow) { + this.props.storeApplicationSettings.changeMacrosRequest(2); + LocalStorage.setItem("pe-mobile-allow-macros-request", 2); + } + setTimeout(() => { + if (callback) callback(false); + this.stackMacrosRequests.shift(); + this.onMacrosPermissionRequest(); + }, 1); + } + }] + }).open(); + } + } + onProcessSaveResult (data) { this.api.asc_OnSaveEnd(data.result); diff --git a/apps/presentationeditor/mobile/src/controller/edit/EditText.jsx b/apps/presentationeditor/mobile/src/controller/edit/EditText.jsx index e7fb78aa2..7d96bf4eb 100644 --- a/apps/presentationeditor/mobile/src/controller/edit/EditText.jsx +++ b/apps/presentationeditor/mobile/src/controller/edit/EditText.jsx @@ -235,6 +235,18 @@ class EditTextController extends Component { api.put_ListType(1, parseInt(type)); } + getIconsBulletsAndNumbers(arrayElements, type) { + const api = Common.EditorApi.get(); + const arr = []; + + arrayElements.forEach( item => { + let data = item.drawdata; + data['divId'] = item.id; + arr.push(data); + }); + if (api) api.SetDrawImagePreviewBulletForMenu(arr, type); + } + onLineSpacing(value) { const api = Common.EditorApi.get(); const LINERULE_AUTO = 1; @@ -263,6 +275,7 @@ class EditTextController extends Component { changeLetterSpacing={this.changeLetterSpacing} onBullet={this.onBullet} onNumber={this.onNumber} + getIconsBulletsAndNumbers={this.getIconsBulletsAndNumbers} onLineSpacing={this.onLineSpacing} /> ) diff --git a/apps/presentationeditor/mobile/src/index_dev.html b/apps/presentationeditor/mobile/src/index_dev.html index 13efdb7ea..631114ced 100644 --- a/apps/presentationeditor/mobile/src/index_dev.html +++ b/apps/presentationeditor/mobile/src/index_dev.html @@ -2,7 +2,7 @@ - + diff --git a/apps/presentationeditor/mobile/src/less/icons-material.less b/apps/presentationeditor/mobile/src/less/icons-material.less index 3fdb2bcff..71b95268b 100644 --- a/apps/presentationeditor/mobile/src/less/icons-material.less +++ b/apps/presentationeditor/mobile/src/less/icons-material.less @@ -448,7 +448,7 @@ &.icon-plus { width: 22px; height: 22px; - .encoded-svg-mask('', @toolbar-icons); + .encoded-svg-mask('', @fill-white); } } diff --git a/apps/presentationeditor/mobile/src/store/appOptions.js b/apps/presentationeditor/mobile/src/store/appOptions.js index 8b187331b..a79235abd 100644 --- a/apps/presentationeditor/mobile/src/store/appOptions.js +++ b/apps/presentationeditor/mobile/src/store/appOptions.js @@ -94,12 +94,17 @@ export class storeAppOptions { this.canComments = this.canLicense && (permissions.comment === undefined ? this.isEdit : permissions.comment) && (this.config.mode !== 'view'); this.canComments = this.canComments && !((typeof (this.customization) == 'object') && this.customization.comments===false); this.canViewComments = this.canComments || !((typeof (this.customization) == 'object') && this.customization.comments===false); - this.canEditComments = this.isOffline || !(typeof (this.customization) == 'object' && this.customization.commentAuthorOnly); + this.canEditComments = this.isOffline || !permissions.editCommentAuthorOnly; this.canDeleteComments= this.isOffline || !permissions.deleteCommentAuthorOnly; + if ((typeof (this.customization) == 'object') && this.customization.commentAuthorOnly===true) { + console.log("Obsolete: The 'commentAuthorOnly' parameter of the 'customization' section is deprecated. Please use 'editCommentAuthorOnly' and 'deleteCommentAuthorOnly' parameters in the permissions instead."); + if (permissions.editCommentAuthorOnly===undefined && permissions.deleteCommentAuthorOnly===undefined) + this.canEditComments = this.canDeleteComments = this.isOffline; + } this.canChat = this.canLicense && !this.isOffline && (permissions.chat !== false); this.canEditStyles = this.canLicense && this.canEdit; this.canPrint = (permissions.print !== false); - this.isRestrictedEdit = !this.isEdit && this.canComments; + this.isRestrictedEdit = !this.isEdit && this.canComments && isSupportEditFeature; this.trialMode = params.asc_getLicenseMode(); const type = /^(?:(pdf|djvu|xps|oxps))$/.exec(document.fileType); diff --git a/apps/presentationeditor/mobile/src/store/applicationSettings.js b/apps/presentationeditor/mobile/src/store/applicationSettings.js index 46a9f1e8f..d1b2c85c1 100644 --- a/apps/presentationeditor/mobile/src/store/applicationSettings.js +++ b/apps/presentationeditor/mobile/src/store/applicationSettings.js @@ -6,15 +6,18 @@ export class storeApplicationSettings { unitMeasurement: observable, isSpellChecking: observable, macrosMode: observable, + macrosRequest: observable, changeUnitMeasurement: action, changeSpellCheck: action, - changeMacrosSettings: action + changeMacrosSettings: action, + changeMacrosRequest: action }); } unitMeasurement = 1; isSpellChecking = true; macrosMode = 0; + macrosRequest = 0; changeUnitMeasurement(value) { this.unitMeasurement = +value; @@ -27,4 +30,8 @@ export class storeApplicationSettings { changeMacrosSettings(value) { this.macrosMode = +value; } + + changeMacrosRequest(value) { + this.macrosRequest = value; + } } \ No newline at end of file diff --git a/apps/presentationeditor/mobile/src/view/edit/EditText.jsx b/apps/presentationeditor/mobile/src/view/edit/EditText.jsx index f815e812e..f58a36cd3 100644 --- a/apps/presentationeditor/mobile/src/view/edit/EditText.jsx +++ b/apps/presentationeditor/mobile/src/view/edit/EditText.jsx @@ -143,6 +143,8 @@ const EditText = props => {
    {previewList}
    {!isAndroid && } @@ -491,24 +493,22 @@ const PageAdditionalFormatting = props => { }; const PageBullets = observer(props => { - const { t } = useTranslation(); - const _t = t('View.Edit', {returnObjects: true}); - const bulletArrays = [ - [ - {type: -1, thumb: ''}, - {type: 1, thumb: 'bullet-01.png'}, - {type: 2, thumb: 'bullet-02.png'}, - {type: 3, thumb: 'bullet-03.png'} - ], - [ - {type: 4, thumb: 'bullet-04.png'}, - {type: 5, thumb: 'bullet-05.png'}, - {type: 6, thumb: 'bullet-06.png'}, - {type: 7, thumb: 'bullet-07.png'} - ] - ]; const storeTextSettings = props.storeTextSettings; const typeBullets = storeTextSettings.typeBullets; + const bulletArrays = [ + {id: `id-markers-0`, type: 0, subtype: -1, drawdata: {type: Asc.asc_PreviewBulletType.text, text: 'None'} }, + {id: `id-markers-1`, type: 0, subtype: 1, drawdata: {type: Asc.asc_PreviewBulletType.char, char: String.fromCharCode(0x00B7), specialFont: 'Symbol'} }, + {id: `id-markers-2`, type: 0, subtype: 2, drawdata: {type: Asc.asc_PreviewBulletType.char, char: 'o', specialFont: 'Courier New'} }, + {id: `id-markers-3`, type: 0, subtype: 3, drawdata: {type: Asc.asc_PreviewBulletType.char, char: String.fromCharCode(0x00A7), specialFont: 'Wingdings'} }, + {id: `id-markers-4`, type: 0, subtype: 4, drawdata: {type: Asc.asc_PreviewBulletType.char, char: String.fromCharCode(0x0076), specialFont: 'Wingdings'} }, + {id: `id-markers-5`, type: 0, subtype: 5, drawdata: {type: Asc.asc_PreviewBulletType.char, char: String.fromCharCode(0x00D8), specialFont: 'Wingdings'} }, + {id: `id-markers-6`, type: 0, subtype: 6, drawdata: {type: Asc.asc_PreviewBulletType.char, char: String.fromCharCode(0x00FC), specialFont: 'Wingdings'} }, + {id: `id-markers-7`, type: 0, subtype: 7, drawdata: {type: Asc.asc_PreviewBulletType.char, char: String.fromCharCode(0x00A8), specialFont: 'Symbol'} } + ]; + + useEffect(() => { + props.getIconsBulletsAndNumbers(bulletArrays, 0); + }, []); const paragraph = props.storeFocusObjects.paragraphObject; const shapeObj = props.storeFocusObjects.shapeObject; @@ -519,49 +519,41 @@ const PageBullets = observer(props => { return( - {bulletArrays.map((bullets, index) => ( - - {bullets.map((bullet) => ( - { - storeTextSettings.resetBullets(bullet.type); - props.onBullet(bullet.type); - }}> - {bullet.thumb.length < 1 ? - - - : - - } - - ))} - - ))} + + {bulletArrays.map( bullet => ( + { + storeTextSettings.resetBullets(bullet.subtype); + props.onBullet(bullet.subtype); + }}> +
    + +
    +
    + ))} +
    ) }); const PageNumbers = observer(props => { - const { t } = useTranslation(); - const _t = t('View.Edit', {returnObjects: true}); - const numberArrays = [ - [ - {type: -1, thumb: ''}, - {type: 4, thumb: 'number-01.png'}, - {type: 5, thumb: 'number-02.png'}, - {type: 6, thumb: 'number-03.png'} - ], - [ - {type: 1, thumb: 'number-04.png'}, - {type: 2, thumb: 'number-05.png'}, - {type: 3, thumb: 'number-06.png'}, - {type: 7, thumb: 'number-07.png'} - ] - ]; - const storeTextSettings = props.storeTextSettings; const typeNumbers = storeTextSettings.typeNumbers; + const numberArrays = [ + {id: `id-numbers-0`, type: 1, subtype: -1, drawdata: {type: Asc.asc_PreviewBulletType.text, text: 'None'}}, + {id: `id-numbers-4`, type: 1, subtype: 4, drawdata: {type: Asc.asc_PreviewBulletType.number, numberingType: Asc.asc_oAscNumberingLevel.UpperLetterDot_Left}}, + {id: `id-numbers-5`, type: 1, subtype: 5, drawdata: {type: Asc.asc_PreviewBulletType.number, numberingType: Asc.asc_oAscNumberingLevel.LowerLetterBracket_Left}}, + {id: `id-numbers-6`, type: 1, subtype: 6, drawdata: {type: Asc.asc_PreviewBulletType.number, numberingType: Asc.asc_oAscNumberingLevel.LowerLetterDot_Left}}, + {id: `id-numbers-1`, type: 1, subtype: 1, drawdata: {type: Asc.asc_PreviewBulletType.number, numberingType: Asc.asc_oAscNumberingLevel.DecimalDot_Right}}, + {id: `id-numbers-2`, type: 1, subtype: 2, drawdata: {type: Asc.asc_PreviewBulletType.number, numberingType: Asc.asc_oAscNumberingLevel.DecimalBracket_Right}}, + {id: `id-numbers-3`, type: 1, subtype: 3, drawdata: {type: Asc.asc_PreviewBulletType.number, numberingType: Asc.asc_oAscNumberingLevel.UpperRomanDot_Right}}, + {id: `id-numbers-7`, type: 1, subtype: 7, drawdata: {type: Asc.asc_PreviewBulletType.number, numberingType: Asc.asc_oAscNumberingLevel.LowerRomanDot_Right}} + ]; + + useEffect(() => { + props.getIconsBulletsAndNumbers(numberArrays, 1); + }, []); const paragraph = props.storeFocusObjects.paragraphObject; const shapeObj = props.storeFocusObjects.shapeObject; @@ -592,7 +584,7 @@ const PageNumbers = observer(props => { ))} - ) + ); }); const PageBulletsAndNumbers = props => { @@ -613,8 +605,24 @@ const PageBulletsAndNumbers = props => { } - - + + + + + + ) diff --git a/apps/spreadsheeteditor/main/app.js b/apps/spreadsheeteditor/main/app.js index cbd99f6a1..e413fd614 100644 --- a/apps/spreadsheeteditor/main/app.js +++ b/apps/spreadsheeteditor/main/app.js @@ -173,6 +173,9 @@ require([ Common.Locale.apply(function(){ require([ + 'common/main/lib/util/LocalStorage', + 'common/main/lib/controller/Themes', + 'common/main/lib/controller/Desktop', 'spreadsheeteditor/main/app/controller/Viewport', 'spreadsheeteditor/main/app/controller/DocumentHolder', 'spreadsheeteditor/main/app/controller/CellEditor', @@ -198,7 +201,6 @@ require([ 'spreadsheeteditor/main/app/view/ValueFieldSettingsDialog', 'spreadsheeteditor/main/app/view/SignatureSettings', 'common/main/lib/util/utils', - 'common/main/lib/util/LocalStorage', 'common/main/lib/controller/Fonts', 'common/main/lib/controller/History', 'common/main/lib/controller/Comments', @@ -207,8 +209,6 @@ require([ ,'common/main/lib/controller/ExternalOleEditor' ,'common/main/lib/controller/ReviewChanges' ,'common/main/lib/controller/Protection' - ,'common/main/lib/controller/Themes' - ,'common/main/lib/controller/Desktop' ], function() { app.start(); }); diff --git a/apps/spreadsheeteditor/main/app/controller/DocumentHolder.js b/apps/spreadsheeteditor/main/app/controller/DocumentHolder.js index ea87aa03a..5137cafa3 100644 --- a/apps/spreadsheeteditor/main/app/controller/DocumentHolder.js +++ b/apps/spreadsheeteditor/main/app/controller/DocumentHolder.js @@ -172,6 +172,9 @@ define([ me.hideCoAuthTips(); me.hideForeignSelectTips(); me.onDocumentResize(); + if (me.api && !me.tooltips.input_msg.isHidden && me.tooltips.input_msg.text) { + me.changeInputMessagePosition(me.tooltips.input_msg); + } }, 'cells:range': function(status){ me.onCellsRange(status); @@ -233,7 +236,7 @@ define([ view.menuParagraphVAlign.menu.on('item:click', _.bind(me.onParagraphVAlign, me)); view.menuParagraphDirection.menu.on('item:click', _.bind(me.onParagraphDirection, me)); view.menuParagraphBullets.menu.on('item:click', _.bind(me.onSelectBulletMenu, me)); - view.menuParagraphBullets.menu.on('render:after', _.bind(me.onBulletMenuShowAfter, me)); + // view.menuParagraphBullets.menu.on('render:after', _.bind(me.onBulletMenuShowAfter, me)); view.menuParagraphBullets.menu.on('show:after', _.bind(me.onBulletMenuShowAfter, me)); view.menuAddHyperlinkShape.on('click', _.bind(me.onInsHyperlink, me)); view.menuEditHyperlinkShape.on('click', _.bind(me.onInsHyperlink, me)); @@ -915,6 +918,7 @@ define([ api: me.api, props: props, type: 0, + storage: me.permissions.canRequestInsertImage || me.permissions.fileChoiceUrl && me.permissions.fileChoiceUrl.indexOf("{documentType}")>-1, interfaceLang: me.permissions.lang, handler: function(result, value) { if (result == 'ok') { @@ -946,7 +950,25 @@ define([ rawData = record; } - if (this.api) + if (rawData.type===0 && rawData.subtype===0x1000) {// custom bullet + var bullet = new Asc.asc_CBullet(); + if (rawData.drawdata.type===Asc.asc_PreviewBulletType.char) { + bullet.asc_putSymbol(rawData.drawdata.char); + bullet.asc_putFont(rawData.drawdata.specialFont); + } else if (rawData.drawdata.type===Asc.asc_PreviewBulletType.image) + bullet.asc_fillBulletImage(rawData.drawdata.imageId); + + var props; + var selectedObjects = this.api.asc_getGraphicObjectProps(); + for (var i = 0; i < selectedObjects.length; i++) { + if (selectedObjects[i].asc_getObjectType() == Asc.c_oAscTypeSelectElement.Paragraph) { + props = selectedObjects[i].asc_getObjectValue(); + props.asc_putBullet(bullet); + this.api.asc_setGraphicObjectProps(props); + break; + } + } + } else this.api.asc_setListType(rawData.type, rawData.subtype); if (e.type !== 'click') @@ -1863,6 +1885,8 @@ define([ event.preventDefault(); event.stopPropagation(); return false; + } else if (key == Common.UI.Keys.ESC && !this.tooltips.input_msg.isHidden && this.tooltips.input_msg.text) { + this.onInputMessage(); } } }, @@ -2106,9 +2130,48 @@ define([ documentHolder.menuParagraphDirect270.setChecked(direct == Asc.c_oAscVertDrawingText.vert270); documentHolder.menuParagraphBulletNone.setChecked(listtype.get_ListType() == -1); - // documentHolder.mnuListSettings.setDisabled(listtype.get_ListType() == -1); - var rec = documentHolder.paraBulletsPicker.store.findWhere({ type: listtype.get_ListType(), subtype: listtype.get_ListSubType() }); + var type = listtype.get_ListType(), + subtype = listtype.get_ListSubType(), + rec, + defrec = documentHolder.paraBulletsPicker.store.at(7), + drawDefBullet = (defrec.get('subtype')===0x1000) && (type===1 || subtype!==0x1000); + if (type===1 || subtype!==0x1000) { + rec = documentHolder.paraBulletsPicker.store.findWhere({ type: type, subtype: subtype }); + } else { + var bullet = listtype.asc_getListCustom(); + if (bullet) { + var bullettype = bullet.asc_getType(); + if (bullettype === Asc.asc_PreviewBulletType.char) { + var symbol = bullet.asc_getChar(); + if (symbol) { + rec = defrec; + rec.set('subtype', 0x1000); + rec.set('drawdata', {type: bullettype, char: symbol, specialFont: bullet.asc_getSpecialFont()}); + rec.set('tip', ''); + documentHolder.paraBulletsPicker.dataViewItems && this.updateBulletTip(documentHolder.paraBulletsPicker.dataViewItems[7], ''); + drawDefBullet = false; + + } + } else if (bullettype === Asc.asc_PreviewBulletType.image) { + var id = bullet.asc_getImageId(); + if (id) { + rec = defrec; + rec.set('subtype', 0x1000); + rec.set('drawdata', {type: bullettype, imageId: id}); + rec.set('tip', ''); + documentHolder.paraBulletsPicker.dataViewItems && this.updateBulletTip(documentHolder.paraBulletsPicker.dataViewItems[7], ''); + drawDefBullet = false; + } + } + } + } documentHolder.paraBulletsPicker.selectRecord(rec, true); + if (drawDefBullet) { + defrec.set('subtype', 8); + defrec.set('drawdata', documentHolder._markersArr[7]); + defrec.set('tip', documentHolder.tipMarkersDash); + documentHolder.paraBulletsPicker.dataViewItems && this.updateBulletTip(documentHolder.paraBulletsPicker.dataViewItems[7], documentHolder.tipMarkersDash); + } } else if (elType == Asc.c_oAscTypeSelectElement.Paragraph) { documentHolder.pmiTextAdvanced.textInfo = selectedObjects[i].asc_getObjectValue(); isObjLocked = isObjLocked || documentHolder.pmiTextAdvanced.textInfo.asc_getLocked(); @@ -2327,7 +2390,7 @@ define([ canComment = iscellmenu && !iscelledit && this.permissions.canCoAuthoring && this.permissions.canComments && !this._isDisabled && cellinfo.asc_getComments() && cellinfo.asc_getComments().length < 1; documentHolder.menuViewUndo.setVisible(this.permissions.canCoAuthoring && this.permissions.canComments && !this._isDisabled); - documentHolder.menuViewUndo.setDisabled(!this.api.asc_getCanUndo() && !this._isDisabled); + documentHolder.menuViewUndo.setDisabled(!this.api.asc_getCanUndo()); documentHolder.menuViewCopySeparator.setVisible(isInSign); var isRequested = (signProps) ? signProps.asc_getRequested() : false; @@ -2768,6 +2831,26 @@ define([ } }, + changeInputMessagePosition: function (inputTip) { + var pos = [ + this.documentHolder.cmpEl.offset().left - $(window).scrollLeft(), + this.documentHolder.cmpEl.offset().top - $(window).scrollTop() + ], + coord = this.api.asc_getActiveCellCoord(), + showPoint = [coord.asc_getX() + pos[0] - 3, coord.asc_getY() + pos[1] - inputTip.ref.getBSTip().$tip.height() - 5]; + var tipwidth = inputTip.ref.getBSTip().$tip.width(); + if (showPoint[0] + tipwidth > this.tooltips.coauth.bodyWidth ) + showPoint[0] = this.tooltips.coauth.bodyWidth - tipwidth; + if (showPoint[1] < pos[1]) + showPoint[1] = pos[1] + coord.asc_getY() + coord.asc_getHeight() + 5; + + inputTip.ref.getBSTip().$tip.css({ + top : showPoint[1] + 'px', + left: showPoint[0] + 'px', + 'z-index': 900 + }); + }, + onInputMessage: function(title, message) { var inputtip = this.tooltips.input_msg; @@ -2794,28 +2877,24 @@ define([ inputtip.ref = new Common.UI.Tooltip({ owner : inputtip.parentEl, html : true, - title : hint + title : hint, + keepvisible: true }); inputtip.ref.show([-10000, -10000]); + + var $tip = inputtip.ref.getBSTip().$tip; + $tip.on('click', function () { + inputtip.ref.hide(); + inputtip.ref = undefined; + inputtip.text = ''; + inputtip.isHidden = true; + }); + inputtip.isHidden = false; } - var pos = [ - this.documentHolder.cmpEl.offset().left - $(window).scrollLeft(), - this.documentHolder.cmpEl.offset().top - $(window).scrollTop() - ], - coord = this.api.asc_getActiveCellCoord(), - showPoint = [coord.asc_getX() + pos[0] - 3, coord.asc_getY() + pos[1] - inputtip.ref.getBSTip().$tip.height() - 5]; - var tipwidth = inputtip.ref.getBSTip().$tip.width(); - if (showPoint[0] + tipwidth > this.tooltips.coauth.bodyWidth ) - showPoint[0] = this.tooltips.coauth.bodyWidth - tipwidth; - - inputtip.ref.getBSTip().$tip.css({ - top : showPoint[1] + 'px', - left: showPoint[0] + 'px', - 'z-index': 900 - }); + this.changeInputMessagePosition(inputtip); } else { if (!inputtip.isHidden && inputtip.ref) { inputtip.ref.hide(); @@ -3743,6 +3822,7 @@ define([ outerMenu: {menu: view.menuParagraphBullets.menu, index: 0}, groups : view.paraBulletsPicker.groups, store : view.paraBulletsPicker.store, + delayRenderTips: true, itemTemplate: _.template('<% if (type==0) { %>' + '
    ' + '<% } else if (type==1) { %>' + @@ -3758,17 +3838,30 @@ define([ var store = this.documentHolder.paraBulletsPicker.store; var arrNum = [], arrMarker = []; store.each(function(item){ - if (item.get('group')=='menu-list-bullet-group') - arrMarker.push(item.get('id')); + var data = item.get('drawdata'); + data['divId'] = item.get('id'); + if (item.get('group')==='menu-list-bullet-group') + arrMarker.push(data); else - arrNum.push(item.get('id')); + arrNum.push(data); }); + if (this.api && this.api.SetDrawImagePreviewBulletForMenu) { this.api.SetDrawImagePreviewBulletForMenu(arrMarker, 0); this.api.SetDrawImagePreviewBulletForMenu(arrNum, 1); } }, + updateBulletTip: function(view, title) { + if (view) { + var tip = $(view.el).data('bs.tooltip'); + if (tip) { + tip.options.title = title; + tip.$tip.find('.tooltip-inner').text(title); + } + } + }, + onSignatureClick: function(item) { var datavalue = item.cmpEl.attr('data-value'); switch (item.value) { diff --git a/apps/spreadsheeteditor/main/app/controller/Main.js b/apps/spreadsheeteditor/main/app/controller/Main.js index 3cbd72ca0..778a8bc05 100644 --- a/apps/spreadsheeteditor/main/app/controller/Main.js +++ b/apps/spreadsheeteditor/main/app/controller/Main.js @@ -230,7 +230,7 @@ define([ strongCompare : this._compareActionWeak, weakCompare : this._compareActionWeak }); - + this.stackMacrosRequests = []; this.isShowOpenDialog = false; // Initialize api gateway @@ -463,6 +463,9 @@ define([ value = parseInt(value); Common.Utils.InternalSettings.set("sse-macros-mode", value); + value = Common.localStorage.getItem("sse-allow-macros-request"); + Common.Utils.InternalSettings.set("sse-allow-macros-request", (value !== null) ? parseInt(value) : 0); + this.appOptions.wopi = this.editorConfig.wopi; this.isFrameClosed = (this.appOptions.isEditDiagram || this.appOptions.isEditMailMerge || this.appOptions.isEditOle); @@ -520,6 +523,7 @@ define([ this.api.asc_registerCallback('asc_onGetEditorPermissions', _.bind(this.onEditorPermissions, this)); this.api.asc_registerCallback('asc_onLicenseChanged', _.bind(this.onLicenseChanged, this)); + this.api.asc_registerCallback('asc_onMacrosPermissionRequest', _.bind(this.onMacrosPermissionRequest, this)); this.api.asc_registerCallback('asc_onRunAutostartMacroses', _.bind(this.onRunAutostartMacroses, this)); this.api.asc_setDocInfo(docInfo); this.api.asc_getEditorPermissions(this.editorConfig.licenseUrl, this.editorConfig.customerId); @@ -866,6 +870,9 @@ define([ var zf = (value!==null) ? parseInt(value)/100 : (this.appOptions.customization && this.appOptions.customization.zoom ? parseInt(this.appOptions.customization.zoom)/100 : 1); this.api.asc_setZoom(zf>0 ? zf : 1); + value = Common.localStorage.getBool("sse-settings-use-alt-key", true); + Common.Utils.InternalSettings.set("sse-settings-use-alt-key", value); + /** coauthoring begin **/ this.isLiveCommenting = Common.localStorage.getBool("sse-settings-livecomment", true); Common.Utils.InternalSettings.set("sse-settings-livecomment", this.isLiveCommenting); @@ -2838,6 +2845,47 @@ define([ } }, + onMacrosPermissionRequest: function(url, callback) { + if (url && callback) { + this.stackMacrosRequests.push({url: url, callback: callback}); + if (this.stackMacrosRequests.length>1) { + return; + } + } else if (this.stackMacrosRequests.length>0) { + url = this.stackMacrosRequests[0].url; + callback = this.stackMacrosRequests[0].callback; + } else + return; + + var me = this; + var value = Common.Utils.InternalSettings.get("sse-allow-macros-request"); + if (value>0) { + callback && callback(value === 1); + this.stackMacrosRequests.shift(); + this.onMacrosPermissionRequest(); + } else { + Common.UI.warning({ + msg: this.textRequestMacros.replace('%1', url), + buttons: ['yes', 'no'], + primary: 'yes', + dontshow: true, + textDontShow: this.textRememberMacros, + maxwidth: 600, + callback: function(btn, dontshow){ + if (dontshow) { + Common.Utils.InternalSettings.set("sse-allow-macros-request", (btn == 'yes') ? 1 : 2); + Common.localStorage.setItem("sse-allow-macros-request", (btn == 'yes') ? 1 : 2); + } + setTimeout(function() { + if (callback) callback(btn == 'yes'); + me.stackMacrosRequests.shift(); + me.onMacrosPermissionRequest(); + }, 1); + } + }); + } + }, + loadAutoCorrectSettings: function() { // autocorrection var me = this; @@ -3534,7 +3582,9 @@ define([ textFormulaFilledFirstRowsOtherIsEmpty: 'Formula filled only first {0} rows by memory save reason. Other rows in this sheet don\'t have data.', textFormulaFilledFirstRowsOtherHaveData: 'Formula filled only first {0} rows have data by memory save reason. There are other {1} rows have data in this sheet. You can fill them manually.', textReconnect: 'Connection is restored', - errorCannotUseCommandProtectedSheet: 'You cannot use this command on a protected sheet. To use this command, unprotect the sheet.
    You might be requested to enter a password.' + errorCannotUseCommandProtectedSheet: 'You cannot use this command on a protected sheet. To use this command, unprotect the sheet.
    You might be requested to enter a password.', + textRequestMacros: 'A macro makes a request to URL. Do you want to allow the request to the %1?', + textRememberMacros: 'Remember my choice for all macros' } })(), SSE.Controllers.Main || {})) }); diff --git a/apps/spreadsheeteditor/main/app/controller/Print.js b/apps/spreadsheeteditor/main/app/controller/Print.js index 6a5071ecb..4bbaaedf4 100644 --- a/apps/spreadsheeteditor/main/app/controller/Print.js +++ b/apps/spreadsheeteditor/main/app/controller/Print.js @@ -124,11 +124,18 @@ define([ this.api.asc_registerCallback('asc_onSheetsChanged', _.bind(this.updateSheetsInfo, this)); this.api.asc_registerCallback('asc_onPrintPreviewSheetChanged', _.bind(this.onApiChangePreviewSheet, this)); this.api.asc_registerCallback('asc_onPrintPreviewPageChanged', _.bind(this.onApiChangePreviewPage, this)); + this.api.asc_registerCallback('asc_onPrintPreviewSheetDataChanged', _.bind(this.onApiPreviewSheetDataChanged, this)); }, updateSheetsInfo: function() { if (this.printSettings.isVisible()) { this.updateSettings(this.printSettings); + this.printSettings.cmbSheet.store.each(function (item) { + var sheetIndex = item.get('value'); + if (!this._changedProps[sheetIndex]) { + this._changedProps[sheetIndex] = this.api.asc_getPageOptions(sheetIndex, true, true); + } + }, this); } else { this.isFillSheets = false; } @@ -152,15 +159,13 @@ define([ panel.cmbSheet.store.findWhere({value: this.api.asc_getActiveWorksheetIndex()}); if (item) { panel.cmbSheet.setValue(item.get('value')); + panel.updateActiveSheet && panel.updateActiveSheet(item.get('displayValue')); } }, comboSheetsChange: function(panel, combo, record) { var currentSheet = record.value; this.fillPageOptions(panel, this._changedProps[currentSheet] ? this._changedProps[currentSheet] : this.api.asc_getPageOptions(currentSheet, true), currentSheet); - if (!this._changedProps[currentSheet]) { - this._changedProps[currentSheet] = this.getPageOptions(this.printSettings, currentSheet); - } }, fillPageOptions: function(panel, props, sheet) { @@ -316,6 +321,7 @@ define([ }, onShowMainSettingsPrint: function() { + var me = this; this._changedProps = []; this.printSettings.$previewBox.removeClass('hidden'); @@ -323,10 +329,15 @@ define([ this.isFillSheets = true; this.updateSettings(this.printSettings); } + this.printSettings.cmbSheet.store.each(function (item) { + var sheetIndex = item.get('value'); + me._changedProps[sheetIndex] = me.api.asc_getPageOptions(sheetIndex, true, true); + }, this); + this.adjPrintParams.asc_setPageOptionsMap(this._changedProps); this.fillPrintOptions(this.adjPrintParams, false); - var opts = new Asc.asc_CDownloadOptions(null, Common.Utils.isChrome || Common.Utils.isSafari || Common.Utils.isOpera || Common.Utils.isGecko && Common.Utils.firefoxVersion>86); + var opts = new Asc.asc_CDownloadOptions(null, Common.Utils.isChrome || Common.Utils.isOpera || Common.Utils.isGecko && Common.Utils.firefoxVersion>86); opts.asc_setAdvancedOptions(this.adjPrintParams); var pageCount = this.api.asc_initPrintPreview('print-preview', opts); @@ -412,7 +423,7 @@ define([ this.adjPrintParams.asc_setIgnorePrintArea(this.printSettings.getIgnorePrintArea()); Common.localStorage.setItem("sse-print-settings-range", printType); - var opts = new Asc.asc_CDownloadOptions(null, Common.Utils.isChrome || Common.Utils.isSafari || Common.Utils.isOpera || Common.Utils.isGecko && Common.Utils.firefoxVersion>86); + var opts = new Asc.asc_CDownloadOptions(null, Common.Utils.isChrome || Common.Utils.isOpera || Common.Utils.isGecko && Common.Utils.firefoxVersion>86); opts.asc_setAdvancedOptions(this.adjPrintParams); this.api.asc_Print(opts); Common.NotificationCenter.trigger('edit:complete', view); @@ -711,23 +722,27 @@ define([ updatePreview: function (needUpdate) { if (this._isPreviewVisible) { + this.printSettings.$previewBox.removeClass('hidden'); + var adjPrintParams = new Asc.asc_CAdjustPrint(), printType = this.printSettings.getRange(); adjPrintParams.asc_setPrintType(printType); adjPrintParams.asc_setPageOptionsMap(this._changedProps); adjPrintParams.asc_setIgnorePrintArea(this.printSettings.getIgnorePrintArea()); - var opts = new Asc.asc_CDownloadOptions(null, Common.Utils.isChrome || Common.Utils.isSafari || Common.Utils.isOpera || Common.Utils.isGecko && Common.Utils.firefoxVersion>86); + var opts = new Asc.asc_CDownloadOptions(null, Common.Utils.isChrome || Common.Utils.isOpera || Common.Utils.isGecko && Common.Utils.firefoxVersion>86); opts.asc_setAdvancedOptions(adjPrintParams); var pageCount = this.api.asc_updatePrintPreview(opts); + this.printSettings.$previewBox.toggleClass('hidden', !pageCount); + this.printSettings.$previewEmpty.toggleClass('hidden', !!pageCount); var newPage; if (this._currentPrintType !== printType) { newPage = 0; this._currentPrintType = printType; } else if (this._navigationPreview.currentPage > pageCount - 1) { - newPage = pageCount - 1; + newPage = Math.max(0, pageCount - 1); } else { newPage = this._navigationPreview.currentPage; } @@ -740,16 +755,14 @@ define([ }, onApiChangePreviewSheet: function (index) { + var item = this.printSettings.cmbSheet.store.findWhere({value: index}); + this.printSettings.updateActiveSheet(item.get('displayValue')); + if (this.notUpdateSheetSettings) { this.notUpdateSheetSettings = false; - return - } - var item = this.printSettings.cmbSheet.store.findWhere({value: index}); - if (item) { + } else if (item) { this.printSettings.cmbSheet.setValue(item.get('value')); this.comboSheetsChange(this.printSettings, this.printSettings.cmbSheet, item.toJSON()); - var sheetName = this.api.asc_getWorksheetName(index); - this.printSettings.updateActiveSheet(sheetName); } }, @@ -786,6 +799,16 @@ define([ } }, + onApiPreviewSheetDataChanged: function (needUpdate) { + if (needUpdate) { + this.updatePreview(); + } else { + this.notUpdateSheetSettings = true; + this.api.asc_drawPrintPreview(this._navigationPreview.currentPage); + this.updateNavigationButtons(this._navigationPreview.currentPage, this._navigationPreview.pageCount); + } + }, + warnCheckMargings: 'Margins are incorrect', strAllSheets: 'All Sheets', textWarning: 'Warning', diff --git a/apps/spreadsheeteditor/main/app/controller/Toolbar.js b/apps/spreadsheeteditor/main/app/controller/Toolbar.js index 585894f26..5bd64d2cd 100644 --- a/apps/spreadsheeteditor/main/app/controller/Toolbar.js +++ b/apps/spreadsheeteditor/main/app/controller/Toolbar.js @@ -3911,6 +3911,7 @@ define([ var wbtab = me.getApplication().getController('WBProtection'); $panel.append(wbtab.createToolbarPanel()); me.toolbar.addTab(tab, $panel, 7); + me.toolbar.setVisible('protect', Common.UI.LayoutManager.isElementVisible('toolbar-protect')); Array.prototype.push.apply(me.toolbar.lockControls, wbtab.getView('WBProtection').getButtons()); } } diff --git a/apps/spreadsheeteditor/main/app/controller/ViewTab.js b/apps/spreadsheeteditor/main/app/controller/ViewTab.js index 66637dbd8..1260ac14e 100644 --- a/apps/spreadsheeteditor/main/app/controller/ViewTab.js +++ b/apps/spreadsheeteditor/main/app/controller/ViewTab.js @@ -84,7 +84,6 @@ define([ mode: mode, compactToolbar: this.toolbar.toolbar.isCompactView }); - this.addListeners({ 'ViewTab': { 'zoom:selected': _.bind(this.onSelectedZoomValue, this), @@ -276,7 +275,7 @@ define([ }, onThemeChanged: function () { - if (this.view) { + if (this.view && Common.UI.Themes.available()) { var current_theme = Common.UI.Themes.currentThemeId() || Common.UI.Themes.defaultThemeId(), menu_item = _.findWhere(this.view.btnInterfaceTheme.menu.items, {value: current_theme}); if ( !!menu_item ) { diff --git a/apps/spreadsheeteditor/main/app/template/StatusBar.template b/apps/spreadsheeteditor/main/app/template/StatusBar.template index 780145617..68367459b 100644 --- a/apps/spreadsheeteditor/main/app/template/StatusBar.template +++ b/apps/spreadsheeteditor/main/app/template/StatusBar.template @@ -1,10 +1,8 @@
    - -
    diff --git a/apps/spreadsheeteditor/main/app/view/DocumentHolder.js b/apps/spreadsheeteditor/main/app/view/DocumentHolder.js index 159f2d452..bcf77715e 100644 --- a/apps/spreadsheeteditor/main/app/view/DocumentHolder.js +++ b/apps/spreadsheeteditor/main/app/view/DocumentHolder.js @@ -966,25 +966,35 @@ define([ }) }); + me._markersArr = [ + {type: Asc.asc_PreviewBulletType.char, char: String.fromCharCode(0x00B7), specialFont: 'Symbol'}, + {type: Asc.asc_PreviewBulletType.char, char: 'o', specialFont: 'Courier New'}, + {type: Asc.asc_PreviewBulletType.char, char: String.fromCharCode(0x00A7), specialFont: 'Wingdings'}, + {type: Asc.asc_PreviewBulletType.char, char: String.fromCharCode(0x0076), specialFont: 'Wingdings'}, + {type: Asc.asc_PreviewBulletType.char, char: String.fromCharCode(0x00D8), specialFont: 'Wingdings'}, + {type: Asc.asc_PreviewBulletType.char, char: String.fromCharCode(0x00FC), specialFont: 'Wingdings'}, + {type: Asc.asc_PreviewBulletType.char, char: String.fromCharCode(0x00A8), specialFont: 'Symbol'}, + {type: Asc.asc_PreviewBulletType.char, char: String.fromCharCode(0x2013), specialFont: 'Arial'} + ]; me.paraBulletsPicker = { conf: {rec: null}, delayRenderTips: true, store : new Common.UI.DataViewStore([ - {group: 'menu-list-bullet-group', id: 'id-markers-' + Common.UI.getId(), type: 0, subtype: 1, skipRenderOnChange: true, tip: this.tipMarkersFRound}, - {group: 'menu-list-bullet-group', id: 'id-markers-' + Common.UI.getId(), type: 0, subtype: 2, skipRenderOnChange: true, tip: this.tipMarkersHRound}, - {group: 'menu-list-bullet-group', id: 'id-markers-' + Common.UI.getId(), type: 0, subtype: 3, skipRenderOnChange: true, tip: this.tipMarkersFSquare}, - {group: 'menu-list-bullet-group', id: 'id-markers-' + Common.UI.getId(), type: 0, subtype: 4, skipRenderOnChange: true, tip: this.tipMarkersStar}, - {group: 'menu-list-bullet-group', id: 'id-markers-' + Common.UI.getId(), type: 0, subtype: 5, skipRenderOnChange: true, tip: this.tipMarkersArrow}, - {group: 'menu-list-bullet-group', id: 'id-markers-' + Common.UI.getId(), type: 0, subtype: 6, skipRenderOnChange: true, tip: this.tipMarkersCheckmark}, - {group: 'menu-list-bullet-group', id: 'id-markers-' + Common.UI.getId(), type: 0, subtype: 7, skipRenderOnChange: true, tip: this.tipMarkersFRhombus}, - {group: 'menu-list-bullet-group', id: 'id-markers-' + Common.UI.getId(), type: 0, subtype: 8, skipRenderOnChange: true, tip: this.tipMarkersDash}, - {group: 'menu-list-number-group', id: 'id-numbers-' + Common.UI.getId(), type: 1, subtype: 4, skipRenderOnChange: true, tip: this.tipNumCapitalLetters}, - {group: 'menu-list-number-group', id: 'id-numbers-' + Common.UI.getId(), type: 1, subtype: 5, skipRenderOnChange: true, tip: this.tipNumLettersParentheses}, - {group: 'menu-list-number-group', id: 'id-numbers-' + Common.UI.getId(), type: 1, subtype: 6, skipRenderOnChange: true, tip: this.tipNumLettersPoints}, - {group: 'menu-list-number-group', id: 'id-numbers-' + Common.UI.getId(), type: 1, subtype: 1, skipRenderOnChange: true, tip: this.tipNumNumbersPoint}, - {group: 'menu-list-number-group', id: 'id-numbers-' + Common.UI.getId(), type: 1, subtype: 2, skipRenderOnChange: true, tip: this.tipNumNumbersParentheses}, - {group: 'menu-list-number-group', id: 'id-numbers-' + Common.UI.getId(), type: 1, subtype: 3, skipRenderOnChange: true, tip: this.tipNumRoman}, - {group: 'menu-list-number-group', id: 'id-numbers-' + Common.UI.getId(), type: 1, subtype: 7, skipRenderOnChange: true, tip: this.tipNumRomanSmall} + {group: 'menu-list-bullet-group', id: 'id-markers-' + Common.UI.getId(), type: 0, subtype: 1, drawdata: me._markersArr[0], skipRenderOnChange: true, tip: this.tipMarkersFRound}, + {group: 'menu-list-bullet-group', id: 'id-markers-' + Common.UI.getId(), type: 0, subtype: 2, drawdata: me._markersArr[1], skipRenderOnChange: true, tip: this.tipMarkersHRound}, + {group: 'menu-list-bullet-group', id: 'id-markers-' + Common.UI.getId(), type: 0, subtype: 3, drawdata: me._markersArr[2], skipRenderOnChange: true, tip: this.tipMarkersFSquare}, + {group: 'menu-list-bullet-group', id: 'id-markers-' + Common.UI.getId(), type: 0, subtype: 4, drawdata: me._markersArr[3], skipRenderOnChange: true, tip: this.tipMarkersStar}, + {group: 'menu-list-bullet-group', id: 'id-markers-' + Common.UI.getId(), type: 0, subtype: 5, drawdata: me._markersArr[4], skipRenderOnChange: true, tip: this.tipMarkersArrow}, + {group: 'menu-list-bullet-group', id: 'id-markers-' + Common.UI.getId(), type: 0, subtype: 6, drawdata: me._markersArr[5], skipRenderOnChange: true, tip: this.tipMarkersCheckmark}, + {group: 'menu-list-bullet-group', id: 'id-markers-' + Common.UI.getId(), type: 0, subtype: 7, drawdata: me._markersArr[6], skipRenderOnChange: true, tip: this.tipMarkersFRhombus}, + {group: 'menu-list-bullet-group', id: 'id-markers-' + Common.UI.getId(), type: 0, subtype: 8, drawdata: me._markersArr[7], skipRenderOnChange: true, tip: this.tipMarkersDash}, + {group: 'menu-list-number-group', id: 'id-numbers-' + Common.UI.getId(), type: 1, subtype: 4, drawdata: {type: Asc.asc_PreviewBulletType.number, numberingType: Asc.asc_oAscNumberingLevel.UpperLetterDot_Left}, skipRenderOnChange: true, tip: this.tipNumCapitalLetters}, + {group: 'menu-list-number-group', id: 'id-numbers-' + Common.UI.getId(), type: 1, subtype: 5, drawdata: {type: Asc.asc_PreviewBulletType.number, numberingType: Asc.asc_oAscNumberingLevel.LowerLetterBracket_Left}, skipRenderOnChange: true, tip: this.tipNumLettersParentheses}, + {group: 'menu-list-number-group', id: 'id-numbers-' + Common.UI.getId(), type: 1, subtype: 6, drawdata: {type: Asc.asc_PreviewBulletType.number, numberingType: Asc.asc_oAscNumberingLevel.LowerLetterDot_Left}, skipRenderOnChange: true, tip: this.tipNumLettersPoints}, + {group: 'menu-list-number-group', id: 'id-numbers-' + Common.UI.getId(), type: 1, subtype: 1, drawdata: {type: Asc.asc_PreviewBulletType.number, numberingType: Asc.asc_oAscNumberingLevel.DecimalDot_Right}, skipRenderOnChange: true, tip: this.tipNumNumbersPoint}, + {group: 'menu-list-number-group', id: 'id-numbers-' + Common.UI.getId(), type: 1, subtype: 2, drawdata: {type: Asc.asc_PreviewBulletType.number, numberingType: Asc.asc_oAscNumberingLevel.DecimalBracket_Right}, skipRenderOnChange: true, tip: this.tipNumNumbersParentheses}, + {group: 'menu-list-number-group', id: 'id-numbers-' + Common.UI.getId(), type: 1, subtype: 3, drawdata: {type: Asc.asc_PreviewBulletType.number, numberingType: Asc.asc_oAscNumberingLevel.UpperRomanDot_Right}, skipRenderOnChange: true, tip: this.tipNumRoman}, + {group: 'menu-list-number-group', id: 'id-numbers-' + Common.UI.getId(), type: 1, subtype: 7, drawdata: {type: Asc.asc_PreviewBulletType.number, numberingType: Asc.asc_oAscNumberingLevel.LowerRomanDot_Right}, skipRenderOnChange: true, tip: this.tipNumRomanSmall} ]), groups: new Common.UI.DataViewGroupStore([ {id: 'menu-list-bullet-group', caption: this.textBullets}, diff --git a/apps/spreadsheeteditor/main/app/view/FileMenuPanels.js b/apps/spreadsheeteditor/main/app/view/FileMenuPanels.js index 12be34634..aae5722aa 100644 --- a/apps/spreadsheeteditor/main/app/view/FileMenuPanels.js +++ b/apps/spreadsheeteditor/main/app/view/FileMenuPanels.js @@ -242,6 +242,9 @@ define([ //'', '
    ', '', + '', + '
    ', + '', '', '', '', @@ -363,6 +366,14 @@ define([ dataHintOffset: 'small' }); + this.chUseAltKey = new Common.UI.CheckBox({ + el: $markup.findById('#fms-chb-use-alt-key'), + labelText: Common.Utils.isMac ? this.txtUseOptionKey : this.txtUseAltKey, + dataHint: '2', + dataHintDirection: 'left', + dataHintOffset: 'small' + }); + this.rbCoAuthModeFast = new Common.UI.RadioBox({ el : $markup.findById('#fms-rb-coauth-mode-fast'), name : 'coauth-mode', @@ -774,6 +785,7 @@ define([ value = (value!==null) ? parseInt(value) : (this.mode.customization && this.mode.customization.zoom ? parseInt(this.mode.customization.zoom) : 100); var item = this.cmbZoom.store.findWhere({value: value}); this.cmbZoom.setValue(item ? parseInt(item.get('value')) : (value>0 ? value+'%' : 100)); + this.chUseAltKey.setValue(Common.Utils.InternalSettings.get("sse-settings-use-alt-key")); /** coauthoring begin **/ this.chLiveComment.setValue(Common.Utils.InternalSettings.get("sse-settings-livecomment")); @@ -904,6 +916,8 @@ define([ applySettings: function() { Common.UI.Themes.setTheme(this.cmbTheme.getValue()); + Common.localStorage.setItem("sse-settings-use-alt-key", this.chUseAltKey.isChecked() ? 1 : 0); + Common.Utils.InternalSettings.set("sse-settings-use-alt-key", Common.localStorage.getBool("sse-settings-use-alt-key")); Common.localStorage.setItem("sse-settings-zoom", this.cmbZoom.getValue()); Common.Utils.InternalSettings.set("sse-settings-zoom", Common.localStorage.getItem("sse-settings-zoom")); /** coauthoring begin **/ @@ -1129,6 +1143,8 @@ define([ strShowResolvedComments: 'Show resolved comments', txtWorkspace: 'Workspace', strReferenceStyle: 'R1C1 reference style', + txtUseAltKey: 'Use Alt key to navigate the user interface using the keyboard', + txtUseOptionKey: 'Use Option key to navigate the user interface using the keyboard', txtRegion: 'Region', txtProofing: 'Proofing', strDictionaryLanguage: 'Dictionary language', diff --git a/apps/spreadsheeteditor/main/app/view/FormatRulesEditDlg.js b/apps/spreadsheeteditor/main/app/view/FormatRulesEditDlg.js index bab9b24b5..1b55567ce 100644 --- a/apps/spreadsheeteditor/main/app/view/FormatRulesEditDlg.js +++ b/apps/spreadsheeteditor/main/app/view/FormatRulesEditDlg.js @@ -531,8 +531,13 @@ define([ 'text!spreadsheeteditor/main/app/template/FormatRulesEditDlg.template', menu : new Common.UI.Menu({ menuAlign : 'tl-tr', items : [ - { template: _.template('
    '), stopPropagation: true }, - { template: _.template('' + this.textNewColor + ''), stopPropagation: true } + { template: _.template('
    '), stopPropagation: true }, + {caption: '--'}, + { + id: "format-rules-borders-menu-new-bordercolor", + template: _.template('' + this.textNewColor + ''), + stopPropagation: true + } ] }) }) @@ -542,8 +547,10 @@ define([ 'text!spreadsheeteditor/main/app/template/FormatRulesEditDlg.template', this.btnBorders.menu.on('item:click', _.bind(this.onBordersMenu, this)); this.btnBorders.on('click', _.bind(this.onBorders, this)); this.mnuBorderColorPicker = new Common.UI.ThemeColorPalette({ - el: $('#format-rules-borders-menu-bordercolor') + el: $('#format-rules-borders-menu-bordercolor'), + outerMenu: {menu: this.mnuBorderColor.menu, index: 0, focusOnShow: true} }); + this.mnuBorderColor.menu.setInnerMenu([{menu: this.mnuBorderColorPicker, index: 0}]); this.mnuBorderColorPicker.on('select', _.bind(this.onBordersColor, this)); $('#format-rules-borders-menu-new-bordercolor').on('click', _.bind(function() { me.mnuBorderColorPicker.addNewColor(); diff --git a/apps/spreadsheeteditor/main/app/view/ShapeSettingsAdvanced.js b/apps/spreadsheeteditor/main/app/view/ShapeSettingsAdvanced.js index 2bb6390e7..510be9f0b 100644 --- a/apps/spreadsheeteditor/main/app/view/ShapeSettingsAdvanced.js +++ b/apps/spreadsheeteditor/main/app/view/ShapeSettingsAdvanced.js @@ -637,6 +637,7 @@ define([ 'text!spreadsheeteditor/main/app/template/ShapeSettingsAdvanced.temp this.chOverflow.setDisabled(true); this.chFlipHor.setDisabled(true); this.chFlipVert.setDisabled(true); + this.btnsCategory[0].setDisabled(true); } this.spnWidth.setValue(Common.Utils.Metric.fnRecalcFromMM(props.asc_getWidth()).toFixed(2), true); @@ -646,7 +647,8 @@ define([ 'text!spreadsheeteditor/main/app/template/ShapeSettingsAdvanced.temp this._nRatio = props.asc_getWidth()/props.asc_getHeight(); var value = props.asc_getLockAspect(); - this.btnRatio.toggle(value); + this.btnRatio.toggle(value || shapeprops.asc_getFromSmartArt()); + this.btnRatio.setDisabled(!!shapeprops.asc_getFromSmartArt()); // can resize smart art only proportionately this._setShapeDefaults(shapeprops); diff --git a/apps/spreadsheeteditor/main/app/view/Statusbar.js b/apps/spreadsheeteditor/main/app/view/Statusbar.js index 19827c534..431bb844c 100644 --- a/apps/spreadsheeteditor/main/app/view/Statusbar.js +++ b/apps/spreadsheeteditor/main/app/view/Statusbar.js @@ -60,10 +60,8 @@ define([ events: function() { return { - 'click #status-btn-tabfirst': _.bind(this.onBtnTabScroll, this, 'first'), 'click #status-btn-tabback': _.bind(this.onBtnTabScroll, this, 'backward'), - 'click #status-btn-tabnext': _.bind(this.onBtnTabScroll, this, 'forward'), - 'click #status-btn-tablast': _.bind(this.onBtnTabScroll, this, 'last') + 'click #status-btn-tabnext': _.bind(this.onBtnTabScroll, this, 'forward') }; }, @@ -100,13 +98,6 @@ define([ hintAnchor: 'top-right' }); - this.btnScrollFirst = new Common.UI.Button({ - el: $('#status-btn-tabfirst',this.el), - hint: this.tipFirst, - disabled: true, - hintAnchor: 'top' - }); - this.btnScrollBack = new Common.UI.Button({ el: $('#status-btn-tabback',this.el), hint: this.tipPrev, @@ -121,13 +112,6 @@ define([ hintAnchor: 'top' }); - this.btnScrollLast = new Common.UI.Button({ - el: $('#status-btn-tablast',this.el), - hint: this.tipLast, - disabled: true, - hintAnchor: 'top' - }); - this.btnAddWorksheet = new Common.UI.Button({ el: $('#status-btn-addtab',this.el), hint: this.tipAddTab, @@ -335,8 +319,12 @@ define([ menuAlign: 'tl-tr', cls: 'color-tab', items: [ - { template: _.template('
    ') }, - { template: _.template('' + me.textNewColor + '') } + { template: _.template('
    ') }, + {caption: '--'}, + { + id: "id-tab-menu-new-color", + template: _.template('' + me.textNewColor + '') + } ] }); @@ -373,11 +361,15 @@ define([ }).on('render:after', function(btn) { me.mnuTabColor = new Common.UI.ThemeColorPalette({ el: $('#id-tab-menu-color'), + outerMenu: {menu: menuColorItems, index: 0, focusOnShow: true}, transparent: true }); - + menuColorItems.setInnerMenu([{menu: me.mnuTabColor, index: 0}]); me.mnuTabColor.on('select', function(picker, color) { me.fireEvent('sheet:setcolor', [color]); + setTimeout(function(){ + me.tabMenu.hide(); + }, 1); }); }); @@ -520,8 +512,6 @@ define([ this.btnAddWorksheet.setDisabled(this.mode.isDisconnected || this.api && (this.api.asc_isWorkbookLocked() || this.api.isCellEdited) || this.rangeSelectionMode!=Asc.c_oAscSelectionDialogType.None); if (this.mode.isEditOle) { // change hints order this.btnAddWorksheet.$el.find('button').addBack().filter('button').attr('data-hint', '1'); - this.btnScrollFirst.$el.find('button').addBack().filter('button').attr('data-hint', '1'); - this.btnScrollLast.$el.find('button').addBack().filter('button').attr('data-hint', '1'); this.btnScrollBack.$el.find('button').addBack().filter('button').attr('data-hint', '1'); this.btnScrollNext.$el.find('button').addBack().filter('button').attr('data-hint', '1'); this.cntSheetList.$el.find('button').attr('data-hint', '1'); @@ -817,13 +807,11 @@ define([ }, onTabInvisible: function(obj, opts) { - if (this.btnScrollFirst.isDisabled() !== (!opts.first)) { - this.btnScrollFirst.setDisabled(!opts.first); + if (this.btnScrollBack.isDisabled() !== (!opts.first)) { this.btnScrollBack.setDisabled(!opts.first); } if (this.btnScrollNext.isDisabled() !== (!opts.last)) { this.btnScrollNext.setDisabled(!opts.last); - this.btnScrollLast.setDisabled(!opts.last); } this.hasTabInvisible = opts.first || opts.last; }, @@ -850,8 +838,8 @@ define([ if (this.boxAction.is(':visible')) { var tabsWidth = this.tabbar.getWidth(); var actionWidth = this.actionWidth || 140; - if (Common.Utils.innerWidth() - right - 175 - actionWidth - tabsWidth > 0) { // docWidth - right - left - this.boxAction.width - var left = tabsWidth + 175; + if (Common.Utils.innerWidth() - right - 129 - actionWidth - tabsWidth > 0) { // docWidth - right - left - this.boxAction.width + var left = tabsWidth + 129; this.boxAction.css({'right': right + 'px', 'left': left + 'px', 'width': 'auto'}); this.boxAction.find('.separator').css('border-left-color', 'transparent'); } else { @@ -904,7 +892,7 @@ define([ changeViewMode: function (mode) { var edit = mode.isEdit; if (edit) { - this.tabBarBox.css('left', '175px'); + this.tabBarBox.css('left', '129px'); } else { this.tabBarBox.css('left', ''); } @@ -1035,8 +1023,6 @@ define([ tipZoomIn : 'Zoom In', tipZoomOut : 'Zoom Out', tipZoomFactor : 'Magnification', - tipFirst : 'First Sheet', - tipLast : 'Last Sheet', tipPrev : 'Previous Sheet', tipNext : 'Next Sheet', tipAddTab : 'Add Worksheet', diff --git a/apps/spreadsheeteditor/main/app/view/Toolbar.js b/apps/spreadsheeteditor/main/app/view/Toolbar.js index 0572660fd..26cc63ec1 100644 --- a/apps/spreadsheeteditor/main/app/view/Toolbar.js +++ b/apps/spreadsheeteditor/main/app/view/Toolbar.js @@ -2120,16 +2120,23 @@ define([ stopPropagation: true }, {caption: '--'}, - { template: _.template('
    '), stopPropagation: true }, - { template: _.template('' + this.textNewColor + ''), stopPropagation: true } + { template: _.template('
    '), stopPropagation: true }, + {caption: '--'}, + { + id: "id-toolbar-menu-new-bordercolor", + template: _.template('' + this.textNewColor + ''), + stopPropagation: true + } ] }) }) ] })); this.mnuBorderColorPicker = new Common.UI.ThemeColorPalette({ - el: $('#id-toolbar-menu-bordercolor') + el: $('#id-toolbar-menu-bordercolor'), + outerMenu: {menu: this.mnuBorderColor.menu, index: 2} }); + this.mnuBorderColor.menu.setInnerMenu([{menu: this.mnuBorderColorPicker, index: 2}]); } if ( this.btnInsertChart ) { diff --git a/apps/spreadsheeteditor/main/app/view/ViewTab.js b/apps/spreadsheeteditor/main/app/view/ViewTab.js index 768cba77c..b095bf02c 100644 --- a/apps/spreadsheeteditor/main/app/view/ViewTab.js +++ b/apps/spreadsheeteditor/main/app/view/ViewTab.js @@ -71,7 +71,7 @@ define([ '
    ' + '' + '
    ' + - '
    ' + + '
    ' + '
    ' + '' + '
    ' + @@ -307,7 +307,6 @@ define([ dataHintOffset: 'small' }); this.lockedControls.push(this.chToolbar); - Common.NotificationCenter.on('app:ready', this.onAppReady.bind(this)); }, @@ -385,6 +384,11 @@ define([ me.toolbar && me.toolbar.$el.find('.group.sheet-gridlines').hide(); } + if (!Common.UI.Themes.available()) { + me.btnInterfaceTheme.$el.closest('.group').remove(); + me.$el.find('.separator-theme').remove(); + } + if (config.canBrandingExt && config.customization && config.customization.statusBar === false || !Common.UI.LayoutManager.isElementVisible('statusBar')) { me.chStatusbar.$el.remove(); if (!config.isEdit) { @@ -396,26 +400,26 @@ define([ me.$el.find('.separator-formula').remove(); } } - var menuItems = [], - currentTheme = Common.UI.Themes.currentThemeId() || Common.UI.Themes.defaultThemeId(); - for (var t in Common.UI.Themes.map()) { - menuItems.push({ - value: t, - caption: Common.UI.Themes.get(t).text, - checked: t === currentTheme, - checkable: true, - toggleGroup: 'interface-theme' - }); + if (Common.UI.Themes.available()) { + var menuItems = [], + currentTheme = Common.UI.Themes.currentThemeId() || Common.UI.Themes.defaultThemeId(); + for (var t in Common.UI.Themes.map()) { + menuItems.push({ + value: t, + caption: Common.UI.Themes.get(t).text, + checked: t === currentTheme, + checkable: true, + toggleGroup: 'interface-theme' + }); + } + if (menuItems.length) { + me.btnInterfaceTheme.setMenu(new Common.UI.Menu({items: menuItems})); + me.btnInterfaceTheme.menu.on('item:click', _.bind(function (menu, item) { + var value = item.value; + Common.UI.Themes.setTheme(value); + }, me)); + } } - - if (menuItems.length) { - me.btnInterfaceTheme.setMenu(new Common.UI.Menu({items: menuItems})); - me.btnInterfaceTheme.menu.on('item:click', _.bind(function (menu, item) { - var value = item.value; - Common.UI.Themes.setTheme(value); - }, me)); - } - setEvents.call(me); }); }, diff --git a/apps/spreadsheeteditor/main/app_dev.js b/apps/spreadsheeteditor/main/app_dev.js index ff148b677..4f67fda77 100644 --- a/apps/spreadsheeteditor/main/app_dev.js +++ b/apps/spreadsheeteditor/main/app_dev.js @@ -163,6 +163,9 @@ require([ Common.Locale.apply(function(){ require([ + 'common/main/lib/util/LocalStorage', + 'common/main/lib/controller/Themes', + 'common/main/lib/controller/Desktop', 'spreadsheeteditor/main/app/controller/Viewport', 'spreadsheeteditor/main/app/controller/DocumentHolder', 'spreadsheeteditor/main/app/controller/CellEditor', @@ -188,7 +191,6 @@ require([ 'spreadsheeteditor/main/app/view/ValueFieldSettingsDialog', 'spreadsheeteditor/main/app/view/SignatureSettings', 'common/main/lib/util/utils', - 'common/main/lib/util/LocalStorage', 'common/main/lib/controller/Fonts', 'common/main/lib/controller/History', 'common/main/lib/controller/Comments', @@ -197,8 +199,6 @@ require([ ,'common/main/lib/controller/ExternalOleEditor' ,'common/main/lib/controller/ReviewChanges' ,'common/main/lib/controller/Protection' - ,'common/main/lib/controller/Themes' - ,'common/main/lib/controller/Desktop' ], function() { window.compareVersions = true; app.start(); diff --git a/apps/spreadsheeteditor/main/index.html b/apps/spreadsheeteditor/main/index.html index e091cc9f8..f5a3aeb1d 100644 --- a/apps/spreadsheeteditor/main/index.html +++ b/apps/spreadsheeteditor/main/index.html @@ -278,8 +278,10 @@ window.frameEditorId = params["frameEditorId"]; window.parentOrigin = params["parentOrigin"]; - if(/MSIE \d|Trident.*rv:/.test(navigator.userAgent)) + if(/MSIE \d|Trident.*rv:/.test(navigator.userAgent)) { document.write(' diff --git a/apps/spreadsheeteditor/main/locale/en.json b/apps/spreadsheeteditor/main/locale/en.json index 3920e2876..527070c36 100644 --- a/apps/spreadsheeteditor/main/locale/en.json +++ b/apps/spreadsheeteditor/main/locale/en.json @@ -128,6 +128,7 @@ "Common.UI.SearchDialog.txtBtnReplaceAll": "Replace All", "Common.UI.SynchronizeTip.textDontShow": "Don't show this message again", "Common.UI.SynchronizeTip.textSynchronize": "The document has been changed by another user.
    Please click to save your changes and reload the updates.", + "Common.UI.ThemeColorPalette.textRecentColors": "Recent Colors", "Common.UI.ThemeColorPalette.textStandartColors": "Standard Colors", "Common.UI.ThemeColorPalette.textThemeColors": "Theme Colors", "Common.UI.Themes.txtThemeClassicLight": "Classic Light", @@ -787,6 +788,7 @@ "SSE.Controllers.Main.textPleaseWait": "The operation might take more time than expected. Please wait...", "SSE.Controllers.Main.textReconnect": "Connection is restored", "SSE.Controllers.Main.textRemember": "Remember my choice for all files", + "SSE.Controllers.Main.textRememberMacros": "Remember my choice for all macros", "SSE.Controllers.Main.textRenameError": "User name must not be empty.", "SSE.Controllers.Main.textRenameLabel": "Enter a name to be used for collaboration", "SSE.Controllers.Main.textShape": "Shape", @@ -1062,6 +1064,7 @@ "SSE.Controllers.Main.warnNoLicense": "You've reached the limit for simultaneous connections to %1 editors. This document will be opened for viewing only.
    Contact %1 sales team for personal upgrade terms.", "SSE.Controllers.Main.warnNoLicenseUsers": "You've reached the user limit for %1 editors. Contact %1 sales team for personal upgrade terms.", "SSE.Controllers.Main.warnProcessRightsChange": "You have been denied the right to edit the file.", + "SSE.Controllers.Main.textRequestMacros": "A macro makes a request to URL. Do you want to allow the request to the %1?", "SSE.Controllers.Print.strAllSheets": "All Sheets", "SSE.Controllers.Print.textFirstCol": "First column", "SSE.Controllers.Print.textFirstRow": "First row", @@ -2093,6 +2096,8 @@ "SSE.Views.FileMenuPanels.MainSettingsGeneral.strPasteButton": "Show the Paste Options button when the content is pasted", "del_SSE.Views.FileMenuPanels.MainSettingsGeneral.strR1C1": "Turn on R1C1 style", "SSE.Views.FileMenuPanels.MainSettingsGeneral.strReferenceStyle": "R1C1 reference style", + "SSE.Views.FileMenuPanels.MainSettingsGeneral.txtUseAltKey": "Use Alt key to navigate the user interface using the keyboard", + "SSE.Views.FileMenuPanels.MainSettingsGeneral.txtUseOptionKey": "Use Option key to navigate the user interface using the keyboard", "SSE.Views.FileMenuPanels.MainSettingsGeneral.strRegSettings": "Regional Settings", "SSE.Views.FileMenuPanels.MainSettingsGeneral.strRegSettingsEx": "Example: ", "del_SSE.Views.FileMenuPanels.MainSettingsGeneral.strResolvedComment": "Turn on display of the resolved comments", diff --git a/apps/spreadsheeteditor/main/resources/less/leftmenu.less b/apps/spreadsheeteditor/main/resources/less/leftmenu.less index 33c621b7e..151d363b5 100644 --- a/apps/spreadsheeteditor/main/resources/less/leftmenu.less +++ b/apps/spreadsheeteditor/main/resources/less/leftmenu.less @@ -41,28 +41,28 @@ .svg-format- { &xlsx { - background: ~"url(../../../apps/common/main/resources/img/doc-formats/xlsx.svg) no-repeat center"; + background: ~"url('@{common-image-const-path}/doc-formats/xlsx.svg') no-repeat center"; } &pdf { - background: ~"url(../../../apps/common/main/resources/img/doc-formats/pdf.svg) no-repeat center"; + background: ~"url('@{common-image-const-path}/doc-formats/pdf.svg') no-repeat center"; } &ods { - background: ~"url(../../../apps/common/main/resources/img/doc-formats/ods.svg) no-repeat center"; + background: ~"url('@{common-image-const-path}/doc-formats/ods.svg') no-repeat center"; } &csv { - background: ~"url(../../../apps/common/main/resources/img/doc-formats/csv.svg) no-repeat center"; + background: ~"url('@{common-image-const-path}/doc-formats/csv.svg') no-repeat center"; } &xltx { - background: ~"url(../../../apps/common/main/resources/img/doc-formats/xltx.svg) no-repeat center"; + background: ~"url('@{common-image-const-path}/doc-formats/xltx.svg') no-repeat center"; } &pdfa { - background: ~"url(../../../apps/common/main/resources/img/doc-formats/pdfa.svg) no-repeat center"; + background: ~"url('@{common-image-const-path}/doc-formats/pdfa.svg') no-repeat center"; } &ots { - background: ~"url(../../../apps/common/main/resources/img/doc-formats/ots.svg) no-repeat center"; + background: ~"url('@{common-image-const-path}/doc-formats/ots.svg') no-repeat center"; } &xlsm { - background: ~"url(../../../apps/common/main/resources/img/doc-formats/xlsm.svg) no-repeat center"; + background: ~"url('@{common-image-const-path}/doc-formats/xlsm.svg') no-repeat center"; } } @@ -83,10 +83,10 @@ cursor: pointer; .svg-format-blank { - background: ~"url(../../../apps/common/main/resources/img/doc-formats/blank.svg) no-repeat center" ; + background: ~"url(@{common-image-const-path}/doc-formats/blank.svg) no-repeat center" ; } .svg-file-template{ - background: ~"url(resources/img/file-template.svg) no-repeat center" ; + background: ~"url(@{app-image-const-path}/file-template.svg) no-repeat center" ; } div { @@ -117,6 +117,7 @@ background-color: @highlight-button-pressed; > a { + color: @text-normal-pressed-ie; color: @text-normal-pressed; } } @@ -425,7 +426,7 @@ width: 100%; height: 100%; .svg-file-recent { - background: ~"url(resources/img/recent-file.svg) no-repeat top"; + background: ~"url(@{app-image-const-path}/recent-file.svg) no-repeat top"; } } } diff --git a/apps/spreadsheeteditor/main/resources/less/statusbar.less b/apps/spreadsheeteditor/main/resources/less/statusbar.less index 44bf51149..aac5953a4 100644 --- a/apps/spreadsheeteditor/main/resources/less/statusbar.less +++ b/apps/spreadsheeteditor/main/resources/less/statusbar.less @@ -3,7 +3,7 @@ z-index: 500; #status-tabs-scroll { - width: 112px; + width: 66px; float: left; padding: 3px 12px 0 10px; height: 25px; @@ -159,7 +159,7 @@ position: absolute; overflow: hidden; height: 25px; - left: 112px; + left: 66px; right: 160px; //margin-right: 3px; } diff --git a/apps/spreadsheeteditor/mobile/locale/az.json b/apps/spreadsheeteditor/mobile/locale/az.json index 3ec04cf8f..5d19f4d0c 100644 --- a/apps/spreadsheeteditor/mobile/locale/az.json +++ b/apps/spreadsheeteditor/mobile/locale/az.json @@ -160,7 +160,8 @@ "textNoTextFound": "Text not found", "textOk": "Ok", "textReplaceSkipped": "The replacement has been made. {0} occurrences were skipped.", - "textReplaceSuccess": "The search has been done. Occurrences replaced: {0}" + "textReplaceSuccess": "The search has been done. Occurrences replaced: {0}", + "textRequestMacros": "A macro makes a request to URL. Do you want to allow the request to the %1?" } }, "Error": { diff --git a/apps/spreadsheeteditor/mobile/locale/be.json b/apps/spreadsheeteditor/mobile/locale/be.json index b4d3132cd..1e918cf09 100644 --- a/apps/spreadsheeteditor/mobile/locale/be.json +++ b/apps/spreadsheeteditor/mobile/locale/be.json @@ -160,7 +160,8 @@ "warnLicenseUsersExceeded": "You've reached the user limit for %1 editors. Contact your administrator to learn more.", "warnNoLicense": "You've reached the limit for simultaneous connections to %1 editors. This document will be opened for viewing only. Contact %1 sales team for personal upgrade terms.", "warnNoLicenseUsers": "You've reached the user limit for %1 editors. Contact %1 sales team for personal upgrade terms.", - "warnProcessRightsChange": "You don't have permission to edit the file." + "warnProcessRightsChange": "You don't have permission to edit the file.", + "textRequestMacros": "A macro makes a request to URL. Do you want to allow the request to the %1?" } }, "Error": { diff --git a/apps/spreadsheeteditor/mobile/locale/bg.json b/apps/spreadsheeteditor/mobile/locale/bg.json index 4e287043e..47b59e13d 100644 --- a/apps/spreadsheeteditor/mobile/locale/bg.json +++ b/apps/spreadsheeteditor/mobile/locale/bg.json @@ -160,7 +160,8 @@ "textReplaceSuccess": "The search has been done. Occurrences replaced: {0}", "textReplaceSkipped": "The replacement has been made. {0} occurrences were skipped.", "textNoTextFound": "Text not found", - "errorOpensource": "Using the free Community version, you can open documents for viewing only. To access mobile web editors, a commercial license is required." + "errorOpensource": "Using the free Community version, you can open documents for viewing only. To access mobile web editors, a commercial license is required.", + "textRequestMacros": "A macro makes a request to URL. Do you want to allow the request to the %1?" } }, "Error": { diff --git a/apps/spreadsheeteditor/mobile/locale/ca.json b/apps/spreadsheeteditor/mobile/locale/ca.json index 4cf66c2ed..0f6f183bc 100644 --- a/apps/spreadsheeteditor/mobile/locale/ca.json +++ b/apps/spreadsheeteditor/mobile/locale/ca.json @@ -160,7 +160,8 @@ "warnLicenseUsersExceeded": "Heu arribat al límit d'usuaris per a %1 editors. Contacteu amb el vostre administrador per a més informació.", "warnNoLicense": "Heu arribat al límit de connexions simultànies a %1 editors. Aquest document només s'obrirà en mode lectura. Contacteu amb l'equip de vendes %1 per a les condicions d'una actualització personal.", "warnNoLicenseUsers": "Heu arribat al límit d'usuaris per a %1 editors. Contacteu amb l'equip de vendes de %1 per obtenir les condicions de millora personals dels vostres serveis.", - "warnProcessRightsChange": "No teniu permís per editar el fitxer." + "warnProcessRightsChange": "No teniu permís per editar el fitxer.", + "textRequestMacros": "A macro makes a request to URL. Do you want to allow the request to the %1?" } }, "Error": { diff --git a/apps/spreadsheeteditor/mobile/locale/cs.json b/apps/spreadsheeteditor/mobile/locale/cs.json index 0b530f889..dbcaa591c 100644 --- a/apps/spreadsheeteditor/mobile/locale/cs.json +++ b/apps/spreadsheeteditor/mobile/locale/cs.json @@ -160,7 +160,8 @@ "warnLicenseUsersExceeded": "Došlo dosažení limitu %1 editorů v režimu spolupráce na úpravách. Ohledně podrobností se obraťte na svého správce.", "warnNoLicense": "Došlo k dosažení limitu souběžného připojení %1 editorů. Tento dokument bude otevřen pouze pro náhled. Pro rozšíření funkcí kontaktujte %1 obchodní oddělení.", "warnNoLicenseUsers": "Došlo k dosažení limitu %1 editorů. Pro rozšíření funkcí kontaktujte %1 obchodní oddělení.", - "warnProcessRightsChange": "Nemáte oprávnění pro úpravu tohoto dokumentu." + "warnProcessRightsChange": "Nemáte oprávnění pro úpravu tohoto dokumentu.", + "textRequestMacros": "A macro makes a request to URL. Do you want to allow the request to the %1?" } }, "Error": { diff --git a/apps/spreadsheeteditor/mobile/locale/da.json b/apps/spreadsheeteditor/mobile/locale/da.json index d46b2b02a..9b46909be 100644 --- a/apps/spreadsheeteditor/mobile/locale/da.json +++ b/apps/spreadsheeteditor/mobile/locale/da.json @@ -160,7 +160,8 @@ "warnLicenseExceeded": "You've reached the limit for simultaneous connections to %1 editors. This document will be opened for viewing only. Contact your administrator to learn more.", "warnNoLicense": "You've reached the limit for simultaneous connections to %1 editors. This document will be opened for viewing only. Contact %1 sales team for personal upgrade terms.", "warnNoLicenseUsers": "You've reached the user limit for %1 editors. Contact %1 sales team for personal upgrade terms.", - "warnProcessRightsChange": "You don't have permission to edit the file." + "warnProcessRightsChange": "You don't have permission to edit the file.", + "textRequestMacros": "A macro makes a request to URL. Do you want to allow the request to the %1?" } }, "Error": { diff --git a/apps/spreadsheeteditor/mobile/locale/de.json b/apps/spreadsheeteditor/mobile/locale/de.json index db1ed98ff..b10fd17d9 100644 --- a/apps/spreadsheeteditor/mobile/locale/de.json +++ b/apps/spreadsheeteditor/mobile/locale/de.json @@ -160,7 +160,8 @@ "warnLicenseUsersExceeded": "Sie haben das Benutzerlimit für %1-Editoren erreicht. Bitte wenden Sie sich an Ihren Administrator, um weitere Informationen zu erhalten.", "warnNoLicense": "Sie haben die maximale Anzahl von gleichzeitigen Verbindungen in %1-Editoren erreicht. Die Bearbeitung ist jetzt in diesem Dokument nicht verfügbar. Bitte kontaktieren Sie unser Verkaufsteam, um persönliche Upgrade-Bedingungen zu erhalten.", "warnNoLicenseUsers": "Sie haben das Benutzerlimit für %1-Editoren erreicht. Bitte kontaktieren Sie unser Verkaufsteam, um persönliche Upgrade-Bedingungen zu erhalten.", - "warnProcessRightsChange": "Sie können diese Datei nicht bearbeiten." + "warnProcessRightsChange": "Sie können diese Datei nicht bearbeiten.", + "textRequestMacros": "A macro makes a request to URL. Do you want to allow the request to the %1?" } }, "Error": { diff --git a/apps/spreadsheeteditor/mobile/locale/el.json b/apps/spreadsheeteditor/mobile/locale/el.json index 8ef0760a4..a6ed05544 100644 --- a/apps/spreadsheeteditor/mobile/locale/el.json +++ b/apps/spreadsheeteditor/mobile/locale/el.json @@ -160,7 +160,8 @@ "warnLicenseUsersExceeded": "Έχετε φτάσει το όριο χρήστη για συντάκτες %1.
    Επικοινωνήστε με τον διαχειριστή σας για περισσότερες πληροφορίες.", "warnNoLicense": "Φτάσατε το όριο ταυτόχρονων συνδέσεων σε %1 συντάκτες. Το έγγραφο θα ανοίξει μόνο για ανάγνωση. Επικοινωνήστε με την ομάδα πωλήσεων %1 για τους όρους αναβάθμισης.", "warnNoLicenseUsers": "Έχετε φτάσει το όριο χρήστη για συντάκτες %1.
    Επικοινωνήστε με την ομάδα πωλήσεων %1 για προσωπικούς όρους αναβάθμισης.", - "warnProcessRightsChange": "Δεν έχετε δικαίωμα επεξεργασίας του αρχείου." + "warnProcessRightsChange": "Δεν έχετε δικαίωμα επεξεργασίας του αρχείου.", + "textRequestMacros": "A macro makes a request to URL. Do you want to allow the request to the %1?" } }, "Error": { diff --git a/apps/spreadsheeteditor/mobile/locale/en.json b/apps/spreadsheeteditor/mobile/locale/en.json index 3bd9f5138..7d19d74b2 100644 --- a/apps/spreadsheeteditor/mobile/locale/en.json +++ b/apps/spreadsheeteditor/mobile/locale/en.json @@ -160,7 +160,8 @@ "warnLicenseUsersExceeded": "You've reached the user limit for %1 editors. Contact your administrator to learn more.", "warnNoLicense": "You've reached the limit for simultaneous connections to %1 editors. This document will be opened for viewing only. Contact %1 sales team for personal upgrade terms.", "warnNoLicenseUsers": "You've reached the user limit for %1 editors. Contact %1 sales team for personal upgrade terms.", - "warnProcessRightsChange": "You don't have permission to edit the file." + "warnProcessRightsChange": "You don't have permission to edit the file.", + "textRequestMacros": "A macro makes a request to URL. Do you want to allow the request to the %1?" } }, "Error": { @@ -399,7 +400,8 @@ "textBottomBorder": "Bottom Border", "textBringToForeground": "Bring to Foreground", "textCell": "Cell", - "textCellStyles": "Cell Styles", + "del_textCellStyles": "Cell Styles", + "textCellStyle": "Cell Style", "textCenter": "Center", "textChart": "Chart", "textChartTitle": "Chart Title", diff --git a/apps/spreadsheeteditor/mobile/locale/es.json b/apps/spreadsheeteditor/mobile/locale/es.json index aed29d2cb..5bbd449fb 100644 --- a/apps/spreadsheeteditor/mobile/locale/es.json +++ b/apps/spreadsheeteditor/mobile/locale/es.json @@ -160,7 +160,8 @@ "warnLicenseUsersExceeded": "Ha alcanzado el límite de usuarios para %1 editores. Póngase en contacto con su administrador para saber más.", "warnNoLicense": "Ha alcanzado el límite de conexiones simultáneas con %1 editores. Este documento se abrirá sólo para su visualización. Póngase en contacto con el equipo de ventas de %1 para conocer las condiciones de actualización personal.", "warnNoLicenseUsers": "Ha alcanzado el límite de usuarios para %1 editores. Póngase en contacto con el equipo de ventas de %1 para conocer las condiciones de actualización personal.", - "warnProcessRightsChange": "No tiene permiso para editar el archivo." + "warnProcessRightsChange": "No tiene permiso para editar el archivo.", + "textRequestMacros": "A macro makes a request to URL. Do you want to allow the request to the %1?" } }, "Error": { diff --git a/apps/spreadsheeteditor/mobile/locale/fr.json b/apps/spreadsheeteditor/mobile/locale/fr.json index ac0615a4b..54100db8c 100644 --- a/apps/spreadsheeteditor/mobile/locale/fr.json +++ b/apps/spreadsheeteditor/mobile/locale/fr.json @@ -160,7 +160,8 @@ "warnLicenseUsersExceeded": "Vous avez dépassé le nombre maximal d’utilisateurs des éditeurs %1. Pour en savoir plus, contactez votre administrateur.", "warnNoLicense": "Vous avez dépassé le nombre maximal de connexions simultanées aux éditeurs %1. Ce document sera ouvert en lecture seule. Contactez l’équipe des ventes %1 pour mettre à jour les termes de la licence.", "warnNoLicenseUsers": "Vous avez dépassé le nombre maximal d’utilisateurs des éditeurs %1. Contactez l’équipe des ventes %1 pour mettre à jour les termes de la licence.", - "warnProcessRightsChange": "Vous n'avez pas la permission de modifier ce fichier." + "warnProcessRightsChange": "Vous n'avez pas la permission de modifier ce fichier.", + "textRequestMacros": "A macro makes a request to URL. Do you want to allow the request to the %1?" } }, "Error": { diff --git a/apps/spreadsheeteditor/mobile/locale/gl.json b/apps/spreadsheeteditor/mobile/locale/gl.json index dd7621b13..59201a367 100644 --- a/apps/spreadsheeteditor/mobile/locale/gl.json +++ b/apps/spreadsheeteditor/mobile/locale/gl.json @@ -160,7 +160,8 @@ "warnLicenseUsersExceeded": "Alcanzou o límite de usuarios para os editores de %1. Por favor, contacte co se uadministrador para recibir máis información.", "warnNoLicense": "Alcanzou o límite de conexións simultáneas con %1 editores. Este documento abrirase para as úa visualización. Póñase en contacto co equipo de vendas de %1 para coñecer as condicións de actualización persoal.", "warnNoLicenseUsers": "Alcanzou o límite de usuarios para os editores de %1.
    Contacte co equipo de vendas de %1 para coñecer os termos de actualización persoal.", - "warnProcessRightsChange": "Non ten permiso para editar o ficheiro." + "warnProcessRightsChange": "Non ten permiso para editar o ficheiro.", + "textRequestMacros": "A macro makes a request to URL. Do you want to allow the request to the %1?" } }, "Error": { diff --git a/apps/spreadsheeteditor/mobile/locale/hu.json b/apps/spreadsheeteditor/mobile/locale/hu.json index 118ac503a..41d532e27 100644 --- a/apps/spreadsheeteditor/mobile/locale/hu.json +++ b/apps/spreadsheeteditor/mobile/locale/hu.json @@ -160,7 +160,8 @@ "warnLicenseUsersExceeded": "Elérte a(z) %1 szerkesztőhöz tartozó felhasználói korlátját. További információért forduljon rendszergazdájához.", "warnNoLicense": "Elérte a(z) %1 szerkesztővel való egyidejű kapcsolódási korlátot. Ez a dokumentum csak megtekintésre nyílik meg. Lépjen kapcsolatba a(z) %1 értékesítési csapattal a személyes frissítés feltételekért.", "warnNoLicenseUsers": "Elérte a(z) %1 szerkesztőhöz tartozó felhasználói korlátját. Vegye fel a kapcsolatot a(z) %1 értékesítési csapattal a személyes frissítési feltételekért.", - "warnProcessRightsChange": "Nincs engedélye a fájl szerkesztésére." + "warnProcessRightsChange": "Nincs engedélye a fájl szerkesztésére.", + "textRequestMacros": "A macro makes a request to URL. Do you want to allow the request to the %1?" } }, "Error": { diff --git a/apps/spreadsheeteditor/mobile/locale/id.json b/apps/spreadsheeteditor/mobile/locale/id.json index 4362082d8..b08a58c1f 100644 --- a/apps/spreadsheeteditor/mobile/locale/id.json +++ b/apps/spreadsheeteditor/mobile/locale/id.json @@ -160,7 +160,8 @@ "warnLicenseUsersExceeded": "Anda sudah mencapai batas user untuk %1 editor. Hubungi admin Anda untuk mempelajari lebih lanjut.", "warnNoLicense": "Anda sudah mencapai batas untuk koneksi bersamaan ke %1 editor. Dokumen ini akan dibuka untuk dilihat saja. Hubungi %1 tim sales untuk syarat personal upgrade.", "warnNoLicenseUsers": "Anda sudah mencapai batas user untuk %1 editor. Hubungi %1 tim sales untuk syarat personal upgrade.", - "warnProcessRightsChange": "Anda tidak memiliki izin edit file ini." + "warnProcessRightsChange": "Anda tidak memiliki izin edit file ini.", + "textRequestMacros": "A macro makes a request to URL. Do you want to allow the request to the %1?" } }, "Error": { diff --git a/apps/spreadsheeteditor/mobile/locale/it.json b/apps/spreadsheeteditor/mobile/locale/it.json index 8a42e3515..01da539f0 100644 --- a/apps/spreadsheeteditor/mobile/locale/it.json +++ b/apps/spreadsheeteditor/mobile/locale/it.json @@ -160,7 +160,8 @@ "warnLicenseUsersExceeded": "Hai raggiunto il limite degli utenti per gli editor %1. Ti preghiamo di contattare il tuo amministratore per maggior informazioni.", "warnNoLicense": "Hai raggiunto il limite delle connessioni simultanee agli editor %1. Questo documento sarà aperto solo in modalità di visualizzazione. Ti preghiamo di contattare il team di vendite di %1 per i termini di aggiornamento personali.", "warnNoLicenseUsers": "Hai raggiunto il limite degli utenti per gli editor %1. Ti preghiamo di contattare il team di vendite di %1 per i termini di aggiornamento personali.", - "warnProcessRightsChange": "Non hai il permesso di modificare il file." + "warnProcessRightsChange": "Non hai il permesso di modificare il file.", + "textRequestMacros": "A macro makes a request to URL. Do you want to allow the request to the %1?" } }, "Error": { diff --git a/apps/spreadsheeteditor/mobile/locale/ja.json b/apps/spreadsheeteditor/mobile/locale/ja.json index b24ca368f..43ef972e3 100644 --- a/apps/spreadsheeteditor/mobile/locale/ja.json +++ b/apps/spreadsheeteditor/mobile/locale/ja.json @@ -160,7 +160,8 @@ "warnLicenseUsersExceeded": "%1エディターのユーザー制限に達しました。 詳細についてはアドミニストレータを連絡してください。", "warnNoLicense": "%1エディター 時接続数の制限に達しました。この文書が見るだけのために開かれる。個人的なアップグレード条件については、%1営業チームを連絡してください。", "warnNoLicenseUsers": "%1エディターのユーザー制限に達しました。 個人的なアップグレード条件については、%1営業チームを連絡してください。", - "warnProcessRightsChange": "ファイルを編集する権限がありません!" + "warnProcessRightsChange": "ファイルを編集する権限がありません!", + "textRequestMacros": "A macro makes a request to URL. Do you want to allow the request to the %1?" } }, "Error": { diff --git a/apps/spreadsheeteditor/mobile/locale/ko.json b/apps/spreadsheeteditor/mobile/locale/ko.json index 29b693a4d..f3d4db495 100644 --- a/apps/spreadsheeteditor/mobile/locale/ko.json +++ b/apps/spreadsheeteditor/mobile/locale/ko.json @@ -160,7 +160,8 @@ "warnLicenseUsersExceeded": "편집자 사용자 한도인 %1명에 도달했습니다. 자세한 내용은 관리자에게 문의하십시오.", "warnNoLicense": "% 1 편집 연결 수 제한에 도달했습니다. 이 문서는 보기 모드로 열립니다. 개인적인 업그레이드 사항은 % 1 영업팀에 연락하십시오.", "warnNoLicenseUsers": "ONLYOFFICE 편집자의이 버전은 동시 사용자에게 일정한 제한이 있습니다.
    더 필요한 것이 있으면 현재 라이센스를 업그레이드하거나 상용 라이센스를 구입하십시오.", - "warnProcessRightsChange": "파일을 수정할 수 있는 권한이 없습니다." + "warnProcessRightsChange": "파일을 수정할 수 있는 권한이 없습니다.", + "textRequestMacros": "A macro makes a request to URL. Do you want to allow the request to the %1?" } }, "Error": { diff --git a/apps/spreadsheeteditor/mobile/locale/lo.json b/apps/spreadsheeteditor/mobile/locale/lo.json index 57f9e408f..2ce86e35a 100644 --- a/apps/spreadsheeteditor/mobile/locale/lo.json +++ b/apps/spreadsheeteditor/mobile/locale/lo.json @@ -160,7 +160,8 @@ "warnLicenseUsersExceeded": "ຈໍານວນ ການເຊື່ອມຕໍ່ພ້ອມກັນກັບຜູ້ແກ້ໄຂ ແມ່ນເກີນກໍານົດ % 1. ຕິດຕໍ່ ທີມບໍລິຫານເພື່ອຂໍ້ມູນເພີ່ມເຕີ່ມ", "warnNoLicense": "ທ່ານໄດ້ຖືກຈຳກັດສິດພຽງເທົ່ານີ້ສຳຫລັບການເຊື່່ອມພ້ອມກັນກັບເຄື່ອງມືແກ້ໄຂ %1 ແລ້ວເອກະສານນີ້ຈະເປີດໃຫ້ເບີ່ງເທົ່ານັ້ນ ຕິດຕໍ່ທີມຂາຍ %1 ສຳຫລັບເງື່ອນໄຂການອັບເກດສ່ວນບຸກຄົນ", "warnNoLicenseUsers": "ຈໍານວນ ການເຊື່ອມຕໍ່ພ້ອມກັນກັບບັນນາທິການ ແມ່ນເກີນກໍານົດ % 1. ຕິດຕໍ່ ທີມຂາຍ% 1 ສຳ ລັບຂໍ້ ກຳນົດການຍົກລະດັບສິດ", - "warnProcessRightsChange": "ທ່ານບໍ່ມີສິດໃນການແກ້ໄຂໄຟລ໌ນີ້." + "warnProcessRightsChange": "ທ່ານບໍ່ມີສິດໃນການແກ້ໄຂໄຟລ໌ນີ້.", + "textRequestMacros": "A macro makes a request to URL. Do you want to allow the request to the %1?" } }, "Error": { diff --git a/apps/spreadsheeteditor/mobile/locale/lv.json b/apps/spreadsheeteditor/mobile/locale/lv.json index 4e287043e..47b59e13d 100644 --- a/apps/spreadsheeteditor/mobile/locale/lv.json +++ b/apps/spreadsheeteditor/mobile/locale/lv.json @@ -160,7 +160,8 @@ "textReplaceSuccess": "The search has been done. Occurrences replaced: {0}", "textReplaceSkipped": "The replacement has been made. {0} occurrences were skipped.", "textNoTextFound": "Text not found", - "errorOpensource": "Using the free Community version, you can open documents for viewing only. To access mobile web editors, a commercial license is required." + "errorOpensource": "Using the free Community version, you can open documents for viewing only. To access mobile web editors, a commercial license is required.", + "textRequestMacros": "A macro makes a request to URL. Do you want to allow the request to the %1?" } }, "Error": { diff --git a/apps/spreadsheeteditor/mobile/locale/nb.json b/apps/spreadsheeteditor/mobile/locale/nb.json index 4e287043e..47b59e13d 100644 --- a/apps/spreadsheeteditor/mobile/locale/nb.json +++ b/apps/spreadsheeteditor/mobile/locale/nb.json @@ -160,7 +160,8 @@ "textReplaceSuccess": "The search has been done. Occurrences replaced: {0}", "textReplaceSkipped": "The replacement has been made. {0} occurrences were skipped.", "textNoTextFound": "Text not found", - "errorOpensource": "Using the free Community version, you can open documents for viewing only. To access mobile web editors, a commercial license is required." + "errorOpensource": "Using the free Community version, you can open documents for viewing only. To access mobile web editors, a commercial license is required.", + "textRequestMacros": "A macro makes a request to URL. Do you want to allow the request to the %1?" } }, "Error": { diff --git a/apps/spreadsheeteditor/mobile/locale/nl.json b/apps/spreadsheeteditor/mobile/locale/nl.json index 4ea377b37..1f22b933b 100644 --- a/apps/spreadsheeteditor/mobile/locale/nl.json +++ b/apps/spreadsheeteditor/mobile/locale/nl.json @@ -160,7 +160,8 @@ "textNoTextFound": "Text not found", "textOk": "Ok", "textReplaceSkipped": "The replacement has been made. {0} occurrences were skipped.", - "textReplaceSuccess": "The search has been done. Occurrences replaced: {0}" + "textReplaceSuccess": "The search has been done. Occurrences replaced: {0}", + "textRequestMacros": "A macro makes a request to URL. Do you want to allow the request to the %1?" } }, "Error": { diff --git a/apps/spreadsheeteditor/mobile/locale/pl.json b/apps/spreadsheeteditor/mobile/locale/pl.json index 4e287043e..47b59e13d 100644 --- a/apps/spreadsheeteditor/mobile/locale/pl.json +++ b/apps/spreadsheeteditor/mobile/locale/pl.json @@ -160,7 +160,8 @@ "textReplaceSuccess": "The search has been done. Occurrences replaced: {0}", "textReplaceSkipped": "The replacement has been made. {0} occurrences were skipped.", "textNoTextFound": "Text not found", - "errorOpensource": "Using the free Community version, you can open documents for viewing only. To access mobile web editors, a commercial license is required." + "errorOpensource": "Using the free Community version, you can open documents for viewing only. To access mobile web editors, a commercial license is required.", + "textRequestMacros": "A macro makes a request to URL. Do you want to allow the request to the %1?" } }, "Error": { diff --git a/apps/spreadsheeteditor/mobile/locale/pt-PT.json b/apps/spreadsheeteditor/mobile/locale/pt-PT.json index 004dacc51..4584ecc84 100644 --- a/apps/spreadsheeteditor/mobile/locale/pt-PT.json +++ b/apps/spreadsheeteditor/mobile/locale/pt-PT.json @@ -160,7 +160,8 @@ "warnLicenseUsersExceeded": "Atingiu o limite de %1 editores. Contacte o seu administrador para obter detalhes.", "warnNoLicense": "Atingiu o limite de ligações simultâneas a %1 editores. Este documento será aberto apenas para visualização. Contacte a %1 equipa de vendas para consultar os termos de atualização para si.", "warnNoLicenseUsers": "Atingiu o limite de %1 editores. Contacte a equipa comercial %1 para obter mais informações.", - "warnProcessRightsChange": "Não tem autorização para editar este ficheiro." + "warnProcessRightsChange": "Não tem autorização para editar este ficheiro.", + "textRequestMacros": "A macro makes a request to URL. Do you want to allow the request to the %1?" } }, "Error": { diff --git a/apps/spreadsheeteditor/mobile/locale/pt.json b/apps/spreadsheeteditor/mobile/locale/pt.json index bcf9197a5..eb35c9190 100644 --- a/apps/spreadsheeteditor/mobile/locale/pt.json +++ b/apps/spreadsheeteditor/mobile/locale/pt.json @@ -160,7 +160,8 @@ "warnLicenseUsersExceeded": "Você atingiu o limite de usuários para editores %1. Entre em contato com seu administrador para saber mais.", "warnNoLicense": "Você atingiu o limite de conexões simultâneas para% 1 editores. Este documento será aberto apenas para visualização. Contate a equipe de vendas% 1 para termos de atualização pessoal.", "warnNoLicenseUsers": "Você atingiu o limite de usuários para editores %1.
    Entre em contato com a equipe de vendas da %1 para obter os termos de atualização pessoais.", - "warnProcessRightsChange": "Você não tem permissão para editar o arquivo." + "warnProcessRightsChange": "Você não tem permissão para editar o arquivo.", + "textRequestMacros": "A macro makes a request to URL. Do you want to allow the request to the %1?" } }, "Error": { diff --git a/apps/spreadsheeteditor/mobile/locale/ro.json b/apps/spreadsheeteditor/mobile/locale/ro.json index a808ca1f8..5c0132acb 100644 --- a/apps/spreadsheeteditor/mobile/locale/ro.json +++ b/apps/spreadsheeteditor/mobile/locale/ro.json @@ -160,7 +160,8 @@ "warnLicenseUsersExceeded": "Ați atins numărul maxim de utilizatori ai %1 editoare. Pentru detalii, contactați administratorul dvs.", "warnNoLicense": "Ați atins numărul maxim de conexiuni simultane la %1 de editoare. Documentul este disponibil numai pentru vizualizare. Contactați %1 Departamentul de Vânzări pentru acordarea condițiilor personale de actualizare.", "warnNoLicenseUsers": "Ați atins numărul maxim de utilizatori ai %1 editoare. Contactați Grup Vânzări %1 pentru acordarea condițiilor personale de licențiere.", - "warnProcessRightsChange": "Nu aveți permisiunea de editare pentru fișier." + "warnProcessRightsChange": "Nu aveți permisiunea de editare pentru fișier.", + "textRequestMacros": "A macro makes a request to URL. Do you want to allow the request to the %1?" } }, "Error": { diff --git a/apps/spreadsheeteditor/mobile/locale/ru.json b/apps/spreadsheeteditor/mobile/locale/ru.json index f68118e11..fb89bb9cb 100644 --- a/apps/spreadsheeteditor/mobile/locale/ru.json +++ b/apps/spreadsheeteditor/mobile/locale/ru.json @@ -160,7 +160,8 @@ "warnLicenseUsersExceeded": "Вы достигли лимита на количество пользователей редакторов %1. Свяжитесь с администратором, чтобы узнать больше.", "warnNoLicense": "Вы достигли лимита на одновременные подключения к редакторам %1. Этот документ будет открыт на просмотр. Напишите в отдел продаж %1, чтобы обсудить индивидуальные условия обновления.", "warnNoLicenseUsers": "Вы достигли лимита на количество пользователей редакторов %1. Напишите в отдел продаж %1, чтобы обсудить индивидуальные условия обновления.", - "warnProcessRightsChange": "У вас нет прав на редактирование этого файла." + "warnProcessRightsChange": "У вас нет прав на редактирование этого файла.", + "textRequestMacros": "A macro makes a request to URL. Do you want to allow the request to the %1?" } }, "Error": { diff --git a/apps/spreadsheeteditor/mobile/locale/sk.json b/apps/spreadsheeteditor/mobile/locale/sk.json index c589527c3..506d23b78 100644 --- a/apps/spreadsheeteditor/mobile/locale/sk.json +++ b/apps/spreadsheeteditor/mobile/locale/sk.json @@ -160,7 +160,8 @@ "warnLicenseUsersExceeded": "Dosiahli ste limit %1 editora v režime spolupráce na úpravách. Ohľadne podrobnosti sa obráťte na svojho správcu. ", "warnNoLicense": "Dosiahli ste limit pre simultánne pripojenia k %1 editorom. Tento dokument sa otvorí iba na prezeranie. Kontaktujte predajný tím %1 pre osobné podmienky inovácie.", "warnNoLicenseUsers": "Dosiahli ste limit %1 editora. Pre rozšírenie funkcií kontaktujte %1 obchodné oddelenie.", - "warnProcessRightsChange": "Nemáte povolenie na úpravu súboru." + "warnProcessRightsChange": "Nemáte povolenie na úpravu súboru.", + "textRequestMacros": "A macro makes a request to URL. Do you want to allow the request to the %1?" } }, "Error": { diff --git a/apps/spreadsheeteditor/mobile/locale/sl.json b/apps/spreadsheeteditor/mobile/locale/sl.json index 4e287043e..47b59e13d 100644 --- a/apps/spreadsheeteditor/mobile/locale/sl.json +++ b/apps/spreadsheeteditor/mobile/locale/sl.json @@ -160,7 +160,8 @@ "textReplaceSuccess": "The search has been done. Occurrences replaced: {0}", "textReplaceSkipped": "The replacement has been made. {0} occurrences were skipped.", "textNoTextFound": "Text not found", - "errorOpensource": "Using the free Community version, you can open documents for viewing only. To access mobile web editors, a commercial license is required." + "errorOpensource": "Using the free Community version, you can open documents for viewing only. To access mobile web editors, a commercial license is required.", + "textRequestMacros": "A macro makes a request to URL. Do you want to allow the request to the %1?" } }, "Error": { diff --git a/apps/spreadsheeteditor/mobile/locale/tr.json b/apps/spreadsheeteditor/mobile/locale/tr.json index ba264eb1c..a6cfc960b 100644 --- a/apps/spreadsheeteditor/mobile/locale/tr.json +++ b/apps/spreadsheeteditor/mobile/locale/tr.json @@ -160,7 +160,8 @@ "warnNoLicense": "%1 düzenleyiciye eşzamanlı bağlantı sınırına ulaştınız. Bu belge yalnızca görüntüleme için açılacaktır. Kişisel yükseltme koşulları için %1 satış ekibiyle iletişime geçin.", "warnNoLicenseUsers": "%1 düzenleyici için kullanıcı sınırına ulaştınız. Kişisel yükseltme koşulları için %1 satış ekibiyle iletişime geçin.", "warnProcessRightsChange": "Dosyayı düzenleme izniniz yok.", - "errorOpensource": "Using the free Community version, you can open documents for viewing only. To access mobile web editors, a commercial license is required." + "errorOpensource": "Using the free Community version, you can open documents for viewing only. To access mobile web editors, a commercial license is required.", + "textRequestMacros": "A macro makes a request to URL. Do you want to allow the request to the %1?" } }, "Error": { diff --git a/apps/spreadsheeteditor/mobile/locale/uk.json b/apps/spreadsheeteditor/mobile/locale/uk.json index 4e287043e..47b59e13d 100644 --- a/apps/spreadsheeteditor/mobile/locale/uk.json +++ b/apps/spreadsheeteditor/mobile/locale/uk.json @@ -160,7 +160,8 @@ "textReplaceSuccess": "The search has been done. Occurrences replaced: {0}", "textReplaceSkipped": "The replacement has been made. {0} occurrences were skipped.", "textNoTextFound": "Text not found", - "errorOpensource": "Using the free Community version, you can open documents for viewing only. To access mobile web editors, a commercial license is required." + "errorOpensource": "Using the free Community version, you can open documents for viewing only. To access mobile web editors, a commercial license is required.", + "textRequestMacros": "A macro makes a request to URL. Do you want to allow the request to the %1?" } }, "Error": { diff --git a/apps/spreadsheeteditor/mobile/locale/vi.json b/apps/spreadsheeteditor/mobile/locale/vi.json index 4e287043e..47b59e13d 100644 --- a/apps/spreadsheeteditor/mobile/locale/vi.json +++ b/apps/spreadsheeteditor/mobile/locale/vi.json @@ -160,7 +160,8 @@ "textReplaceSuccess": "The search has been done. Occurrences replaced: {0}", "textReplaceSkipped": "The replacement has been made. {0} occurrences were skipped.", "textNoTextFound": "Text not found", - "errorOpensource": "Using the free Community version, you can open documents for viewing only. To access mobile web editors, a commercial license is required." + "errorOpensource": "Using the free Community version, you can open documents for viewing only. To access mobile web editors, a commercial license is required.", + "textRequestMacros": "A macro makes a request to URL. Do you want to allow the request to the %1?" } }, "Error": { diff --git a/apps/spreadsheeteditor/mobile/locale/zh-TW.json b/apps/spreadsheeteditor/mobile/locale/zh-TW.json index 6f863a83f..671b26601 100644 --- a/apps/spreadsheeteditor/mobile/locale/zh-TW.json +++ b/apps/spreadsheeteditor/mobile/locale/zh-TW.json @@ -160,7 +160,8 @@ "warnLicenseUsersExceeded": "您已達到 %1 個編輯器的使用者限制。請聯繫您的管理員以了解更多資訊。", "warnNoLicense": "您已達到同時連接到 %1 編輯器的限制。此文件將只提供檢視。有關個人升級條款,請聯繫 %1 業務團隊。", "warnNoLicenseUsers": "您已達到%1個編輯器的用戶限制。與%1銷售團隊聯繫以了解個人升級條款。", - "warnProcessRightsChange": "您沒有編輯此文件的權限。" + "warnProcessRightsChange": "您沒有編輯此文件的權限。", + "textRequestMacros": "A macro makes a request to URL. Do you want to allow the request to the %1?" } }, "Error": { diff --git a/apps/spreadsheeteditor/mobile/locale/zh.json b/apps/spreadsheeteditor/mobile/locale/zh.json index 6cf7ed8e4..3bfffc346 100644 --- a/apps/spreadsheeteditor/mobile/locale/zh.json +++ b/apps/spreadsheeteditor/mobile/locale/zh.json @@ -160,7 +160,8 @@ "warnLicenseUsersExceeded": "你触发了 %1 编辑器的同时在线数限制。可联系管理员来了解更多信息。", "warnNoLicense": "你已经触发了 %1 编辑器的同时在线数限制. 该文档打开后,你将只能查看。请联系 %1 的销售团队,获取个人升级条款。", "warnNoLicenseUsers": "你触发了 %1 编辑器的同时在线数限制。请与 %1 的销售团队联系,以获取个人升级条款。", - "warnProcessRightsChange": "你没有编辑文件的权限。" + "warnProcessRightsChange": "你没有编辑文件的权限。", + "textRequestMacros": "A macro makes a request to URL. Do you want to allow the request to the %1?" } }, "Error": { diff --git a/apps/spreadsheeteditor/mobile/src/controller/ContextMenu.jsx b/apps/spreadsheeteditor/mobile/src/controller/ContextMenu.jsx index d21cff870..8deb76aa2 100644 --- a/apps/spreadsheeteditor/mobile/src/controller/ContextMenu.jsx +++ b/apps/spreadsheeteditor/mobile/src/controller/ContextMenu.jsx @@ -14,6 +14,7 @@ import EditorUIController from '../lib/patch'; canComments: stores.storeAppOptions.canComments, canViewComments: stores.storeAppOptions.canViewComments, canCoAuthoring: stores.storeAppOptions.canCoAuthoring, + isRestrictedEdit: stores.storeAppOptions.isRestrictedEdit, users: stores.users, isDisconnected: stores.users.isDisconnected, storeSheets: stores.sheets, @@ -215,12 +216,12 @@ class ContextMenu extends ContextMenuController { const { t } = this.props; const _t = t("ContextMenu", { returnObjects: true }); - const { isEdit, isDisconnected } = this.props; + const { isEdit, isRestrictedEdit, isDisconnected } = this.props; if (isEdit && EditorUIController.ContextMenu) { return EditorUIController.ContextMenu.mapMenuItems(this); } else { - const {canViewComments} = this.props; + const {canViewComments, canCoAuthoring, canComments} = this.props; const api = Common.EditorApi.get(); const cellinfo = api.asc_getCellInfo(); @@ -262,6 +263,13 @@ class ContextMenu extends ContextMenuController { event: 'viewcomment' }); } + + if (iscellmenu && !api.isCellEdited && isRestrictedEdit && canCoAuthoring && canComments && hasComments && hasComments.length<1) { + itemsText.push({ + caption: _t.menuAddComment, + event: 'addcomment' + }); + } } return itemsIcon.concat(itemsText); diff --git a/apps/spreadsheeteditor/mobile/src/controller/Error.jsx b/apps/spreadsheeteditor/mobile/src/controller/Error.jsx index 1b991fc32..5a836adef 100644 --- a/apps/spreadsheeteditor/mobile/src/controller/Error.jsx +++ b/apps/spreadsheeteditor/mobile/src/controller/Error.jsx @@ -222,6 +222,7 @@ const ErrorController = inject('storeAppOptions')(({storeAppOptions, LoadingDocu case Asc.c_oAscError.ID.DataValidate: errData && errData.asc_getErrorTitle() && (config.title = Common.Utils.String.htmlEncode(errData.asc_getErrorTitle())); + config.buttons = ['OK', 'Cancel']; config.msg = errData && errData.asc_getError() ? Common.Utils.String.htmlEncode(errData.asc_getError()) : _t.errorDataValidate; break; @@ -350,8 +351,9 @@ const ErrorController = inject('storeAppOptions')(({storeAppOptions, LoadingDocu Common.Gateway.reportWarning(id, config.msg); config.title = config.title || _t.notcriticalErrorTitle; - config.callback = (btn) => { - if (id == Asc.c_oAscError.ID.DataValidate) { + config.buttons = config.buttons || ['OK']; + config.callback = (_, btn) => { + if (id == Asc.c_oAscError.ID.DataValidate && btn.target.textContent !== 'OK') { api.asc_closeCellEditor(true); } storeAppOptions.changeEditingRights(false); @@ -362,12 +364,12 @@ const ErrorController = inject('storeAppOptions')(({storeAppOptions, LoadingDocu cssClass: 'error-dialog', title : config.title, text : config.msg, - buttons: [ + buttons: config.buttons.map( button => ( { - text: 'OK', - onClick: () => config.callback + text:button, + onClick: (_, btn) => config.callback(_, btn) } - ] + )) }).open(); Common.component.Analytics.trackEvent('Internal Error', id.toString()); diff --git a/apps/spreadsheeteditor/mobile/src/controller/Main.jsx b/apps/spreadsheeteditor/mobile/src/controller/Main.jsx index a0d59fba0..0beb6c1a5 100644 --- a/apps/spreadsheeteditor/mobile/src/controller/Main.jsx +++ b/apps/spreadsheeteditor/mobile/src/controller/Main.jsx @@ -56,6 +56,7 @@ class MainController extends Component { 'DeleteRows', 'Sort', 'AutoFilter', 'PivotTables', 'Objects', 'Scenarios']; this.defaultTitleText = __APP_TITLE_TEXT__; + this.stackMacrosRequests = []; const { t } = this.props; this._t = t('Controller.Main', {returnObjects:true}); @@ -138,6 +139,9 @@ class MainController extends Component { value = parseInt(value); } this.props.storeApplicationSettings.changeMacrosSettings(value); + + value = localStorage.getItem("sse-mobile-allow-macros-request"); + this.props.storeApplicationSettings.changeMacrosRequest((value !== null) ? parseInt(value) : 0); }; const loadDocument = data => { @@ -151,6 +155,7 @@ class MainController extends Component { let _permissions = Object.assign({}, data.doc.permissions), _user = new Asc.asc_CUserInfo(); + const _options = Object.assign({}, data.doc.options, this.editorConfig.actionLink || {}); const _userOptions = this.props.storeAppOptions.user; _user.put_Id(_userOptions.id); @@ -163,7 +168,7 @@ class MainController extends Component { docInfo.put_Title(data.doc.title); docInfo.put_Format(data.doc.fileType); docInfo.put_VKey(data.doc.vkey); - docInfo.put_Options(data.doc.options); + docInfo.put_Options(_options); docInfo.put_UserInfo(_user); docInfo.put_CallbackUrl(this.editorConfig.callbackUrl); docInfo.put_Token(data.doc.token); @@ -186,6 +191,7 @@ class MainController extends Component { this.api.asc_registerCallback('asc_onGetEditorPermissions', onEditorPermissions); this.api.asc_registerCallback('asc_onLicenseChanged', this.onLicenseChanged.bind(this)); + this.api.asc_registerCallback('asc_onMacrosPermissionRequest', this.onMacrosPermissionRequest.bind(this)); this.api.asc_registerCallback('asc_onRunAutostartMacroses', this.onRunAutostartMacroses.bind(this)); this.api.asc_setDocInfo(docInfo); this.api.asc_getEditorPermissions(this.editorConfig.licenseUrl, this.editorConfig.customerId); @@ -789,6 +795,70 @@ class MainController extends Component { } } + onMacrosPermissionRequest (url, callback) { + if (url && callback) { + this.stackMacrosRequests.push({url: url, callback: callback}); + if (this.stackMacrosRequests.length>1) { + return; + } + } else if (this.stackMacrosRequests.length>0) { + url = this.stackMacrosRequests[0].url; + callback = this.stackMacrosRequests[0].callback; + } else + return; + + const value = this.props.storeApplicationSettings.macrosRequest; + if (value>0) { + callback && callback(value === 1); + this.stackMacrosRequests.shift(); + this.onMacrosPermissionRequest(); + } else { + const { t } = this.props; + const _t = t('Controller.Main', {returnObjects:true}); + f7.dialog.create({ + title: _t.notcriticalErrorTitle, + text: _t.textRequestMacros.replace('%1', url), + cssClass: 'dlg-macros-request', + content: `
    + + ${_t.textRemember} +
    `, + buttons: [{ + text: _t.textYes, + onClick: () => { + const dontshow = $$('input[name="checkbox-show-macros"]').prop('checked'); + if (dontshow) { + this.props.storeApplicationSettings.changeMacrosRequest(1); + LocalStorage.setItem("sse-mobile-allow-macros-request", 1); + } + setTimeout(() => { + if (callback) callback(true); + this.stackMacrosRequests.shift(); + this.onMacrosPermissionRequest(); + }, 1); + }}, + { + text: _t.textNo, + onClick: () => { + const dontshow = $$('input[name="checkbox-show-macros"]').prop('checked'); + if (dontshow) { + this.props.storeApplicationSettings.changeMacrosRequest(2); + LocalStorage.setItem("sse-mobile-allow-macros-request", 2); + } + setTimeout(() => { + if (callback) callback(false); + this.stackMacrosRequests.shift(); + this.onMacrosPermissionRequest(); + }, 1); + } + }] + }).open(); + } + } + onDownloadUrl (url, fileType) { if (this._state.isFromGatewayDownloadAs) { Common.Gateway.downloadAs(url, fileType); diff --git a/apps/spreadsheeteditor/mobile/src/controller/Statusbar.jsx b/apps/spreadsheeteditor/mobile/src/controller/Statusbar.jsx index 5c871267f..47f114d8f 100644 --- a/apps/spreadsheeteditor/mobile/src/controller/Statusbar.jsx +++ b/apps/spreadsheeteditor/mobile/src/controller/Statusbar.jsx @@ -373,13 +373,6 @@ const Statusbar = inject('sheets', 'storeAppOptions', 'users')(observer(props => api.asc_showWorksheet(sheetIndex); f7.popover.close('#idx-all-list'); } - - const tab = $$('.sheet-tabs .tab').eq(sheetIndex); - if(tab.offset().left < 0) { - $$('.sheet-tabs').scrollLeft( $$('.sheet-tabs').scrollLeft() + tab.offset().left - 96, 500); - } else { - $$('.sheet-tabs').scrollLeft( $$('.sheet-tabs').scrollLeft() + (tab.offset().left + tab.width() - $$('.sheet-tabs').width()/1.5), 500); - } }; const onSetWorkSheetColor = (color) => { diff --git a/apps/spreadsheeteditor/mobile/src/index_dev.html b/apps/spreadsheeteditor/mobile/src/index_dev.html index c2a8cbaf8..b9b13f4c9 100644 --- a/apps/spreadsheeteditor/mobile/src/index_dev.html +++ b/apps/spreadsheeteditor/mobile/src/index_dev.html @@ -2,7 +2,7 @@ - + diff --git a/apps/spreadsheeteditor/mobile/src/less/icons-ios.less b/apps/spreadsheeteditor/mobile/src/less/icons-ios.less index 74136b59b..90d210542 100644 --- a/apps/spreadsheeteditor/mobile/src/less/icons-ios.less +++ b/apps/spreadsheeteditor/mobile/src/less/icons-ios.less @@ -182,6 +182,11 @@ height: 28px; .encoded-svg-mask(''); } + &.icon-cell-style { + width: 24px; + height: 24px; + .encoded-svg-mask(''); + } // Presets of table borders diff --git a/apps/spreadsheeteditor/mobile/src/store/appOptions.js b/apps/spreadsheeteditor/mobile/src/store/appOptions.js index e1dcf79c5..7c0c94181 100644 --- a/apps/spreadsheeteditor/mobile/src/store/appOptions.js +++ b/apps/spreadsheeteditor/mobile/src/store/appOptions.js @@ -94,11 +94,16 @@ export class storeAppOptions { this.canComments = this.canLicense && (permissions.comment === undefined ? this.isEdit : permissions.comment) && (this.config.mode !== 'view'); this.canComments = this.canComments && !((typeof (this.customization) == 'object') && this.customization.comments===false); this.canViewComments = this.canComments || !((typeof (this.customization) == 'object') && this.customization.comments===false); - this.canEditComments = this.isOffline || !(typeof (this.customization) == 'object' && this.customization.commentAuthorOnly); + this.canEditComments = this.isOffline || !permissions.editCommentAuthorOnly; this.canDeleteComments= this.isOffline || !permissions.deleteCommentAuthorOnly; + if ((typeof (this.customization) == 'object') && this.customization.commentAuthorOnly===true) { + console.log("Obsolete: The 'commentAuthorOnly' parameter of the 'customization' section is deprecated. Please use 'editCommentAuthorOnly' and 'deleteCommentAuthorOnly' parameters in the permissions instead."); + if (permissions.editCommentAuthorOnly===undefined && permissions.deleteCommentAuthorOnly===undefined) + this.canEditComments = this.canDeleteComments = this.isOffline; + } this.canChat = this.canLicense && !this.isOffline && (permissions.chat !== false); this.canPrint = (permissions.print !== false); - this.isRestrictedEdit = !this.isEdit && this.canComments; + this.isRestrictedEdit = !this.isEdit && this.canComments && isSupportEditFeature; this.trialMode = params.asc_getLicenseMode(); const type = /^(?:(pdf|djvu|xps|oxps))$/.exec(document.fileType); diff --git a/apps/spreadsheeteditor/mobile/src/store/applicationSettings.js b/apps/spreadsheeteditor/mobile/src/store/applicationSettings.js index 1d22a10ce..fdf83b3b3 100644 --- a/apps/spreadsheeteditor/mobile/src/store/applicationSettings.js +++ b/apps/spreadsheeteditor/mobile/src/store/applicationSettings.js @@ -5,7 +5,8 @@ export class storeApplicationSettings { constructor() { makeObservable(this, { unitMeasurement: observable, - macrosMode: observable, + macrosMode: observable, + macrosRequest: observable, formulaLang: observable, regCode: observable, regExample: observable, @@ -18,7 +19,8 @@ export class storeApplicationSettings { changeRegCode: action, setRegExample: action, changeUnitMeasurement: action, - changeMacrosSettings: action, + changeMacrosSettings: action, + changeMacrosRequest: action, changeDisplayComments: action, changeDisplayResolved: action, changeRefStyle: action, @@ -31,6 +33,7 @@ export class storeApplicationSettings { directionMode = LocalStorage.getItem('mode-direction') || 'ltr'; unitMeasurement = Common.Utils.Metric.getCurrentMetric(); macrosMode = 0; + macrosRequest = 0; formulaLang = LocalStorage.getItem('sse-settings-func-lang') || this.getFormulaLanguages()[0].value; regCode = undefined; regExample = ''; @@ -109,6 +112,10 @@ export class storeApplicationSettings { this.macrosMode = +value; } + changeMacrosRequest(value) { + this.macrosRequest = value; + } + changeDisplayComments(value) { this.isComments = value; if (!value) this.changeDisplayResolved(value); diff --git a/apps/spreadsheeteditor/mobile/src/view/Statusbar.jsx b/apps/spreadsheeteditor/mobile/src/view/Statusbar.jsx index e5aff2a69..f9e264924 100644 --- a/apps/spreadsheeteditor/mobile/src/view/Statusbar.jsx +++ b/apps/spreadsheeteditor/mobile/src/view/Statusbar.jsx @@ -42,6 +42,22 @@ const PageAllList = (props) => { const { sheets, onTabListClick } = props; const allSheets = sheets.sheets; + useEffect(() => { + const tabs = $$('.sheet-tabs .tab'); + let tab = tabs.eq(sheets.activeWorksheet); + + if(sheets.activeWorksheet !== -1) { + if(tab.length === 0) { + tab = tabs.eq(tabs.length - 1); + $$('.sheet-tabs').scrollLeft( tab.offset().left + tab.width(), 500); + } else if(tab.offset().left < 0) { + $$('.sheet-tabs').scrollLeft( $$('.sheet-tabs').scrollLeft() + tab.offset().left - 96, 500); + } else { + $$('.sheet-tabs').scrollLeft( $$('.sheet-tabs').scrollLeft() + (tab.offset().left + tab.width() - $$('.sheet-tabs').width()), 500); + } + } + }, [sheets.activeWorksheet]); + return ( diff --git a/apps/spreadsheeteditor/mobile/src/view/edit/Edit.jsx b/apps/spreadsheeteditor/mobile/src/view/edit/Edit.jsx index f7354726f..89d408d9d 100644 --- a/apps/spreadsheeteditor/mobile/src/view/edit/Edit.jsx +++ b/apps/spreadsheeteditor/mobile/src/view/edit/Edit.jsx @@ -14,7 +14,7 @@ import { EditLinkController } from "../../controller/edit/EditLink"; import { PageShapeStyle, PageShapeStyleNoFill, PageReplaceContainer, PageReorderContainer, PageShapeBorderColor, PageShapeCustomBorderColor, PageShapeCustomFillColor } from './EditShape'; import { PageImageReplace, PageImageReorder, PageLinkSettings } from './EditImage'; -import { TextColorCell, FillColorCell, CustomTextColorCell, CustomFillColorCell, FontsCell, TextFormatCell, TextOrientationCell, BorderStyleCell, BorderColorCell, CustomBorderColorCell, BorderSizeCell, PageFormatCell, PageAccountingFormatCell, PageCurrencyFormatCell, PageDateFormatCell, PageTimeFormatCell } from './EditCell'; +import { TextColorCell, FillColorCell, CustomTextColorCell, CustomFillColorCell, FontsCell, TextFormatCell, TextOrientationCell, BorderStyleCell, BorderColorCell, CustomBorderColorCell, BorderSizeCell, PageFormatCell, PageAccountingFormatCell, PageCurrencyFormatCell, PageDateFormatCell, PageTimeFormatCell, CellStyle } from './EditCell'; import { PageTextFonts, PageTextFontColor, PageTextCustomFontColor } from './EditText'; import { PageChartDesign, PageChartDesignType, PageChartDesignStyle, PageChartDesignFill, PageChartDesignBorder, PageChartCustomFillColor, PageChartBorderColor, PageChartCustomBorderColor, PageChartReorder, PageChartLayout, PageLegend, PageChartTitle, PageHorizontalAxisTitle, PageVerticalAxisTitle, PageHorizontalGridlines, PageVerticalGridlines, PageDataLabels, PageChartVerticalAxis, PageVertAxisCrosses, PageDisplayUnits, PageVertMajorType, PageVertMinorType, PageVertLabelPosition, PageChartHorizontalAxis, PageHorAxisCrosses, PageHorAxisPosition, PageHorMajorType, PageHorMinorType, PageHorLabelPosition } from './EditChart'; import { PageTypeLink, PageSheet } from './EditLink'; @@ -133,6 +133,10 @@ const routes = [ path: '/edit-time-format-cell/', component: PageTimeFormatCell }, + { + path: '/edit-cell-style/', + component: CellStyle + }, // Text diff --git a/apps/spreadsheeteditor/mobile/src/view/edit/EditCell.jsx b/apps/spreadsheeteditor/mobile/src/view/edit/EditCell.jsx index ba2bb0aff..fdc307643 100644 --- a/apps/spreadsheeteditor/mobile/src/view/edit/EditCell.jsx +++ b/apps/spreadsheeteditor/mobile/src/view/edit/EditCell.jsx @@ -14,9 +14,8 @@ const EditCell = props => { const storeWorksheets = props.storeWorksheets; const wsProps = storeWorksheets.wsProps; const cellStyles = storeCellSettings.cellStyles; - const countSlides = Math.floor(cellStyles.length / 9); - const arraySlides = Array(countSlides).fill(countSlides); - const styleName = storeCellSettings.styleName; + const curStyleName = storeCellSettings.styleName; + const curStyle = cellStyles.find(style => style.name === curStyleName); const fontInfo = storeCellSettings.fontInfo; const fontName = fontInfo.name || _t.textFonts; @@ -109,32 +108,65 @@ const EditCell = props => { } - {_t.textCellStyles} - {cellStyles && cellStyles.length ? ( -
    -
    - {arraySlides.map((_, indexSlide) => { - let stylesSlide = cellStyles.slice(indexSlide * 9, (indexSlide * 9) + 9); - - return ( -
    - - {stylesSlide.map((elem, index) => ( - props.onStyleClick(elem.name)}> -
    -
    - ))} -
    -
    - )})} + + + {!isAndroid && } +
    +
    -
    - ) : null} + + } ) }; +const PageCellStyle = props => { + const { t } = useTranslation(); + const _t = t('View.Edit', {returnObjects: true}); + const storeCellSettings = props.storeCellSettings; + const styleName = storeCellSettings.styleName; + const cellStyles = storeCellSettings.cellStyles; + const countStylesSlide = Device.phone ? 6 : 15; + const countSlides = Math.floor(cellStyles.length / countStylesSlide); + const arraySlides = Array(countSlides).fill(countSlides); + + return ( + + + {Device.phone && + + + + } + + {cellStyles && cellStyles.length ? ( +
    +
    +
    + {arraySlides.map((_, indexSlide) => { + let stylesSlide = cellStyles.slice(indexSlide * countStylesSlide, (indexSlide * countStylesSlide) + countStylesSlide); + + return ( +
    + + {stylesSlide.map((elem, index) => ( + props.onStyleClick(elem.name)}> +
    +
    + ))} +
    +
    + )})} +
    +
    + ) : null} +
    + ) +} + const PageFontsCell = props => { const isAndroid = Device.android; const { t } = useTranslation(); @@ -1016,6 +1048,7 @@ const BorderStyleCell = inject("storeCellSettings", "storeFocusObjects")(observe const BorderColorCell = inject("storeCellSettings", "storePalette")(observer(PageBorderColorCell)); const CustomBorderColorCell = inject("storeCellSettings", "storePalette")(observer(PageCustomBorderColorCell)); const BorderSizeCell = inject("storeCellSettings")(observer(PageBorderSizeCell)); +const CellStyle = inject("storeCellSettings")(observer(PageCellStyle)); export { PageEditCell as EditCell, @@ -1034,5 +1067,6 @@ export { PageAccountingFormatCell, PageCurrencyFormatCell, PageDateFormatCell, - PageTimeFormatCell + PageTimeFormatCell, + CellStyle }; \ No newline at end of file