Merge branch 'develop' into hotfix/v5.2.3

This commit is contained in:
Julia Radzhabova 2018-10-30 13:08:21 +03:00 committed by GitHub
commit 1d3f946653
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
113 changed files with 1858 additions and 366 deletions

View file

@ -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 <username>(<opened browser tabs>)
* 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

View file

@ -57,9 +57,10 @@
canBackToFolder: <can return to folder> - 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: <url for connection between sdk and portal>,
mergeFolderUrl: 'folder for saving merged file',
mergeFolderUrl: 'folder for saving merged file', // must be deprecated, use saveAsUrl instead
saveAsUrl: 'folder for saving files'
licenseUrl: <url for license>,
customerId: <customer id>,
@ -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.");

View file

@ -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));

View file

@ -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);

View file

@ -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);

View file

@ -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;

View file

@ -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(),

View file

@ -280,6 +280,12 @@ define([
},50);
},
onPrimary: function() {
this.trigger('onmodalresult', 1);
this.close(true);
return false;
},
cancelButtonText: 'Cancel',
addButtonText: 'Add',
textNew: 'New',

View file

@ -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);

View file

@ -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) {

View file

@ -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'

View file

@ -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);
},

View file

@ -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) {

View file

@ -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);

View file

@ -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) {

View file

@ -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',

View file

@ -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 = [
'<div id="id-mail-merge-folder-placeholder"></div>'
'<div id="id-saveas-folder-placeholder"></div>'
].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 || {}));
});

View file

@ -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 = [
'<div id="id-mail-recepients-placeholder"></div>'
'<div id="id-select-file-placeholder"></div>'
].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 || {}));
});

View file

@ -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) {

View file

@ -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) {

View file

@ -1,5 +1,4 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 127" version="1.1" width="100" height="127">
<symbol id="svg-format-odt">
<path d="M95,23v96a2.9,2.9,0,0,1-3,3H8a2.9,2.9,0,0,1-3-3V8A2.9,2.9,0,0,1,8,5H77Z" style="fill: #3c6d88"/>
<path d="M95,23H80a2.9,2.9,0,0,1-3-3V5Z" style="opacity: 0.20000000298023224;isolation: isolate"/>

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

View file

@ -1,18 +1,18 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 127" version="1.1" width="100" height="127">
<symbol id="svg-format-pdfa">
<path d="M95,23v96a2.9,2.9,0,0,1-2.8,3H8a2.9,2.9,0,0,1-3-2.8V8A2.9,2.9,0,0,1,7.8,5H77Z" style="fill: #ba4c3f"/>
<path d="M95,23H80a2.9,2.9,0,0,1-3-2.8V5Z" style="opacity: 0.20000000298023224;isolation: isolate"/>
<g>
<path d="M38.9,107.1a2.7,2.7,0,0,1-.9,2.1,4.1,4.1,0,0,1-2.4.8h-.8v3H33v-8.6h2.7a4,4,0,0,1,2.4.7A2.8,2.8,0,0,1,38.9,107.1Zm-4.1,1.4h.6a1.7,1.7,0,0,0,1.2-.4,1.1,1.1,0,0,0,.4-.9,1.7,1.7,0,0,0-.3-1,2,2,0,0,0-1.1-.3h-.8Z" style="fill: #fff"/>
<path d="M47.6,108.6a4.5,4.5,0,0,1-1.2,3.3,4.9,4.9,0,0,1-3.5,1.1H40.5v-8.6h2.7a4.2,4.2,0,0,1,3.2,1.1A3.9,3.9,0,0,1,47.6,108.6Zm-1.9.1c0-1.9-.8-2.8-2.4-2.8h-1v5.6h.8C44.8,111.5,45.7,110.6,45.7,108.7Z" style="fill: #fff"/>
<path d="M51.2,113H49.4v-8.6h4.9v1.5H51.2v2.2h2.9v1.5H51.2Z" style="fill: #fff"/>
<path d="M59.8,104.4,56.6,113H55l3.2-8.6Z" style="fill: #fff"/>
<path d="M66.2,113l-.7-2H62.4l-.6,2h-2l3.1-8.6h2.2l3,8.6Zm-1.1-3.6c-.6-1.8-.9-2.9-1-3.1a1.3,1.3,0,0,1-.1-.6c0-.2-.5,1.8-1.1,3.7Z" style="fill: #fff"/>
</g>
<path id="path4463" d="M40.4,66.7c1.6-3.2,3.4-6.7,4.9-10.2h0l.6-1.4c-1.9-7.3-3.1-13.1-2-16.9h0a2.5,2.5,0,0,1,2.6-1.5h.9c1.6,0,2.4,2,2.5,2.9h0a11.2,11.2,0,0,1-.5,3.6h0a9.2,9.2,0,0,0-.5-3.7h0c-.7-1.5-1.4-2.4-2-2.5h0a1.9,1.9,0,0,0-.7,1.4h0c-.1,1.1-.2,2.1-.2,3.2h0A37.6,37.6,0,0,0,47.5,51h0c.1-.5.3-1,.4-1.5h0l1.5-5.9h0a87.2,87.2,0,0,1-.8,8.8h0l-.3,1.3h0a29.2,29.2,0,0,0,7.4,11.5h0A24.9,24.9,0,0,0,60,68.1h0a63.6,63.6,0,0,1,8.7-.6h0c3.2,0,5.6.5,6.6,1.5h0a2.4,2.4,0,0,1,.7,1.6h0c0,.4-.1.7-.1,1h0c0-.2,0-1-2.6-1.9h0c-2.1-.6-6-.6-10.6-.1h0c5.3,2.6,10.6,4,12.3,3.2h0l.9-.9h0l-.6,1.6h0a1.6,1.6,0,0,1-1.2.9h0c-2.7.7-9.5-.9-15.5-4.3h0a123.9,123.9,0,0,0-19.8,4.7h0C33,84.9,28.7,89.5,25.2,87.8h0l-1.3-.7a1.4,1.4,0,0,1-.5-1.6h0c.4-2,2.9-5,8-8.1h0l3-1.6h0l-2.2,2.1h0c-4,3.3-7,7.5-6.9,9.1h0c3.4-.5,8.5-7.5,15.1-20.4m2.1,1.1-3.2,5.8h0a77.8,77.8,0,0,1,17.1-4.9h0L54.3,67h0A30.1,30.1,0,0,1,47,57.7h0a100.4,100.4,0,0,1-4.5,10.1" style="fill: #fff"/>
<g>
<rect x="60" y="36.7" width="16" height="12.77" rx="2" ry="2" style="fill: #fff"/>
<path d="M70.8,47.3l-1-2.7H66.6l-1,2.7h-1l3.2-8.6h.8l3.2,8.6Zm-1.3-3.6L68.6,41a5.6,5.6,0,0,1-.4-1.2c-.1.3-.2.8-.3,1.2l-1,2.7Z" style="fill: #ba4c3f"/>
</g>
</symbol>
<path d="M95,23v96a2.9,2.9,0,0,1-2.8,3H8a2.9,2.9,0,0,1-3-2.8V8A2.9,2.9,0,0,1,7.8,5H77Z" style="fill: #ba4c3f"/>
<path d="M95,23H80a2.9,2.9,0,0,1-3-2.8V5Z" style="opacity: 0.20000000298023224;isolation: isolate"/>
<g>
<path d="M38.9,107.1a2.7,2.7,0,0,1-.9,2.1,4.1,4.1,0,0,1-2.4.8h-.8v3H33v-8.6h2.7a4,4,0,0,1,2.4.7A2.8,2.8,0,0,1,38.9,107.1Zm-4.1,1.4h.6a1.7,1.7,0,0,0,1.2-.4,1.1,1.1,0,0,0,.4-.9,1.7,1.7,0,0,0-.3-1,2,2,0,0,0-1.1-.3h-.8Z" style="fill: #fff"/>
<path d="M47.6,108.6a4.5,4.5,0,0,1-1.2,3.3,4.9,4.9,0,0,1-3.5,1.1H40.5v-8.6h2.7a4.2,4.2,0,0,1,3.2,1.1A3.9,3.9,0,0,1,47.6,108.6Zm-1.9.1c0-1.9-.8-2.8-2.4-2.8h-1v5.6h.8C44.8,111.5,45.7,110.6,45.7,108.7Z" style="fill: #fff"/>
<path d="M51.2,113H49.4v-8.6h4.9v1.5H51.2v2.2h2.9v1.5H51.2Z" style="fill: #fff"/>
<path d="M59.8,104.4,56.6,113H55l3.2-8.6Z" style="fill: #fff"/>
<path d="M66.2,113l-.7-2H62.4l-.6,2h-2l3.1-8.6h2.2l3,8.6Zm-1.1-3.6c-.6-1.8-.9-2.9-1-3.1a1.3,1.3,0,0,1-.1-.6c0-.2-.5,1.8-1.1,3.7Z" style="fill: #fff"/>
</g>
<path id="path4463" d="M40.4,66.7c1.6-3.2,3.4-6.7,4.9-10.2h0l.6-1.4c-1.9-7.3-3.1-13.1-2-16.9h0a2.5,2.5,0,0,1,2.6-1.5h.9c1.6,0,2.4,2,2.5,2.9h0a11.2,11.2,0,0,1-.5,3.6h0a9.2,9.2,0,0,0-.5-3.7h0c-.7-1.5-1.4-2.4-2-2.5h0a1.9,1.9,0,0,0-.7,1.4h0c-.1,1.1-.2,2.1-.2,3.2h0A37.6,37.6,0,0,0,47.5,51h0c.1-.5.3-1,.4-1.5h0l1.5-5.9h0a87.2,87.2,0,0,1-.8,8.8h0l-.3,1.3h0a29.2,29.2,0,0,0,7.4,11.5h0A24.9,24.9,0,0,0,60,68.1h0a63.6,63.6,0,0,1,8.7-.6h0c3.2,0,5.6.5,6.6,1.5h0a2.4,2.4,0,0,1,.7,1.6h0c0,.4-.1.7-.1,1h0c0-.2,0-1-2.6-1.9h0c-2.1-.6-6-.6-10.6-.1h0c5.3,2.6,10.6,4,12.3,3.2h0l.9-.9h0l-.6,1.6h0a1.6,1.6,0,0,1-1.2.9h0c-2.7.7-9.5-.9-15.5-4.3h0a123.9,123.9,0,0,0-19.8,4.7h0C33,84.9,28.7,89.5,25.2,87.8h0l-1.3-.7a1.4,1.4,0,0,1-.5-1.6h0c.4-2,2.9-5,8-8.1h0l3-1.6h0l-2.2,2.1h0c-4,3.3-7,7.5-6.9,9.1h0c3.4-.5,8.5-7.5,15.1-20.4m2.1,1.1-3.2,5.8h0a77.8,77.8,0,0,1,17.1-4.9h0L54.3,67h0A30.1,30.1,0,0,1,47,57.7h0a100.4,100.4,0,0,1-4.5,10.1" style="fill: #fff"/>
<g>
<rect x="60" y="36.7" width="16" height="12.77" rx="2" ry="2" style="fill: #fff"/>
<path d="M70.8,47.3l-1-2.7H66.6l-1,2.7h-1l3.2-8.6h.8l3.2,8.6Zm-1.3-3.6L68.6,41a5.6,5.6,0,0,1-.4-1.2c-.1.3-.2.8-.3,1.2l-1,2.7Z" style="fill: #ba4c3f"/>
</g>
</symbol>
</svg>

Before

Width:  |  Height:  |  Size: 2.3 KiB

After

Width:  |  Height:  |  Size: 2.4 KiB

View file

@ -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);

View file

@ -34,6 +34,7 @@
opacity: 0;
position: fixed;
cursor: default;
> .header {
height: 34px;

View file

@ -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.<br> 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.<br>Are you sure you want to continue?',
warnDownloadAsRTF : 'If you continue saving in this format some of the formatting might be lost.<br>Are you sure you want to continue?'
warnDownloadAsRTF : 'If you continue saving in this format some of the formatting might be lost.<br>Are you sure you want to continue?',
txtUntitled: 'Untitled'
}, DE.Controllers.LeftMenu || {}));
});

View file

@ -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.<br>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.<br>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.<br>Use the \'Download as...\' option to save the file backup copy to your computer hard drive.'
}
})(), DE.Controllers.Main || {}))
});

View file

@ -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));
}
}
},

View file

@ -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');

View file

@ -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();

View file

@ -5,6 +5,7 @@
<li id="fm-btn-save" class="fm-btn" />
<li id="fm-btn-edit" class="fm-btn" />
<li id="fm-btn-download" class="fm-btn" />
<li id="fm-btn-save-copy" class="fm-btn" />
<li id="fm-btn-save-desktop" class="fm-btn" />
<li id="fm-btn-print" class="fm-btn" />
<li id="fm-btn-rename" class="fm-btn" />
@ -25,6 +26,7 @@
</div>
<div class="panel-context">
<div id="panel-saveas" class="content-box" />
<div id="panel-savecopy" class="content-box" />
<div id="panel-recentfiles" class="content-box" />
<div id="panel-createnew" class="content-box" />
<div id="panel-info" class="content-box" />

View file

@ -27,6 +27,32 @@
<div class="separator horizontal"></div>
</td>
</tr>
<tr>
<td colspan=2 class="padding-small">
<label class="header"><%= scope.textRotation %></label>
</td>
</tr>
<tr>
<td class="padding-small" width="50%">
<label class="input-label"><%= scope.textRotate90 %></label>
<div>
<div id="image-button-270" style="display: inline-block;margin-right: 4px;"></div>
<div id="image-button-90" style="display: inline-block;"></div>
</div>
</td>
<td class="padding-small" width="50%">
<label class="input-label"><%= scope.textFlip %></label>
<div>
<div id="image-button-fliph" style="display: inline-block;margin-right: 4px;"></div>
<div id="image-button-flipv" style="display: inline-block;"></div>
</div>
</td>
</tr>
<tr>
<td class="padding-small" colspan=2>
<div class="separator horizontal"></div>
</td>
</tr>
<tr>
<td colspan=2 class="padding-small">
<label class="header"><%= scope.textWrap %></label>

View file

@ -90,6 +90,32 @@
</table>
</div>
</div>
<div id="id-adv-image-rotate" class="settings-panel active">
<div class="inner-content padding-large">
<div style="width: 100%;">
<label class="input-label"><%= scope.textAngle %></label>
<div id="image-advanced-spin-angle" style="display: inline-block; margin-left: 5px;"></div>
</div>
</div>
<div class="separator horizontal padding-large"></div>
<div class="inner-content padding-large">
<table cols="2">
<tr>
<td rowspan="2" class="padding-small" style="vertical-align: top;">
<label class="input-label" style="margin-right: 15px;vertical-align: top;"><%= scope.textFlipped %></label>
</td>
<td class="padding-small">
<div id="image-advanced-checkbox-hor"></div>
</td>
</tr>
<tr>
<td class="padding-small">
<div id="image-advanced-checkbox-vert"></div>
</td>
</tr>
</table>
</div>
</div>
<div id="id-adv-image-wrap" class="settings-panel">
<div class="inner-content padding-large">
<label class="header padding-small"><%= scope.textWrap %></label>

View file

@ -121,6 +121,38 @@
<div class="separator horizontal"></div>
</td>
</tr>
<tr class="shape-only">
<td class="padding-small">
<label class="header"><%= scope.textRotation %></label>
</td>
</tr>
<tr class="shape-only">
<td>
<table cols="2" style="width: 100%;">
<tr>
<td class="padding-small" width="50%">
<label class="input-label"><%= scope.textRotate90 %></label>
<div>
<div id="shape-button-270" style="display: inline-block;margin-right: 4px;"></div>
<div id="shape-button-90" style="display: inline-block;"></div>
</div>
</td>
<td class="padding-small" width="50%">
<label class="input-label"><%= scope.textFlip %></label>
<div>
<div id="shape-button-fliph" style="display: inline-block;margin-right: 4px;"></div>
<div id="shape-button-flipv" style="display: inline-block;"></div>
</div>
</td>
</tr>
</table>
</td>
</tr>
<tr class="shape-only">
<td class="padding-small">
<div class="separator horizontal"></div>
</td>
</tr>
<tr class="shape-only">
<td class="padding-small">
<label class="header"><%= scope.textWrap %></label>

View file

@ -297,10 +297,6 @@ define([
this.close();
},
onPrimary: function() {
return true;
},
applyAllClick: function(btn, eOpts){
if (this.api) {
var props = new AscCommon.CContentControlPr();

View file

@ -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();

View file

@ -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 || {}));
});

View file

@ -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([
'<table><tbody>',
'<% _.each(rows, function(row) { %>',
'<tr>',
'<% _.each(row, function(item) { %>',
'<td><div><svg class="btn-doc-format" format="<%= item.type %>", format-ext="<%= item.ext %>">',
'<use xlink:href="#svg-format-<%= item.imgCls %>"></use>',
'</svg></div></td>',
'<% }) %>',
'</tr>',
'<% }) %>',
'</tbody></table>'
].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,

View file

@ -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) {

View file

@ -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 || {}));
});

View file

@ -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 || {}));
});

View file

@ -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
// }
}
},

View file

@ -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'],

View file

@ -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) {

View file

@ -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) {

View file

@ -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();

View file

@ -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.<br>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 || {}));
});

View file

@ -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) {

View file

@ -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 || {}));
});

View file

@ -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.<br>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.<br>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,<br>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.<br>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.<br>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"
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 37 KiB

After

Width:  |  Height:  |  Size: 38 KiB

View file

@ -86,7 +86,7 @@
}
}
#panel-saveas {
#panel-saveas, #panel-savecopy {
table {
margin-left: auto;
margin-right: auto;

View file

@ -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);

View file

@ -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",

View file

@ -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 || {}));
});

View file

@ -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.<br>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.<br>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.<br>Use the \'Download as...\' option to save the file backup copy to your computer hard drive.'
}
})(), PE.Controllers.Main || {}))
});

View file

@ -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));
}
}
},

View file

@ -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();
}
},

View file

@ -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();

View file

@ -5,6 +5,7 @@
<li id="fm-btn-save" class="fm-btn" />
<li id="fm-btn-edit" class="fm-btn" />
<li id="fm-btn-download" class="fm-btn" />
<li id="fm-btn-save-copy" class="fm-btn" />
<li id="fm-btn-save-desktop" class="fm-btn" />
<li id="fm-btn-print" class="fm-btn" />
<li id="fm-btn-rename" class="fm-btn" />
@ -24,6 +25,7 @@
</div>
<div class="panel-context">
<div id="panel-saveas" class="content-box" />
<div id="panel-savecopy" class="content-box" />
<div id="panel-recentfiles" class="content-box" />
<div id="panel-createnew" class="content-box" />
<div id="panel-info" class="content-box" />

View file

@ -22,6 +22,32 @@
<div class="separator horizontal"></div>
</td>
</tr>
<tr>
<td colspan=2 class="padding-small">
<label class="header"><%= scope.textRotation %></label>
</td>
</tr>
<tr>
<td class="padding-small" width="50%">
<label class="input-label"><%= scope.textRotate90 %></label>
<div>
<div id="image-button-270" style="display: inline-block;margin-right: 4px;"></div>
<div id="image-button-90" style="display: inline-block;"></div>
</div>
</td>
<td class="padding-small" width="50%">
<label class="input-label"><%= scope.textFlip %></label>
<div>
<div id="image-button-fliph" style="display: inline-block;margin-right: 4px;"></div>
<div id="image-button-flipv" style="display: inline-block;"></div>
</div>
</td>
</tr>
<tr>
<td class="padding-small" colspan=2>
<div class="separator horizontal"></div>
</td>
</tr>
<tr>
<td colspan=2>
<label class="header" id="image-lbl-replace" ><%= scope.textInsert %></label>

View file

@ -45,6 +45,32 @@
</table>
</div>
</div>
<div id="id-adv-image-rotate" class="settings-panel active">
<div class="inner-content padding-large">
<div style="width: 100%;">
<label class="input-label"><%= scope.textAngle %></label>
<div id="image-advanced-spin-angle" style="display: inline-block; margin-left: 5px;"></div>
</div>
</div>
<div class="separator horizontal padding-large"></div>
<div class="inner-content padding-large">
<table cols="2">
<tr>
<td rowspan="2" class="padding-small" style="vertical-align: top;">
<label class="input-label" style="margin-right: 15px;vertical-align: top;"><%= scope.textFlipped %></label>
</td>
<td class="padding-small">
<div id="image-advanced-checkbox-hor"></div>
</td>
</tr>
<tr>
<td class="padding-small">
<div id="image-advanced-checkbox-vert"></div>
</td>
</tr>
</table>
</div>
</div>
<div id="id-adv-image-alttext" class="settings-panel">
<div class="inner-content">
<table cols="1" width="100%">

View file

@ -116,6 +116,38 @@
</div>
</td>
</tr>
<tr class="shape-only">
<td class="padding-small">
<div class="separator horizontal"></div>
</td>
</tr>
<tr class="shape-only">
<td class="padding-small">
<label class="header"><%= scope.textRotation %></label>
</td>
</tr>
<tr class="shape-only">
<td>
<table cols="2" style="width: 100%;">
<tr>
<td class="padding-small" width="50%">
<label class="input-label"><%= scope.textRotate90 %></label>
<div>
<div id="shape-button-270" style="display: inline-block;margin-right: 4px;"></div>
<div id="shape-button-90" style="display: inline-block;"></div>
</div>
</td>
<td class="padding-small" width="50%">
<label class="input-label"><%= scope.textFlip %></label>
<div>
<div id="shape-button-fliph" style="display: inline-block;margin-right: 4px;"></div>
<div id="shape-button-flipv" style="display: inline-block;"></div>
</div>
</td>
</tr>
</table>
</td>
</tr>
<tr class="change-type">
<td class="padding-small">
<div class="separator horizontal"></div>

View file

@ -17,6 +17,32 @@
</table>
</div>
</div>
<div id="id-adv-shape-rotate" class="settings-panel active">
<div class="inner-content padding-large">
<div style="width: 100%;">
<label class="input-label"><%= scope.textAngle %></label>
<div id="shape-advanced-spin-angle" style="display: inline-block; margin-left: 5px;"></div>
</div>
</div>
<div class="separator horizontal padding-large"></div>
<div class="inner-content padding-large">
<table cols="2">
<tr>
<td rowspan="2" class="padding-small" style="vertical-align: top;">
<label class="input-label" style="margin-right: 15px;vertical-align: top;"><%= scope.textFlipped %></label>
</td>
<td class="padding-small">
<div id="shape-advanced-checkbox-hor"></div>
</td>
</tr>
<tr>
<td class="padding-small">
<div id="shape-advanced-checkbox-vert"></div>
</td>
</tr>
</table>
</div>
</div>
<div id="id-adv-shape-shape" class="settings-panel">
<div class="inner-content">
<table cols="2" style="width: 100%;">

View file

@ -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();

View file

@ -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 || {}));
});

View file

@ -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([
'<table><tbody>',
'<% _.each(rows, function(row) { %>',
'<tr>',
'<% _.each(row, function(item) { %>',
'<td><div><svg class="btn-doc-format" format="<%= item.type %>", format-ext="<%= item.ext %>">',
'<use xlink:href="#svg-format-<%= item.imgCls %>"></use>',
'</svg></div></td>',
'<% }) %>',
'</tr>',
'<% }) %>',
'</tbody></table>'
].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,

View file

@ -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) {

View file

@ -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 || {}));
});

View file

@ -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 || {}));
});

View file

@ -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();

View file

@ -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.<br>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 || {}));
});

View file

@ -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<this._arrJoinType.length; i++) {
@ -731,7 +763,12 @@ define([ 'text!presentationeditor/main/app/template/ShapeSettingsAdvanced.tem
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.',
strColumns: 'Columns',
textSpacing: 'Spacing between columns',
textColNumber: 'Number of columns'
textColNumber: 'Number of columns',
textRotation: 'Rotation',
textAngle: 'Angle',
textFlipped: 'Flipped',
textHorizontally: 'Horizontally',
textVertically: 'Vertically'
}, PE.Views.ShapeSettingsAdvanced || {}));
});

View file

@ -201,7 +201,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();
},
@ -218,12 +217,6 @@ define([
this._handleInput(event.currentTarget.attributes['result'].value);
},
onKeyPress: function(event) {
if (event.keyCode == Common.UI.Keys.RETURN) {
this._handleInput('ok');
}
},
onPrimary: function() {
this._handleInput('ok');
return false;

View file

@ -86,7 +86,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));
},
_handleInput: function(state) {
@ -101,12 +100,6 @@ define([
this._handleInput(event.currentTarget.attributes['result'].value);
},
onKeyPress: function(event) {
if (event.keyCode == Common.UI.Keys.RETURN) {
this._handleInput('ok');
}
},
onPrimary: function() {
this._handleInput('ok');
return false;

View file

@ -175,9 +175,10 @@ define([
id: 'id-toolbar-btn-print',
cls: 'btn-toolbar',
iconCls: 'btn-print no-mask',
lock: [_set.slideDeleted, _set.noSlides, _set.cantPrint]
lock: [_set.slideDeleted, _set.noSlides, _set.cantPrint, _set.disableOnStart],
signals: ['disabled']
});
me.paragraphControls.push(me.btnPrint);
me.slideOnlyControls.push(me.btnPrint);
me.btnSave = new Common.UI.Button({
id: 'id-toolbar-btn-save',
@ -1026,12 +1027,14 @@ define([
new Common.UI.Menu({
items: [
{caption: me.mniImageFromFile, value: 'file'},
{caption: me.mniImageFromUrl, value: 'url'}
{caption: me.mniImageFromUrl, value: 'url'},
{caption: me.mniImageFromStorage, value: 'storage'}
]
}).on('item:click', function (menu, item, e) {
me.fireEvent('insert:image', [item.value]);
})
);
btn.menu.items[2].setVisible(config.fileChoiceUrl && config.fileChoiceUrl.indexOf("{documentType}")>-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 || {}));
});

View file

@ -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,<br>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.<br>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.<br>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"
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 34 KiB

After

Width:  |  Height:  |  Size: 36 KiB

View file

@ -185,7 +185,7 @@
overflow: hidden;
}
#panel-saveas {
#panel-saveas, #panel-savecopy {
table {
margin-left: auto;
margin-right: auto;

View file

@ -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,

View file

@ -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",

View file

@ -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',

View file

@ -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 || {}));
});

View file

@ -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.<br>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.<br>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.<br>Use the \'Download as...\' option to save the file backup copy to your computer hard drive.'
}
})(), SSE.Controllers.Main || {}))
});

View file

@ -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));

View file

@ -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.<br>Continue?',
textWarning : 'Warning',

View file

@ -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();

View file

@ -5,6 +5,7 @@
<li id="fm-btn-save" class="fm-btn" />
<li id="fm-btn-edit" class="fm-btn" />
<li id="fm-btn-download" class="fm-btn" />
<li id="fm-btn-save-copy" class="fm-btn" />
<li id="fm-btn-save-desktop" class="fm-btn" />
<li id="fm-btn-print" class="fm-btn" />
<li id="fm-btn-rename" class="fm-btn" />
@ -24,6 +25,7 @@
</div>
<div class="panel-context">
<div id="panel-saveas" class="content-box" />
<div id="panel-savecopy" class="content-box" />
<div id="panel-recentfiles" class="content-box" />
<div id="panel-createnew" class="content-box" />
<div id="panel-info" class="content-box" />

View file

@ -29,6 +29,32 @@
<div class="separator horizontal"></div>
</td>
</tr>
<tr>
<td colspan=2 class="padding-small">
<label class="header"><%= scope.textRotation %></label>
</td>
</tr>
<tr>
<td class="padding-small" width="50%">
<label class="input-label"><%= scope.textRotate90 %></label>
<div>
<div id="image-button-270" style="display: inline-block;margin-right: 4px;"></div>
<div id="image-button-90" style="display: inline-block;"></div>
</div>
</td>
<td class="padding-small" width="50%">
<label class="input-label"><%= scope.textFlip %></label>
<div>
<div id="image-button-fliph" style="display: inline-block;margin-right: 4px;"></div>
<div id="image-button-flipv" style="display: inline-block;"></div>
</div>
</td>
</tr>
<tr>
<td class="padding-small" colspan=2>
<div class="separator horizontal"></div>
</td>
</tr>
<tr>
<td colspan=2>
<label class="header" id="image-lbl-replace"><%= scope.textInsert %></label>

View file

@ -1,3 +1,29 @@
<div id="id-adv-image-rotate" class="settings-panel active">
<div class="inner-content padding-large">
<div style="width: 100%;">
<label class="input-label"><%= scope.textAngle %></label>
<div id="image-advanced-spin-angle" style="display: inline-block; margin-left: 5px;"></div>
</div>
</div>
<div class="separator horizontal padding-large"></div>
<div class="inner-content padding-large">
<table cols="2">
<tr>
<td rowspan="2" class="padding-small" style="vertical-align: top;">
<label class="input-label" style="margin-right: 15px;vertical-align: top;"><%= scope.textFlipped %></label>
</td>
<td class="padding-small">
<div id="image-advanced-checkbox-hor"></div>
</td>
</tr>
<tr>
<td class="padding-small">
<div id="image-advanced-checkbox-vert"></div>
</td>
</tr>
</table>
</div>
</div>
<div id="id-adv-image-alttext" class="settings-panel active">
<div class="inner-content">
<table cols="1" width="100%">

View file

@ -116,6 +116,38 @@
</div>
</td>
</tr>
<tr class="shape-only">
<td class="padding-small">
<div class="separator horizontal"></div>
</td>
</tr>
<tr class="shape-only">
<td class="padding-small">
<label class="header"><%= scope.textRotation %></label>
</td>
</tr>
<tr class="shape-only">
<td>
<table cols="2" style="width: 100%;">
<tr>
<td class="padding-small" width="50%">
<label class="input-label"><%= scope.textRotate90 %></label>
<div>
<div id="shape-button-270" style="display: inline-block;margin-right: 4px;"></div>
<div id="shape-button-90" style="display: inline-block;"></div>
</div>
</td>
<td class="padding-small" width="50%">
<label class="input-label"><%= scope.textFlip %></label>
<div>
<div id="shape-button-fliph" style="display: inline-block;margin-right: 4px;"></div>
<div id="shape-button-flipv" style="display: inline-block;"></div>
</div>
</td>
</tr>
</table>
</td>
</tr>
<tr class="change-type">
<td class="padding-small">
<div class="separator horizontal"></div>

View file

@ -17,6 +17,32 @@
</table>
</div>
</div>
<div id="id-adv-shape-rotate" class="settings-panel active">
<div class="inner-content padding-large">
<div style="width: 100%;">
<label class="input-label"><%= scope.textAngle %></label>
<div id="shape-advanced-spin-angle" style="display: inline-block; margin-left: 5px;"></div>
</div>
</div>
<div class="separator horizontal padding-large"></div>
<div class="inner-content padding-large">
<table cols="2">
<tr>
<td rowspan="2" class="padding-small" style="vertical-align: top;">
<label class="input-label" style="margin-right: 15px;vertical-align: top;"><%= scope.textFlipped %></label>
</td>
<td class="padding-small">
<div id="shape-advanced-checkbox-hor"></div>
</td>
</tr>
<tr>
<td class="padding-small">
<div id="shape-advanced-checkbox-vert"></div>
</td>
</tr>
</table>
</div>
</div>
<div id="id-adv-shape-shape" class="settings-panel">
<div class="inner-content">
<table cols="2" style="width: 100%;">

View file

@ -141,6 +141,7 @@
<span class="btn-slot text x-huge" id="slot-btn-pagemargins"></span>
<span class="btn-slot text x-huge" id="slot-btn-pageorient"></span>
<span class="btn-slot text x-huge" id="slot-btn-pagesize"></span>
<span class="btn-slot text x-huge" id="slot-btn-printarea"></span>
</div>
<div class="separator long"></div>
<div class="group">

View file

@ -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') {

View file

@ -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 || {}));
});

View file

@ -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([
'<table><tbody>',
'<% _.each(rows, function(row) { %>',
'<tr>',
'<% _.each(row, function(item) { %>',
'<td><div><svg class="btn-doc-format" format="<%= item.type %>", format-ext="<%= item.ext %>">',
'<use xlink:href="#svg-format-<%= item.imgCls %>"></use>',
'</svg></div></td>',
'<% }) %>',
'</tr>',
'<% }) %>',
'</tbody></table>'
].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,

View file

@ -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) {

View file

@ -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 || {}));
});

View file

@ -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 || {}));
});

Some files were not shown because too many files have changed in this diff Show more