diff --git a/CHANGELOG.md b/CHANGELOG.md index dea78e9b0..fd3f1236c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,44 +1,16 @@ # Change log -## 5.2 +## 5.3 ### All Editors -* Customize initial zoom for the embedded editors -* Customize availability of help in the editor -* Add File and Plugins tabs for viewers -* Mark username by color in the comments, review changes, chat messages -* bug #37570 -* Show edit-mode users in format () -* Don't duplicate online users in the left chat panel -* Sort comments in the popover by ascending creation time +* Save to pdfa format +* Add rotation and flip to image and shape settings (bug #19378) +* Save file copy to selected folder (bug #23603, bug #32790) +* Load image from storage +* Add customization parameter 'hideRightMenu' for hiding right panel on first loading (bug #39096) ### Document Editor -* Create and manage bookmarks -* Create internal hyperlinks to bookmarks and headings -* Content controls settings (highlight and appearance) -* Change numbering value, start/continue numbering -* Review changes and comments are in combined window -* Add page presets А0, А1, А2, А6 (bug #36583) -* Enable closing chart dialog while loading (bug #36870) -* Change encoding format for txt files (bug #36998) -* Add mode for filling forms -* Enable closing window when save to txt -* Enable inserting shapes when shape is selected -* Check new revisions in fast co-editing mode -* Save track-changes option for file key -* Disable bookmarks in the document headers (bug #38957) ### Spreadsheet Editor -* Set options for saving in PDF format (bug #34914) -* Cell settings in the right panel -* Add Layout tab: save margins, page size, orientation for sheets, align/arrange, group/ungroup objects (shapes, images, charts) -* Added hint for autofilters -* Change encoding format for csv files (bug #36998) -* Rename sheets in the mobile editor (bug #37701) -* Enable closing window when save to csv -* Save page options to file before printing -* Hide options for headings, gridlines, freeze panes in the viewer (bug #38033) +* Set print area ### Presentation Editor -* Add hints to presentation themes (bug #21362) -* Add presenter preview in the viewer (bug #37499) -* Enable closing chart dialog while loading (bug #36870) - +* Enter the slide number manually for internal hyperlinks diff --git a/apps/api/documents/api.js b/apps/api/documents/api.js index ae5e1781a..c53692eb1 100644 --- a/apps/api/documents/api.js +++ b/apps/api/documents/api.js @@ -57,9 +57,10 @@ canBackToFolder: - deprecated. use "customization.goback" parameter, createUrl: 'create document url', sharingSettingsUrl: 'document sharing settings url', - fileChoiceUrl: 'mail merge sources url', + fileChoiceUrl: 'source url', // for mail merge or image from storage callbackUrl: , - mergeFolderUrl: 'folder for saving merged file', + mergeFolderUrl: 'folder for saving merged file', // must be deprecated, use saveAsUrl instead + saveAsUrl: 'folder for saving files' licenseUrl: , customerId: , @@ -89,8 +90,6 @@ imageEmbedded: url, url: http://... }, - backgroundColor: 'header background color', - textColor: 'header text color', customer: { name: 'SuperPuper', address: 'New-York, 125f-25', @@ -115,6 +114,7 @@ compactToolbar: false, leftMenu: true, rightMenu: true, + hideRightMenu: false, // hide or show right panel on first loading toolbar: true, header: true, statusBar: true, @@ -195,6 +195,7 @@ _config.editorConfig.canRequestEditRights = _config.events && !!_config.events.onRequestEditRights; _config.editorConfig.canRequestClose = _config.events && !!_config.events.onRequestClose; _config.editorConfig.canRename = _config.events && !!_config.events.onRequestRename; + _config.editorConfig.mergeFolderUrl = _config.editorConfig.mergeFolderUrl || _config.editorConfig.saveAsUrl; _config.frameEditorId = placeholderId; _config.events && !!_config.events.onReady && console.log("Obsolete: The onReady event is deprecated. Please use onAppReady instead."); diff --git a/apps/common/main/lib/component/DataView.js b/apps/common/main/lib/component/DataView.js index 07b629f58..d343f62ac 100644 --- a/apps/common/main/lib/component/DataView.js +++ b/apps/common/main/lib/component/DataView.js @@ -424,7 +424,7 @@ define([ innerEl.prepend(view.render().el); else innerEl.append(view.render().el); - innerEl.find('.empty-text').remove(); + (this.dataViewItems.length<1) && innerEl.find('.empty-text').remove(); var idx = _.indexOf(this.store.models, record); this.dataViewItems = this.dataViewItems.slice(0, idx).concat(view).concat(this.dataViewItems.slice(idx)); diff --git a/apps/common/main/lib/component/InputField.js b/apps/common/main/lib/component/InputField.js index 5bfea7578..00fc916a6 100644 --- a/apps/common/main/lib/component/InputField.js +++ b/apps/common/main/lib/component/InputField.js @@ -155,6 +155,7 @@ define([ if (this.editable) { this._input.on('blur', _.bind(this.onInputChanged, this)); this._input.on('keypress', _.bind(this.onKeyPress, this)); + this._input.on('keydown', _.bind(this.onKeyDown, this)); this._input.on('keyup', _.bind(this.onKeyUp, this)); if (this.validateOnChange) this._input.on('input', _.bind(this.onInputChanging, this)); if (this.maxLength) this._input.attr('maxlength', this.maxLength); @@ -225,13 +226,11 @@ define([ if (e.isDefaultPrevented()) return; - if (e.keyCode === Common.UI.Keys.RETURN) { - this._doChange(e); - } else if (this.options.maskExp && !_.isEmpty(this.options.maskExp.source)){ + if (this.options.maskExp && !_.isEmpty(this.options.maskExp.source)){ var charCode = String.fromCharCode(e.which); if(!this.options.maskExp.test(charCode) && !e.ctrlKey && e.keyCode !== Common.UI.Keys.DELETE && e.keyCode !== Common.UI.Keys.BACKSPACE && e.keyCode !== Common.UI.Keys.LEFT && e.keyCode !== Common.UI.Keys.RIGHT && e.keyCode !== Common.UI.Keys.HOME && - e.keyCode !== Common.UI.Keys.END && e.keyCode !== Common.UI.Keys.ESC && e.keyCode !== Common.UI.Keys.INSERT ){ + e.keyCode !== Common.UI.Keys.END && e.keyCode !== Common.UI.Keys.ESC && e.keyCode !== Common.UI.Keys.INSERT && e.keyCode !== Common.UI.Keys.RETURN){ e.preventDefault(); e.stopPropagation(); } @@ -240,6 +239,14 @@ define([ this.trigger('keypress:after', this, e); }, + onKeyDown: function(e) { + if (e.isDefaultPrevented()) + return; + + if (e.keyCode === Common.UI.Keys.RETURN) + this._doChange(e); + }, + onKeyUp: function(e) { this.trigger('keyup:before', this, e); diff --git a/apps/common/main/lib/component/ListView.js b/apps/common/main/lib/component/ListView.js index 1476af029..c23f24473 100644 --- a/apps/common/main/lib/component/ListView.js +++ b/apps/common/main/lib/component/ListView.js @@ -77,7 +77,7 @@ define([ this.innerEl = $(this.el).find('.inner'); if (view && this.innerEl) { - this.innerEl.find('.empty-text').remove(); + (this.dataViewItems.length<1) && this.innerEl.find('.empty-text').remove(); if (this.options.simpleAddMode) { this.innerEl.append(view.render().el); this.dataViewItems.push(view); diff --git a/apps/common/main/lib/component/TreeView.js b/apps/common/main/lib/component/TreeView.js index 1eb299f1b..fb5b001d3 100644 --- a/apps/common/main/lib/component/TreeView.js +++ b/apps/common/main/lib/component/TreeView.js @@ -195,7 +195,7 @@ define([ if (view) { var innerEl = $(this.el).find('.inner').addBack().filter('.inner'); if (innerEl) { - innerEl.find('.empty-text').remove(); + (this.dataViewItems.length<1) && innerEl.find('.empty-text').remove(); if (opts && opts.at!==undefined) { var idx = opts.at; diff --git a/apps/common/main/lib/component/Window.js b/apps/common/main/lib/component/Window.js index 1c4511b20..74c39d64a 100644 --- a/apps/common/main/lib/component/Window.js +++ b/apps/common/main/lib/component/Window.js @@ -612,9 +612,10 @@ define([ this.setResizable(this.initConfig.resizable); var me = this; - Common.NotificationCenter.on('window:close', function() { - if (me.$window && me.isVisible()) me.close(); - }); + this.binding.winclose = function(obj) { + if (me.$window && me.isVisible() && me.$window == obj.$window) me.close(); + }; + Common.NotificationCenter.on('window:close', this.binding.winclose); this.fireEvent('render:after',this); return this; @@ -704,6 +705,7 @@ define([ if ( this.initConfig.header ) { this.$window.find('.header').off('mousedown', this.binding.dragStart); } + Common.NotificationCenter.off({'window:close': this.binding.winclose}); if (this.initConfig.modal) { var mask = _getMask(), diff --git a/apps/common/main/lib/view/ExtendedColorDialog.js b/apps/common/main/lib/view/ExtendedColorDialog.js index ff6e6e86d..541124f4d 100644 --- a/apps/common/main/lib/view/ExtendedColorDialog.js +++ b/apps/common/main/lib/view/ExtendedColorDialog.js @@ -280,6 +280,12 @@ define([ },50); }, + onPrimary: function() { + this.trigger('onmodalresult', 1); + this.close(true); + return false; + }, + cancelButtonText: 'Cancel', addButtonText: 'Add', textNew: 'New', diff --git a/apps/common/main/lib/view/Header.js b/apps/common/main/lib/view/Header.js index 4ef297cb7..902906dca 100644 --- a/apps/common/main/lib/view/Header.js +++ b/apps/common/main/lib/view/Header.js @@ -481,7 +481,7 @@ define([ me.setUserName(me.options.userName); if ( config.canPrint && config.isEdit ) { - me.btnPrint = createTitleButton('svg-btn-print', $('#slot-btn-dt-print', $html)); + me.btnPrint = createTitleButton('svg-btn-print', $('#slot-btn-dt-print', $html), true); } me.btnSave = createTitleButton('svg-btn-save', $('#slot-btn-dt-save', $html), true); diff --git a/apps/common/main/lib/view/ImageFromUrlDialog.js b/apps/common/main/lib/view/ImageFromUrlDialog.js index 5f92912fc..8cfb3d3d9 100644 --- a/apps/common/main/lib/view/ImageFromUrlDialog.js +++ b/apps/common/main/lib/view/ImageFromUrlDialog.js @@ -87,7 +87,6 @@ define([ var $window = this.getChild(); $window.find('.btn').on('click', _.bind(this.onBtnClick, this)); - $window.find('input').on('keypress', _.bind(this.onKeyPress, this)); }, show: function() { @@ -99,10 +98,9 @@ define([ },500); }, - onKeyPress: function(event) { - if (event.keyCode == Common.UI.Keys.RETURN) { - this._handleInput('ok'); - } + onPrimary: function(event) { + this._handleInput('ok'); + return false; }, onBtnClick: function(event) { diff --git a/apps/common/main/lib/view/LanguageDialog.js b/apps/common/main/lib/view/LanguageDialog.js index 26f87e7c3..c9fa28635 100644 --- a/apps/common/main/lib/view/LanguageDialog.js +++ b/apps/common/main/lib/view/LanguageDialog.js @@ -136,6 +136,15 @@ define([ icon.addClass(rec.value).attr('lang',rec.value); }, + onPrimary: function() { + if (this.options.handler) { + this.options.handler.call(this, 'ok', this.cmbLanguage.getValue()); + } + + this.close(); + return false; + }, + labelSelect : 'Select document language', btnCancel : 'Cancel', btnOk : 'Ok' diff --git a/apps/common/main/lib/view/OpenDialog.js b/apps/common/main/lib/view/OpenDialog.js index 5c4ead4d9..25497ec57 100644 --- a/apps/common/main/lib/view/OpenDialog.js +++ b/apps/common/main/lib/view/OpenDialog.js @@ -173,7 +173,7 @@ define([ return me.txtIncorrectPwd; } }); - this.$window.find('input').on('keypress', _.bind(this.onKeyPress, this)); + this.$window.find('input').on('input', function(){ if ($(this).val() !== '') { ($(this).attr('type') !== 'password') && $(this).attr('type', 'password'); @@ -185,11 +185,11 @@ define([ this.initCodePages(); if (this.preview) this.updatePreview(); - this.onPrimary = function() { - me._handleInput('ok'); - return false; - }; } + this.onPrimary = function() { + me._handleInput('ok'); + return false; + }; } }, @@ -206,13 +206,6 @@ define([ } }, - onKeyPress: function(event) { - if (event.keyCode == Common.UI.Keys.RETURN) { - this._handleInput('ok'); - } else if (this.closable && event.keyCode == Common.UI.Keys.ESC) - this._handleInput('cancel'); - }, - onBtnClick: function(event) { this._handleInput(event.currentTarget.attributes['result'].value); }, diff --git a/apps/common/main/lib/view/PasswordDialog.js b/apps/common/main/lib/view/PasswordDialog.js index 02ab68cf1..cc2302195 100644 --- a/apps/common/main/lib/view/PasswordDialog.js +++ b/apps/common/main/lib/view/PasswordDialog.js @@ -114,7 +114,6 @@ define([ return me.txtIncorrectPwd; } }); - this.$window.find('input').on('keypress', _.bind(this.onKeyPress, this)); } }, @@ -127,10 +126,9 @@ define([ }, 500); }, - onKeyPress: function(event) { - if (event.keyCode == Common.UI.Keys.RETURN) { - this._handleInput('ok'); - } + onPrimary: function(event) { + this._handleInput('ok'); + return false; }, onBtnClick: function(event) { diff --git a/apps/common/main/lib/view/Protection.js b/apps/common/main/lib/view/Protection.js index 2142ad837..2caaf9c02 100644 --- a/apps/common/main/lib/view/Protection.js +++ b/apps/common/main/lib/view/Protection.js @@ -111,7 +111,7 @@ define([ this.btnsDelPwd = []; this.btnsChangePwd = []; - this._state = {disabled: false, hasPassword: false, disabledPassword: false}; + this._state = {disabled: false, hasPassword: false, disabledPassword: false, invisibleSignDisabled: false}; var filter = Common.localStorage.getKeysFilter(); this.appPrefix = (filter && filter.length) ? filter.split(',')[0] : ''; @@ -226,7 +226,7 @@ define([ cls: 'btn-text-default', style: 'width: 100%;', caption: this.txtInvisibleSignature, - disabled: this._state.disabled + disabled: this._state.invisibleSignDisabled }); this.btnsInvisibleSignature.push(button); @@ -269,6 +269,7 @@ define([ SetDisabled: function (state, canProtect) { this._state.disabled = state; + this._state.invisibleSignDisabled = state && !canProtect; this.btnsInvisibleSignature && this.btnsInvisibleSignature.forEach(function(button) { if ( button ) { button.setDisabled(state && !canProtect); diff --git a/apps/common/main/lib/view/RenameDialog.js b/apps/common/main/lib/view/RenameDialog.js index 241b8c589..02feecc2f 100644 --- a/apps/common/main/lib/view/RenameDialog.js +++ b/apps/common/main/lib/view/RenameDialog.js @@ -88,23 +88,24 @@ define([ $window.find('.btn').on('click', _.bind(this.onBtnClick, this)); me.inputNameEl = $window.find('input'); - me.inputNameEl.on('keypress', _.bind(this.onKeyPress, this)); }, show: function() { Common.UI.Window.prototype.show.apply(this, arguments); var me = this; + var idx = me.options.filename.lastIndexOf('.'); + if (idx>0) + me.options.filename = me.options.filename.substring(0, idx); _.delay(function(){ me.inputName.setValue(me.options.filename); me.inputNameEl.focus().select(); },100); }, - onKeyPress: function(event) { - if (event.keyCode == Common.UI.Keys.RETURN) { - this._handleInput('ok'); - } + onPrimary: function(event) { + this._handleInput('ok'); + return false; }, onBtnClick: function(event) { diff --git a/apps/common/main/lib/view/ReviewPopover.js b/apps/common/main/lib/view/ReviewPopover.js index d2738d796..067cef0a6 100644 --- a/apps/common/main/lib/view/ReviewPopover.js +++ b/apps/common/main/lib/view/ReviewPopover.js @@ -196,7 +196,7 @@ define([ } parentView.scroller.scrollTop(scrollPos); - view.autoScrollToEditButtons(); + parentView.autoScrollToEditButtons(); } if (textBox && textBox.length) { @@ -216,23 +216,6 @@ define([ this.textBox.unbind('input propertychange'); this.textBox = undefined; } - }, - autoScrollToEditButtons: function () { - var button = $('#id-comments-change-popover'), // TODO: add to cache - btnBounds = null, - contentBounds = this.el.getBoundingClientRect(), - moveY = 0, - padding = 7; - - if (button.length) { - btnBounds = button.get(0).getBoundingClientRect(); - if (btnBounds && contentBounds) { - moveY = contentBounds.bottom - (btnBounds.bottom + padding); - if (moveY < 0) { - parentView.scroller.scrollTop(parentView.scroller.getScrollTop() - moveY); - } - } - } } } })()); @@ -328,7 +311,7 @@ define([ me.hookTextBox(); - this.autoScrollToEditButtons(); + me.autoScrollToEditButtons(); this.setFocusToTextBox(); } else { if (!showEditBox) { @@ -347,7 +330,7 @@ define([ me.hookTextBox(); - this.autoScrollToEditButtons(); + me.autoScrollToEditButtons(); this.setFocusToTextBox(); } } @@ -380,7 +363,7 @@ define([ this.autoHeightTextBox(); me.hookTextBox(); - this.autoScrollToEditButtons(); + me.autoScrollToEditButtons(); this.setFocusToTextBox(); } else if (btn.hasClass('btn-reply', false)) { if (showReplyBox) { @@ -388,6 +371,7 @@ define([ me.fireEvent('comment:addReply', [commentId, this.getActiveTextBoxVal()]); me.fireEvent('comment:closeEditing'); + me.calculateSizeOfContent(); readdresolves(); } @@ -774,6 +758,8 @@ define([ sdkBoundsTopPos = 0; if (commentsView && arrowView && commentsView.get(0)) { + var scrollPos = this.scroller.getScrollTop(); + commentsView.css({height: '100%'}); contentBounds = commentsView.get(0).getBoundingClientRect(); @@ -813,6 +799,7 @@ define([ arrowPosY = Math.min(arrowPosY, sdkBoundsHeight - (sdkPanelHeight + this.arrow.margin + this.arrow.width)); arrowView.css({top: arrowPosY + 'px'}); + this.scroller.scrollTop(scrollPos); } else { outerHeight = windowHeight; @@ -922,6 +909,24 @@ define([ return this.popover; }, + autoScrollToEditButtons: function () { + var button = $('#id-comments-change-popover'), // TODO: add to cache + btnBounds = null, + contentBounds = this.$window[0].getBoundingClientRect(), + moveY = 0, + padding = 7; + + if (button.length) { + btnBounds = button.get(0).getBoundingClientRect(); + if (btnBounds && contentBounds) { + moveY = contentBounds.bottom - (btnBounds.bottom + padding); + if (moveY < 0) { + this.scroller.scrollTop(this.scroller.getScrollTop() - moveY); + } + } + } + }, + textAddReply : 'Add Reply', textAdd : "Add", textCancel : 'Cancel', diff --git a/apps/documenteditor/main/app/view/MailMergeSaveDlg.js b/apps/common/main/lib/view/SaveAsDlg.js similarity index 83% rename from apps/documenteditor/main/app/view/MailMergeSaveDlg.js rename to apps/common/main/lib/view/SaveAsDlg.js index 832f1bc6b..82fa60380 100644 --- a/apps/documenteditor/main/app/view/MailMergeSaveDlg.js +++ b/apps/common/main/lib/view/SaveAsDlg.js @@ -31,9 +31,8 @@ * */ /** - * User: Julia.Radzhabova - * Date: 15.04.15 - * Time: 13:56 + * Created by Julia.Radzhabova on 9/27/18 + * Copyright (c) 2018 Ascensio System SIA. All rights reserved. */ define([ @@ -41,7 +40,7 @@ define([ 'common/main/lib/component/LoadMask' ], function () { 'use strict'; - DE.Views.MailMergeSaveDlg = Common.UI.Window.extend(_.extend({ + Common.Views.SaveAsDlg = Common.UI.Window.extend(_.extend({ initialize : function(options) { var _options = {}; _.extend(_options, { @@ -52,15 +51,15 @@ define([ }, options); this.template = [ - '
' + '
' ].join(''); _options.tpl = _.template(this.template)(_options); - this.mergeFolderUrl = options.mergeFolderUrl || ''; - this.mergedFileUrl = options.mergedFileUrl || ''; + this.saveFolderUrl = options.saveFolderUrl || ''; + this.saveFileUrl = options.saveFileUrl || ''; this.defFileName = options.defFileName || ''; - this.mergeFolderUrl = this.mergeFolderUrl.replace("{title}", encodeURIComponent(this.defFileName)).replace("{fileuri}", encodeURIComponent(this.mergedFileUrl)); + this.saveFolderUrl = this.saveFolderUrl.replace("{title}", encodeURIComponent(this.defFileName)).replace("{fileuri}", encodeURIComponent(this.saveFileUrl)); Common.UI.Window.prototype.initialize.call(this, _options); }, @@ -75,13 +74,13 @@ define([ iframe.frameBorder = 0; iframe.scrolling = "no"; iframe.onload = _.bind(this._onLoad,this); - $('#id-mail-merge-folder-placeholder').append(iframe); + $('#id-saveas-folder-placeholder').append(iframe); - this.loadMask = new Common.UI.LoadMask({owner: $('#id-mail-merge-folder-placeholder')}); + this.loadMask = new Common.UI.LoadMask({owner: $('#id-saveas-folder-placeholder')}); this.loadMask.setTitle(this.textLoading); this.loadMask.show(); - iframe.src = this.mergeFolderUrl; + iframe.src = this.saveFolderUrl; var me = this; this._eventfunc = function(msg) { @@ -122,10 +121,10 @@ define([ _onMessage: function(msg) { if (msg && msg.Referer == "onlyoffice") { if ( !_.isEmpty(msg.error) ) { - this.trigger('mailmergeerror', this, msg.error); + this.trigger('saveaserror', this, msg.error); } // if ( !_.isEmpty(msg.folder) ) { -// this.trigger('mailmergefolder', this, msg.folder); // save last folder url +// this.trigger('saveasfolder', this, msg.folder); // save last folder url // } Common.NotificationCenter.trigger('window:close', this); } @@ -138,6 +137,6 @@ define([ textTitle : 'Folder for save', textLoading : 'Loading' - }, DE.Views.MailMergeSaveDlg || {})); + }, Common.Views.SaveAsDlg || {})); }); diff --git a/apps/documenteditor/main/app/view/MailMergeRecepients.js b/apps/common/main/lib/view/SelectFileDlg.js similarity index 92% rename from apps/documenteditor/main/app/view/MailMergeRecepients.js rename to apps/common/main/lib/view/SelectFileDlg.js index 38f4d6ef7..9d2bf2be5 100644 --- a/apps/documenteditor/main/app/view/MailMergeRecepients.js +++ b/apps/common/main/lib/view/SelectFileDlg.js @@ -40,7 +40,7 @@ define([ 'common/main/lib/component/LoadMask' ], function () { 'use strict'; - DE.Views.MailMergeRecepients = Common.UI.Window.extend(_.extend({ + Common.Views.SelectFileDlg = Common.UI.Window.extend(_.extend({ initialize : function(options) { var _options = {}; _.extend(_options, { @@ -51,7 +51,7 @@ define([ }, options); this.template = [ - '
' + '
' ].join(''); _options.tpl = _.template(this.template)(_options); @@ -71,9 +71,9 @@ define([ iframe.frameBorder = 0; iframe.scrolling = "no"; iframe.onload = _.bind(this._onLoad,this); - $('#id-mail-recepients-placeholder').append(iframe); + $('#id-select-file-placeholder').append(iframe); - this.loadMask = new Common.UI.LoadMask({owner: $('#id-mail-recepients-placeholder')}); + this.loadMask = new Common.UI.LoadMask({owner: $('#id-select-file-placeholder')}); this.loadMask.setTitle(this.textLoading); this.loadMask.show(); @@ -121,7 +121,7 @@ define([ var me = this; setTimeout(function() { if ( !_.isEmpty(msg.file) ) { - me.trigger('mailmergerecepients', me, msg.file); + me.trigger('selectfile', me, msg.file); } }, 50); } @@ -134,5 +134,5 @@ define([ textTitle : 'Select Data Source', textLoading : 'Loading' - }, DE.Views.MailMergeRecepients || {})); + }, Common.Views.SelectFileDlg || {})); }); diff --git a/apps/common/main/lib/view/SignDialog.js b/apps/common/main/lib/view/SignDialog.js index 561249529..158389f8f 100644 --- a/apps/common/main/lib/view/SignDialog.js +++ b/apps/common/main/lib/view/SignDialog.js @@ -239,7 +239,6 @@ define([ (me.signType == 'visible') ? me.cntInvisibleSign.addClass('hidden') : me.cntVisibleSign.addClass('hidden'); $window.find('.dlg-btn').on('click', _.bind(me.onBtnClick, me)); - $window.find('input').on('keypress', _.bind(me.onKeyPress, me)); me.afterRender(); }, @@ -297,11 +296,9 @@ define([ this._handleInput(event.currentTarget.attributes['result'].value); }, - onKeyPress: function(event) { - if (event.keyCode == Common.UI.Keys.RETURN) { - this._handleInput('ok'); - return false; - } + onPrimary: function(event) { + this._handleInput('ok'); + return false; }, _handleInput: function(state) { diff --git a/apps/common/main/lib/view/SignSettingsDialog.js b/apps/common/main/lib/view/SignSettingsDialog.js index 4d284c8cd..59a1c25c3 100644 --- a/apps/common/main/lib/view/SignSettingsDialog.js +++ b/apps/common/main/lib/view/SignSettingsDialog.js @@ -140,7 +140,6 @@ define([ }); $window.find('.dlg-btn').on('click', _.bind(this.onBtnClick, this)); - $window.find('input').on('keypress', _.bind(this.onKeyPress, this)); }, show: function() { @@ -185,11 +184,9 @@ define([ this._handleInput(event.currentTarget.attributes['result'].value); }, - onKeyPress: function(event) { - if (event.keyCode == Common.UI.Keys.RETURN) { - this._handleInput('ok'); - return false; - } + onPrimary: function(event) { + this._handleInput('ok'); + return false; }, _handleInput: function(state) { diff --git a/apps/common/main/resources/img/doc-formats/odt.svg b/apps/common/main/resources/img/doc-formats/odt.svg index f5eec1f67..6f43ba494 100644 --- a/apps/common/main/resources/img/doc-formats/odt.svg +++ b/apps/common/main/resources/img/doc-formats/odt.svg @@ -1,5 +1,4 @@ - diff --git a/apps/common/main/resources/img/doc-formats/pdfa.svg b/apps/common/main/resources/img/doc-formats/pdfa.svg index c97e2d165..5cd08e2d8 100644 --- a/apps/common/main/resources/img/doc-formats/pdfa.svg +++ b/apps/common/main/resources/img/doc-formats/pdfa.svg @@ -1,18 +1,18 @@ - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + diff --git a/apps/common/main/resources/less/toolbar.less b/apps/common/main/resources/less/toolbar.less index c90ccf813..f633706bc 100644 --- a/apps/common/main/resources/less/toolbar.less +++ b/apps/common/main/resources/less/toolbar.less @@ -323,3 +323,4 @@ .button-normal-icon(btn-controls, 54, @toolbar-big-icon-size); .button-normal-icon(~'x-huge .btn-select-pivot', 55, @toolbar-big-icon-size); .button-normal-icon(~'x-huge .btn-bookmarks', 56, @toolbar-big-icon-size); +.button-normal-icon(btn-print-area, 56, @toolbar-big-icon-size); \ No newline at end of file diff --git a/apps/common/main/resources/less/window.less b/apps/common/main/resources/less/window.less index 8e3302440..f0661610f 100644 --- a/apps/common/main/resources/less/window.less +++ b/apps/common/main/resources/less/window.less @@ -34,6 +34,7 @@ opacity: 0; position: fixed; + cursor: default; > .header { height: 34px; diff --git a/apps/documenteditor/main/app/controller/LeftMenu.js b/apps/documenteditor/main/app/controller/LeftMenu.js index 4c05068d0..0fa76faae 100644 --- a/apps/documenteditor/main/app/controller/LeftMenu.js +++ b/apps/documenteditor/main/app/controller/LeftMenu.js @@ -43,6 +43,7 @@ define([ 'core', 'common/main/lib/util/Shortcuts', + 'common/main/lib/view/SaveAsDlg', 'documenteditor/main/app/view/LeftMenu', 'documenteditor/main/app/view/FileMenu' ], function () { @@ -85,6 +86,7 @@ define([ 'menu:show': _.bind(this.menuFilesShowHide, this, 'show'), 'item:click': _.bind(this.clickMenuFileItem, this), 'saveas:format': _.bind(this.clickSaveAsFormat, this), + 'savecopy:format': _.bind(this.clickSaveCopyAsFormat, this), 'settings:apply': _.bind(this.applySettings, this), 'create:new': _.bind(this.onCreateNew, this), 'recent:open': _.bind(this.onOpenRecent, this) @@ -141,8 +143,9 @@ define([ setApi: function(api) { this.api = api; this.api.asc_registerCallback('asc_onReplaceAll', _.bind(this.onApiTextReplaced, this)); - this.api.asc_registerCallback('asc_onCoAuthoringDisconnect', _.bind(this.onApiServerDisconnect, this, true)); + this.api.asc_registerCallback('asc_onCoAuthoringDisconnect', _.bind(this.onApiServerDisconnect, this)); Common.NotificationCenter.on('api:disconnect', _.bind(this.onApiServerDisconnect, this)); + this.api.asc_registerCallback('asc_onDownloadUrl', _.bind(this.onDownloadUrl, this)); /** coauthoring begin **/ if (this.mode.canCoAuthoring) { if (this.mode.canChat) @@ -229,6 +232,10 @@ define([ if ( isopts ) close_menu = false; else this.clickSaveAsFormat(undefined); break; + case 'save-copy': + if ( isopts ) close_menu = false; + else this.clickSaveCopyAsFormat(undefined); + break; case 'print': this.api.asc_Print(Common.Utils.isChrome || Common.Utils.isSafari || Common.Utils.isOpera); break; case 'exit': Common.NotificationCenter.trigger('goback'); break; case 'edit': @@ -307,6 +314,70 @@ define([ this.api.asc_DownloadOrigin(); }, + clickSaveCopyAsFormat: function(menu, format, ext) { + if (menu) { + if (format == Asc.c_oAscFileType.TXT || format == Asc.c_oAscFileType.RTF) { + Common.UI.warning({ + closable: false, + title: this.notcriticalErrorTitle, + msg: (format == Asc.c_oAscFileType.TXT) ? this.warnDownloadAs : this.warnDownloadAsRTF, + buttons: ['ok', 'cancel'], + callback: _.bind(function(btn){ + if (btn == 'ok') { + this.isFromFileDownloadAs = ext; + this.api.asc_DownloadAs(format, true); + menu.hide(); + } + }, this) + }); + } else { + this.isFromFileDownloadAs = ext; + this.api.asc_DownloadAs(format, true); + menu.hide(); + } + } else { + this.isFromFileDownloadAs = true; + this.api.asc_DownloadOrigin(true); + } + }, + + onDownloadUrl: function(url) { + if (this.isFromFileDownloadAs) { + var me = this, + defFileName = this.getApplication().getController('Viewport').getView('Common.Views.Header').getDocumentCaption(); + !defFileName && (defFileName = me.txtUntitled); + + if (typeof this.isFromFileDownloadAs == 'string') { + var idx = defFileName.lastIndexOf('.'); + if (idx>0) + defFileName = defFileName.substring(0, idx) + this.isFromFileDownloadAs; + } + + me._saveCopyDlg = new Common.Views.SaveAsDlg({ + saveFolderUrl: me.mode.saveAsUrl, + saveFileUrl: url, + defFileName: defFileName + }); + me._saveCopyDlg.on('saveaserror', function(obj, err){ + var config = { + closable: false, + title: me.notcriticalErrorTitle, + msg: err, + iconCls: 'warn', + buttons: ['ok'], + callback: function(btn){ + Common.NotificationCenter.trigger('edit:complete', me); + } + }; + Common.UI.alert(config); + }).on('close', function(obj){ + me._saveCopyDlg = undefined; + }); + me._saveCopyDlg.show(); + } + this.isFromFileDownloadAs = false; + }, + applySettings: function(menu) { var value; @@ -493,7 +564,7 @@ define([ } }, - onApiServerDisconnect: function(disableDownload) { + onApiServerDisconnect: function(enableDownload) { this.mode.isEdit = false; this.leftMenu.close(); @@ -504,7 +575,7 @@ define([ this.leftMenu.btnPlugins.setDisabled(true); this.leftMenu.btnNavigation.setDisabled(true); - this.leftMenu.getMenu('file').setMode({isDisconnected: true, disableDownload: !!disableDownload}); + this.leftMenu.getMenu('file').setMode({isDisconnected: true, enableDownload: !!enableDownload}); if ( this.dlgSearch ) { this.leftMenu.btnSearch.toggle(false, true); this.dlgSearch['hide'](); @@ -733,6 +804,7 @@ define([ notcriticalErrorTitle: 'Warning', leavePageText: 'All unsaved changes in this document will be lost.
Click \'Cancel\' then \'Save\' to save them. Click \'OK\' to discard all the unsaved changes.', warnDownloadAs : 'If you continue saving in this format all features except the text will be lost.
Are you sure you want to continue?', - warnDownloadAsRTF : 'If you continue saving in this format some of the formatting might be lost.
Are you sure you want to continue?' + warnDownloadAsRTF : 'If you continue saving in this format some of the formatting might be lost.
Are you sure you want to continue?', + txtUntitled: 'Untitled' }, DE.Controllers.LeftMenu || {})); }); \ No newline at end of file diff --git a/apps/documenteditor/main/app/controller/Main.js b/apps/documenteditor/main/app/controller/Main.js index aa6caf0b3..cca280fcf 100644 --- a/apps/documenteditor/main/app/controller/Main.js +++ b/apps/documenteditor/main/app/controller/Main.js @@ -305,6 +305,7 @@ define([ this.appOptions.sharingSettingsUrl = this.editorConfig.sharingSettingsUrl; this.appOptions.fileChoiceUrl = this.editorConfig.fileChoiceUrl; this.appOptions.mergeFolderUrl = this.editorConfig.mergeFolderUrl; + this.appOptions.saveAsUrl = this.editorConfig.saveAsUrl; this.appOptions.canAnalytics = false; this.appOptions.customization = this.editorConfig.customization; this.appOptions.canBackToFolder = (this.editorConfig.canBackToFolder!==false) && (typeof (this.editorConfig.customization) == 'object') @@ -1434,6 +1435,10 @@ define([ config.msg = this.errorDataEncrypted; break; + case Asc.c_oAscError.ID.EditingError: + config.msg = (this.appOptions.isDesktopApp && this.appOptions.isOffline) ? this.errorEditingSaveas : this.errorEditingDownloadas; + break; + default: config.msg = (typeof id == 'string') ? id : this.errorDefaultMessage.replace('%1', id); break; @@ -1487,6 +1492,9 @@ define([ } })).show(); },10); + } else if (id == Asc.c_oAscError.ID.EditingError) { + this.disableEditing(true); + Common.NotificationCenter.trigger('api:disconnect', true); // enable download and print } this._state.lostEditingRights = false; this.onEditComplete(); @@ -2307,7 +2315,9 @@ define([ textClose: 'Close', textPaidFeature: 'Paid feature', textLicencePaidFeature: 'The feature you are trying to use is available for additional payment.
If you need it, please contact Sales Department', - scriptLoadError: 'The connection is too slow, some of the components could not be loaded. Please reload the page.' + scriptLoadError: 'The connection is too slow, some of the components could not be loaded. Please reload the page.', + errorEditingSaveas: 'An error occurred during the work with the document.
Use the \'Save as...\' option to save the file backup copy to your computer hard drive.', + errorEditingDownloadas: 'An error occurred during the work with the document.
Use the \'Download as...\' option to save the file backup copy to your computer hard drive.' } })(), DE.Controllers.Main || {})) }); \ No newline at end of file diff --git a/apps/documenteditor/main/app/controller/RightMenu.js b/apps/documenteditor/main/app/controller/RightMenu.js index 3069b0d93..a752c6f3e 100644 --- a/apps/documenteditor/main/app/controller/RightMenu.js +++ b/apps/documenteditor/main/app/controller/RightMenu.js @@ -279,7 +279,7 @@ define([ this.rightmenu.shapeSettings.createDelayedElements(); var selectedElements = this.api.getSelectedElements(); if (selectedElements.length>0) { - this.onFocusObject(selectedElements, !Common.localStorage.getBool("de-hide-right-settings")); + this.onFocusObject(selectedElements, !Common.localStorage.getBool("de-hide-right-settings", this.rightmenu.defaultHideRightMenu)); } } }, diff --git a/apps/documenteditor/main/app/controller/Toolbar.js b/apps/documenteditor/main/app/controller/Toolbar.js index eb5375260..fb6a2c204 100644 --- a/apps/documenteditor/main/app/controller/Toolbar.js +++ b/apps/documenteditor/main/app/controller/Toolbar.js @@ -46,10 +46,10 @@ define([ 'common/main/lib/view/CopyWarningDialog', 'common/main/lib/view/ImageFromUrlDialog', 'common/main/lib/view/InsertTableDialog', + 'common/main/lib/view/SelectFileDlg', 'common/main/lib/util/define', 'documenteditor/main/app/view/Toolbar', 'documenteditor/main/app/view/DropcapSettingsAdvanced', - 'documenteditor/main/app/view/MailMergeRecepients', 'documenteditor/main/app/view/StyleTitleDialog', 'documenteditor/main/app/view/PageMarginsDialog', 'documenteditor/main/app/view/PageSizeDialog', @@ -238,6 +238,7 @@ define([ */ toolbar.btnPrint.on('click', _.bind(this.onPrint, this)); + toolbar.btnPrint.on('disabled', _.bind(this.onBtnChangeState, this, 'print:disabled')); toolbar.btnSave.on('click', _.bind(this.onSave, this)); toolbar.btnUndo.on('click', _.bind(this.onUndo, this)); toolbar.btnUndo.on('disabled', _.bind(this.onBtnChangeState, this, 'undo:disabled')); @@ -357,7 +358,7 @@ define([ this.api.asc_registerCallback('asc_onMarkerFormatChanged', _.bind(this.onApiStartHighlight, this)); this.api.asc_registerCallback('asc_onTextHighLight', _.bind(this.onApiHighlightColor, this)); this.api.asc_registerCallback('asc_onInitEditorStyles', _.bind(this.onApiInitEditorStyles, this)); - this.api.asc_registerCallback('asc_onCoAuthoringDisconnect',_.bind(this.onApiCoAuthoringDisconnect, this, true)); + this.api.asc_registerCallback('asc_onCoAuthoringDisconnect',_.bind(this.onApiCoAuthoringDisconnect, this)); Common.NotificationCenter.on('api:disconnect', _.bind(this.onApiCoAuthoringDisconnect, this)); this.api.asc_registerCallback('asc_onCanCopyCut', _.bind(this.onApiCanCopyCut, this)); this.api.asc_registerCallback('asc_onMathTypes', _.bind(this.onMathTypes, this)); @@ -1358,7 +1359,7 @@ define([ Common.NotificationCenter.trigger('edit:complete', me.toolbar); Common.component.Analytics.trackEvent('ToolBar', 'Image'); - } else { + } else if (item.value === 'url') { (new Common.Views.ImageFromUrlDialog({ handler: function(result, value) { if (result == 'ok') { @@ -1380,6 +1381,14 @@ define([ } } })).show(); + } else if (item.value === 'storage') { + (new Common.Views.SelectFileDlg({ + fileChoiceUrl: this.toolbar.mode.fileChoiceUrl.replace("{fileExt}", "").replace("{documentType}", "ImagesOnly") + })).on('selectfile', function(obj, file){ + me.toolbar.fireEvent('insertimage', me.toolbar); + me.api.AddImageUrl(file.url); + Common.component.Analytics.trackEvent('ToolBar', 'Image'); + }).show(); } }, @@ -2665,8 +2674,8 @@ define([ }); }, - onApiCoAuthoringDisconnect: function(disableDownload) { - this.toolbar.setMode({isDisconnected:true, disableDownload: !!disableDownload}); + onApiCoAuthoringDisconnect: function(enableDownload) { + this.toolbar.setMode({isDisconnected:true, enableDownload: !!enableDownload}); this.editMode = false; this.DisableToolbar(true, true); }, @@ -2712,10 +2721,10 @@ define([ if (this._mailMergeDlg) return; var me = this; - me._mailMergeDlg = new DE.Views.MailMergeRecepients({ - fileChoiceUrl: this.toolbar.mode.fileChoiceUrl + me._mailMergeDlg = new Common.Views.SelectFileDlg({ + fileChoiceUrl: this.toolbar.mode.fileChoiceUrl.replace("{fileExt}", "xlsx").replace("{documentType}", "") }); - me._mailMergeDlg.on('mailmergerecepients', function(obj, recepients){ + me._mailMergeDlg.on('selectfile', function(obj, recepients){ me.api.asc_StartMailMerge(recepients); if (!me.mergeEditor) me.mergeEditor = me.getApplication().getController('Common.Controllers.ExternalMergeEditor').getView('Common.Views.ExternalMergeEditor'); diff --git a/apps/documenteditor/main/app/controller/Viewport.js b/apps/documenteditor/main/app/controller/Viewport.js index 15eea4154..cfc77acc8 100644 --- a/apps/documenteditor/main/app/controller/Viewport.js +++ b/apps/documenteditor/main/app/controller/Viewport.js @@ -96,6 +96,10 @@ define([ me.header.btnRedo.keepState.disabled = state; else me.header.btnRedo.setDisabled(state); }, + 'print:disabled' : function (state) { + if ( me.header.btnPrint ) + me.header.btnPrint.setDisabled(state); + }, 'save:disabled' : function (state) { if ( me.header.btnSave ) me.header.btnSave.setDisabled(state); @@ -377,11 +381,11 @@ define([ } }, - onApiCoAuthoringDisconnect: function() { + onApiCoAuthoringDisconnect: function(enableDownload) { if (this.header) { - if (this.header.btnDownload) + if (this.header.btnDownload && !enableDownload) this.header.btnDownload.hide(); - if (this.header.btnPrint) + if (this.header.btnPrint && !enableDownload) this.header.btnPrint.hide(); if (this.header.btnEdit) this.header.btnEdit.hide(); diff --git a/apps/documenteditor/main/app/template/FileMenu.template b/apps/documenteditor/main/app/template/FileMenu.template index 8ec3a1927..35378e635 100644 --- a/apps/documenteditor/main/app/template/FileMenu.template +++ b/apps/documenteditor/main/app/template/FileMenu.template @@ -5,6 +5,7 @@
  • +
  • @@ -25,6 +26,7 @@
    +
    diff --git a/apps/documenteditor/main/app/template/ImageSettings.template b/apps/documenteditor/main/app/template/ImageSettings.template index 21298ecca..31d181a60 100644 --- a/apps/documenteditor/main/app/template/ImageSettings.template +++ b/apps/documenteditor/main/app/template/ImageSettings.template @@ -27,6 +27,32 @@
    + + + + + + + + +
    +
    +
    +
    + + + +
    +
    +
    +
    + + + + +
    + + diff --git a/apps/documenteditor/main/app/template/ImageSettingsAdvanced.template b/apps/documenteditor/main/app/template/ImageSettingsAdvanced.template index a10802ec9..3b1df3d24 100644 --- a/apps/documenteditor/main/app/template/ImageSettingsAdvanced.template +++ b/apps/documenteditor/main/app/template/ImageSettingsAdvanced.template @@ -90,6 +90,32 @@
    +
    +
    +
    + +
    +
    +
    +
    +
    + + + + + + + + +
    + + +
    +
    +
    +
    +
    +
    diff --git a/apps/documenteditor/main/app/template/ShapeSettings.template b/apps/documenteditor/main/app/template/ShapeSettings.template index 4a4ff30d1..e6169facb 100644 --- a/apps/documenteditor/main/app/template/ShapeSettings.template +++ b/apps/documenteditor/main/app/template/ShapeSettings.template @@ -121,6 +121,38 @@
    + + + + + + + + + + + + +
    + +
    +
    +
    +
    +
    + +
    +
    +
    +
    +
    + + + + +
    + + diff --git a/apps/documenteditor/main/app/view/ControlSettingsDialog.js b/apps/documenteditor/main/app/view/ControlSettingsDialog.js index 5da86fd65..9a4489988 100644 --- a/apps/documenteditor/main/app/view/ControlSettingsDialog.js +++ b/apps/documenteditor/main/app/view/ControlSettingsDialog.js @@ -297,10 +297,6 @@ define([ this.close(); }, - onPrimary: function() { - return true; - }, - applyAllClick: function(btn, eOpts){ if (this.api) { var props = new AscCommon.CContentControlPr(); diff --git a/apps/documenteditor/main/app/view/DocumentHolder.js b/apps/documenteditor/main/app/view/DocumentHolder.js index 064d0b02f..438cf3cee 100644 --- a/apps/documenteditor/main/app/view/DocumentHolder.js +++ b/apps/documenteditor/main/app/view/DocumentHolder.js @@ -674,7 +674,7 @@ define([ var onDialogAddHyperlink = function() { var win, props, text; - if (me.api && me.mode.isEdit && !me._isDisabled){ + 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(); diff --git a/apps/documenteditor/main/app/view/FileMenu.js b/apps/documenteditor/main/app/view/FileMenu.js index 614923fb4..de4c32223 100644 --- a/apps/documenteditor/main/app/view/FileMenu.js +++ b/apps/documenteditor/main/app/view/FileMenu.js @@ -105,6 +105,13 @@ define([ canFocused: false }); + this.miSaveCopyAs = new Common.UI.MenuItem({ + el : $('#fm-btn-save-copy',this.el), + action : 'save-copy', + caption : this.btnSaveCopyAsCaption, + canFocused: false + }); + this.miSaveAs = new Common.UI.MenuItem({ el : $('#fm-btn-save-desktop',this.el), action : 'save-desktop', @@ -179,6 +186,7 @@ define([ this.miSave, this.miEdit, this.miDownload, + this.miSaveCopyAs, this.miSaveAs, this.miPrint, this.miRename, @@ -251,6 +259,7 @@ define([ this.miNew.$el.find('+.devider')[this.mode.canCreateNew?'show':'hide'](); this.miDownload[((this.mode.canDownload || this.mode.canDownloadOrigin) && (!this.mode.isDesktopApp || !this.mode.isOffline))?'show':'hide'](); + this.miSaveCopyAs[((this.mode.canDownload || this.mode.canDownloadOrigin) && (!this.mode.isDesktopApp || !this.mode.isOffline)) && this.mode.saveAsUrl ?'show':'hide'](); this.miSaveAs[((this.mode.canDownload || this.mode.canDownloadOrigin) && this.mode.isDesktopApp && this.mode.isOffline)?'show':'hide'](); // this.hkSaveAs[this.mode.canDownload?'enable':'disable'](); @@ -295,6 +304,10 @@ define([ } else if (this.mode.canDownloadOrigin) $('a',this.miDownload.$el).text(this.textDownload); + if (this.mode.canDownload && this.mode.saveAsUrl) { + this.panels['save-copy'] = ((new DE.Views.FileMenuPanels.ViewSaveCopy({menu: this})).render()); + } + if (this.mode.canHelp) { this.panels['help'] = ((new DE.Views.FileMenuPanels.Help({menu: this})).render()); this.panels['help'].setLangConfig(this.mode.lang); @@ -309,8 +322,8 @@ define([ this.mode.canOpenRecent = this.mode.canCreateNew = false; this.mode.isDisconnected = mode.isDisconnected; this.mode.canRename = false; - this.mode.canPrint = false; - this.mode.canDownload = this.mode.canDownloadOrigin = false; + if (!mode.enableDownload) + this.mode.canPrint = this.mode.canDownload = this.mode.canDownloadOrigin = false; } else { this.mode = mode; } @@ -385,6 +398,7 @@ define([ textDownload : 'Download', btnRenameCaption : 'Rename...', btnCloseMenuCaption : 'Close Menu', - btnProtectCaption: 'Protect' + btnProtectCaption: 'Protect', + btnSaveCopyAsCaption : 'Save Copy as...' }, DE.Views.FileMenu || {})); }); diff --git a/apps/documenteditor/main/app/view/FileMenuPanels.js b/apps/documenteditor/main/app/view/FileMenuPanels.js index fdbfed6eb..87aabd98a 100644 --- a/apps/documenteditor/main/app/view/FileMenuPanels.js +++ b/apps/documenteditor/main/app/view/FileMenuPanels.js @@ -54,7 +54,7 @@ define([ formats: [[ {name: 'DOCX', imgCls: 'docx', type: Asc.c_oAscFileType.DOCX}, {name: 'PDF', imgCls: 'pdf', type: Asc.c_oAscFileType.PDF}, - // {name: 'PDFA', imgCls: 'pdfa', type: Asc.c_oAscFileType.PDFA}, + {name: 'PDFA', imgCls: 'pdfa', type: Asc.c_oAscFileType.PDFA}, {name: 'TXT', imgCls: 'txt', type: Asc.c_oAscFileType.TXT} ],[ // {name: 'DOC', imgCls: 'doc-format btn-doc', type: Asc.c_oAscFileType.DOC}, @@ -107,6 +107,67 @@ define([ } }); + DE.Views.FileMenuPanels.ViewSaveCopy = Common.UI.BaseView.extend({ + el: '#panel-savecopy', + menu: undefined, + + formats: [[ + {name: 'DOCX', imgCls: 'docx', type: Asc.c_oAscFileType.DOCX, ext: '.docx'}, + {name: 'PDF', imgCls: 'pdf', type: Asc.c_oAscFileType.PDF, ext: '.pdf'}, + {name: 'PDFA', imgCls: 'pdfa', type: Asc.c_oAscFileType.PDFA, ext: '.pdf'}, + {name: 'TXT', imgCls: 'txt', type: Asc.c_oAscFileType.TXT, ext: '.txt'} + ],[ +// {name: 'DOC', imgCls: 'doc-format btn-doc', type: Asc.c_oAscFileType.DOC, ext: '.doc'}, + {name: 'ODT', imgCls: 'odt', type: Asc.c_oAscFileType.ODT, ext: '.odt'}, + {name: 'RTF', imgCls: 'rtf', type: Asc.c_oAscFileType.RTF, ext: '.rtf'}, + {name: 'HTML (Zipped)', imgCls: 'html', type: Asc.c_oAscFileType.HTML, ext: '.html'} +// {name: 'EPUB', imgCls: 'doc-format btn-epub', type: Asc.c_oAscFileType.EPUB, ext: '.epub'} + ]], + + + template: _.template([ + '', + '<% _.each(rows, function(row) { %>', + '', + '<% _.each(row, function(item) { %>', + '', + '<% }) %>', + '', + '<% }) %>', + '
    ', + '', + '
    ' + ].join('')), + + initialize: function(options) { + Common.UI.BaseView.prototype.initialize.call(this,arguments); + + this.menu = options.menu; + }, + + render: function() { + $(this.el).html(this.template({rows:this.formats})); + $('.btn-doc-format',this.el).on('click', _.bind(this.onFormatClick,this)); + + if (_.isUndefined(this.scroller)) { + this.scroller = new Common.UI.Scroller({ + el: $(this.el), + suppressScrollX: true + }); + } + + return this; + }, + + onFormatClick: function(e) { + var type = e.currentTarget.attributes['format'], + ext = e.currentTarget.attributes['format-ext']; + if (!_.isUndefined(type) && !_.isUndefined(ext) && this.menu) { + this.menu.fireEvent('savecopy:format', [this.menu, parseInt(type.value), ext.value]); + } + } + }); + DE.Views.FileMenuPanels.Settings = Common.UI.BaseView.extend(_.extend({ el: '#panel-settings', menu: undefined, diff --git a/apps/documenteditor/main/app/view/HyperlinkSettingsDialog.js b/apps/documenteditor/main/app/view/HyperlinkSettingsDialog.js index d8a782461..4d7c87cbb 100644 --- a/apps/documenteditor/main/app/view/HyperlinkSettingsDialog.js +++ b/apps/documenteditor/main/app/view/HyperlinkSettingsDialog.js @@ -165,7 +165,7 @@ define([ }); $window.find('.dlg-btn').on('click', _.bind(this.onBtnClick, this)); - $window.find('input').on('keypress', _.bind(this.onKeyPress, this)); + me.internalList.on('entervalue', _.bind(me.onPrimary, me)); me.externalPanel = $window.find('#id-external-link'); me.internalPanel = $window.find('#id-internal-link'); }, @@ -367,11 +367,9 @@ define([ this._handleInput(event.currentTarget.attributes['result'].value); }, - onKeyPress: function(event) { - if (event.keyCode == Common.UI.Keys.RETURN) { - this._handleInput('ok'); - return false; - } + onPrimary: function(event) { + this._handleInput('ok'); + return false; }, _handleInput: function(state) { diff --git a/apps/documenteditor/main/app/view/ImageSettings.js b/apps/documenteditor/main/app/view/ImageSettings.js index 392be905e..76766f132 100644 --- a/apps/documenteditor/main/app/view/ImageSettings.js +++ b/apps/documenteditor/main/app/view/ImageSettings.js @@ -186,6 +186,46 @@ define([ }, this)); this.btnFitMargins.on('click', _.bind(this.setFitMargins, this)); + this.btnRotate270 = new Common.UI.Button({ + cls: 'btn-toolbar', + iconCls: 'rotate-270', + value: 0, + hint: this.textHint270 + }); + this.btnRotate270.render( $('#image-button-270', me.$el)); + this.btnRotate270.on('click', _.bind(this.onBtnRotateClick, this)); + this.lockedControls.push(this.btnRotate270); + + this.btnRotate90 = new Common.UI.Button({ + cls: 'btn-toolbar', + iconCls: 'rotate-90', + value: 1, + hint: this.textHint90 + }); + this.btnRotate90.render( $('#image-button-90', me.$el)); + this.btnRotate90.on('click', _.bind(this.onBtnRotateClick, this)); + this.lockedControls.push(this.btnRotate90); + + this.btnFlipV = new Common.UI.Button({ + cls: 'btn-toolbar', + iconCls: 'flip-vert', + value: 0, + hint: this.textHintFlipV + }); + this.btnFlipV.render( $('#image-button-flipv', me.$el)); + this.btnFlipV.on('click', _.bind(this.onBtnFlipClick, this)); + this.lockedControls.push(this.btnFlipV); + + this.btnFlipH = new Common.UI.Button({ + cls: 'btn-toolbar', + iconCls: 'flip-hor', + value: 1, + hint: this.textHintFlipH + }); + this.btnFlipH.render( $('#image-button-fliph', me.$el)); + this.btnFlipH.on('click', _.bind(this.onBtnFlipClick, this)); + this.lockedControls.push(this.btnFlipH); + this.linkAdvanced = $('#image-advanced-link'); this.lblReplace = $('#image-lbl-replace'); $(this.el).on('click', '#image-advanced-link', _.bind(this.openAdvancedSettings, this)); @@ -384,6 +424,23 @@ define([ })).show(); }, + onBtnRotateClick: function(btn) { + var properties = new Asc.asc_CImgProperty(); + properties.asc_putRot((btn.options.value==1 ? 90 : 270) * 3.14159265358979 / 180); + this.api.ImgApply(properties); + this.fireEvent('editcomplete', this); + }, + + onBtnFlipClick: function(btn) { + var properties = new Asc.asc_CImgProperty(); + if (btn.options.value==1) + properties.asc_putFlipH(true); + else + properties.asc_putFlipV(true); + this.api.ImgApply(properties); + this.fireEvent('editcomplete', this); + }, + openAdvancedSettings: function(e) { if (this.linkAdvanced.hasClass('disabled')) return; @@ -458,7 +515,14 @@ define([ txtInFront: 'In front', textEditObject: 'Edit Object', textEdit: 'Edit', - textFitMargins: 'Fit to Margin' + textFitMargins: 'Fit to Margin', + textRotation: 'Rotation', + textRotate90: 'Rotate 90°', + textFlip: 'Flip', + textHint270: 'Rotate Left 90°', + textHint90: 'Rotate Right 90°', + textHintFlipV: 'Flip Vertical', + textHintFlipH: 'Flip Horizontal' }, DE.Views.ImageSettings || {})); }); \ No newline at end of file diff --git a/apps/documenteditor/main/app/view/ImageSettingsAdvanced.js b/apps/documenteditor/main/app/view/ImageSettingsAdvanced.js index 434248ee7..853d37920 100644 --- a/apps/documenteditor/main/app/view/ImageSettingsAdvanced.js +++ b/apps/documenteditor/main/app/view/ImageSettingsAdvanced.js @@ -64,6 +64,7 @@ define([ 'text!documenteditor/main/app/template/ImageSettingsAdvanced.templat items: [ {panelId: 'id-adv-image-width', panelCaption: this.textSize}, {panelId: 'id-adv-shape-size', panelCaption: this.textSize}, + {panelId: 'id-adv-image-rotate', panelCaption: this.textRotation}, {panelId: 'id-adv-image-wrap', panelCaption: this.textBtnWrap}, {panelId: 'id-adv-image-position', panelCaption: this.textPosition}, {panelId: 'id-adv-image-shape', panelCaption: this.textWeightArrows}, @@ -370,6 +371,27 @@ define([ 'text!documenteditor/main/app/template/ImageSettingsAdvanced.templat this.cmbHeightPc.setValue(this._state.ShapeHeightPcFrom); this.cmbHeightPc.on('selected', _.bind(this.onCmbHeightPcSelect, this)); + // Rotation + this.spnAngle = new Common.UI.MetricSpinner({ + el: $('#image-advanced-spin-angle'), + step: 1, + width: 80, + defaultUnit : "°", + value: '0 °', + maxValue: 3600, + minValue: -3600 + }); + + this.chFlipHor = new Common.UI.CheckBox({ + el: $('#image-advanced-checkbox-hor'), + labelText: this.textHorizontally + }); + + this.chFlipVert = new Common.UI.CheckBox({ + el: $('#image-advanced-checkbox-vert'), + labelText: this.textVertically + }); + // Wrapping this.btnWrapInline = new Common.UI.Button({ @@ -1268,9 +1290,10 @@ define([ 'text!documenteditor/main/app/template/ImageSettingsAdvanced.templat this.btnOriginalSize.setVisible(!(shapeprops || chartprops)); this.btnOriginalSize.setDisabled(props.get_ImageUrl()===null || props.get_ImageUrl()===undefined); - this.btnsCategory[4].setVisible(shapeprops!==null && !shapeprops.get_FromChart()); // Shapes - this.btnsCategory[5].setVisible(shapeprops!==null && !shapeprops.get_FromChart()); // Margins - this.btnsCategory[2].setDisabled(props.get_FromGroup()); // Wrapping + this.btnsCategory[5].setVisible(shapeprops!==null && !shapeprops.get_FromChart()); // Shapes + this.btnsCategory[6].setVisible(shapeprops!==null && !shapeprops.get_FromChart()); // Margins + this.btnsCategory[3].setDisabled(props.get_FromGroup()); // Wrapping + this.btnsCategory[2].setVisible(!chartprops); // Rotation if (shapeprops) { this._objectType = Asc.c_oAscTypeSelectElement.Shape; @@ -1333,8 +1356,8 @@ define([ 'text!documenteditor/main/app/template/ImageSettingsAdvanced.templat this.spnMarginBottom.setValue((null !== val && undefined !== val) ? Common.Utils.Metric.fnRecalcFromMM(val) : '', true); } - this.btnsCategory[5].setDisabled(null === margins); // Margins - this.btnsCategory[4].setDisabled(shapeprops.get_stroke().get_type() == Asc.c_oAscStrokeType.STROKE_NONE); // Weights & Arrows + this.btnsCategory[6].setDisabled(null === margins); // Margins + this.btnsCategory[5].setDisabled(shapeprops.get_stroke().get_type() == Asc.c_oAscStrokeType.STROKE_NONE); // Weights & Arrows } else { value = props.asc_getLockAspect(); @@ -1355,6 +1378,13 @@ define([ 'text!documenteditor/main/app/template/ImageSettingsAdvanced.templat this.spnHeight.setValue((value!==undefined) ? Common.Utils.Metric.fnRecalcFromMM(value).toFixed(2) : '', true); } + if (!chartprops) { + value = props.asc_getRot(); + this.spnAngle.setValue((value==undefined || value===null) ? '' : Math.floor(value*180/3.14159265358979+0.5), true); + this.chFlipHor.setValue(props.asc_getFlipH()); + this.chFlipVert.setValue(props.asc_getFlipV()); + } + value = props.asc_getTitle(); this.inputAltTitle.setValue(value ? value : ''); @@ -1397,6 +1427,12 @@ define([ 'text!documenteditor/main/app/template/ImageSettingsAdvanced.templat } } + if (this._objectType != Asc.c_oAscTypeSelectElement.Chart) { + properties.asc_putRot(this.spnAngle.getNumberValue() * 3.14159265358979 / 180); + properties.asc_putFlipH(this.chFlipHor.getValue()=='checked'); + properties.asc_putFlipV(this.chFlipVert.getValue()=='checked'); + } + if (this.isAltTitleChanged) properties.asc_putTitle(this.inputAltTitle.getValue()); @@ -1515,7 +1551,7 @@ define([ 'text!documenteditor/main/app/template/ImageSettingsAdvanced.templat this.spnTop.setDisabled(disabledTB); this.spnBottom.setDisabled(disabledTB); - this.btnsCategory[3].setDisabled(btnId == Asc.c_oAscWrapStyle2.Inline); + this.btnsCategory[4].setDisabled(btnId == Asc.c_oAscWrapStyle2.Inline); }, onHAlignSelect: function(combo, record){ @@ -2033,7 +2069,12 @@ define([ 'text!documenteditor/main/app/template/ImageSettingsAdvanced.templat textAltTitle: 'Title', textAltDescription: 'Description', textAltTip: 'The alternative text-based representation of the visual object information, which will be read to the people with vision or cognitive impairments to help them better understand what information there is in the image, autoshape, chart or table.', - textWeightArrows: 'Weights & Arrows' + textWeightArrows: 'Weights & Arrows', + textRotation: 'Rotation', + textAngle: 'Angle', + textFlipped: 'Flipped', + textHorizontally: 'Horizontally', + textVertically: 'Vertically' }, DE.Views.ImageSettingsAdvanced || {})); }); \ No newline at end of file diff --git a/apps/documenteditor/main/app/view/MailMergeEmailDlg.js b/apps/documenteditor/main/app/view/MailMergeEmailDlg.js index 639aab015..ac61668f9 100644 --- a/apps/documenteditor/main/app/view/MailMergeEmailDlg.js +++ b/apps/documenteditor/main/app/view/MailMergeEmailDlg.js @@ -171,7 +171,7 @@ define([ 'text!documenteditor/main/app/template/MailMergeEmailDlg.template', _onMessage: function(msg) { if (msg && msg.Referer == "onlyoffice") { // if ( !_.isEmpty(msg.folder) ) { -// this.trigger('mailmergefolder', this, msg.folder); // save last folder url +// this.trigger('saveasfolder', this, msg.folder); // save last folder url // } } }, diff --git a/apps/documenteditor/main/app/view/MailMergeSettings.js b/apps/documenteditor/main/app/view/MailMergeSettings.js index 3146960b6..8f42f11f9 100644 --- a/apps/documenteditor/main/app/view/MailMergeSettings.js +++ b/apps/documenteditor/main/app/view/MailMergeSettings.js @@ -42,8 +42,8 @@ define([ 'backbone', 'common/main/lib/component/Button', 'common/main/lib/component/Switcher', - 'documenteditor/main/app/view/MailMergeRecepients', - 'documenteditor/main/app/view/MailMergeSaveDlg', + 'common/main/lib/view/SaveAsDlg', + 'common/main/lib/view/SelectFileDlg', 'documenteditor/main/app/view/MailMergeEmailDlg' ], function (menuTemplate, $, _, Backbone) { 'use strict'; @@ -544,16 +544,16 @@ define([ if (this._mailMergeDlg) return; var me = this; if (this.cmbMergeTo.getValue() != Asc.c_oAscFileType.HTML) { - me._mailMergeDlg = new DE.Views.MailMergeSaveDlg({ - mergeFolderUrl: me.mode.mergeFolderUrl, - mergedFileUrl: url, + me._mailMergeDlg = new Common.Views.SaveAsDlg({ + saveFolderUrl: me.mode.mergeFolderUrl, + savedFileUrl: url, defFileName: me.defFileName + ((this.cmbMergeTo.getValue() == Asc.c_oAscFileType.PDF) ? '.pdf' : '.docx') }); - me._mailMergeDlg.on('mailmergefolder', function(obj, folder){ // save last folder - }).on('mailmergeerror', function(obj, err){ // save last folder + me._mailMergeDlg.on('saveasfolder', function(obj, folder){ // save last folder + }).on('saveaserror', function(obj, err){ // save last folder var config = { closable: false, - title: this.notcriticalErrorTitle, + title: me.notcriticalErrorTitle, msg: err, iconCls: 'warn', buttons: ['ok'], diff --git a/apps/documenteditor/main/app/view/PageMarginsDialog.js b/apps/documenteditor/main/app/view/PageMarginsDialog.js index 891381e50..fe97fb7b2 100644 --- a/apps/documenteditor/main/app/view/PageMarginsDialog.js +++ b/apps/documenteditor/main/app/view/PageMarginsDialog.js @@ -147,7 +147,6 @@ define([ var $window = this.getChild(); $window.find('.dlg-btn').on('click', _.bind(this.onBtnClick, this)); - $window.find('input').on('keypress', _.bind(this.onKeyPress, this)); this.updateMetricUnit(); }, @@ -178,10 +177,9 @@ define([ this._handleInput(event.currentTarget.attributes['result'].value); }, - onKeyPress: function(event) { - if (event.keyCode == Common.UI.Keys.RETURN) { - this._handleInput('ok'); - } + onPrimary: function(event) { + this._handleInput('ok'); + return false; }, setSettings: function (props) { diff --git a/apps/documenteditor/main/app/view/PageSizeDialog.js b/apps/documenteditor/main/app/view/PageSizeDialog.js index a41d0b835..5b7f99add 100644 --- a/apps/documenteditor/main/app/view/PageSizeDialog.js +++ b/apps/documenteditor/main/app/view/PageSizeDialog.js @@ -167,7 +167,6 @@ define([ var $window = this.getChild(); $window.find('.dlg-btn').on('click', _.bind(this.onBtnClick, this)); - $window.find('input').on('keypress', _.bind(this.onKeyPress, this)); this.updateMetricUnit(); }, @@ -184,10 +183,9 @@ define([ this._handleInput(event.currentTarget.attributes['result'].value); }, - onKeyPress: function(event) { - if (event.keyCode == Common.UI.Keys.RETURN) { - this._handleInput('ok'); - } + onPrimary: function(event) { + this._handleInput('ok'); + return false; }, setSettings: function (props) { diff --git a/apps/documenteditor/main/app/view/RightMenu.js b/apps/documenteditor/main/app/view/RightMenu.js index fbc92710f..6f367f5b8 100644 --- a/apps/documenteditor/main/app/view/RightMenu.js +++ b/apps/documenteditor/main/app/view/RightMenu.js @@ -150,7 +150,8 @@ define([ this.trigger('render:before', this); - var open = !Common.localStorage.getBool("de-hide-right-settings"); + this.defaultHideRightMenu = mode.customization && !!mode.customization.hideRightMenu; + var open = !Common.localStorage.getBool("de-hide-right-settings", this.defaultHideRightMenu); el.css('width', ((open) ? MENU_SCALE_PART : SCALE_MIN) + 'px'); el.show(); diff --git a/apps/documenteditor/main/app/view/ShapeSettings.js b/apps/documenteditor/main/app/view/ShapeSettings.js index 9982d3d26..4a8c3d828 100644 --- a/apps/documenteditor/main/app/view/ShapeSettings.js +++ b/apps/documenteditor/main/app/view/ShapeSettings.js @@ -1366,6 +1366,46 @@ define([ this.cmbBorderType.setValue(this.BorderType); this.lockedControls.push(this.cmbBorderType); + this.btnRotate270 = new Common.UI.Button({ + cls: 'btn-toolbar', + iconCls: 'rotate-270', + value: 0, + hint: this.textHint270 + }); + this.btnRotate270.render( $('#shape-button-270', me.$el)); + this.btnRotate270.on('click', _.bind(this.onBtnRotateClick, this)); + this.lockedControls.push(this.btnRotate270); + + this.btnRotate90 = new Common.UI.Button({ + cls: 'btn-toolbar', + iconCls: 'rotate-90', + value: 1, + hint: this.textHint90 + }); + this.btnRotate90.render( $('#shape-button-90', me.$el)); + this.btnRotate90.on('click', _.bind(this.onBtnRotateClick, this)); + this.lockedControls.push(this.btnRotate90); + + this.btnFlipV = new Common.UI.Button({ + cls: 'btn-toolbar', + iconCls: 'flip-vert', + value: 0, + hint: this.textHintFlipV + }); + this.btnFlipV.render( $('#shape-button-flipv', me.$el)); + this.btnFlipV.on('click', _.bind(this.onBtnFlipClick, this)); + this.lockedControls.push(this.btnFlipV); + + this.btnFlipH = new Common.UI.Button({ + cls: 'btn-toolbar', + iconCls: 'flip-hor', + value: 1, + hint: this.textHintFlipH + }); + this.btnFlipH.render( $('#shape-button-fliph', me.$el)); + this.btnFlipH.on('click', _.bind(this.onBtnFlipClick, this)); + this.lockedControls.push(this.btnFlipH); + var viewData = [ { offsetx: 0, data: Asc.c_oAscWrapStyle2.Inline, tip: this.txtInline, selected: true }, { offsetx: 50, data: Asc.c_oAscWrapStyle2.Square, tip: this.txtSquare }, @@ -1523,6 +1563,23 @@ define([ this.fireEvent('editcomplete', this); }, + onBtnRotateClick: function(btn) { + var properties = new Asc.asc_CImgProperty(); + properties.asc_putRot((btn.options.value==1 ? 90 : 270) * 3.14159265358979 / 180); + this.api.ImgApply(properties); + this.fireEvent('editcomplete', this); + }, + + onBtnFlipClick: function(btn) { + var properties = new Asc.asc_CImgProperty(); + if (btn.options.value==1) + properties.asc_putFlipH(true); + else + properties.asc_putFlipV(true); + this.api.ImgApply(properties); + this.fireEvent('editcomplete', this); + }, + fillAutoShapes: function() { var me = this, shapesStore = this.application.getCollection('ShapeGroups'); @@ -1779,6 +1836,13 @@ define([ txtBehind: 'Behind', txtInFront: 'In front', textBorderSizeErr: 'The entered value is incorrect.
    Please enter a value between 0 pt and 1584 pt.', - strType: 'Type' + strType: 'Type', + textRotation: 'Rotation', + textRotate90: 'Rotate 90°', + textFlip: 'Flip', + textHint270: 'Rotate Left 90°', + textHint90: 'Rotate Right 90°', + textHintFlipV: 'Flip Vertical', + textHintFlipH: 'Flip Horizontal' }, DE.Views.ShapeSettings || {})); }); diff --git a/apps/documenteditor/main/app/view/StyleTitleDialog.js b/apps/documenteditor/main/app/view/StyleTitleDialog.js index 1779b986b..d227cdc77 100644 --- a/apps/documenteditor/main/app/view/StyleTitleDialog.js +++ b/apps/documenteditor/main/app/view/StyleTitleDialog.js @@ -99,7 +99,6 @@ define([ }); $window.find('.dlg-btn').on('click', _.bind(this.onBtnClick, this)); - $window.find('input').on('keypress', _.bind(this.onKeyPress, this)); this.cmbNextStyle = new Common.UI.ComboBox({ el : $('#id-dlg-style-next-par'), @@ -137,11 +136,9 @@ define([ this._handleInput(event.currentTarget.attributes['result'].value); }, - onKeyPress: function(event) { - if (event.keyCode == Common.UI.Keys.RETURN) { - this._handleInput('ok'); - return false; - } + onPrimary: function(event) { + this._handleInput('ok'); + return false; }, _handleInput: function(state) { diff --git a/apps/documenteditor/main/app/view/Toolbar.js b/apps/documenteditor/main/app/view/Toolbar.js index c1123e3fd..efe545c14 100644 --- a/apps/documenteditor/main/app/view/Toolbar.js +++ b/apps/documenteditor/main/app/view/Toolbar.js @@ -124,7 +124,8 @@ define([ this.btnPrint = new Common.UI.Button({ id: 'id-toolbar-btn-print', cls: 'btn-toolbar', - iconCls: 'btn-print no-mask' + iconCls: 'btn-print no-mask', + signals: ['disabled'] }); this.toolbarControls.push(this.btnPrint); @@ -493,7 +494,8 @@ define([ menu: new Common.UI.Menu({ items: [ {caption: this.mniImageFromFile, value: 'file'}, - {caption: this.mniImageFromUrl, value: 'url'} + {caption: this.mniImageFromUrl, value: 'url'}, + {caption: this.mniImageFromStorage, value: 'storage'} ] }) }); @@ -2001,7 +2003,7 @@ define([ setMode: function (mode) { if (mode.isDisconnected) { this.btnSave.setDisabled(true); - if (mode.disableDownload) + if (!mode.enableDownload) this.btnPrint.setDisabled(true); } @@ -2011,6 +2013,7 @@ define([ this.listStylesAdditionalMenuItem.setVisible(mode.canEditStyles); this.btnContentControls.menu.items[4].setVisible(mode.canEditContentControl); this.btnContentControls.menu.items[5].setVisible(mode.canEditContentControl); + this.mnuInsertImage.items[2].setVisible(this.mode.fileChoiceUrl && this.mode.fileChoiceUrl.indexOf("{documentType}")>-1); }, onSendThemeColorSchemes: function (schemas) { @@ -2367,7 +2370,8 @@ define([ mniEditControls: 'Settings', tipControls: 'Insert content control', mniHighlightControls: 'Highlight settings', - textNoHighlight: 'No highlighting' + textNoHighlight: 'No highlighting', + mniImageFromStorage: 'Image from Storage' } })(), DE.Views.Toolbar || {})); }); diff --git a/apps/documenteditor/main/locale/en.json b/apps/documenteditor/main/locale/en.json index fb04cb0b8..407085b9e 100644 --- a/apps/documenteditor/main/locale/en.json +++ b/apps/documenteditor/main/locale/en.json @@ -280,6 +280,10 @@ "Common.Views.ReviewPopover.textOpenAgain": "Open Again", "Common.Views.ReviewPopover.textReply": "Reply", "Common.Views.ReviewPopover.textResolve": "Resolve", + "Common.Views.SaveAsDlg.textLoading": "Loading", + "Common.Views.SaveAsDlg.textTitle": "Folder for save", + "Common.Views.SelectFileDlg.textLoading": "Loading", + "Common.Views.SelectFileDlg.textTitle": "Select Data Source", "Common.Views.SignDialog.cancelButtonText": "Cancel", "Common.Views.SignDialog.okButtonText": "Ok", "Common.Views.SignDialog.textBold": "Bold", @@ -317,6 +321,7 @@ "DE.Controllers.LeftMenu.textReplaceSuccess": "The search has been done. Occurrences replaced: {0}", "DE.Controllers.LeftMenu.warnDownloadAs": "If you continue saving in this format all features except the text will be lost.
    Are you sure you want to continue?", "DE.Controllers.LeftMenu.warnDownloadAsRTF": "If you continue saving in this format some of the formatting might be lost.
    Are you sure you want to continue?", + "DE.Controllers.LeftMenu.txtUntitled": "Untitled", "DE.Controllers.Main.applyChangesTextText": "Loading the changes...", "DE.Controllers.Main.applyChangesTitleText": "Loading the Changes", "DE.Controllers.Main.convertationTimeoutText": "Conversion timeout exceeded.", @@ -354,6 +359,8 @@ "DE.Controllers.Main.errorUserDrop": "The file cannot be accessed right now.", "DE.Controllers.Main.errorUsersExceed": "The number of users allowed by the pricing plan was exceeded", "DE.Controllers.Main.errorViewerDisconnect": "Connection is lost. You can still view the document,
    but will not be able to download or print until the connection is restored.", + "DE.Controllers.Main.errorEditingSaveas": "An error occurred during the work with the document.
    Use the 'Save as...' option to save the file backup copy to your computer hard drive.", + "DE.Controllers.Main.errorEditingDownloadas": "An error occurred during the work with the document.
    Use the 'Download as...' option to save the file backup copy to your computer hard drive.", "DE.Controllers.Main.leavePageText": "You have unsaved changes in this document. Click \"Stay on This Page\", then \"Save\" to save them. Click \"Leave This Page\" to discard all the unsaved changes.", "DE.Controllers.Main.loadFontsTextText": "Loading data...", "DE.Controllers.Main.loadFontsTitleText": "Loading Data", @@ -1125,6 +1132,7 @@ "DE.Views.FileMenu.btnSettingsCaption": "Advanced Settings...", "DE.Views.FileMenu.btnToEditCaption": "Edit Document", "DE.Views.FileMenu.textDownload": "Download", + "DE.Views.FileMenu.btnSaveCopyAsCaption": "Save Copy as...", "DE.Views.FileMenuPanels.CreateNew.fromBlankText": "From Blank", "DE.Views.FileMenuPanels.CreateNew.fromTemplateText": "From Template", "DE.Views.FileMenuPanels.CreateNew.newDescriptionText": "Create a new blank text document which you will be able to style and format after it is created during the editing. Or choose one of the templates to start a document of a certain type or purpose where some styles have already been pre-applied.", @@ -1251,6 +1259,13 @@ "DE.Views.ImageSettings.txtThrough": "Through", "DE.Views.ImageSettings.txtTight": "Tight", "DE.Views.ImageSettings.txtTopAndBottom": "Top and bottom", + "DE.Views.ImageSettings.textRotation": "Rotation", + "DE.Views.ImageSettings.textRotate90": "Rotate 90°", + "DE.Views.ImageSettings.textFlip": "Flip", + "DE.Views.ImageSettings.textHint270": "Rotate Left 90°", + "DE.Views.ImageSettings.textHint90": "Rotate Right 90°", + "DE.Views.ImageSettings.textHintFlipV": "Flip Vertical", + "DE.Views.ImageSettings.textHintFlipH": "Flip Horizontal", "DE.Views.ImageSettingsAdvanced.cancelButtonText": "Cancel", "DE.Views.ImageSettingsAdvanced.okButtonText": "OK", "DE.Views.ImageSettingsAdvanced.strMargins": "Text Padding", @@ -1320,6 +1335,11 @@ "DE.Views.ImageSettingsAdvanced.textWrapThroughTooltip": "Through", "DE.Views.ImageSettingsAdvanced.textWrapTightTooltip": "Tight", "DE.Views.ImageSettingsAdvanced.textWrapTopbottomTooltip": "Top and bottom", + "DE.Views.ImageSettingsAdvanced.textRotation": "Rotation", + "DE.Views.ImageSettingsAdvanced.textAngle": "Angle", + "DE.Views.ImageSettingsAdvanced.textFlipped": "Flipped", + "DE.Views.ImageSettingsAdvanced.textHorizontally": "Horizontally", + "DE.Views.ImageSettingsAdvanced.textVertically": "Vertically", "DE.Views.LeftMenu.tipAbout": "About", "DE.Views.LeftMenu.tipChat": "Chat", "DE.Views.LeftMenu.tipComments": "Comments", @@ -1365,10 +1385,10 @@ "DE.Views.MailMergeEmailDlg.textTo": "To", "DE.Views.MailMergeEmailDlg.textWarning": "Warning!", "DE.Views.MailMergeEmailDlg.textWarningMsg": "Please note that mailing cannot be stopped once your click the 'Send' button.", - "DE.Views.MailMergeRecepients.textLoading": "Loading", - "DE.Views.MailMergeRecepients.textTitle": "Select Data Source", - "DE.Views.MailMergeSaveDlg.textLoading": "Loading", - "DE.Views.MailMergeSaveDlg.textTitle": "Folder for save", + "del_DE.Views.MailMergeRecepients.textLoading": "Loading", + "del_DE.Views.MailMergeRecepients.textTitle": "Select Data Source", + "del_DE.Views.MailMergeSaveDlg.textLoading": "Loading", + "del_DE.Views.MailMergeSaveDlg.textTitle": "Folder for save", "DE.Views.MailMergeSettings.downloadMergeTitle": "Merging", "DE.Views.MailMergeSettings.errorMailMergeSaveFile": "Merge failed.", "DE.Views.MailMergeSettings.notcriticalErrorTitle": "Warning", @@ -1578,6 +1598,13 @@ "DE.Views.ShapeSettings.txtTight": "Tight", "DE.Views.ShapeSettings.txtTopAndBottom": "Top and bottom", "DE.Views.ShapeSettings.txtWood": "Wood", + "DE.Views.ShapeSettings.textRotation": "Rotation", + "DE.Views.ShapeSettings.textRotate90": "Rotate 90°", + "DE.Views.ShapeSettings.textFlip": "Flip", + "DE.Views.ShapeSettings.textHint270": "Rotate Left 90°", + "DE.Views.ShapeSettings.textHint90": "Rotate Right 90°", + "DE.Views.ShapeSettings.textHintFlipV": "Flip Vertical", + "DE.Views.ShapeSettings.textHintFlipH": "Flip Horizontal", "DE.Views.SignatureSettings.notcriticalErrorTitle": "Warning", "DE.Views.SignatureSettings.strDelete": "Remove Signature", "DE.Views.SignatureSettings.strDetails": "Signature Details", @@ -1947,5 +1974,6 @@ "DE.Views.Toolbar.txtScheme6": "Concourse", "DE.Views.Toolbar.txtScheme7": "Equity", "DE.Views.Toolbar.txtScheme8": "Flow", - "DE.Views.Toolbar.txtScheme9": "Foundry" + "DE.Views.Toolbar.txtScheme9": "Foundry", + "DE.Views.Toolbar.mniImageFromStorage": "Image from Storage" } \ No newline at end of file diff --git a/apps/documenteditor/main/resources/img/toolbar-menu.png b/apps/documenteditor/main/resources/img/toolbar-menu.png index 7d8bad438..a7d0d4e3a 100644 Binary files a/apps/documenteditor/main/resources/img/toolbar-menu.png and b/apps/documenteditor/main/resources/img/toolbar-menu.png differ diff --git a/apps/documenteditor/main/resources/img/toolbar-menu@2x.png b/apps/documenteditor/main/resources/img/toolbar-menu@2x.png index b88f17f15..f20fe4f75 100644 Binary files a/apps/documenteditor/main/resources/img/toolbar-menu@2x.png and b/apps/documenteditor/main/resources/img/toolbar-menu@2x.png differ diff --git a/apps/documenteditor/main/resources/less/filemenu.less b/apps/documenteditor/main/resources/less/filemenu.less index c800db23b..67712c42c 100644 --- a/apps/documenteditor/main/resources/less/filemenu.less +++ b/apps/documenteditor/main/resources/less/filemenu.less @@ -86,7 +86,7 @@ } } -#panel-saveas { +#panel-saveas, #panel-savecopy { table { margin-left: auto; margin-right: auto; diff --git a/apps/documenteditor/main/resources/less/toolbar.less b/apps/documenteditor/main/resources/less/toolbar.less index 865c29994..8c5a85faf 100644 --- a/apps/documenteditor/main/resources/less/toolbar.less +++ b/apps/documenteditor/main/resources/less/toolbar.less @@ -341,6 +341,11 @@ //.button-normal-icon(btn-dropcap, 50, @toolbar-icon-size); .button-normal-icon(btn-ic-doclang, 67, @toolbar-icon-size); +.button-normal-icon(rotate-90, 81, @toolbar-icon-size); +.button-normal-icon(rotate-270, 82, @toolbar-icon-size); +.button-normal-icon(flip-hor, 84, @toolbar-icon-size); +.button-normal-icon(flip-vert, 85, @toolbar-icon-size); + @menu-icon-size: 22px; .menu-icon-normal(mnu-wrap-inline, 0, @menu-icon-size); .menu-icon-normal(mnu-wrap-square, 1, @menu-icon-size); diff --git a/apps/documenteditor/sdk_dev_scripts.js b/apps/documenteditor/sdk_dev_scripts.js index 6efa61aea..62154ff69 100644 --- a/apps/documenteditor/sdk_dev_scripts.js +++ b/apps/documenteditor/sdk_dev_scripts.js @@ -86,6 +86,7 @@ var sdk_dev_scrpipts = [ "../../../../sdkjs/word/Editor/GraphicObjects/Format/ImagePrototype.js", "../../../../sdkjs/word/Editor/GraphicObjects/Format/GroupPrototype.js", "../../../../sdkjs/word/Editor/GraphicObjects/Format/ChartSpacePrototype.js", + "../../../../sdkjs/common/Drawings/Format/LockedCanvas.js", "../../../../sdkjs/word/Editor/GraphicObjects/GraphicObjects.js", "../../../../sdkjs/word/Editor/GraphicObjects/GraphicPage.js", "../../../../sdkjs/word/Editor/GraphicObjects/WrapManager.js", diff --git a/apps/presentationeditor/main/app/controller/LeftMenu.js b/apps/presentationeditor/main/app/controller/LeftMenu.js index d1a1eb9ee..0e191aa88 100644 --- a/apps/presentationeditor/main/app/controller/LeftMenu.js +++ b/apps/presentationeditor/main/app/controller/LeftMenu.js @@ -43,6 +43,7 @@ define([ 'core', 'common/main/lib/util/Shortcuts', + 'common/main/lib/view/SaveAsDlg', 'presentationeditor/main/app/view/LeftMenu', 'presentationeditor/main/app/view/FileMenu' ], function () { @@ -83,6 +84,7 @@ define([ 'filemenu:hide': _.bind(this.menuFilesHide, this), 'item:click': _.bind(this.clickMenuFileItem, this), 'saveas:format': _.bind(this.clickSaveAsFormat, this), + 'savecopy:format': _.bind(this.clickSaveCopyAsFormat, this), 'settings:apply': _.bind(this.applySettings, this), 'create:new': _.bind(this.onCreateNew, this), 'recent:open': _.bind(this.onOpenRecent, this) @@ -131,8 +133,9 @@ define([ setApi: function(api) { this.api = api; this.api.asc_registerCallback('asc_onThumbnailsShow', _.bind(this.onThumbnailsShow, this)); - this.api.asc_registerCallback('asc_onCoAuthoringDisconnect', _.bind(this.onApiServerDisconnect, this, true)); + this.api.asc_registerCallback('asc_onCoAuthoringDisconnect', _.bind(this.onApiServerDisconnect, this)); Common.NotificationCenter.on('api:disconnect', _.bind(this.onApiServerDisconnect, this)); + this.api.asc_registerCallback('asc_onDownloadUrl', _.bind(this.onDownloadUrl, this)); /** coauthoring begin **/ if (this.mode.canCoAuthoring) { if (this.mode.canChat) @@ -244,6 +247,49 @@ define([ menu.hide(); }, + clickSaveCopyAsFormat: function(menu, format, ext) { + this.isFromFileDownloadAs = ext; + this.api.asc_DownloadAs(format, true); + menu.hide(); + }, + + onDownloadUrl: function(url) { + if (this.isFromFileDownloadAs) { + var me = this, + defFileName = this.getApplication().getController('Viewport').getView('Common.Views.Header').getDocumentCaption(); + !defFileName && (defFileName = me.txtUntitled); + + if (typeof this.isFromFileDownloadAs == 'string') { + var idx = defFileName.lastIndexOf('.'); + if (idx>0) + defFileName = defFileName.substring(0, idx) + this.isFromFileDownloadAs; + } + + me._saveCopyDlg = new Common.Views.SaveAsDlg({ + saveFolderUrl: me.mode.saveAsUrl, + saveFileUrl: url, + defFileName: defFileName + }); + me._saveCopyDlg.on('saveaserror', function(obj, err){ + var config = { + closable: false, + title: me.notcriticalErrorTitle, + msg: err, + iconCls: 'warn', + buttons: ['ok'], + callback: function(btn){ + Common.NotificationCenter.trigger('edit:complete', me); + } + }; + Common.UI.alert(config); + }).on('close', function(obj){ + me._saveCopyDlg = undefined; + }); + me._saveCopyDlg.show(); + } + this.isFromFileDownloadAs = false; + }, + applySettings: function(menu) { var value = Common.localStorage.getBool("pe-settings-inputmode"); Common.Utils.InternalSettings.set("pe-settings-inputmode", value); @@ -376,7 +422,7 @@ define([ // this.api.asc_selectSearchingResults(false); }, - onApiServerDisconnect: function(disableDownload) { + onApiServerDisconnect: function(enableDownload) { this.mode.isEdit = false; this.leftMenu.close(); @@ -386,7 +432,7 @@ define([ /** coauthoring end **/ this.leftMenu.btnPlugins.setDisabled(true); - this.leftMenu.getMenu('file').setMode({isDisconnected: true, disableDownload: !!disableDownload}); + this.leftMenu.getMenu('file').setMode({isDisconnected: true, enableDownload: !!enableDownload}); if ( this.dlgSearch ) { this.leftMenu.btnSearch.toggle(false, true); this.dlgSearch['hide'](); @@ -591,6 +637,8 @@ define([ textNoTextFound : 'Text not found', newDocumentTitle : 'Unnamed document', - requestEditRightsText : 'Requesting editing rights...' + requestEditRightsText : 'Requesting editing rights...', + notcriticalErrorTitle: 'Warning', + txtUntitled: 'Untitled' }, PE.Controllers.LeftMenu || {})); }); \ 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 53f7c1cc6..6e6753df3 100644 --- a/apps/presentationeditor/main/app/controller/Main.js +++ b/apps/presentationeditor/main/app/controller/Main.js @@ -290,6 +290,8 @@ define([ this.appOptions.lang = this.editorConfig.lang; this.appOptions.location = (typeof (this.editorConfig.location) == 'string') ? this.editorConfig.location.toLowerCase() : ''; this.appOptions.sharingSettingsUrl = this.editorConfig.sharingSettingsUrl; + this.appOptions.saveAsUrl = this.editorConfig.saveAsUrl; + this.appOptions.fileChoiceUrl = this.editorConfig.fileChoiceUrl; this.appOptions.canAnalytics = false; this.appOptions.customization = this.editorConfig.customization; this.appOptions.canBackToFolder = (this.editorConfig.canBackToFolder!==false) && (typeof (this.editorConfig.customization) == 'object') @@ -1168,6 +1170,10 @@ define([ config.msg = this.errorDataEncrypted; break; + case Asc.c_oAscError.ID.EditingError: + config.msg = (this.appOptions.isDesktopApp && this.appOptions.isOffline) ? this.errorEditingSaveas : this.errorEditingDownloadas; + break; + default: config.msg = (typeof id == 'string') ? id : this.errorDefaultMessage.replace('%1', id); break; @@ -1220,6 +1226,9 @@ define([ } })).show(); },10); + } else if (id == Asc.c_oAscError.ID.EditingError) { + this.disableEditing(true); + Common.NotificationCenter.trigger('api:disconnect', true); // enable download and print } this._state.lostEditingRights = false; this.onEditComplete(); @@ -2076,7 +2085,9 @@ define([ textClose: 'Close', textPaidFeature: 'Paid feature', textLicencePaidFeature: 'The feature you are trying to use is available for additional payment.
    If you need it, please contact Sales Department', - scriptLoadError: 'The connection is too slow, some of the components could not be loaded. Please reload the page.' + scriptLoadError: 'The connection is too slow, some of the components could not be loaded. Please reload the page.', + errorEditingSaveas: 'An error occurred during the work with the document.
    Use the \'Save as...\' option to save the file backup copy to your computer hard drive.', + errorEditingDownloadas: 'An error occurred during the work with the document.
    Use the \'Download as...\' option to save the file backup copy to your computer hard drive.' } })(), PE.Controllers.Main || {})) }); diff --git a/apps/presentationeditor/main/app/controller/RightMenu.js b/apps/presentationeditor/main/app/controller/RightMenu.js index ee427b30f..af4b18eaa 100644 --- a/apps/presentationeditor/main/app/controller/RightMenu.js +++ b/apps/presentationeditor/main/app/controller/RightMenu.js @@ -287,7 +287,7 @@ define([ this.rightmenu.shapeSettings.createDelayedElements(); var selectedElements = this.api.getSelectedElements(); if (selectedElements.length>0) { - this.onFocusObject(selectedElements, !Common.localStorage.getBool("pe-hide-right-settings")); + this.onFocusObject(selectedElements, !Common.localStorage.getBool("pe-hide-right-settings", this.rightmenu.defaultHideRightMenu)); } } }, diff --git a/apps/presentationeditor/main/app/controller/Toolbar.js b/apps/presentationeditor/main/app/controller/Toolbar.js index ceb2a7fd0..d0e994dfd 100644 --- a/apps/presentationeditor/main/app/controller/Toolbar.js +++ b/apps/presentationeditor/main/app/controller/Toolbar.js @@ -47,6 +47,7 @@ define([ 'common/main/lib/view/CopyWarningDialog', 'common/main/lib/view/ImageFromUrlDialog', 'common/main/lib/view/InsertTableDialog', + 'common/main/lib/view/SelectFileDlg', 'common/main/lib/util/define', 'presentationeditor/main/app/collection/SlideThemes', 'presentationeditor/main/app/view/Toolbar', @@ -255,6 +256,7 @@ define([ toolbar.btnPreview.on('click', _.bind(this.onPreviewBtnClick, this)); toolbar.btnPreview.menu.on('item:click', _.bind(this.onPreviewItemClick, this)); toolbar.btnPrint.on('click', _.bind(this.onPrint, this)); + toolbar.btnPrint.on('disabled', _.bind(this.onBtnChangeState, this, 'print:disabled')); toolbar.btnSave.on('click', _.bind(this.onSave, this)); toolbar.btnSave.on('disabled', _.bind(this.onBtnChangeState, this, 'save:disabled')); toolbar.btnUndo.on('click', _.bind(this.onUndo, this)); @@ -337,7 +339,7 @@ define([ this.api.asc_registerCallback('asc_onCanUnGroup', _.bind(this.onApiCanUnGroup, this)); this.api.asc_registerCallback('asc_onPresentationSize', _.bind(this.onApiPageSize, this)); - this.api.asc_registerCallback('asc_onCoAuthoringDisconnect',_.bind(this.onApiCoAuthoringDisconnect, this, true)); + this.api.asc_registerCallback('asc_onCoAuthoringDisconnect',_.bind(this.onApiCoAuthoringDisconnect, this)); Common.NotificationCenter.on('api:disconnect', _.bind(this.onApiCoAuthoringDisconnect, this)); this.api.asc_registerCallback('asc_onZoomChange', _.bind(this.onApiZoomChange, this)); this.api.asc_registerCallback('asc_onFocusObject', _.bind(this.onApiFocusObject, this)); @@ -607,7 +609,7 @@ define([ this._state.no_slides = (count<=0); this.toolbar.lockToolbar(PE.enumLock.noSlides, this._state.no_slides, {array: this.toolbar.paragraphControls}); this.toolbar.lockToolbar(PE.enumLock.noSlides, this._state.no_slides, {array: [ - this.toolbar.btnChangeSlide, this.toolbar.btnPreview, this.toolbar.btnCopy, this.toolbar.btnPaste, + this.toolbar.btnChangeSlide, this.toolbar.btnPreview, this.toolbar.btnPrint, this.toolbar.btnCopy, this.toolbar.btnPaste, this.toolbar.btnCopyStyle, this.toolbar.btnInsertTable, this.toolbar.btnInsertChart, this.toolbar.btnColorSchemas, this.toolbar.btnShapeAlign, this.toolbar.btnShapeArrange, this.toolbar.btnSlideSize, this.toolbar.listTheme @@ -768,8 +770,8 @@ define([ this.toolbar.lockToolbar(PE.enumLock.themeLock, false, {array: [this.toolbar.btnColorSchemas, this.toolbar.listTheme]}); }, - onApiCoAuthoringDisconnect: function(disableDownload) { - this.toolbar.setMode({isDisconnected:true, disableDownload: !!disableDownload}); + onApiCoAuthoringDisconnect: function(enableDownload) { + this.toolbar.setMode({isDisconnected:true, enableDownload: !!enableDownload}); this.editMode = false; }, @@ -1339,7 +1341,7 @@ define([ Common.NotificationCenter.trigger('edit:complete', this.toolbar); Common.component.Analytics.trackEvent('ToolBar', 'Image'); - } else { + } else if (opts === 'url') { (new Common.Views.ImageFromUrlDialog({ handler: function(result, value) { if (result == 'ok') { @@ -1361,6 +1363,14 @@ define([ } } })).show(); + } else if (opts === 'storage') { + (new Common.Views.SelectFileDlg({ + fileChoiceUrl: me.toolbar.mode.fileChoiceUrl.replace("{fileExt}", "").replace("{documentType}", "ImagesOnly") + })).on('selectfile', function(obj, file){ + me.toolbar.fireEvent('insertimage', me.toolbar); + me.api.AddImageUrl(file.url); + Common.component.Analytics.trackEvent('ToolBar', 'Image'); + }).show(); } }, diff --git a/apps/presentationeditor/main/app/controller/Viewport.js b/apps/presentationeditor/main/app/controller/Viewport.js index b827fce0d..5f464226a 100644 --- a/apps/presentationeditor/main/app/controller/Viewport.js +++ b/apps/presentationeditor/main/app/controller/Viewport.js @@ -98,6 +98,10 @@ define([ else me.header.btnRedo.setDisabled(state); } }, + 'print:disabled' : function (state) { + if ( me.header.btnPrint ) + me.header.btnPrint.setDisabled(state); + }, 'save:disabled' : function (state) { if ( me.header.btnSave ) me.header.btnSave.setDisabled(state); @@ -419,11 +423,11 @@ define([ } }, - onApiCoAuthoringDisconnect: function() { + onApiCoAuthoringDisconnect: function(enableDownload) { if (this.header) { - if (this.header.btnDownload) + if (this.header.btnDownload && !enableDownload) this.header.btnDownload.hide(); - if (this.header.btnPrint) + if (this.header.btnPrint && !enableDownload) this.header.btnPrint.hide(); if (this.header.btnEdit) this.header.btnEdit.hide(); diff --git a/apps/presentationeditor/main/app/template/FileMenu.template b/apps/presentationeditor/main/app/template/FileMenu.template index 5565d15e9..d67b35cfe 100644 --- a/apps/presentationeditor/main/app/template/FileMenu.template +++ b/apps/presentationeditor/main/app/template/FileMenu.template @@ -5,6 +5,7 @@
  • +
  • @@ -24,6 +25,7 @@
    +
    diff --git a/apps/presentationeditor/main/app/template/ImageSettings.template b/apps/presentationeditor/main/app/template/ImageSettings.template index 709adceca..d1c9ef2fa 100644 --- a/apps/presentationeditor/main/app/template/ImageSettings.template +++ b/apps/presentationeditor/main/app/template/ImageSettings.template @@ -22,6 +22,32 @@
    + + + + + + + + +
    +
    +
    +
    + + + +
    +
    +
    +
    + + + + +
    + + diff --git a/apps/presentationeditor/main/app/template/ImageSettingsAdvanced.template b/apps/presentationeditor/main/app/template/ImageSettingsAdvanced.template index d811bd244..337aff709 100644 --- a/apps/presentationeditor/main/app/template/ImageSettingsAdvanced.template +++ b/apps/presentationeditor/main/app/template/ImageSettingsAdvanced.template @@ -45,6 +45,32 @@
    +
    +
    +
    + +
    +
    +
    +
    +
    + + + + + + + + +
    + + +
    +
    +
    +
    +
    +
    diff --git a/apps/presentationeditor/main/app/template/ShapeSettings.template b/apps/presentationeditor/main/app/template/ShapeSettings.template index f86e7770a..f97d33753 100644 --- a/apps/presentationeditor/main/app/template/ShapeSettings.template +++ b/apps/presentationeditor/main/app/template/ShapeSettings.template @@ -116,6 +116,38 @@ + + + + + + + + +
    +
    +
    + +
    + + + + + +
    + +
    +
    +
    +
    +
    + +
    +
    +
    +
    +
    +
    diff --git a/apps/presentationeditor/main/app/template/ShapeSettingsAdvanced.template b/apps/presentationeditor/main/app/template/ShapeSettingsAdvanced.template index 2b7149a8c..957639ea8 100644 --- a/apps/presentationeditor/main/app/template/ShapeSettingsAdvanced.template +++ b/apps/presentationeditor/main/app/template/ShapeSettingsAdvanced.template @@ -17,6 +17,32 @@
    +
    +
    +
    + +
    +
    +
    +
    +
    + + + + + + + + +
    + + +
    +
    +
    +
    +
    +
    diff --git a/apps/presentationeditor/main/app/view/DocumentHolder.js b/apps/presentationeditor/main/app/view/DocumentHolder.js index 0ff9ee452..b8b8aba62 100644 --- a/apps/presentationeditor/main/app/view/DocumentHolder.js +++ b/apps/presentationeditor/main/app/view/DocumentHolder.js @@ -583,7 +583,7 @@ define([ var onDialogAddHyperlink = function() { var win, props, text; - if (me.api && me.mode.isEdit && !me._isDisabled){ + if (me.api && me.mode.isEdit && !me._isDisabled && !PE.getController('LeftMenu').leftMenu.menuFile.isVisible()){ var handlerDlg = function(dlg, result) { if (result == 'ok') { props = dlg.getSettings(); diff --git a/apps/presentationeditor/main/app/view/FileMenu.js b/apps/presentationeditor/main/app/view/FileMenu.js index a1c5c4591..562e9fe3c 100644 --- a/apps/presentationeditor/main/app/view/FileMenu.js +++ b/apps/presentationeditor/main/app/view/FileMenu.js @@ -109,6 +109,13 @@ define([ canFocused: false }); + this.miSaveCopyAs = new Common.UI.MenuItem({ + el : $('#fm-btn-save-copy',this.el), + action : 'save-copy', + caption : this.btnSaveCopyAsCaption, + canFocused: false + }); + this.miSaveAs = new Common.UI.MenuItem({ el : $('#fm-btn-save-desktop',this.el), action : 'save-desktop', @@ -176,6 +183,7 @@ define([ this.miSave, this.miEdit, this.miDownload, + this.miSaveCopyAs, this.miSaveAs, this.miPrint, this.miRename, @@ -207,6 +215,7 @@ define([ var me = this; me.panels = { 'saveas' : (new PE.Views.FileMenuPanels.ViewSaveAs({menu:me})).render(), + 'save-copy' : (new PE.Views.FileMenuPanels.ViewSaveCopy({menu:me})).render(), 'opts' : (new PE.Views.FileMenuPanels.Settings({menu:me})).render(), 'info' : (new PE.Views.FileMenuPanels.DocumentInfo({menu:me})).render(), 'rights' : (new PE.Views.FileMenuPanels.DocumentRights({menu:me})).render() @@ -247,6 +256,7 @@ define([ this.miNew.$el.find('+.devider')[this.mode.canCreateNew?'show':'hide'](); this.miDownload[(this.mode.canDownload && (!this.mode.isDesktopApp || !this.mode.isOffline))?'show':'hide'](); + this.miSaveCopyAs[((this.mode.canDownload || this.mode.canDownloadOrigin) && (!this.mode.isDesktopApp || !this.mode.isOffline)) && this.mode.saveAsUrl ?'show':'hide'](); this.miSaveAs[(this.mode.canDownload && this.mode.isDesktopApp && this.mode.isOffline)?'show':'hide'](); // this.hkSaveAs[this.mode.canDownload?'enable':'disable'](); @@ -300,8 +310,8 @@ define([ this.mode.canOpenRecent = this.mode.canCreateNew = false; this.mode.isDisconnected = mode.isDisconnected; this.mode.canRename = false; - this.mode.canPrint = false; - this.mode.canDownload = false; + if (!mode.enableDownload) + this.mode.canPrint = this.mode.canDownload = false; } else { this.mode = mode; } @@ -383,6 +393,7 @@ define([ btnSaveAsCaption : 'Save as', btnRenameCaption : 'Rename...', btnCloseMenuCaption : 'Close Menu', - btnProtectCaption: 'Protect' + btnProtectCaption: 'Protect', + btnSaveCopyAsCaption : 'Save Copy as...' }, PE.Views.FileMenu || {})); }); diff --git a/apps/presentationeditor/main/app/view/FileMenuPanels.js b/apps/presentationeditor/main/app/view/FileMenuPanels.js index 8284491ad..1ef0aecd9 100644 --- a/apps/presentationeditor/main/app/view/FileMenuPanels.js +++ b/apps/presentationeditor/main/app/view/FileMenuPanels.js @@ -55,7 +55,7 @@ define([ formats: [[ {name: 'PPTX', imgCls: 'pptx', type: Asc.c_oAscFileType.PPTX}, {name: 'PDF', imgCls: 'pdf', type: Asc.c_oAscFileType.PDF}, - // {name: 'PDFA', imgCls: 'pdfa', type: Asc.c_oAscFileType.PDFA}, + {name: 'PDFA', imgCls: 'pdfa', type: Asc.c_oAscFileType.PDFA}, {name: 'ODP', imgCls: 'odp', type: Asc.c_oAscFileType.ODP} ]], @@ -102,6 +102,60 @@ define([ } }); + PE.Views.FileMenuPanels.ViewSaveCopy = Common.UI.BaseView.extend({ + el: '#panel-savecopy', + menu: undefined, + + formats: [[ + {name: 'PPTX', imgCls: 'pptx', type: Asc.c_oAscFileType.PPTX, ext: '.pptx'}, + {name: 'PDF', imgCls: 'pdf', type: Asc.c_oAscFileType.PDF, ext: '.pdf'}, + {name: 'PDFA', imgCls: 'pdfa', type: Asc.c_oAscFileType.PDFA, ext: '.pdf'}, + {name: 'ODP', imgCls: 'odp', type: Asc.c_oAscFileType.ODP, ext: '.odp'} + ]], + + template: _.template([ + '
    ', + '<% _.each(rows, function(row) { %>', + '', + '<% _.each(row, function(item) { %>', + '', + '<% }) %>', + '', + '<% }) %>', + '
    ', + '', + '
    ' + ].join('')), + + initialize: function(options) { + Common.UI.BaseView.prototype.initialize.call(this,arguments); + + this.menu = options.menu; + }, + + render: function() { + $(this.el).html(this.template({rows:this.formats})); + $('.btn-doc-format',this.el).on('click', _.bind(this.onFormatClick,this)); + + if (_.isUndefined(this.scroller)) { + this.scroller = new Common.UI.Scroller({ + el: $(this.el), + suppressScrollX: true + }); + } + + return this; + }, + + onFormatClick: function(e) { + var type = e.currentTarget.attributes['format'], + ext = e.currentTarget.attributes['format-ext']; + if (!_.isUndefined(type) && !_.isUndefined(ext) && this.menu) { + this.menu.fireEvent('savecopy:format', [this.menu, parseInt(type.value), ext.value]); + } + } + }); + PE.Views.FileMenuPanels.Settings = Common.UI.BaseView.extend(_.extend({ el: '#panel-settings', menu: undefined, diff --git a/apps/presentationeditor/main/app/view/HyperlinkSettingsDialog.js b/apps/presentationeditor/main/app/view/HyperlinkSettingsDialog.js index 796a8e1c9..f88c9c372 100644 --- a/apps/presentationeditor/main/app/view/HyperlinkSettingsDialog.js +++ b/apps/presentationeditor/main/app/view/HyperlinkSettingsDialog.js @@ -197,16 +197,23 @@ define([ cls: 'input-group-nr', style: 'width: 50px;', menuStyle: 'min-width: 50px; max-height: 200px;', - editable: false, data: this.slides }); me.cmbSlides.setValue(0); me.cmbSlides.on('selected', _.bind(function(combo, record) { me.radioSlide.setValue(true); + }, me)) + .on('changed:after', _.bind(function(combo, record) { + me.radioSlide.setValue(true); + if (record.value>me.slides.length) + combo.setValue(me.slides.length-1); + else if (record.value<1) + combo.setValue(0); + else + combo.setValue(record.value-1); }, me)); $window.find('.dlg-btn').on('click', _.bind(this.onBtnClick, this)); - $window.find('input').on('keypress', _.bind(this.onKeyPress, this)); me.externalPanel = $window.find('#id-external-link'); me.internalPanel = $window.find('#id-internal-link'); }, @@ -287,11 +294,9 @@ define([ this._handleInput(event.currentTarget.attributes['result'].value); }, - onKeyPress: function(event) { - if (event.keyCode == Common.UI.Keys.RETURN) { - this._handleInput('ok'); - return false; - } + onPrimary: function(event) { + this._handleInput('ok'); + return false; }, _handleInput: function(state) { diff --git a/apps/presentationeditor/main/app/view/ImageSettings.js b/apps/presentationeditor/main/app/view/ImageSettings.js index 189eb1188..4a13258f1 100644 --- a/apps/presentationeditor/main/app/view/ImageSettings.js +++ b/apps/presentationeditor/main/app/view/ImageSettings.js @@ -139,6 +139,46 @@ define([ this.fireEvent('editcomplete', this); }, this)); + this.btnRotate270 = new Common.UI.Button({ + cls: 'btn-toolbar', + iconCls: 'rotate-270', + value: 0, + hint: this.textHint270 + }); + this.btnRotate270.render( $('#image-button-270', this.$el)); + this.btnRotate270.on('click', _.bind(this.onBtnRotateClick, this)); + this.lockedControls.push(this.btnRotate270); + + this.btnRotate90 = new Common.UI.Button({ + cls: 'btn-toolbar', + iconCls: 'rotate-90', + value: 1, + hint: this.textHint90 + }); + this.btnRotate90.render( $('#image-button-90', this.$el)); + this.btnRotate90.on('click', _.bind(this.onBtnRotateClick, this)); + this.lockedControls.push(this.btnRotate90); + + this.btnFlipV = new Common.UI.Button({ + cls: 'btn-toolbar', + iconCls: 'flip-vert', + value: 0, + hint: this.textHintFlipV + }); + this.btnFlipV.render( $('#image-button-flipv', this.$el)); + this.btnFlipV.on('click', _.bind(this.onBtnFlipClick, this)); + this.lockedControls.push(this.btnFlipV); + + this.btnFlipH = new Common.UI.Button({ + cls: 'btn-toolbar', + iconCls: 'flip-hor', + value: 1, + hint: this.textHintFlipH + }); + this.btnFlipH.render( $('#image-button-fliph', this.$el)); + this.btnFlipH.on('click', _.bind(this.onBtnFlipClick, this)); + this.lockedControls.push(this.btnFlipH); + this.linkAdvanced = $('#image-advanced-link'); this.lblReplace = $('#image-lbl-replace'); $(this.el).on('click', '#image-advanced-link', _.bind(this.openAdvancedSettings, this)); @@ -268,6 +308,23 @@ define([ } }, + onBtnRotateClick: function(btn) { + var properties = new Asc.asc_CImgProperty(); + properties.asc_putRot((btn.options.value==1 ? 90 : 270) * 3.14159265358979 / 180); + this.api.ImgApply(properties); + this.fireEvent('editcomplete', this); + }, + + onBtnFlipClick: function(btn) { + var properties = new Asc.asc_CImgProperty(); + if (btn.options.value==1) + properties.asc_putFlipH(true); + else + properties.asc_putFlipV(true); + this.api.ImgApply(properties); + this.fireEvent('editcomplete', this); + }, + setLocked: function (locked) { this._locked = locked; }, @@ -293,7 +350,14 @@ define([ textFromFile: 'From File', textAdvanced: 'Show advanced settings', textEditObject: 'Edit Object', - textEdit: 'Edit' + textEdit: 'Edit', + textRotation: 'Rotation', + textRotate90: 'Rotate 90°', + textFlip: 'Flip', + textHint270: 'Rotate Left 90°', + textHint90: 'Rotate Right 90°', + textHintFlipV: 'Flip Vertical', + textHintFlipH: 'Flip Horizontal' }, PE.Views.ImageSettings || {})); }); \ No newline at end of file diff --git a/apps/presentationeditor/main/app/view/ImageSettingsAdvanced.js b/apps/presentationeditor/main/app/view/ImageSettingsAdvanced.js index 1fd3b5887..b8066688b 100644 --- a/apps/presentationeditor/main/app/view/ImageSettingsAdvanced.js +++ b/apps/presentationeditor/main/app/view/ImageSettingsAdvanced.js @@ -40,7 +40,8 @@ define([ 'text!presentationeditor/main/app/template/ImageSettingsAdvanced.template', 'common/main/lib/view/AdvancedSettingsWindow', - 'common/main/lib/component/MetricSpinner' + 'common/main/lib/component/MetricSpinner', + 'common/main/lib/component/CheckBox' ], function (contentTemplate) { 'use strict'; @@ -59,6 +60,7 @@ define([ 'text!presentationeditor/main/app/template/ImageSettingsAdvanced.tem title: this.textTitle, items: [ {panelId: 'id-adv-image-size', panelCaption: this.textPlacement}, + {panelId: 'id-adv-image-rotate', panelCaption: this.textRotation}, {panelId: 'id-adv-image-alttext', panelCaption: this.textAlt} ], contentTemplate: _.template(contentTemplate)({ @@ -171,6 +173,27 @@ define([ 'text!presentationeditor/main/app/template/ImageSettingsAdvanced.tem }); this.spinners.push(this.spnY); + // Rotation + this.spnAngle = new Common.UI.MetricSpinner({ + el: $('#image-advanced-spin-angle'), + step: 1, + width: 80, + defaultUnit : "°", + value: '0 °', + maxValue: 3600, + minValue: -3600 + }); + + this.chFlipHor = new Common.UI.CheckBox({ + el: $('#image-advanced-checkbox-hor'), + labelText: this.textHorizontally + }); + + this.chFlipVert = new Common.UI.CheckBox({ + el: $('#image-advanced-checkbox-vert'), + labelText: this.textVertically + }); + // Alt Text this.inputAltTitle = new Common.UI.InputField({ @@ -225,6 +248,11 @@ define([ 'text!presentationeditor/main/app/template/ImageSettingsAdvanced.tem this.spnY.setValue('', true); } + value = props.asc_getRot(); + this.spnAngle.setValue((value==undefined || value===null) ? '' : Math.floor(value*180/3.14159265358979+0.5), true); + this.chFlipHor.setValue(props.asc_getFlipH()); + this.chFlipVert.setValue(props.asc_getFlipV()); + value = props.asc_getTitle(); this.inputAltTitle.setValue(value ? value : ''); @@ -254,6 +282,10 @@ define([ 'text!presentationeditor/main/app/template/ImageSettingsAdvanced.tem if (this.isAltDescChanged) properties.asc_putDescription(this.textareaAltDescription.val()); + properties.asc_putRot(this.spnAngle.getNumberValue() * 3.14159265358979 / 180); + properties.asc_putFlipH(this.chFlipHor.getValue()=='checked'); + properties.asc_putFlipV(this.chFlipVert.getValue()=='checked'); + return { imageProps: properties }; }, @@ -289,7 +321,12 @@ define([ 'text!presentationeditor/main/app/template/ImageSettingsAdvanced.tem textAlt: 'Alternative Text', textAltTitle: 'Title', textAltDescription: 'Description', - textAltTip: 'The alternative text-based representation of the visual object information, which will be read to the people with vision or cognitive impairments to help them better understand what information there is in the image, autoshape, chart or table.' + textAltTip: 'The alternative text-based representation of the visual object information, which will be read to the people with vision or cognitive impairments to help them better understand what information there is in the image, autoshape, chart or table.', + textRotation: 'Rotation', + textAngle: 'Angle', + textFlipped: 'Flipped', + textHorizontally: 'Horizontally', + textVertically: 'Vertically' }, PE.Views.ImageSettingsAdvanced || {})); }); \ No newline at end of file diff --git a/apps/presentationeditor/main/app/view/RightMenu.js b/apps/presentationeditor/main/app/view/RightMenu.js index 71bad526c..54c947e9e 100644 --- a/apps/presentationeditor/main/app/view/RightMenu.js +++ b/apps/presentationeditor/main/app/view/RightMenu.js @@ -149,7 +149,8 @@ define([ this.trigger('render:before', this); - var open = !Common.localStorage.getBool("pe-hide-right-settings"); + this.defaultHideRightMenu = mode.customization && !!mode.customization.hideRightMenu; + var open = !Common.localStorage.getBool("pe-hide-right-settings", this.defaultHideRightMenu); el.css('width', ((open) ? MENU_SCALE_PART : SCALE_MIN) + 'px'); el.show(); diff --git a/apps/presentationeditor/main/app/view/ShapeSettings.js b/apps/presentationeditor/main/app/view/ShapeSettings.js index cf5597b06..9d1e60cb9 100644 --- a/apps/presentationeditor/main/app/view/ShapeSettings.js +++ b/apps/presentationeditor/main/app/view/ShapeSettings.js @@ -1290,6 +1290,46 @@ define([ this.btnChangeShape.render( $('#shape-btn-change')) ; this.lockedControls.push(this.btnChangeShape); + this.btnRotate270 = new Common.UI.Button({ + cls: 'btn-toolbar', + iconCls: 'rotate-270', + value: 0, + hint: this.textHint270 + }); + this.btnRotate270.render( $('#shape-button-270', me.$el)); + this.btnRotate270.on('click', _.bind(this.onBtnRotateClick, this)); + this.lockedControls.push(this.btnRotate270); + + this.btnRotate90 = new Common.UI.Button({ + cls: 'btn-toolbar', + iconCls: 'rotate-90', + value: 1, + hint: this.textHint90 + }); + this.btnRotate90.render( $('#shape-button-90', me.$el)); + this.btnRotate90.on('click', _.bind(this.onBtnRotateClick, this)); + this.lockedControls.push(this.btnRotate90); + + this.btnFlipV = new Common.UI.Button({ + cls: 'btn-toolbar', + iconCls: 'flip-vert', + value: 0, + hint: this.textHintFlipV + }); + this.btnFlipV.render( $('#shape-button-flipv', me.$el)); + this.btnFlipV.on('click', _.bind(this.onBtnFlipClick, this)); + this.lockedControls.push(this.btnFlipV); + + this.btnFlipH = new Common.UI.Button({ + cls: 'btn-toolbar', + iconCls: 'flip-hor', + value: 1, + hint: this.textHintFlipH + }); + this.btnFlipH.render( $('#shape-button-fliph', me.$el)); + this.btnFlipH.on('click', _.bind(this.onBtnFlipClick, this)); + this.lockedControls.push(this.btnFlipH); + this.linkAdvanced = $('#shape-advanced-link'); $(this.el).on('click', '#shape-advanced-link', _.bind(this.openAdvancedSettings, this)); }, @@ -1544,6 +1584,23 @@ define([ this.colorsGrad.updateColors(Common.Utils.ThemeColor.getEffectColors(), Common.Utils.ThemeColor.getStandartColors()); }, + onBtnRotateClick: function(btn) { + var properties = new Asc.asc_CShapeProperty(); + properties.asc_putRot((btn.options.value==1 ? 90 : 270) * 3.14159265358979 / 180); + this.api.ShapeApply(properties); + this.fireEvent('editcomplete', this); + }, + + onBtnFlipClick: function(btn) { + var properties = new Asc.asc_CShapeProperty(); + if (btn.options.value==1) + properties.asc_putFlipH(true); + else + properties.asc_putFlipV(true); + this.api.ShapeApply(properties); + this.fireEvent('editcomplete', this); + }, + _pt2mm: function(value) { return (value * 25.4 / 72.0); }, @@ -1643,6 +1700,13 @@ define([ textStyle: 'Style', textGradient: 'Gradient', textBorderSizeErr: 'The entered value is incorrect.
    Please enter a value between 0 pt and 1584 pt.', - strType: 'Type' + strType: 'Type', + textRotation: 'Rotation', + textRotate90: 'Rotate 90°', + textFlip: 'Flip', + textHint270: 'Rotate Left 90°', + textHint90: 'Rotate Right 90°', + textHintFlipV: 'Flip Vertical', + textHintFlipH: 'Flip Horizontal' }, PE.Views.ShapeSettings || {})); }); diff --git a/apps/presentationeditor/main/app/view/ShapeSettingsAdvanced.js b/apps/presentationeditor/main/app/view/ShapeSettingsAdvanced.js index abe18a36c..3f4951f61 100644 --- a/apps/presentationeditor/main/app/view/ShapeSettingsAdvanced.js +++ b/apps/presentationeditor/main/app/view/ShapeSettingsAdvanced.js @@ -41,7 +41,8 @@ define([ 'text!presentationeditor/main/app/template/ShapeSettingsAdvanced.template', 'common/main/lib/view/AdvancedSettingsWindow', 'common/main/lib/component/ComboBox', - 'common/main/lib/component/MetricSpinner' + 'common/main/lib/component/MetricSpinner', + 'common/main/lib/component/CheckBox' ], function (contentTemplate) { 'use strict'; @@ -61,6 +62,7 @@ define([ 'text!presentationeditor/main/app/template/ShapeSettingsAdvanced.tem title: this.textTitle, items: [ {panelId: 'id-adv-shape-width', panelCaption: this.textSize}, + {panelId: 'id-adv-shape-rotate', panelCaption: this.textRotation}, {panelId: 'id-adv-shape-shape', panelCaption: this.textWeightArrows}, {panelId: 'id-adv-shape-margins', panelCaption: this.strMargins}, {panelId: 'id-adv-shape-columns', panelCaption: this.strColumns}, @@ -230,6 +232,27 @@ define([ 'text!presentationeditor/main/app/template/ShapeSettingsAdvanced.tem }, this)); this.spinners.push(this.spnMarginRight); + // Rotation + this.spnAngle = new Common.UI.MetricSpinner({ + el: $('#shape-advanced-spin-angle'), + step: 1, + width: 80, + defaultUnit : "°", + value: '0 °', + maxValue: 3600, + minValue: -3600 + }); + + this.chFlipHor = new Common.UI.CheckBox({ + el: $('#shape-advanced-checkbox-hor'), + labelText: this.textHorizontally + }); + + this.chFlipVert = new Common.UI.CheckBox({ + el: $('#shape-advanced-checkbox-vert'), + labelText: this.textVertically + }); + // Shape this._arrCapType = [ {displayValue: this.textFlat, value: Asc.c_oAscLineCapType.Flat}, @@ -499,10 +522,10 @@ define([ 'text!presentationeditor/main/app/template/ShapeSettingsAdvanced.tem val = margins.get_Bottom(); this.spnMarginBottom.setValue((null !== val && undefined !== val) ? Common.Utils.Metric.fnRecalcFromMM(val) : '', true); } - this.btnsCategory[2].setDisabled(null === margins); // Margins + this.btnsCategory[3].setDisabled(null === margins); // Margins var shapetype = props.asc_getType(); - this.btnsCategory[3].setDisabled(shapetype=='line' || shapetype=='bentConnector2' || shapetype=='bentConnector3' + this.btnsCategory[4].setDisabled(shapetype=='line' || shapetype=='bentConnector2' || shapetype=='bentConnector3' || shapetype=='bentConnector4' || shapetype=='bentConnector5' || shapetype=='curvedConnector2' || shapetype=='curvedConnector3' || shapetype=='curvedConnector4' || shapetype=='curvedConnector5' || shapetype=='straightConnector1'); @@ -519,6 +542,11 @@ define([ 'text!presentationeditor/main/app/template/ShapeSettingsAdvanced.tem value = props.asc_getDescription(); this.textareaAltDescription.val(value ? value : ''); + value = props.asc_getRot(); + this.spnAngle.setValue((value==undefined || value===null) ? '' : Math.floor(value*180/3.14159265358979+0.5), true); + this.chFlipHor.setValue(props.asc_getFlipH()); + this.chFlipVert.setValue(props.asc_getFlipV()); + this._changedProps = new Asc.asc_CShapeProperty(); } }, @@ -530,6 +558,10 @@ define([ 'text!presentationeditor/main/app/template/ShapeSettingsAdvanced.tem if (this.isAltDescChanged) this._changedProps.asc_putDescription(this.textareaAltDescription.val()); + this._changedProps.asc_putRot(this.spnAngle.getNumberValue() * 3.14159265358979 / 180); + this._changedProps.asc_putFlipH(this.chFlipHor.getValue()=='checked'); + this._changedProps.asc_putFlipV(this.chFlipVert.getValue()=='checked'); + Common.localStorage.setItem("pe-settings-shaperatio", (this.btnRatio.pressed) ? 1 : 0); return { shapeProps: this._changedProps} ; }, @@ -538,7 +570,7 @@ define([ 'text!presentationeditor/main/app/template/ShapeSettingsAdvanced.tem if (props ){ var stroke = props.get_stroke(); if (stroke) { - this.btnsCategory[1].setDisabled(stroke.get_type() == Asc.c_oAscStrokeType.STROKE_NONE); // Weights & Arrows + this.btnsCategory[2].setDisabled(stroke.get_type() == Asc.c_oAscStrokeType.STROKE_NONE); // Weights & Arrows var value = stroke.get_linejoin(); for (var i=0; i-1); }); me.btnsInsertText.forEach(function (btn) { @@ -1271,9 +1274,6 @@ define([ me.mnuChangeSlidePicker._needRecalcSlideLayout = true; }); -// // Enable none paragraph components - this.lockToolbar(PE.enumLock.disableOnStart, false, {array: this.slideOnlyControls.concat(this.shapeControls)}); - /** coauthoring begin **/ this.showSynchTip = !Common.localStorage.getBool('pe-hide-synch'); @@ -1316,7 +1316,11 @@ define([ setMode: function (mode) { if (mode.isDisconnected) { this.lockToolbar(PE.enumLock.lostConnect, true); - } + if (!mode.enableDownload) + this.lockToolbar(PE.enumLock.cantPrint, true, {array: [this.btnPrint]}); + } else + this.lockToolbar(PE.enumLock.cantPrint, !mode.canPrint, {array: [this.btnPrint]}); + this.mode = mode; if (!mode.nativeApp) { var nativeBtnGroup = $('.toolbar-group-native'); @@ -1328,8 +1332,6 @@ define([ if (mode.isDesktopApp) $('.toolbar-group-native').hide(); - - this.lockToolbar(PE.enumLock.cantPrint, !mode.canPrint || mode.disableDownload, {array: [this.btnPrint]}); }, onSendThemeColorSchemes: function (schemas) { @@ -1733,7 +1735,8 @@ define([ textSurface: 'Surface', textShowPresenterView: 'Show presenter view', textTabCollaboration: 'Collaboration', - textTabProtect: 'Protection' + textTabProtect: 'Protection', + mniImageFromStorage: 'Image from Storage' } }()), PE.Views.Toolbar || {})); }); \ No newline at end of file diff --git a/apps/presentationeditor/main/locale/en.json b/apps/presentationeditor/main/locale/en.json index 85953a51e..5721d5003 100644 --- a/apps/presentationeditor/main/locale/en.json +++ b/apps/presentationeditor/main/locale/en.json @@ -202,6 +202,10 @@ "Common.Views.ReviewPopover.textOpenAgain": "Open Again", "Common.Views.ReviewPopover.textReply": "Reply", "Common.Views.ReviewPopover.textResolve": "Resolve", + "Common.Views.SaveAsDlg.textLoading": "Loading", + "Common.Views.SaveAsDlg.textTitle": "Folder for save", + "Common.Views.SelectFileDlg.textLoading": "Loading", + "Common.Views.SelectFileDlg.textTitle": "Select Data Source", "Common.Views.SignDialog.cancelButtonText": "Cancel", "Common.Views.SignDialog.okButtonText": "Ok", "Common.Views.SignDialog.textBold": "Bold", @@ -230,8 +234,10 @@ "Common.Views.SignSettingsDialog.textTitle": "Signature Setup", "Common.Views.SignSettingsDialog.txtEmpty": "This field is required", "PE.Controllers.LeftMenu.newDocumentTitle": "Unnamed presentation", + "PE.Controllers.LeftMenu.notcriticalErrorTitle": "Warning", "PE.Controllers.LeftMenu.requestEditRightsText": "Requesting editing rights...", "PE.Controllers.LeftMenu.textNoTextFound": "The data you have been searching for could not be found. Please adjust your search options.", + "PE.Controllers.LeftMenu.txtUntitled": "Untitled", "PE.Controllers.Main.applyChangesTextText": "Loading data...", "PE.Controllers.Main.applyChangesTitleText": "Loading Data", "PE.Controllers.Main.convertationTimeoutText": "Conversion timeout exceeded.", @@ -265,6 +271,8 @@ "PE.Controllers.Main.errorUserDrop": "The file cannot be accessed right now.", "PE.Controllers.Main.errorUsersExceed": "The number of users allowed by the pricing plan was exceeded", "PE.Controllers.Main.errorViewerDisconnect": "Connection is lost. You can still view the document,
    but will not be able to download or print until the connection is restored.", + "PE.Controllers.Main.errorEditingSaveas": "An error occurred during the work with the document.
    Use the 'Save as...' option to save the file backup copy to your computer hard drive.", + "PE.Controllers.Main.errorEditingDownloadas": "An error occurred during the work with the document.
    Use the 'Download as...' option to save the file backup copy to your computer hard drive.", "PE.Controllers.Main.leavePageText": "You have unsaved changes in this presentation. Click \"Stay on This Page\", then \"Save\" to save them. Click \"Leave This Page\" to discard all the unsaved changes.", "PE.Controllers.Main.loadFontsTextText": "Loading data...", "PE.Controllers.Main.loadFontsTitleText": "Loading Data", @@ -954,6 +962,7 @@ "PE.Views.FileMenu.btnSaveCaption": "Save", "PE.Views.FileMenu.btnSettingsCaption": "Advanced Settings...", "PE.Views.FileMenu.btnToEditCaption": "Edit Presentation", + "PE.Views.FileMenu.btnSaveCopyAsCaption": "Save Copy as...", "PE.Views.FileMenuPanels.CreateNew.fromBlankText": "From Blank", "PE.Views.FileMenuPanels.CreateNew.fromTemplateText": "From Template", "PE.Views.FileMenuPanels.CreateNew.newDescriptionText": "Create a new blank presentation which you will be able to style and format after it is created during the editing. Or choose one of the templates to start a presentation of a certain type or purpose where some styles have already been pre-applied.", @@ -1041,6 +1050,13 @@ "PE.Views.ImageSettings.textOriginalSize": "Default Size", "PE.Views.ImageSettings.textSize": "Size", "PE.Views.ImageSettings.textWidth": "Width", + "PE.Views.ImageSettings.textRotation": "Rotation", + "PE.Views.ImageSettings.textRotate90": "Rotate 90°", + "PE.Views.ImageSettings.textFlip": "Flip", + "PE.Views.ImageSettings.textHint270": "Rotate Left 90°", + "PE.Views.ImageSettings.textHint90": "Rotate Right 90°", + "PE.Views.ImageSettings.textHintFlipV": "Flip Vertical", + "PE.Views.ImageSettings.textHintFlipH": "Flip Horizontal", "PE.Views.ImageSettingsAdvanced.cancelButtonText": "Cancel", "PE.Views.ImageSettingsAdvanced.okButtonText": "OK", "PE.Views.ImageSettingsAdvanced.textAlt": "Alternative Text", @@ -1055,6 +1071,11 @@ "PE.Views.ImageSettingsAdvanced.textSize": "Size", "PE.Views.ImageSettingsAdvanced.textTitle": "Image - Advanced Settings", "PE.Views.ImageSettingsAdvanced.textWidth": "Width", + "PE.Views.ImageSettingsAdvanced.textRotation": "Rotation", + "PE.Views.ImageSettingsAdvanced.textAngle": "Angle", + "PE.Views.ImageSettingsAdvanced.textFlipped": "Flipped", + "PE.Views.ImageSettingsAdvanced.textHorizontally": "Horizontally", + "PE.Views.ImageSettingsAdvanced.textVertically": "Vertically", "PE.Views.LeftMenu.tipAbout": "About", "PE.Views.LeftMenu.tipChat": "Chat", "PE.Views.LeftMenu.tipComments": "Comments", @@ -1152,6 +1173,13 @@ "PE.Views.ShapeSettings.txtNoBorders": "No Line", "PE.Views.ShapeSettings.txtPapyrus": "Papyrus", "PE.Views.ShapeSettings.txtWood": "Wood", + "PE.Views.ShapeSettings.textRotation": "Rotation", + "PE.Views.ShapeSettings.textRotate90": "Rotate 90°", + "PE.Views.ShapeSettings.textFlip": "Flip", + "PE.Views.ShapeSettings.textHint270": "Rotate Left 90°", + "PE.Views.ShapeSettings.textHint90": "Rotate Right 90°", + "PE.Views.ShapeSettings.textHintFlipV": "Flip Vertical", + "PE.Views.ShapeSettings.textHintFlipH": "Flip Horizontal", "PE.Views.ShapeSettingsAdvanced.cancelButtonText": "Cancel", "PE.Views.ShapeSettingsAdvanced.okButtonText": "OK", "PE.Views.ShapeSettingsAdvanced.strColumns": "Columns", @@ -1186,6 +1214,11 @@ "PE.Views.ShapeSettingsAdvanced.textWeightArrows": "Weights & Arrows", "PE.Views.ShapeSettingsAdvanced.textWidth": "Width", "PE.Views.ShapeSettingsAdvanced.txtNone": "None", + "PE.Views.ShapeSettingsAdvanced.textRotation": "Rotation", + "PE.Views.ShapeSettingsAdvanced.textAngle": "Angle", + "PE.Views.ShapeSettingsAdvanced.textFlipped": "Flipped", + "PE.Views.ShapeSettingsAdvanced.textHorizontally": "Horizontally", + "PE.Views.ShapeSettingsAdvanced.textVertically": "Vertically", "PE.Views.SignatureSettings.notcriticalErrorTitle": "Warning", "PE.Views.SignatureSettings.strDelete": "Remove Signature", "PE.Views.SignatureSettings.strDetails": "Signature Details", @@ -1539,5 +1572,6 @@ "PE.Views.Toolbar.txtScheme7": "Equity", "PE.Views.Toolbar.txtScheme8": "Flow", "PE.Views.Toolbar.txtScheme9": "Foundry", - "PE.Views.Toolbar.txtUngroup": "Ungroup" + "PE.Views.Toolbar.txtUngroup": "Ungroup", + "PE.Views.Toolbar.mniImageFromStorage": "Image from Storage" } \ No newline at end of file diff --git a/apps/presentationeditor/main/resources/img/toolbar-menu.png b/apps/presentationeditor/main/resources/img/toolbar-menu.png index 695b0428a..09999738b 100644 Binary files a/apps/presentationeditor/main/resources/img/toolbar-menu.png and b/apps/presentationeditor/main/resources/img/toolbar-menu.png differ diff --git a/apps/presentationeditor/main/resources/img/toolbar-menu@2x.png b/apps/presentationeditor/main/resources/img/toolbar-menu@2x.png index 4f8500885..1392b298c 100644 Binary files a/apps/presentationeditor/main/resources/img/toolbar-menu@2x.png and b/apps/presentationeditor/main/resources/img/toolbar-menu@2x.png differ diff --git a/apps/presentationeditor/main/resources/less/leftmenu.less b/apps/presentationeditor/main/resources/less/leftmenu.less index 98ca17e83..6be922434 100644 --- a/apps/presentationeditor/main/resources/less/leftmenu.less +++ b/apps/presentationeditor/main/resources/less/leftmenu.less @@ -185,7 +185,7 @@ overflow: hidden; } - #panel-saveas { + #panel-saveas, #panel-savecopy { table { margin-left: auto; margin-right: auto; diff --git a/apps/presentationeditor/main/resources/less/toolbar.less b/apps/presentationeditor/main/resources/less/toolbar.less index 8840f802f..3b92700ab 100644 --- a/apps/presentationeditor/main/resources/less/toolbar.less +++ b/apps/presentationeditor/main/resources/less/toolbar.less @@ -289,6 +289,11 @@ .toolbar-btn-icon(btn-save-coauth, 69, @toolbar-icon-size); //.toolbar-btn-icon(btn-insertequation, 74, @toolbar-icon-size); +.toolbar-btn-icon(rotate-90, 79, @toolbar-icon-size); +.toolbar-btn-icon(rotate-270, 80, @toolbar-icon-size); +.toolbar-btn-icon(flip-hor, 81, @toolbar-icon-size); +.toolbar-btn-icon(flip-vert, 82, @toolbar-icon-size); + // add slide //.btn-toolbar .btn-addslide {background-position: 0 -120px;} //.btn-toolbar.active > .btn-addslide, diff --git a/apps/presentationeditor/sdk_dev_scripts.js b/apps/presentationeditor/sdk_dev_scripts.js index 1a057f337..85fcf375e 100644 --- a/apps/presentationeditor/sdk_dev_scripts.js +++ b/apps/presentationeditor/sdk_dev_scripts.js @@ -187,6 +187,7 @@ var sdk_dev_scrpipts = [ "../../../../sdkjs/slide/Editor/Format/ImagePrototype.js", "../../../../sdkjs/slide/Editor/Format/GroupPrototype.js", "../../../../sdkjs/slide/Editor/Format/ChartSpacePrototype.js", + "../../../../sdkjs/common/Drawings/Format/LockedCanvas.js", "../../../../sdkjs/common/Private/Locks.js", "../../../../sdkjs/word/apiCommon.js", "../../../../sdkjs/common/applyDocumentChanges.js", diff --git a/apps/spreadsheeteditor/main/app/controller/DocumentHolder.js b/apps/spreadsheeteditor/main/app/controller/DocumentHolder.js index 59a894376..97863f743 100644 --- a/apps/spreadsheeteditor/main/app/controller/DocumentHolder.js +++ b/apps/spreadsheeteditor/main/app/controller/DocumentHolder.js @@ -43,6 +43,7 @@ define([ 'core', 'common/main/lib/util/utils', + 'common/main/lib/util/Shortcuts', 'common/main/lib/view/CopyWarningDialog', 'spreadsheeteditor/main/app/view/DocumentHolder', 'spreadsheeteditor/main/app/view/HyperlinkSettingsDialog', diff --git a/apps/spreadsheeteditor/main/app/controller/LeftMenu.js b/apps/spreadsheeteditor/main/app/controller/LeftMenu.js index c1d730f21..52092f2f8 100644 --- a/apps/spreadsheeteditor/main/app/controller/LeftMenu.js +++ b/apps/spreadsheeteditor/main/app/controller/LeftMenu.js @@ -33,6 +33,7 @@ define([ 'core', 'common/main/lib/util/Shortcuts', + 'common/main/lib/view/SaveAsDlg', 'spreadsheeteditor/main/app/view/LeftMenu', 'spreadsheeteditor/main/app/view/FileMenu' ], function () { @@ -73,6 +74,7 @@ define([ 'menu:show': _.bind(this.menuFilesShowHide, this, 'show'), 'item:click': _.bind(this.clickMenuFileItem, this), 'saveas:format': _.bind(this.clickSaveAsFormat, this), + 'savecopy:format': _.bind(this.clickSaveCopyAsFormat, this), 'settings:apply': _.bind(this.applySettings, this), 'create:new': _.bind(this.onCreateNew, this), 'recent:open': _.bind(this.onOpenRecent, this) @@ -139,8 +141,9 @@ define([ setApi: function(api) { this.api = api; this.api.asc_registerCallback('asc_onRenameCellTextEnd', _.bind(this.onRenameText, this)); - this.api.asc_registerCallback('asc_onCoAuthoringDisconnect', _.bind(this.onApiServerDisconnect, this, true)); + this.api.asc_registerCallback('asc_onCoAuthoringDisconnect', _.bind(this.onApiServerDisconnect, this)); Common.NotificationCenter.on('api:disconnect', _.bind(this.onApiServerDisconnect, this)); + this.api.asc_registerCallback('asc_onDownloadUrl', _.bind(this.onDownloadUrl, this)); /** coauthoring begin **/ if (this.mode.canCoAuthoring) { if (this.mode.canChat) @@ -270,6 +273,68 @@ define([ } }, + clickSaveCopyAsFormat: function(menu, format, ext) { + if (format == Asc.c_oAscFileType.CSV) { + Common.UI.warning({ + title: this.textWarning, + msg: this.warnDownloadAs, + buttons: ['ok', 'cancel'], + callback: _.bind(function(btn){ + if (btn == 'ok') { + this.isFromFileDownloadAs = ext; + this.api.asc_DownloadAs(format, true); + menu.hide(); + } + }, this) + }); + } else if (format == Asc.c_oAscFileType.PDF || format == Asc.c_oAscFileType.PDFA) { + this.isFromFileDownloadAs = ext; + menu.hide(); + Common.NotificationCenter.trigger('download:settings', this.leftMenu, format, true); + } else { + this.isFromFileDownloadAs = ext; + this.api.asc_DownloadAs(format, true); + menu.hide(); + } + }, + + onDownloadUrl: function(url) { + if (this.isFromFileDownloadAs) { + var me = this, + defFileName = this.getApplication().getController('Viewport').getView('Common.Views.Header').getDocumentCaption(); + !defFileName && (defFileName = me.txtUntitled); + + if (typeof this.isFromFileDownloadAs == 'string') { + var idx = defFileName.lastIndexOf('.'); + if (idx>0) + defFileName = defFileName.substring(0, idx) + this.isFromFileDownloadAs; + } + + me._saveCopyDlg = new Common.Views.SaveAsDlg({ + saveFolderUrl: me.mode.saveAsUrl, + saveFileUrl: url, + defFileName: defFileName + }); + me._saveCopyDlg.on('saveaserror', function(obj, err){ + var config = { + closable: false, + title: me.textWarning, + msg: err, + iconCls: 'warn', + buttons: ['ok'], + callback: function(btn){ + Common.NotificationCenter.trigger('edit:complete', me); + } + }; + Common.UI.alert(config); + }).on('close', function(obj){ + me._saveCopyDlg = undefined; + }); + me._saveCopyDlg.show(); + } + this.isFromFileDownloadAs = false; + }, + applySettings: function(menu) { var value = Common.localStorage.getItem("sse-settings-fontrender"); Common.Utils.InternalSettings.set("sse-settings-fontrender", value); @@ -556,7 +621,7 @@ define([ } }, - onApiServerDisconnect: function(disableDownload) { + onApiServerDisconnect: function(enableDownload) { this.mode.isEdit = false; this.leftMenu.close(); @@ -566,7 +631,7 @@ define([ /** coauthoring end **/ this.leftMenu.btnPlugins.setDisabled(true); - this.leftMenu.getMenu('file').setMode({isDisconnected: true, disableDownload: !!disableDownload}); + this.leftMenu.getMenu('file').setMode({isDisconnected: true, enableDownload: !!enableDownload}); if ( this.dlgSearch ) { this.leftMenu.btnSearch.toggle(false, true); this.dlgSearch['hide'](); @@ -820,6 +885,7 @@ define([ textValues: 'Values', textWithin: 'Within', textSearch: 'Search', - textLookin: 'Look in' + textLookin: 'Look in', + txtUntitled: 'Untitled' }, SSE.Controllers.LeftMenu || {})); }); \ No newline at end of file diff --git a/apps/spreadsheeteditor/main/app/controller/Main.js b/apps/spreadsheeteditor/main/app/controller/Main.js index f8f73f8e6..f42209bff 100644 --- a/apps/spreadsheeteditor/main/app/controller/Main.js +++ b/apps/spreadsheeteditor/main/app/controller/Main.js @@ -297,6 +297,8 @@ define([ this.appOptions.canAutosave = false; this.appOptions.canAnalytics = false; this.appOptions.sharingSettingsUrl = this.editorConfig.sharingSettingsUrl; + this.appOptions.saveAsUrl = this.editorConfig.saveAsUrl; + this.appOptions.fileChoiceUrl = this.editorConfig.fileChoiceUrl; this.appOptions.isEditDiagram = this.editorConfig.mode == 'editdiagram'; this.appOptions.isEditMailMerge = this.editorConfig.mode == 'editmerge'; this.appOptions.customization = this.editorConfig.customization; @@ -730,6 +732,7 @@ define([ me.fillTextArt(me.api.asc_getTextArtPreviews()); me.updateThemeColors(); + toolbarController.activateControls(); } rightmenuController.createDelayedElements(); @@ -1329,6 +1332,10 @@ define([ config.msg = this.errorDataEncrypted; break; + case Asc.c_oAscError.ID.EditingError: + config.msg = (this.appOptions.isDesktopApp && this.appOptions.isOffline) ? this.errorEditingSaveas : this.errorEditingDownloadas; + break; + default: config.msg = (typeof id == 'string') ? id : this.errorDefaultMessage.replace('%1', id); break; @@ -1364,6 +1371,9 @@ define([ if (id == Asc.c_oAscError.ID.Warning && btn == 'ok' && this.appOptions.canDownload) { Common.UI.Menu.Manager.hideAll(); (this.appOptions.isDesktopApp && this.appOptions.isOffline) ? this.api.asc_DownloadAs() : this.getApplication().getController('LeftMenu').leftMenu.showMenu('file:saveas'); + } else if (id == Asc.c_oAscError.ID.EditingError) { + this.disableEditing(true); + Common.NotificationCenter.trigger('api:disconnect', true); // enable download and print } this._state.lostEditingRights = false; this.onEditComplete(); @@ -2255,7 +2265,9 @@ define([ textClose: 'Close', textPaidFeature: 'Paid feature', textLicencePaidFeature: 'The feature you are trying to use is available for additional payment.
    If you need it, please contact Sales Department', - scriptLoadError: 'The connection is too slow, some of the components could not be loaded. Please reload the page.' + scriptLoadError: 'The connection is too slow, some of the components could not be loaded. Please reload the page.', + errorEditingSaveas: 'An error occurred during the work with the document.
    Use the \'Save as...\' option to save the file backup copy to your computer hard drive.', + errorEditingDownloadas: 'An error occurred during the work with the document.
    Use the \'Download as...\' option to save the file backup copy to your computer hard drive.' } })(), SSE.Controllers.Main || {})) }); diff --git a/apps/spreadsheeteditor/main/app/controller/RightMenu.js b/apps/spreadsheeteditor/main/app/controller/RightMenu.js index 333d56e7a..b572a5cb5 100644 --- a/apps/spreadsheeteditor/main/app/controller/RightMenu.js +++ b/apps/spreadsheeteditor/main/app/controller/RightMenu.js @@ -306,8 +306,7 @@ define([ createDelayedElements: function() { var me = this; if (this.api) { - var open = Common.localStorage.getItem("sse-hide-right-settings"); - this._openRightMenu = (open===null || parseInt(open) == 0); + this._openRightMenu = !Common.localStorage.getBool("sse-hide-right-settings", this.rightmenu.defaultHideRightMenu); this.api.asc_registerCallback('asc_onSelectionChanged', _.bind(this.onSelectionChanged, this)); this.api.asc_registerCallback('asc_doubleClickOnObject', _.bind(this.onDoubleClickOnObject, this)); diff --git a/apps/spreadsheeteditor/main/app/controller/Toolbar.js b/apps/spreadsheeteditor/main/app/controller/Toolbar.js index 4a1d45c35..044fdbe37 100644 --- a/apps/spreadsheeteditor/main/app/controller/Toolbar.js +++ b/apps/spreadsheeteditor/main/app/controller/Toolbar.js @@ -43,6 +43,7 @@ define([ 'common/main/lib/component/Window', 'common/main/lib/view/CopyWarningDialog', 'common/main/lib/view/ImageFromUrlDialog', + 'common/main/lib/view/SelectFileDlg', 'common/main/lib/util/define', 'spreadsheeteditor/main/app/view/Toolbar', 'spreadsheeteditor/main/app/collection/TableTemplates', @@ -124,6 +125,7 @@ define([ this.editMode = true; this._isAddingShape = false; this._state = { + activated: false, prstyle: undefined, clrtext: undefined, pralign: undefined, @@ -263,6 +265,7 @@ define([ toolbar.btnClearAutofilter.on('click', _.bind(this.onClearFilter, this)); } else { toolbar.btnPrint.on('click', _.bind(this.onPrint, this)); + toolbar.btnPrint.on('disabled', _.bind(this.onBtnChangeState, this, 'print:disabled')); toolbar.btnSave.on('click', _.bind(this.onSave, this)); toolbar.btnSave.on('disabled', _.bind(this.onBtnChangeState, this, 'save:disabled')); toolbar.btnUndo.on('click', _.bind(this.onUndo, this)); @@ -354,6 +357,8 @@ define([ toolbar.btnPageOrient.menu.on('item:click', _.bind(this.onPageOrientSelect, this)); toolbar.btnPageMargins.menu.on('item:click', _.bind(this.onPageMarginsSelect, this)); toolbar.mnuPageSize.on('item:click', _.bind(this.onPageSizeClick, this)); + toolbar.btnPrintArea.menu.on('item:click', _.bind(this.onPrintAreaClick, this)); + toolbar.btnPrintArea.menu.on('show:after', _.bind(this.onPrintAreaMenuOpen, this)); toolbar.btnImgGroup.menu.on('item:click', _.bind(this.onImgGroupSelect, this)); toolbar.btnImgBackward.menu.on('item:click', _.bind(this.onImgArrangeSelect, this)); toolbar.btnImgForward.menu.on('item:click', _.bind(this.onImgArrangeSelect, this)); @@ -376,7 +381,7 @@ define([ } this.api.asc_registerCallback('asc_onInitEditorStyles', _.bind(this.onApiInitEditorStyles, this)); - this.api.asc_registerCallback('asc_onCoAuthoringDisconnect',_.bind(this.onApiCoAuthoringDisconnect, this, true)); + this.api.asc_registerCallback('asc_onCoAuthoringDisconnect',_.bind(this.onApiCoAuthoringDisconnect, this)); Common.NotificationCenter.on('api:disconnect', _.bind(this.onApiCoAuthoringDisconnect, this)); this.api.asc_registerCallback('asc_onLockDefNameManager', _.bind(this.onLockDefNameManager, this)); this.api.asc_registerCallback('asc_onZoomChanged', _.bind(this.onApiZoomChange, this)); @@ -820,7 +825,7 @@ define([ Common.NotificationCenter.trigger('edit:complete', this.toolbar); Common.component.Analytics.trackEvent('ToolBar', 'Image'); - } else { + } else if (item.value === 'url') { var me = this; (new Common.Views.ImageFromUrlDialog({ @@ -844,6 +849,15 @@ define([ } } })).show(); + } else if (item.value === 'storage') { + var me = this; + (new Common.Views.SelectFileDlg({ + fileChoiceUrl: me.toolbar.mode.fileChoiceUrl.replace("{fileExt}", "").replace("{documentType}", "ImagesOnly") + })).on('selectfile', function(obj, file){ + me.toolbar.fireEvent('insertimage', me.toolbar); + me.api.asc_addImageDrawingObject(file.url); + Common.component.Analytics.trackEvent('ToolBar', 'Image'); + }).show(); } }, @@ -1456,7 +1470,8 @@ define([ e.stopPropagation(); }, 'command+k,ctrl+k': function (e) { - if (me.editMode && !me.toolbar.mode.isEditMailMerge && !me.toolbar.mode.isEditDiagram && !me.api.isCellEdited && !me._state.multiselect && !me._state.inpivot) + if (me.editMode && !me.toolbar.mode.isEditMailMerge && !me.toolbar.mode.isEditDiagram && !me.api.isCellEdited && !me._state.multiselect && !me._state.inpivot && + !me.getApplication().getController('LeftMenu').leftMenu.menuFile.isVisible()) me.onHyperlink(); e.preventDefault(); }, @@ -1612,8 +1627,8 @@ define([ window.styles_loaded = true; }, - onApiCoAuthoringDisconnect: function(disableDownload) { - this.toolbar.setMode({isDisconnected:true, disableDownload: !!disableDownload}); + onApiCoAuthoringDisconnect: function(enableDownload) { + this.toolbar.setMode({isDisconnected:true, enableDownload: !!enableDownload}); this.editMode = false; }, @@ -1702,6 +1717,7 @@ define([ this.onApiPageMargins(props.asc_getPageMargins()); this.api.asc_isLayoutLocked(currentSheet) ? this.onApiLockDocumentProps(currentSheet) : this.onApiUnLockDocumentProps(currentSheet); + this.toolbar.lockToolbar(SSE.enumLock.printAreaLock, this.api.asc_isPrintAreaLocked(currentSheet), {array: [this.toolbar.btnPrintArea]}); }, onUpdateDocumentProps: function(nIndex) { @@ -3026,6 +3042,14 @@ define([ onLockDefNameManager: function(state) { this._state.namedrange_locked = (state == Asc.c_oAscDefinedNameReason.LockDefNameManager); + + this.toolbar.lockToolbar(SSE.enumLock.printAreaLock, this.api.asc_isPrintAreaLocked(this.api.asc_getActiveWorksheetIndex()), {array: [this.toolbar.btnPrintArea]}); + this.toolbar.lockToolbar(SSE.enumLock.namedRangeLock, this._state.namedrange_locked, {array: [this.toolbar.btnPrintArea.menu.items[0], this.toolbar.btnPrintArea.menu.items[2]]}); + }, + + activateControls: function() { + this.toolbar.lockToolbar(SSE.enumLock.disableOnStart, false, {array: [this.toolbar.btnPrint]}); + this._state.activated = true; }, DisableToolbar: function(disable, viewMode) { @@ -3079,6 +3103,7 @@ define([ me.toolbar.btnSave && me.toolbar.btnSave.on('disabled', _.bind(me.onBtnChangeState, me, 'save:disabled')); me.toolbar.btnUndo && me.toolbar.btnUndo.on('disabled', _.bind(me.onBtnChangeState, me, 'undo:disabled')); me.toolbar.btnRedo && me.toolbar.btnRedo.on('disabled', _.bind(me.onBtnChangeState, me, 'redo:disabled')); + me.toolbar.btnPrint && me.toolbar.btnPrint.on('disabled', _.bind(me.onBtnChangeState, me, 'print:disabled')); me.toolbar.setApi(me.api); if ( !config.isEditDiagram && !config.isEditMailMerge ) { @@ -3259,6 +3284,20 @@ define([ Common.component.Analytics.trackEvent('ToolBar', 'Objects Align'); }, + onPrintAreaClick: function(menu, item) { + if (this.api) { + this.api.asc_ChangePrintArea(item.value); + Common.component.Analytics.trackEvent('ToolBar', 'Print Area'); + } + + Common.NotificationCenter.trigger('edit:complete', this.toolbar); + }, + + onPrintAreaMenuOpen: function() { + if (this.api) + this.toolbar.btnPrintArea.menu.items[2].setVisible(this.api.asc_CanAddPrintArea()); + }, + textEmptyImgUrl : 'You need to specify image URL.', warnMergeLostData : 'Operation can destroy data in the selected cells.
    Continue?', textWarning : 'Warning', diff --git a/apps/spreadsheeteditor/main/app/controller/Viewport.js b/apps/spreadsheeteditor/main/app/controller/Viewport.js index ae52f7426..cb7577576 100644 --- a/apps/spreadsheeteditor/main/app/controller/Viewport.js +++ b/apps/spreadsheeteditor/main/app/controller/Viewport.js @@ -104,6 +104,10 @@ define([ else me.header.btnRedo.setDisabled(state); } }, + 'print:disabled' : function (state) { + if ( me.header.btnPrint ) + me.header.btnPrint.setDisabled(state); + }, 'save:disabled' : function (state) { if ( me.header.btnSave ) me.header.btnSave.setDisabled(state); @@ -433,11 +437,11 @@ define([ } }, - onApiCoAuthoringDisconnect: function() { + onApiCoAuthoringDisconnect: function(enableDownload) { if (this.header) { - if (this.header.btnDownload) + if (this.header.btnDownload && !enableDownload) this.header.btnDownload.hide(); - if (this.header.btnPrint) + if (this.header.btnPrint && !enableDownload) this.header.btnPrint.hide(); if (this.header.btnEdit) this.header.btnEdit.hide(); diff --git a/apps/spreadsheeteditor/main/app/template/FileMenu.template b/apps/spreadsheeteditor/main/app/template/FileMenu.template index 5565d15e9..d67b35cfe 100644 --- a/apps/spreadsheeteditor/main/app/template/FileMenu.template +++ b/apps/spreadsheeteditor/main/app/template/FileMenu.template @@ -5,6 +5,7 @@
  • +
  • @@ -24,6 +25,7 @@
    +
    diff --git a/apps/spreadsheeteditor/main/app/template/ImageSettings.template b/apps/spreadsheeteditor/main/app/template/ImageSettings.template index ce4c7e79d..bef0c6502 100644 --- a/apps/spreadsheeteditor/main/app/template/ImageSettings.template +++ b/apps/spreadsheeteditor/main/app/template/ImageSettings.template @@ -29,6 +29,32 @@
    + + + + + + + + +
    +
    +
    +
    + + + +
    +
    +
    +
    + + + + +
    + + diff --git a/apps/spreadsheeteditor/main/app/template/ImageSettingsAdvanced.template b/apps/spreadsheeteditor/main/app/template/ImageSettingsAdvanced.template index cb944530b..fea2f0c20 100644 --- a/apps/spreadsheeteditor/main/app/template/ImageSettingsAdvanced.template +++ b/apps/spreadsheeteditor/main/app/template/ImageSettingsAdvanced.template @@ -1,3 +1,29 @@ +
    +
    +
    + +
    +
    +
    +
    +
    + + + + + + + + +
    + + +
    +
    +
    +
    +
    +
    diff --git a/apps/spreadsheeteditor/main/app/template/ShapeSettings.template b/apps/spreadsheeteditor/main/app/template/ShapeSettings.template index f86e7770a..f97d33753 100644 --- a/apps/spreadsheeteditor/main/app/template/ShapeSettings.template +++ b/apps/spreadsheeteditor/main/app/template/ShapeSettings.template @@ -116,6 +116,38 @@ + + + + + + + + +
    +
    +
    + +
    + + + + + +
    + +
    +
    +
    +
    +
    + +
    +
    +
    +
    +
    +
    diff --git a/apps/spreadsheeteditor/main/app/template/ShapeSettingsAdvanced.template b/apps/spreadsheeteditor/main/app/template/ShapeSettingsAdvanced.template index 2ae9bfa02..8ed314425 100644 --- a/apps/spreadsheeteditor/main/app/template/ShapeSettingsAdvanced.template +++ b/apps/spreadsheeteditor/main/app/template/ShapeSettingsAdvanced.template @@ -17,6 +17,32 @@
    +
    +
    +
    + +
    +
    +
    +
    +
    + + + + + + + + +
    + + +
    +
    +
    +
    +
    +
    diff --git a/apps/spreadsheeteditor/main/app/template/Toolbar.template b/apps/spreadsheeteditor/main/app/template/Toolbar.template index 708cb7936..d6054321a 100644 --- a/apps/spreadsheeteditor/main/app/template/Toolbar.template +++ b/apps/spreadsheeteditor/main/app/template/Toolbar.template @@ -141,6 +141,7 @@ +
    diff --git a/apps/spreadsheeteditor/main/app/view/CellRangeDialog.js b/apps/spreadsheeteditor/main/app/view/CellRangeDialog.js index 8fd7f5347..0f38550f1 100644 --- a/apps/spreadsheeteditor/main/app/view/CellRangeDialog.js +++ b/apps/spreadsheeteditor/main/app/view/CellRangeDialog.js @@ -90,7 +90,6 @@ define([ }); $window.find('.dlg-btn').on('click', _.bind(this.onBtnClick, this)); - me.inputRange.cmpEl.find('input').on('keypress', _.bind(this.onKeyPress, this)); this.on('close', _.bind(this.onClose, this)); @@ -153,12 +152,6 @@ define([ SSE.getController('RightMenu').SetDisabled(false); }, - onKeyPress: function(event) { - if (event.keyCode == Common.UI.Keys.RETURN) { - this._handleInput('ok'); - } - }, - _handleInput: function(state) { if (this.options.handler) { if (state == 'ok') { diff --git a/apps/spreadsheeteditor/main/app/view/FileMenu.js b/apps/spreadsheeteditor/main/app/view/FileMenu.js index 39e89b655..51335b2fc 100644 --- a/apps/spreadsheeteditor/main/app/view/FileMenu.js +++ b/apps/spreadsheeteditor/main/app/view/FileMenu.js @@ -96,6 +96,13 @@ define([ canFocused: false }); + this.miSaveCopyAs = new Common.UI.MenuItem({ + el : $('#fm-btn-save-copy',this.el), + action : 'save-copy', + caption : this.btnSaveCopyAsCaption, + canFocused: false + }); + this.miSaveAs = new Common.UI.MenuItem({ el : $('#fm-btn-save-desktop',this.el), action : 'save-desktop', @@ -170,6 +177,7 @@ define([ this.miSave, this.miEdit, this.miDownload, + this.miSaveCopyAs, this.miSaveAs, this.miPrint, this.miRename, @@ -196,6 +204,7 @@ define([ var me = this; me.panels = { 'saveas' : (new SSE.Views.FileMenuPanels.ViewSaveAs({menu:me})).render(), + 'save-copy' : (new SSE.Views.FileMenuPanels.ViewSaveCopy({menu:me})).render(), 'opts' : (new SSE.Views.FileMenuPanels.Settings({menu:me})).render(), 'info' : (new SSE.Views.FileMenuPanels.DocumentInfo({menu:me})).render(), 'rights' : (new SSE.Views.FileMenuPanels.DocumentRights({menu:me})).render() @@ -236,6 +245,7 @@ define([ this.miNew.$el.find('+.devider')[this.mode.canCreateNew?'show':'hide'](); this.miDownload[(this.mode.canDownload && (!this.mode.isDesktopApp || !this.mode.isOffline))?'show':'hide'](); + this.miSaveCopyAs[((this.mode.canDownload || this.mode.canDownloadOrigin) && (!this.mode.isDesktopApp || !this.mode.isOffline)) && this.mode.saveAsUrl ?'show':'hide'](); this.miSaveAs[(this.mode.canDownload && this.mode.isDesktopApp && this.mode.isOffline)?'show':'hide'](); // this.hkSaveAs[this.mode.canDownload?'enable':'disable'](); @@ -288,8 +298,8 @@ define([ this.mode.canOpenRecent = this.mode.canCreateNew = false; this.mode.isDisconnected = mode.isDisconnected; this.mode.canRename = false; - this.mode.canPrint = false; - this.mode.canDownload = false; + if (!mode.enableDownload) + this.mode.canPrint = this.mode.canDownload = false; } else { this.mode = mode; } @@ -363,6 +373,7 @@ define([ btnSaveAsCaption : 'Save as', btnRenameCaption : 'Rename...', btnCloseMenuCaption : 'Close Menu', - btnProtectCaption: 'Protect' + btnProtectCaption: 'Protect', + btnSaveCopyAsCaption : 'Save Copy as...' }, SSE.Views.FileMenu || {})); }); diff --git a/apps/spreadsheeteditor/main/app/view/FileMenuPanels.js b/apps/spreadsheeteditor/main/app/view/FileMenuPanels.js index 31b9a8e72..4e9b5d1a1 100644 --- a/apps/spreadsheeteditor/main/app/view/FileMenuPanels.js +++ b/apps/spreadsheeteditor/main/app/view/FileMenuPanels.js @@ -43,8 +43,8 @@ define([ formats: [[ {name: 'XLSX', imgCls: 'xlsx', type: Asc.c_oAscFileType.XLSX}, - {name: 'PDF', imgCls: 'pdf', type: Asc.c_oAscFileType.PDF} - // {name: 'PDFA', imgCls: 'pdfa', type: Asc.c_oAscFileType.PDFA} + {name: 'PDF', imgCls: 'pdf', type: Asc.c_oAscFileType.PDF}, + {name: 'PDFA', imgCls: 'pdfa', type: Asc.c_oAscFileType.PDFA} ],[ {name: 'ODS', imgCls: 'ods', type: Asc.c_oAscFileType.ODS}, {name: 'CSV', imgCls: 'csv', type: Asc.c_oAscFileType.CSV} @@ -97,6 +97,66 @@ define([ } }); + SSE.Views.FileMenuPanels.ViewSaveCopy = Common.UI.BaseView.extend({ + el: '#panel-savecopy', + menu: undefined, + + formats: [[ + {name: 'XLSX', imgCls: 'xlsx', type: Asc.c_oAscFileType.XLSX, ext: '.xlsx'}, + {name: 'PDF', imgCls: 'pdf', type: Asc.c_oAscFileType.PDF, ext: '.pdf'}, + {name: 'PDFA', imgCls: 'pdfa', type: Asc.c_oAscFileType.PDFA, ext: '.pdf'} + ],[ + {name: 'ODS', imgCls: 'ods', type: Asc.c_oAscFileType.ODS, ext: '.ods'}, + {name: 'CSV', imgCls: 'csv', type: Asc.c_oAscFileType.CSV, ext: '.csv'} + ] +// ,[ +// {name: 'HTML', imgCls: 'html', type: Asc.c_oAscFileType.HTML, ext: '.html'} +// ] + ], + + template: _.template([ + '
    ', + '<% _.each(rows, function(row) { %>', + '', + '<% _.each(row, function(item) { %>', + '', + '<% }) %>', + '', + '<% }) %>', + '
    ', + '', + '
    ' + ].join('')), + + initialize: function(options) { + Common.UI.BaseView.prototype.initialize.call(this,arguments); + + this.menu = options.menu; + }, + + render: function() { + $(this.el).html(this.template({rows:this.formats})); + $('.btn-doc-format',this.el).on('click', _.bind(this.onFormatClick,this)); + + if (_.isUndefined(this.scroller)) { + this.scroller = new Common.UI.Scroller({ + el: $(this.el), + suppressScrollX: true + }); + } + + return this; + }, + + onFormatClick: function(e) { + var type = e.currentTarget.attributes['format'], + ext = e.currentTarget.attributes['format-ext']; + if (!_.isUndefined(type) && !_.isUndefined(ext) && this.menu) { + this.menu.fireEvent('savecopy:format', [this.menu, parseInt(type.value), ext.value]); + } + } + }); + SSE.Views.FileMenuPanels.Settings = Common.UI.BaseView.extend(_.extend({ el: '#panel-settings', menu: undefined, diff --git a/apps/spreadsheeteditor/main/app/view/HyperlinkSettingsDialog.js b/apps/spreadsheeteditor/main/app/view/HyperlinkSettingsDialog.js index 8fb87634e..eae907f2f 100644 --- a/apps/spreadsheeteditor/main/app/view/HyperlinkSettingsDialog.js +++ b/apps/spreadsheeteditor/main/app/view/HyperlinkSettingsDialog.js @@ -182,7 +182,6 @@ define([ }); $window.find('.dlg-btn').on('click', _.bind(this.onBtnClick, this)); - $window.find('input').on('keypress', _.bind(this.onKeyPress, this)); me.externalPanel = $window.find('#id-external-link'); me.internalPanel = $window.find('#id-internal-link'); @@ -265,11 +264,9 @@ define([ this._handleInput(event.currentTarget.attributes['result'].value); }, - onKeyPress: function(event) { - if (event.keyCode == Common.UI.Keys.RETURN) { - this._handleInput('ok'); - return false; - } + onPrimary: function(event) { + this._handleInput('ok'); + return false; }, _handleInput: function(state) { diff --git a/apps/spreadsheeteditor/main/app/view/ImageSettings.js b/apps/spreadsheeteditor/main/app/view/ImageSettings.js index cb61b7d20..266f160f8 100644 --- a/apps/spreadsheeteditor/main/app/view/ImageSettings.js +++ b/apps/spreadsheeteditor/main/app/view/ImageSettings.js @@ -195,6 +195,46 @@ define([ this.lblReplace = $('#image-lbl-replace'); + this.btnRotate270 = new Common.UI.Button({ + cls: 'btn-toolbar', + iconCls: 'rotate-270', + value: 0, + hint: this.textHint270 + }); + this.btnRotate270.render( $('#image-button-270', me.$el)); + this.btnRotate270.on('click', _.bind(this.onBtnRotateClick, this)); + this.lockedControls.push(this.btnRotate270); + + this.btnRotate90 = new Common.UI.Button({ + cls: 'btn-toolbar', + iconCls: 'rotate-90', + value: 1, + hint: this.textHint90 + }); + this.btnRotate90.render( $('#image-button-90', me.$el)); + this.btnRotate90.on('click', _.bind(this.onBtnRotateClick, this)); + this.lockedControls.push(this.btnRotate90); + + this.btnFlipV = new Common.UI.Button({ + cls: 'btn-toolbar', + iconCls: 'flip-vert', + value: 0, + hint: this.textHintFlipV + }); + this.btnFlipV.render( $('#image-button-flipv', me.$el)); + this.btnFlipV.on('click', _.bind(this.onBtnFlipClick, this)); + this.lockedControls.push(this.btnFlipV); + + this.btnFlipH = new Common.UI.Button({ + cls: 'btn-toolbar', + iconCls: 'flip-hor', + value: 1, + hint: this.textHintFlipH + }); + this.btnFlipH.render( $('#image-button-fliph', me.$el)); + this.btnFlipH.on('click', _.bind(this.onBtnFlipClick, this)); + this.lockedControls.push(this.btnFlipH); + $(this.el).on('click', '#image-advanced-link', _.bind(this.openAdvancedSettings, this)); }, @@ -366,6 +406,23 @@ define([ })).show(); }, + onBtnRotateClick: function(btn) { + var properties = new Asc.asc_CImgProperty(); + properties.asc_putRot((btn.options.value==1 ? 90 : 270) * 3.14159265358979 / 180); + this.api.asc_setGraphicObjectProps(properties); + Common.NotificationCenter.trigger('edit:complete', this); + }, + + onBtnFlipClick: function(btn) { + var properties = new Asc.asc_CImgProperty(); + if (btn.options.value==1) + properties.asc_putFlipH(true); + else + properties.asc_putFlipV(true); + this.api.asc_setGraphicObjectProps(properties); + Common.NotificationCenter.trigger('edit:complete', this); + }, + setLocked: function (locked) { this._locked = locked; }, @@ -392,6 +449,13 @@ define([ textFromFile: 'From File', textEditObject: 'Edit Object', textEdit: 'Edit', - textAdvanced: 'Show advanced settings' + textAdvanced: 'Show advanced settings', + textRotation: 'Rotation', + textRotate90: 'Rotate 90°', + textFlip: 'Flip', + textHint270: 'Rotate Left 90°', + textHint90: 'Rotate Right 90°', + textHintFlipV: 'Flip Vertical', + textHintFlipH: 'Flip Horizontal' }, SSE.Views.ImageSettings || {})); }); \ No newline at end of file diff --git a/apps/spreadsheeteditor/main/app/view/ImageSettingsAdvanced.js b/apps/spreadsheeteditor/main/app/view/ImageSettingsAdvanced.js index 74f43448a..b4bb98e96 100644 --- a/apps/spreadsheeteditor/main/app/view/ImageSettingsAdvanced.js +++ b/apps/spreadsheeteditor/main/app/view/ImageSettingsAdvanced.js @@ -40,7 +40,9 @@ define([ 'text!spreadsheeteditor/main/app/template/ImageSettingsAdvanced.template', 'common/main/lib/view/AdvancedSettingsWindow', - 'common/main/lib/component/InputField' + 'common/main/lib/component/InputField', + 'common/main/lib/component/MetricSpinner', + 'common/main/lib/component/CheckBox' ], function (contentTemplate) { 'use strict'; @@ -57,6 +59,7 @@ define([ 'text!spreadsheeteditor/main/app/template/ImageSettingsAdvanced.temp _.extend(this.options, { title: this.textTitle, items: [ + {panelId: 'id-adv-image-rotate', panelCaption: this.textRotation}, {panelId: 'id-adv-image-alttext', panelCaption: this.textAlt} ], contentTemplate: _.template(contentTemplate)({ @@ -74,6 +77,27 @@ define([ 'text!spreadsheeteditor/main/app/template/ImageSettingsAdvanced.temp var me = this; + // Rotation + this.spnAngle = new Common.UI.MetricSpinner({ + el: $('#image-advanced-spin-angle'), + step: 1, + width: 80, + defaultUnit : "°", + value: '0 °', + maxValue: 3600, + minValue: -3600 + }); + + this.chFlipHor = new Common.UI.CheckBox({ + el: $('#image-advanced-checkbox-hor'), + labelText: this.textHorizontally + }); + + this.chFlipVert = new Common.UI.CheckBox({ + el: $('#image-advanced-checkbox-vert'), + labelText: this.textVertically + }); + // Alt Text this.inputAltTitle = new Common.UI.InputField({ @@ -112,6 +136,11 @@ define([ 'text!spreadsheeteditor/main/app/template/ImageSettingsAdvanced.temp value = props.asc_getDescription(); this.textareaAltDescription.val(value ? value : ''); + value = props.asc_getRot(); + this.spnAngle.setValue((value==undefined || value===null) ? '' : Math.floor(value*180/3.14159265358979+0.5), true); + this.chFlipHor.setValue(props.asc_getFlipH()); + this.chFlipVert.setValue(props.asc_getFlipV()); + this._changedProps = new Asc.asc_CImgProperty(); } }, @@ -123,6 +152,10 @@ define([ 'text!spreadsheeteditor/main/app/template/ImageSettingsAdvanced.temp if (this.isAltDescChanged) this._changedProps.asc_putDescription(this.textareaAltDescription.val()); + this._changedProps.asc_putRot(this.spnAngle.getNumberValue() * 3.14159265358979 / 180); + this._changedProps.asc_putFlipH(this.chFlipHor.getValue()=='checked'); + this._changedProps.asc_putFlipV(this.chFlipVert.getValue()=='checked'); + return { imageProps: this._changedProps} ; }, @@ -132,7 +165,12 @@ define([ 'text!spreadsheeteditor/main/app/template/ImageSettingsAdvanced.temp textAlt: 'Alternative Text', textAltTitle: 'Title', textAltDescription: 'Description', - textAltTip: 'The alternative text-based representation of the visual object information, which will be read to the people with vision or cognitive impairments to help them better understand what information there is in the image, autoshape, chart or table.' + textAltTip: 'The alternative text-based representation of the visual object information, which will be read to the people with vision or cognitive impairments to help them better understand what information there is in the image, autoshape, chart or table.', + textRotation: 'Rotation', + textAngle: 'Angle', + textFlipped: 'Flipped', + textHorizontally: 'Horizontally', + textVertically: 'Vertically' }, SSE.Views.ImageSettingsAdvanced || {})); }); \ No newline at end of file diff --git a/apps/spreadsheeteditor/main/app/view/NamedRangeEditDlg.js b/apps/spreadsheeteditor/main/app/view/NamedRangeEditDlg.js index 5fe5fef46..8156f089e 100644 --- a/apps/spreadsheeteditor/main/app/view/NamedRangeEditDlg.js +++ b/apps/spreadsheeteditor/main/app/view/NamedRangeEditDlg.js @@ -145,12 +145,7 @@ define([ } } } - }).on('keypress:after', function(input, e) { - if (e.keyCode === Common.UI.Keys.RETURN) { - me.onDlgBtnClick('ok'); - } - } - ); + }); this.cmbScope = new Common.UI.ComboBox({ el : $('#named-range-combo-scope'), @@ -175,12 +170,7 @@ define([ var isvalid = me.api.asc_checkDataRange(Asc.c_oAscSelectionDialogType.Chart, value, false); return (isvalid!==Asc.c_oAscError.ID.DataRangeError || (me.isEdit && me.props.asc_getRef().toLowerCase() == value.toLowerCase())) ? true : me.textInvalidRange; } - }).on('keypress:after', function(input, e) { - if (e.keyCode === Common.UI.Keys.RETURN) { - me.onDlgBtnClick('ok'); - } - } - ); + }); this.btnSelectData = new Common.UI.Button({ el: $('#named-range-btn-data') @@ -262,7 +252,8 @@ define([ }, onPrimary: function() { - return true; + this.onDlgBtnClick('ok'); + return false; }, onDlgBtnClick: function(event) { diff --git a/apps/spreadsheeteditor/main/app/view/RightMenu.js b/apps/spreadsheeteditor/main/app/view/RightMenu.js index 8ab5db088..e05aa3c82 100644 --- a/apps/spreadsheeteditor/main/app/view/RightMenu.js +++ b/apps/spreadsheeteditor/main/app/view/RightMenu.js @@ -161,7 +161,8 @@ define([ this.trigger('render:before', this); - var open = !Common.localStorage.getBool("sse-hide-right-settings"); + this.defaultHideRightMenu = mode.customization && !!mode.customization.hideRightMenu; + var open = !Common.localStorage.getBool("sse-hide-right-settings", this.defaultHideRightMenu); el.css('width', ((open) ? MENU_SCALE_PART : SCALE_MIN) + 'px'); el.css('z-index', 101); el.show(); diff --git a/apps/spreadsheeteditor/main/app/view/ShapeSettings.js b/apps/spreadsheeteditor/main/app/view/ShapeSettings.js index ecc89e8a8..44162897e 100644 --- a/apps/spreadsheeteditor/main/app/view/ShapeSettings.js +++ b/apps/spreadsheeteditor/main/app/view/ShapeSettings.js @@ -1314,6 +1314,46 @@ define([ this.btnChangeShape.render( $('#shape-btn-change')) ; this.lockedControls.push(this.btnChangeShape); + this.btnRotate270 = new Common.UI.Button({ + cls: 'btn-toolbar', + iconCls: 'rotate-270', + value: 0, + hint: this.textHint270 + }); + this.btnRotate270.render( $('#shape-button-270', me.$el)); + this.btnRotate270.on('click', _.bind(this.onBtnRotateClick, this)); + this.lockedControls.push(this.btnRotate270); + + this.btnRotate90 = new Common.UI.Button({ + cls: 'btn-toolbar', + iconCls: 'rotate-90', + value: 1, + hint: this.textHint90 + }); + this.btnRotate90.render( $('#shape-button-90', me.$el)); + this.btnRotate90.on('click', _.bind(this.onBtnRotateClick, this)); + this.lockedControls.push(this.btnRotate90); + + this.btnFlipV = new Common.UI.Button({ + cls: 'btn-toolbar', + iconCls: 'flip-vert', + value: 0, + hint: this.textHintFlipV + }); + this.btnFlipV.render( $('#shape-button-flipv', me.$el)); + this.btnFlipV.on('click', _.bind(this.onBtnFlipClick, this)); + this.lockedControls.push(this.btnFlipV); + + this.btnFlipH = new Common.UI.Button({ + cls: 'btn-toolbar', + iconCls: 'flip-hor', + value: 1, + hint: this.textHintFlipH + }); + this.btnFlipH.render( $('#shape-button-fliph', me.$el)); + this.btnFlipH.on('click', _.bind(this.onBtnFlipClick, this)); + this.lockedControls.push(this.btnFlipH); + $(this.el).on('click', '#shape-advanced-link', _.bind(this.openAdvancedSettings, this)); this.linkAdvanced = $('#shape-advanced-link'); }, @@ -1463,6 +1503,25 @@ define([ } }, + onBtnRotateClick: function(btn) { + var props = new Asc.asc_CShapeProperty(); + props.asc_putRot((btn.options.value==1 ? 90 : 270) * 3.14159265358979 / 180); + this.imgprops.asc_putShapeProperties(props); + this.api.asc_setGraphicObjectProps(this.imgprops); + Common.NotificationCenter.trigger('edit:complete', this); + }, + + onBtnFlipClick: function(btn) { + var props = new Asc.asc_CShapeProperty(); + if (btn.options.value==1) + props.asc_putFlipH(true); + else + props.asc_putFlipV(true); + this.imgprops.asc_putShapeProperties(props); + this.api.asc_setGraphicObjectProps(this.imgprops); + Common.NotificationCenter.trigger('edit:complete', this); + }, + UpdateThemeColors: function() { if (!this.btnBackColor) { this.btnBackColor = new Common.UI.ColorButton({ @@ -1668,6 +1727,13 @@ define([ textStyle: 'Style', textGradient: 'Gradient', textBorderSizeErr: 'The entered value is incorrect.
    Please enter a value between 0 pt and 1584 pt.', - strType: 'Type' + strType: 'Type', + textRotation: 'Rotation', + textRotate90: 'Rotate 90°', + textFlip: 'Flip', + textHint270: 'Rotate Left 90°', + textHint90: 'Rotate Right 90°', + textHintFlipV: 'Flip Vertical', + textHintFlipH: 'Flip Horizontal' }, SSE.Views.ShapeSettings || {})); }); diff --git a/apps/spreadsheeteditor/main/app/view/ShapeSettingsAdvanced.js b/apps/spreadsheeteditor/main/app/view/ShapeSettingsAdvanced.js index b06b78d65..2d8ab3521 100644 --- a/apps/spreadsheeteditor/main/app/view/ShapeSettingsAdvanced.js +++ b/apps/spreadsheeteditor/main/app/view/ShapeSettingsAdvanced.js @@ -41,7 +41,8 @@ define([ 'text!spreadsheeteditor/main/app/template/ShapeSettingsAdvanced.template', 'common/main/lib/view/AdvancedSettingsWindow', 'common/main/lib/component/ComboBox', - 'common/main/lib/component/MetricSpinner' + 'common/main/lib/component/MetricSpinner', + 'common/main/lib/component/CheckBox' ], function (contentTemplate) { 'use strict'; @@ -61,6 +62,7 @@ define([ 'text!spreadsheeteditor/main/app/template/ShapeSettingsAdvanced.temp title: this.textTitle, items: [ {panelId: 'id-adv-shape-width', panelCaption: this.textSize}, + {panelId: 'id-adv-shape-rotate', panelCaption: this.textRotation}, {panelId: 'id-adv-shape-shape', panelCaption: this.textWeightArrows}, {panelId: 'id-adv-shape-margins', panelCaption: this.strMargins}, {panelId: 'id-adv-shape-columns', panelCaption: this.strColumns}, @@ -246,6 +248,27 @@ define([ 'text!spreadsheeteditor/main/app/template/ShapeSettingsAdvanced.temp }, this)); this.spinners.push(this.spnMarginRight); + // Rotation + this.spnAngle = new Common.UI.MetricSpinner({ + el: $('#shape-advanced-spin-angle'), + step: 1, + width: 80, + defaultUnit : "°", + value: '0 °', + maxValue: 3600, + minValue: -3600 + }); + + this.chFlipHor = new Common.UI.CheckBox({ + el: $('#shape-advanced-checkbox-hor'), + labelText: this.textHorizontally + }); + + this.chFlipVert = new Common.UI.CheckBox({ + el: $('#shape-advanced-checkbox-vert'), + labelText: this.textVertically + }); + // Shape this._arrCapType = [ {displayValue: this.textFlat, value: Asc.c_oAscLineCapType.Flat}, @@ -533,10 +556,10 @@ define([ 'text!spreadsheeteditor/main/app/template/ShapeSettingsAdvanced.temp val = margins.asc_getBottom(); this.spnMarginBottom.setValue((null !== val && undefined !== val) ? Common.Utils.Metric.fnRecalcFromMM(val) : '', true); } - this.btnsCategory[2].setDisabled(null === margins); // Margins + this.btnsCategory[3].setDisabled(null === margins); // Margins var shapetype = shapeprops.asc_getType(); - this.btnsCategory[3].setDisabled(shapetype=='line' || shapetype=='bentConnector2' || shapetype=='bentConnector3' + this.btnsCategory[4].setDisabled(shapetype=='line' || shapetype=='bentConnector2' || shapetype=='bentConnector3' || shapetype=='bentConnector4' || shapetype=='bentConnector5' || shapetype=='curvedConnector2' || shapetype=='curvedConnector3' || shapetype=='curvedConnector4' || shapetype=='curvedConnector5' || shapetype=='straightConnector1'); @@ -553,6 +576,11 @@ define([ 'text!spreadsheeteditor/main/app/template/ShapeSettingsAdvanced.temp value = props.asc_getDescription(); this.textareaAltDescription.val(value ? value : ''); + value = props.asc_getRot(); + this.spnAngle.setValue((value==undefined || value===null) ? '' : Math.floor(value*180/3.14159265358979+0.5), true); + this.chFlipHor.setValue(props.asc_getFlipH()); + this.chFlipVert.setValue(props.asc_getFlipV()); + this._changedProps = new Asc.asc_CImgProperty(); } }, @@ -564,6 +592,10 @@ define([ 'text!spreadsheeteditor/main/app/template/ShapeSettingsAdvanced.temp if (this.isAltDescChanged) this._changedProps.asc_putDescription(this.textareaAltDescription.val()); + this._changedProps.asc_putRot(this.spnAngle.getNumberValue() * 3.14159265358979 / 180); + this._changedProps.asc_putFlipH(this.chFlipHor.getValue()=='checked'); + this._changedProps.asc_putFlipV(this.chFlipVert.getValue()=='checked'); + return { shapeProps: this._changedProps} ; }, @@ -571,7 +603,7 @@ define([ 'text!spreadsheeteditor/main/app/template/ShapeSettingsAdvanced.temp if (props ){ var stroke = props.asc_getStroke(); if (stroke) { - this.btnsCategory[1].setDisabled(stroke.asc_getType() == Asc.c_oAscStrokeType.STROKE_NONE); // Weights & Arrows + this.btnsCategory[2].setDisabled(stroke.asc_getType() == Asc.c_oAscStrokeType.STROKE_NONE); // Weights & Arrows var value = stroke.asc_getLinejoin(); for (var i=0; i-1); } me.setTab('home'); @@ -1630,6 +1664,7 @@ define([ _injectComponent('#slot-btn-pageorient', this.btnPageOrient); _injectComponent('#slot-btn-pagemargins', this.btnPageMargins); _injectComponent('#slot-btn-pagesize', this.btnPageSize); + _injectComponent('#slot-btn-printarea', this.btnPrintArea); _injectComponent('#slot-img-align', this.btnImgAlign); _injectComponent('#slot-img-group', this.btnImgGroup); _injectComponent('#slot-img-movefrwd', this.btnImgForward); @@ -1706,6 +1741,7 @@ define([ _updateHint(this.btnPageOrient, this.tipPageOrient); _updateHint(this.btnPageSize, this.tipPageSize); _updateHint(this.btnPageMargins, this.tipPageMargins); + _updateHint(this.btnPrintArea, this.tipPrintArea); // set menus if (this.btnBorders && this.btnBorders.rendered) { @@ -1971,7 +2007,8 @@ define([ this.lockToolbar( SSE.enumLock.lostConnect, true ); this.lockToolbar( SSE.enumLock.lostConnect, true, {array:[this.btnEditChart,this.btnUndo,this.btnRedo]} ); - this.lockToolbar(SSE.enumLock.cantPrint, !mode.canPrint || mode.disableDownload, {array: [this.btnPrint]}); + if (!mode.enableDownload) + this.lockToolbar(SSE.enumLock.cantPrint, true, {array: [this.btnPrint]}); } else { this.mode = mode; this.lockToolbar(SSE.enumLock.cantPrint, !mode.canPrint, {array: [this.btnPrint]}); @@ -2409,6 +2446,12 @@ define([ textBottom: 'Bottom: ', textRight: 'Right: ', textPortrait: 'Portrait', - textLandscape: 'Landscape' + textLandscape: 'Landscape', + mniImageFromStorage: 'Image from Storage', + capBtnPrintArea: 'Print Area', + textSetPrintArea: 'Set Print Area', + textClearPrintArea: 'Clear Print Area', + textAddPrintArea: 'Add to Print Area', + tipPrintArea: 'Print Area' }, SSE.Views.Toolbar || {})); }); \ No newline at end of file diff --git a/apps/spreadsheeteditor/main/locale/en.json b/apps/spreadsheeteditor/main/locale/en.json index 9ab098eaa..df12d9013 100644 --- a/apps/spreadsheeteditor/main/locale/en.json +++ b/apps/spreadsheeteditor/main/locale/en.json @@ -192,6 +192,10 @@ "Common.Views.ReviewPopover.textOpenAgain": "Open Again", "Common.Views.ReviewPopover.textReply": "Reply", "Common.Views.ReviewPopover.textResolve": "Resolve", + "Common.Views.SaveAsDlg.textLoading": "Loading", + "Common.Views.SaveAsDlg.textTitle": "Folder for save", + "Common.Views.SelectFileDlg.textLoading": "Loading", + "Common.Views.SelectFileDlg.textTitle": "Select Data Source", "Common.Views.SignDialog.cancelButtonText": "Cancel", "Common.Views.SignDialog.okButtonText": "Ok", "Common.Views.SignDialog.textBold": "Bold", @@ -379,6 +383,7 @@ "SSE.Controllers.LeftMenu.textWithin": "Within", "SSE.Controllers.LeftMenu.textWorkbook": "Workbook", "SSE.Controllers.LeftMenu.warnDownloadAs": "If you continue saving in this format all features except the text will be lost.
    Are you sure you want to continue?", + "SSE.Controllers.LeftMenu.txtUntitled": "Untitled", "SSE.Controllers.Main.confirmMoveCellRange": "The destination cell range can contain data. Continue the operation?", "SSE.Controllers.Main.confirmPutMergeRange": "The source data contained merged cells.
    They had been unmerged before they were pasted into the table.", "SSE.Controllers.Main.convertationTimeoutText": "Conversion timeout exceeded.", @@ -440,6 +445,8 @@ "SSE.Controllers.Main.errorViewerDisconnect": "Connection is lost. You can still view the document,
    but will not be able to download or print until the connection is restored.", "SSE.Controllers.Main.errorWrongBracketsCount": "An error in the entered formula.
    Wrong number of brackets is used.", "SSE.Controllers.Main.errorWrongOperator": "An error in the entered formula. Wrong operator is used.
    Please correct the error.", + "SSE.Controllers.Main.errorEditingSaveas": "An error occurred during the work with the document.
    Use the 'Save as...' option to save the file backup copy to your computer hard drive.", + "SSE.Controllers.Main.errorEditingDownloadas": "An error occurred during the work with the document.
    Use the 'Download as...' option to save the file backup copy to your computer hard drive.", "SSE.Controllers.Main.leavePageText": "You have unsaved changes in this spreadsheet. Click 'Stay on this Page' then 'Save' to save them. Click 'Leave this Page' to discard all the unsaved changes.", "SSE.Controllers.Main.loadFontsTextText": "Loading data...", "SSE.Controllers.Main.loadFontsTitleText": "Loading Data", @@ -1271,6 +1278,7 @@ "SSE.Views.FileMenu.btnSaveCaption": "Save", "SSE.Views.FileMenu.btnSettingsCaption": "Advanced Settings...", "SSE.Views.FileMenu.btnToEditCaption": "Edit Spreadsheet", + "SSE.Views.FileMenu.btnSaveCopyAsCaption": "Save Copy as...", "SSE.Views.FileMenuPanels.CreateNew.fromBlankText": "From Blank", "SSE.Views.FileMenuPanels.CreateNew.fromTemplateText": "From Template", "SSE.Views.FileMenuPanels.CreateNew.newDescriptionText": "Create a new blank spreadsheet which you will be able to style and format after it is created during the editing. Or choose one of the templates to start a spreadsheet of a certain type or purpose where some styles have already been pre-applied.", @@ -1399,6 +1407,13 @@ "SSE.Views.ImageSettings.textOriginalSize": "Default Size", "SSE.Views.ImageSettings.textSize": "Size", "SSE.Views.ImageSettings.textWidth": "Width", + "SSE.Views.ImageSettings.textRotation": "Rotation", + "SSE.Views.ImageSettings.textRotate90": "Rotate 90°", + "SSE.Views.ImageSettings.textFlip": "Flip", + "SSE.Views.ImageSettings.textHint270": "Rotate Left 90°", + "SSE.Views.ImageSettings.textHint90": "Rotate Right 90°", + "SSE.Views.ImageSettings.textHintFlipV": "Flip Vertical", + "SSE.Views.ImageSettings.textHintFlipH": "Flip Horizontal", "SSE.Views.ImageSettingsAdvanced.cancelButtonText": "Cancel", "SSE.Views.ImageSettingsAdvanced.okButtonText": "Ok", "SSE.Views.ImageSettingsAdvanced.textAlt": "Alternative Text", @@ -1406,6 +1421,11 @@ "SSE.Views.ImageSettingsAdvanced.textAltTip": "The alternative text-based representation of the visual object information, which will be read to the people with vision or cognitive impairments to help them better understand what information there is in the image, autoshape, chart or table.", "SSE.Views.ImageSettingsAdvanced.textAltTitle": "Title", "SSE.Views.ImageSettingsAdvanced.textTitle": "Image - Advanced Settings", + "SSE.Views.ImageSettingsAdvanced.textRotation": "Rotation", + "SSE.Views.ImageSettingsAdvanced.textAngle": "Angle", + "SSE.Views.ImageSettingsAdvanced.textFlipped": "Flipped", + "SSE.Views.ImageSettingsAdvanced.textHorizontally": "Horizontally", + "SSE.Views.ImageSettingsAdvanced.textVertically": "Vertically", "SSE.Views.LeftMenu.tipAbout": "About", "SSE.Views.LeftMenu.tipChat": "Chat", "SSE.Views.LeftMenu.tipComments": "Comments", @@ -1665,6 +1685,13 @@ "SSE.Views.ShapeSettings.txtNoBorders": "No Line", "SSE.Views.ShapeSettings.txtPapyrus": "Papyrus", "SSE.Views.ShapeSettings.txtWood": "Wood", + "SSE.Views.ShapeSettings.textRotation": "Rotation", + "SSE.Views.ShapeSettings.textRotate90": "Rotate 90°", + "SSE.Views.ShapeSettings.textFlip": "Flip", + "SSE.Views.ShapeSettings.textHint270": "Rotate Left 90°", + "SSE.Views.ShapeSettings.textHint90": "Rotate Right 90°", + "SSE.Views.ShapeSettings.textHintFlipV": "Flip Vertical", + "SSE.Views.ShapeSettings.textHintFlipH": "Flip Horizontal", "SSE.Views.ShapeSettingsAdvanced.cancelButtonText": "Cancel", "SSE.Views.ShapeSettingsAdvanced.okButtonText": "OK", "SSE.Views.ShapeSettingsAdvanced.strColumns": "Columns", @@ -1698,6 +1725,11 @@ "SSE.Views.ShapeSettingsAdvanced.textTop": "Top", "SSE.Views.ShapeSettingsAdvanced.textWeightArrows": "Weights & Arrows", "SSE.Views.ShapeSettingsAdvanced.textWidth": "Width", + "SSE.Views.ShapeSettingsAdvanced.textRotation": "Rotation", + "SSE.Views.ShapeSettingsAdvanced.textAngle": "Angle", + "SSE.Views.ShapeSettingsAdvanced.textFlipped": "Flipped", + "SSE.Views.ShapeSettingsAdvanced.textHorizontally": "Horizontally", + "SSE.Views.ShapeSettingsAdvanced.textVertically": "Vertically", "SSE.Views.SignatureSettings.notcriticalErrorTitle": "Warning", "SSE.Views.SignatureSettings.strDelete": "Remove Signature", "SSE.Views.SignatureSettings.strDetails": "Signature Details", @@ -2054,6 +2086,12 @@ "SSE.Views.Toolbar.txtTime": "Time", "SSE.Views.Toolbar.txtUnmerge": "Unmerge Cells", "SSE.Views.Toolbar.txtYen": "¥ Yen", + "SSE.Views.Toolbar.mniImageFromStorage": "Image from Storage", + "SSE.Views.Toolbar.capBtnPrintArea": "Print Area", + "SSE.Views.Toolbar.textSetPrintArea": "Set Print Area", + "SSE.Views.Toolbar.textClearPrintArea": "Clear Print Area", + "SSE.Views.Toolbar.textAddPrintArea": "Add to Print Area", + "SSE.Views.Toolbar.tipPrintArea": "Print Area", "SSE.Views.Top10FilterDialog.cancelButtonText": "Cancel", "SSE.Views.Top10FilterDialog.okButtonText": "OK", "SSE.Views.Top10FilterDialog.textType": "Show", diff --git a/apps/spreadsheeteditor/main/resources/img/toolbar-menu.png b/apps/spreadsheeteditor/main/resources/img/toolbar-menu.png index ae5718575..09d3dba03 100644 Binary files a/apps/spreadsheeteditor/main/resources/img/toolbar-menu.png and b/apps/spreadsheeteditor/main/resources/img/toolbar-menu.png differ diff --git a/apps/spreadsheeteditor/main/resources/img/toolbar-menu@2x.png b/apps/spreadsheeteditor/main/resources/img/toolbar-menu@2x.png index db08728ab..84f5c88ff 100644 Binary files a/apps/spreadsheeteditor/main/resources/img/toolbar-menu@2x.png and b/apps/spreadsheeteditor/main/resources/img/toolbar-menu@2x.png differ diff --git a/apps/spreadsheeteditor/main/resources/less/leftmenu.less b/apps/spreadsheeteditor/main/resources/less/leftmenu.less index 7f818cac5..7dc8bec55 100644 --- a/apps/spreadsheeteditor/main/resources/less/leftmenu.less +++ b/apps/spreadsheeteditor/main/resources/less/leftmenu.less @@ -174,7 +174,7 @@ overflow: hidden; } - #panel-saveas { + #panel-saveas, #panel-savecopy { table { margin-left: auto; margin-right: auto; diff --git a/apps/spreadsheeteditor/main/resources/less/toolbar.less b/apps/spreadsheeteditor/main/resources/less/toolbar.less index 664592127..ea7d7af88 100644 --- a/apps/spreadsheeteditor/main/resources/less/toolbar.less +++ b/apps/spreadsheeteditor/main/resources/less/toolbar.less @@ -168,6 +168,11 @@ .toolbar-btn-icon(btn-subscript, 85, @toolbar-icon-size); .toolbar-btn-icon(btn-superscript, 86, @toolbar-icon-size); +.toolbar-btn-icon(rotate-90, 89, @toolbar-icon-size); +.toolbar-btn-icon(rotate-270, 90, @toolbar-icon-size); +.toolbar-btn-icon(flip-hor, 91, @toolbar-icon-size); +.toolbar-btn-icon(flip-vert, 92, @toolbar-icon-size); + @menu-icon-size: 22px; .menu-btn-icon(mnu-align-center, 0, @menu-icon-size); .menu-btn-icon(mnu-align-just, 1, @menu-icon-size); diff --git a/apps/spreadsheeteditor/sdk_dev_scripts.js b/apps/spreadsheeteditor/sdk_dev_scripts.js index 09772ded1..5710cf5d2 100644 --- a/apps/spreadsheeteditor/sdk_dev_scripts.js +++ b/apps/spreadsheeteditor/sdk_dev_scripts.js @@ -127,6 +127,7 @@ var sdk_dev_scrpipts = [ "../../../../sdkjs/cell/model/DrawingObjects/Format/ImagePrototype.js", "../../../../sdkjs/cell/model/DrawingObjects/Format/GroupPrototype.js", "../../../../sdkjs/cell/model/DrawingObjects/Format/ChartSpacePrototype.js", + "../../../../sdkjs/common/Drawings/Format/LockedCanvas.js", "../../../../sdkjs/cell/model/PivotTables.js", "../../../../sdkjs/word/Editor/DocumentContentElementBase.js", "../../../../sdkjs/word/Editor/ParagraphContentBase.js",