Merge branch 'develop'
This commit is contained in:
commit
4f07c793ae
10
.travis.yml
Normal file
10
.travis.yml
Normal file
|
@ -0,0 +1,10 @@
|
|||
dist: trusty
|
||||
language: node_js
|
||||
node_js:
|
||||
- '6'
|
||||
before_install: npm install -g grunt-cli
|
||||
before_script:
|
||||
- cd build
|
||||
script:
|
||||
- npm install
|
||||
- grunt --level=ADVANCED
|
|
@ -2,6 +2,7 @@
|
|||
## 5.1.1
|
||||
### All Editors
|
||||
* Customize initial zoom for the embedded editors
|
||||
* Replace image from context menu (bug #11493)
|
||||
|
||||
### Document Editor
|
||||
* Create and manage bookmarks
|
||||
|
@ -10,7 +11,8 @@
|
|||
|
||||
### Spreadsheet Editor
|
||||
* Add Spanish, French formula translations
|
||||
* Set options for saving in PDF format
|
||||
* Set options for saving in PDF format (bug #34914)
|
||||
* Change cell format from context menu (bug #16272)
|
||||
|
||||
### Presentation Editor
|
||||
*
|
||||
* Add hints to presentation themes (bug #21362)
|
||||
|
|
|
@ -213,6 +213,8 @@ define([
|
|||
}, 10);
|
||||
} else
|
||||
me._skipInputChange = false;
|
||||
} else if (e.keyCode == Common.UI.Keys.RETURN && this._input.val() === me.lastValue){
|
||||
this._input.trigger('change', { reapply: true });
|
||||
}
|
||||
},
|
||||
|
||||
|
@ -233,7 +235,7 @@ define([
|
|||
var val = $(e.target).val(),
|
||||
record = {};
|
||||
|
||||
if (this.lastValue === val) {
|
||||
if (this.lastValue === val && !(extra && extra.reapply)) {
|
||||
if (extra && extra.onkeydown)
|
||||
this.trigger('combo:blur', this, e);
|
||||
return;
|
||||
|
|
|
@ -742,10 +742,10 @@ define([
|
|||
if (!silentUpdate) {
|
||||
this.updateComments(false, true);
|
||||
|
||||
if (this.getPopover() && this.getPopover().isVisible()) {
|
||||
this._dontScrollToComment = true;
|
||||
this.api.asc_showComment(id, true);
|
||||
}
|
||||
// if (this.getPopover() && this.getPopover().isVisible()) {
|
||||
// this._dontScrollToComment = true;
|
||||
// this.api.asc_showComment(id, true);
|
||||
// }
|
||||
}
|
||||
}
|
||||
},
|
||||
|
@ -776,8 +776,9 @@ define([
|
|||
onApiShowComment: function (uids, posX, posY, leftX, opts, hint) {
|
||||
if (this.previewmode) return;
|
||||
this.isModeChanged = false;
|
||||
var same_uids = (0 === _.difference(this.uids, uids).length) && (0 === _.difference(uids, this.uids).length);
|
||||
|
||||
if (hint && this.isSelectedComment && (0 === _.difference(this.uids, uids).length)) {
|
||||
if (hint && this.isSelectedComment && same_uids) {
|
||||
// хотим показать тот же коментарий что был и выбран
|
||||
return;
|
||||
}
|
||||
|
@ -788,7 +789,7 @@ define([
|
|||
if (popover) {
|
||||
this.clearDummyComment();
|
||||
|
||||
if (this.isSelectedComment && (0 === _.difference(this.uids, uids).length)) {
|
||||
if (this.isSelectedComment && same_uids) {
|
||||
//NOTE: click to sdk view ?
|
||||
if (this.api) {
|
||||
//this.view.txtComment.blur();
|
||||
|
@ -827,10 +828,10 @@ define([
|
|||
comment.set('hint', !_.isUndefined(hint) ? hint : false);
|
||||
|
||||
if (!hint && this.hintmode) {
|
||||
if (0 === _.difference(this.uids, uids).length && (this.uids.length === 0))
|
||||
if (same_uids && (this.uids.length === 0))
|
||||
animate = false;
|
||||
|
||||
if (this.oldUids.length && (0 === _.difference(this.oldUids, uids).length)) {
|
||||
if (this.oldUids.length && (0 === _.difference(this.oldUids, uids).length) && (0 === _.difference(uids, this.oldUids).length)) {
|
||||
animate = false;
|
||||
this.oldUids = [];
|
||||
}
|
||||
|
|
|
@ -119,10 +119,11 @@ define([
|
|||
},
|
||||
|
||||
_onMessage: function(msg) {
|
||||
if (msg && msg.needUpdate) {
|
||||
this.trigger('accessrights', this, msg.sharingSettings);
|
||||
if (msg && msg.Referer == "onlyoffice") {
|
||||
if (msg.needUpdate)
|
||||
this.trigger('accessrights', this, msg.sharingSettings);
|
||||
Common.NotificationCenter.trigger('window:close', this);
|
||||
}
|
||||
Common.NotificationCenter.trigger('window:close', this);
|
||||
},
|
||||
|
||||
_onLoad: function() {
|
||||
|
|
|
@ -393,9 +393,9 @@ define([
|
|||
menuStyle: 'min-width: 100px;',
|
||||
cls: 'input-group-nr',
|
||||
data: [
|
||||
{value: 4, displayValue: ','},
|
||||
{value: 2, displayValue: ';'},
|
||||
{value: 3, displayValue: ':'},
|
||||
{value: 4, displayValue: this.txtComma},
|
||||
{value: 2, displayValue: this.txtSemicolon},
|
||||
{value: 3, displayValue: this.txtColon},
|
||||
{value: 1, displayValue: this.txtTab},
|
||||
{value: 5, displayValue: this.txtSpace},
|
||||
{value: -1, displayValue: this.txtOther}],
|
||||
|
@ -524,7 +524,10 @@ define([
|
|||
txtOther: 'Other',
|
||||
txtIncorrectPwd: 'Password is incorrect.',
|
||||
closeButtonText: 'Close File',
|
||||
txtPreview: 'Preview'
|
||||
txtPreview: 'Preview',
|
||||
txtComma: 'Comma',
|
||||
txtColon: 'Colon',
|
||||
txtSemicolon: 'Semicolon'
|
||||
|
||||
}, Common.Views.OpenDialog || {}));
|
||||
});
|
|
@ -2264,6 +2264,43 @@ define([
|
|||
}
|
||||
});
|
||||
|
||||
var menuImgReplace = new Common.UI.MenuItem({
|
||||
caption : me.textReplace,
|
||||
menu : new Common.UI.Menu({
|
||||
menuAlign: 'tl-tr',
|
||||
items: [
|
||||
new Common.UI.MenuItem({
|
||||
caption : this.textFromFile
|
||||
}).on('click', function(item) {
|
||||
setTimeout(function(){
|
||||
if (me.api) me.api.ChangeImageFromFile();
|
||||
me.fireEvent('editcomplete', me);
|
||||
}, 10);
|
||||
}),
|
||||
new Common.UI.MenuItem({
|
||||
caption : this.textFromUrl
|
||||
}).on('click', function(item) {
|
||||
var me = this;
|
||||
(new Common.Views.ImageFromUrlDialog({
|
||||
handler: function(result, value) {
|
||||
if (result == 'ok') {
|
||||
if (me.api) {
|
||||
var checkUrl = value.replace(/ /g, '');
|
||||
if (!_.isEmpty(checkUrl)) {
|
||||
var props = new Asc.asc_CImgProperty();
|
||||
props.put_ImageUrl(checkUrl);
|
||||
me.api.ImgApply(props);
|
||||
}
|
||||
}
|
||||
}
|
||||
me.fireEvent('editcomplete', me);
|
||||
}
|
||||
})).show();
|
||||
})
|
||||
]
|
||||
})
|
||||
});
|
||||
|
||||
var menuImgCopy = new Common.UI.MenuItem({
|
||||
caption : me.textCopy,
|
||||
value : 'copy'
|
||||
|
@ -2341,13 +2378,19 @@ define([
|
|||
|
||||
menuChartEdit.setVisible(!_.isNull(value.imgProps.value.get_ChartProperties()) && !onlyCommonProps);
|
||||
|
||||
me.menuOriginalSize.setVisible(value.imgProps.isOnlyImg);
|
||||
me.pictureMenu.items[10].setVisible(menuChartEdit.isVisible() || me.menuOriginalSize.isVisible());
|
||||
me.menuOriginalSize.setVisible(value.imgProps.isOnlyImg || !value.imgProps.isChart && !value.imgProps.isShape);
|
||||
|
||||
var pluginGuid = value.imgProps.value.asc_getPluginGuid();
|
||||
menuImgReplace.setVisible(value.imgProps.isOnlyImg && (pluginGuid===null || pluginGuid===undefined));
|
||||
if (menuImgReplace.isVisible())
|
||||
menuImgReplace.setDisabled(islocked || pluginGuid===null);
|
||||
|
||||
var islocked = value.imgProps.locked || (value.headerProps!==undefined && value.headerProps.locked);
|
||||
if (menuChartEdit.isVisible())
|
||||
menuChartEdit.setDisabled(islocked || value.imgProps.value.get_SeveralCharts());
|
||||
|
||||
me.pictureMenu.items[14].setVisible(menuChartEdit.isVisible());
|
||||
|
||||
me.menuOriginalSize.setDisabled(islocked || value.imgProps.value.get_ImageUrl()===null || value.imgProps.value.get_ImageUrl()===undefined);
|
||||
menuImageAdvanced.setDisabled(islocked);
|
||||
menuImageAlign.setDisabled( islocked || (wrapping == Asc.c_oAscWrapStyle2.Inline) );
|
||||
|
@ -2390,6 +2433,7 @@ define([
|
|||
me.menuImageWrap,
|
||||
{ caption: '--' },
|
||||
me.menuOriginalSize,
|
||||
menuImgReplace,
|
||||
menuChartEdit,
|
||||
{ caption: '--' },
|
||||
menuImageAdvanced
|
||||
|
@ -3729,7 +3773,10 @@ define([
|
|||
textTOCSettings: 'Table of contents settings',
|
||||
textTOC: 'Table of contents',
|
||||
textRefreshField: 'Refresh field',
|
||||
txtPasteSourceFormat: 'Keep source formatting'
|
||||
txtPasteSourceFormat: 'Keep source formatting',
|
||||
textReplace: 'Replace image',
|
||||
textFromUrl: 'From URL',
|
||||
textFromFile: 'From File'
|
||||
|
||||
}, DE.Views.DocumentHolder || {}));
|
||||
});
|
|
@ -169,7 +169,7 @@ define([ 'text!documenteditor/main/app/template/MailMergeEmailDlg.template',
|
|||
},
|
||||
|
||||
_onMessage: function(msg) {
|
||||
if (msg) {
|
||||
if (msg && msg.Referer == "onlyoffice") {
|
||||
// if ( !_.isEmpty(msg.folder) ) {
|
||||
// this.trigger('mailmergefolder', this, msg.folder); // save last folder url
|
||||
// }
|
||||
|
|
|
@ -116,7 +116,7 @@ define([
|
|||
},
|
||||
|
||||
_onMessage: function(msg) {
|
||||
if (msg && msg.file !== undefined) {
|
||||
if (msg && msg.Referer == "onlyoffice" && msg.file !== undefined) {
|
||||
Common.NotificationCenter.trigger('window:close', this);
|
||||
var me = this;
|
||||
setTimeout(function() {
|
||||
|
|
|
@ -120,7 +120,7 @@ define([
|
|||
},
|
||||
|
||||
_onMessage: function(msg) {
|
||||
if (msg) {
|
||||
if (msg && msg.Referer == "onlyoffice") {
|
||||
if ( !_.isEmpty(msg.error) ) {
|
||||
this.trigger('mailmergeerror', this, msg.error);
|
||||
}
|
||||
|
|
|
@ -1023,6 +1023,9 @@
|
|||
"DE.Views.DocumentHolder.txtUngroup": "Ungroup",
|
||||
"DE.Views.DocumentHolder.updateStyleText": "Update %1 style",
|
||||
"DE.Views.DocumentHolder.vertAlignText": "Vertical Alignment",
|
||||
"DE.Views.DocumentHolder.textReplace": "Replace image",
|
||||
"DE.Views.DocumentHolder.textFromUrl": "From URL",
|
||||
"DE.Views.DocumentHolder.textFromFile": "From File",
|
||||
"DE.Views.DropcapSettingsAdvanced.cancelButtonText": "Cancel",
|
||||
"DE.Views.DropcapSettingsAdvanced.okButtonText": "Ok",
|
||||
"DE.Views.DropcapSettingsAdvanced.strBorders": "Borders & Fill",
|
||||
|
|
|
@ -2723,6 +2723,43 @@ define([
|
|||
}
|
||||
});
|
||||
|
||||
var menuImgReplace = new Common.UI.MenuItem({
|
||||
caption : me.textReplace,
|
||||
menu : new Common.UI.Menu({
|
||||
menuAlign: 'tl-tr',
|
||||
items: [
|
||||
new Common.UI.MenuItem({
|
||||
caption : this.textFromFile
|
||||
}).on('click', function(item) {
|
||||
setTimeout(function(){
|
||||
if (me.api) me.api.ChangeImageFromFile();
|
||||
me.fireEvent('editcomplete', me);
|
||||
}, 10);
|
||||
}),
|
||||
new Common.UI.MenuItem({
|
||||
caption : this.textFromUrl
|
||||
}).on('click', function(item) {
|
||||
var me = this;
|
||||
(new Common.Views.ImageFromUrlDialog({
|
||||
handler: function(result, value) {
|
||||
if (result == 'ok') {
|
||||
if (me.api) {
|
||||
var checkUrl = value.replace(/ /g, '');
|
||||
if (!_.isEmpty(checkUrl)) {
|
||||
var props = new Asc.asc_CImgProperty();
|
||||
props.put_ImageUrl(checkUrl);
|
||||
me.api.ImgApply(props);
|
||||
}
|
||||
}
|
||||
}
|
||||
me.fireEvent('editcomplete', me);
|
||||
}
|
||||
})).show();
|
||||
})
|
||||
]
|
||||
})
|
||||
});
|
||||
|
||||
/** coauthoring begin **/
|
||||
var menuAddCommentPara = new Common.UI.MenuItem({
|
||||
caption : me.addCommentText
|
||||
|
@ -3117,18 +3154,23 @@ define([
|
|||
mnuGroupImg.setDisabled(!me.api.canGroup());
|
||||
}
|
||||
|
||||
var imgdisabled = (value.imgProps!==undefined && value.imgProps.locked),
|
||||
var isimage = (_.isUndefined(value.shapeProps) || value.shapeProps.value.get_FromImage()) && _.isUndefined(value.chartProps),
|
||||
imgdisabled = (value.imgProps!==undefined && value.imgProps.locked),
|
||||
shapedisabled = (value.shapeProps!==undefined && value.shapeProps.locked),
|
||||
chartdisabled = (value.chartProps!==undefined && value.chartProps.locked),
|
||||
disabled = imgdisabled || shapedisabled || chartdisabled || (value.slideProps!==undefined && value.slideProps.locked);
|
||||
disabled = imgdisabled || shapedisabled || chartdisabled || (value.slideProps!==undefined && value.slideProps.locked),
|
||||
pluginGuid = (value.imgProps) ? value.imgProps.value.asc_getPluginGuid() : null;
|
||||
|
||||
// image properties
|
||||
menuImgOriginalSize.setVisible((_.isUndefined(value.shapeProps) || value.shapeProps.value.get_FromImage()) && _.isUndefined(value.chartProps));
|
||||
|
||||
menuImgOriginalSize.setVisible(isimage);
|
||||
if (menuImgOriginalSize.isVisible())
|
||||
menuImgOriginalSize.setDisabled(disabled || _.isNull(value.imgProps.value.get_ImageUrl()) || _.isUndefined(value.imgProps.value.get_ImageUrl()));
|
||||
|
||||
menuImageAdvanced.setVisible((_.isUndefined(value.shapeProps) || value.shapeProps.value.get_FromImage()) && _.isUndefined(value.chartProps));
|
||||
menuImgReplace.setVisible(isimage && (pluginGuid===null || pluginGuid===undefined));
|
||||
if (menuImgReplace.isVisible())
|
||||
menuImgReplace.setDisabled(disabled || pluginGuid===null);
|
||||
|
||||
menuImageAdvanced.setVisible(isimage);
|
||||
menuShapeAdvanced.setVisible(_.isUndefined(value.imgProps) && _.isUndefined(value.chartProps));
|
||||
menuChartEdit.setVisible(_.isUndefined(value.imgProps) && !_.isUndefined(value.chartProps) && (_.isUndefined(value.shapeProps) || value.shapeProps.isChart));
|
||||
menuImgShapeSeparator.setVisible(menuImageAdvanced.isVisible() || menuShapeAdvanced.isVisible() || menuChartEdit.isVisible());
|
||||
|
@ -3155,6 +3197,7 @@ define([
|
|||
menuImgShapeAlign,
|
||||
menuImgShapeSeparator,
|
||||
menuImgOriginalSize,
|
||||
menuImgReplace,
|
||||
menuImageAdvanced,
|
||||
menuShapeAdvanced
|
||||
,menuChartEdit
|
||||
|
@ -3399,7 +3442,10 @@ define([
|
|||
txtPasteSourceFormat: 'Keep source formatting',
|
||||
txtPasteDestFormat: 'Use destination theme',
|
||||
textDistributeRows: 'Distribute rows',
|
||||
textDistributeCols: 'Distribute columns'
|
||||
textDistributeCols: 'Distribute columns',
|
||||
textReplace: 'Replace image',
|
||||
textFromUrl: 'From URL',
|
||||
textFromFile: 'From File'
|
||||
|
||||
}, PE.Views.DocumentHolder || {}));
|
||||
});
|
|
@ -174,7 +174,7 @@ define([
|
|||
this.btnOriginalSize.setDisabled(props.get_ImageUrl()===null || props.get_ImageUrl()===undefined || this._locked);
|
||||
|
||||
var pluginGuid = props.asc_getPluginGuid();
|
||||
value = (pluginGuid !== null && pluginGuid !== undefined);
|
||||
value = (pluginGuid !== null && pluginGuid !== undefined); // undefined - only images are selected, null - selected images and ole-objects
|
||||
if (this._state.isOleObject!==value) {
|
||||
this.btnInsertFromUrl.setVisible(!value);
|
||||
this.btnInsertFromFile.setVisible(!value);
|
||||
|
|
|
@ -901,6 +901,9 @@
|
|||
"PE.Views.DocumentHolder.txtUnderbar": "Bar under text",
|
||||
"PE.Views.DocumentHolder.txtUngroup": "Ungroup",
|
||||
"PE.Views.DocumentHolder.vertAlignText": "Vertical Alignment",
|
||||
"PE.Views.DocumentHolder.textReplace": "Replace image",
|
||||
"PE.Views.DocumentHolder.textFromUrl": "From URL",
|
||||
"PE.Views.DocumentHolder.textFromFile": "From File",
|
||||
"PE.Views.DocumentPreview.goToSlideText": "Go to Slide",
|
||||
"PE.Views.DocumentPreview.slideIndexText": "Slide {0} of {1}",
|
||||
"PE.Views.DocumentPreview.txtClose": "Close slideshow",
|
||||
|
|
|
@ -82,7 +82,7 @@ define([
|
|||
me._currentMathObj = undefined;
|
||||
me._currentParaObjDisabled = false;
|
||||
me._isDisabled = false;
|
||||
|
||||
me._state = {};
|
||||
/** coauthoring begin **/
|
||||
this.wrapEvents = {
|
||||
apiHideComment: _.bind(this.onApiHideComment, this)
|
||||
|
@ -194,6 +194,12 @@ define([
|
|||
view.textInShapeMenu.on('render:after', _.bind(me.onTextInShapeAfterRender, me));
|
||||
view.menuSignatureEditSign.on('click', _.bind(me.onSignatureClick, me));
|
||||
view.menuSignatureEditSetup.on('click', _.bind(me.onSignatureClick, me));
|
||||
view.menuImgOriginalSize.on('click', _.bind(me.onOriginalSizeClick, me));
|
||||
view.menuImgReplace.menu.on('item:click', _.bind(me.onImgReplace, me));
|
||||
view.pmiNumFormat.menu.on('item:click', _.bind(me.onNumberFormatSelect, me));
|
||||
view.pmiNumFormat.menu.on('show:after', _.bind(me.onNumberFormatOpenAfter, me));
|
||||
view.pmiAdvancedNumFormat.on('click', _.bind(me.onCustomNumberFormat, me));
|
||||
|
||||
} else {
|
||||
view.menuViewCopy.on('click', _.bind(me.onCopyPaste, me));
|
||||
view.menuViewUndo.on('click', _.bind(me.onUndo, me));
|
||||
|
@ -1314,6 +1320,15 @@ define([
|
|||
documentHolder.pmiImgPaste.setDisabled(isObjLocked);
|
||||
documentHolder.mnuImgAdvanced.setVisible(isimagemenu && (!isshapemenu || isimageonly) && !ischartmenu);
|
||||
documentHolder.mnuImgAdvanced.setDisabled(isObjLocked);
|
||||
documentHolder.menuImgOriginalSize.setVisible(isimagemenu && (!isshapemenu || isimageonly) && !ischartmenu);
|
||||
if (documentHolder.mnuImgAdvanced.imageInfo)
|
||||
documentHolder.menuImgOriginalSize.setDisabled(isObjLocked || documentHolder.mnuImgAdvanced.imageInfo.get_ImageUrl()===null || documentHolder.mnuImgAdvanced.imageInfo.get_ImageUrl()===undefined);
|
||||
|
||||
var pluginGuid = (documentHolder.mnuImgAdvanced.imageInfo) ? documentHolder.mnuImgAdvanced.imageInfo.asc_getPluginGuid() : null;
|
||||
documentHolder.menuImgReplace.setVisible(isimageonly && (pluginGuid===null || pluginGuid===undefined));
|
||||
documentHolder.menuImgReplace.setDisabled(isObjLocked || pluginGuid===null);
|
||||
|
||||
|
||||
|
||||
var isInSign = !!signGuid;
|
||||
documentHolder.menuSignatureEditSign.setVisible(isInSign);
|
||||
|
@ -1471,6 +1486,10 @@ define([
|
|||
|
||||
documentHolder.pmiEntriesList.setVisible(!iscelledit && !inPivot);
|
||||
|
||||
documentHolder.pmiNumFormat.setVisible(!iscelledit);
|
||||
documentHolder.pmiAdvancedNumFormat.options.numformatinfo = documentHolder.pmiNumFormat.menu.options.numformatinfo = cellinfo.asc_getNumFormatInfo();
|
||||
documentHolder.pmiAdvancedNumFormat.options.numformat = cellinfo.asc_getNumFormat();
|
||||
|
||||
_.each(documentHolder.ssMenu.items, function(item) {
|
||||
item.setDisabled(isCellLocked);
|
||||
});
|
||||
|
@ -2598,6 +2617,105 @@ define([
|
|||
}
|
||||
},
|
||||
|
||||
onOriginalSizeClick: function(item) {
|
||||
if (this.api){
|
||||
var imgsize = this.api.asc_getOriginalImageSize();
|
||||
var w = imgsize.asc_getImageWidth();
|
||||
var h = imgsize.asc_getImageHeight();
|
||||
|
||||
var properties = new Asc.asc_CImgProperty();
|
||||
properties.asc_putWidth(w);
|
||||
properties.asc_putHeight(h);
|
||||
this.api.asc_setGraphicObjectProps(properties);
|
||||
|
||||
Common.NotificationCenter.trigger('edit:complete', this.documentHolder);
|
||||
Common.component.Analytics.trackEvent('DocumentHolder', 'Set Image Original Size');
|
||||
}
|
||||
},
|
||||
|
||||
onImgReplace: function(menu, item) {
|
||||
var me = this;
|
||||
if (this.api) {
|
||||
if (item.value == 'file') {
|
||||
setTimeout(function(){
|
||||
if (me.api) me.api.asc_changeImageFromFile();
|
||||
Common.NotificationCenter.trigger('edit:complete', me.documentHolder);
|
||||
}, 10);
|
||||
} else {
|
||||
(new Common.Views.ImageFromUrlDialog({
|
||||
handler: function(result, value) {
|
||||
if (result == 'ok') {
|
||||
if (me.api) {
|
||||
var checkUrl = value.replace(/ /g, '');
|
||||
if (!_.isEmpty(checkUrl)) {
|
||||
var props = new Asc.asc_CImgProperty();
|
||||
props.asc_putImageUrl(checkUrl);
|
||||
me.api.asc_setGraphicObjectProps(props);
|
||||
}
|
||||
}
|
||||
}
|
||||
Common.NotificationCenter.trigger('edit:complete', me.documentHolder);
|
||||
}
|
||||
})).show();
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
onNumberFormatSelect: function(menu, item) {
|
||||
if (item.value !== undefined && item.value !== 'advanced') {
|
||||
if (this.api)
|
||||
this.api.asc_setCellFormat(item.options.format);
|
||||
}
|
||||
Common.NotificationCenter.trigger('edit:complete', this.documentHolder);
|
||||
},
|
||||
|
||||
onCustomNumberFormat: function(item) {
|
||||
var me = this,
|
||||
value = me.api.asc_getLocale();
|
||||
(!value) && (value = ((me.permissions.lang) ? parseInt(Common.util.LanguageInfo.getLocalLanguageCode(me.permissions.lang)) : 0x0409));
|
||||
|
||||
(new SSE.Views.FormatSettingsDialog({
|
||||
api: me.api,
|
||||
handler: function(result, settings) {
|
||||
if (settings) {
|
||||
me.api.asc_setCellFormat(settings.format);
|
||||
}
|
||||
Common.NotificationCenter.trigger('edit:complete', me.documentHolder);
|
||||
},
|
||||
props : {format: item.options.numformat, formatInfo: item.options.numformatinfo, langId: value}
|
||||
})).show();
|
||||
Common.NotificationCenter.trigger('edit:complete', this.documentHolder);
|
||||
},
|
||||
|
||||
onNumberFormatOpenAfter: function(menu) {
|
||||
if (this.api) {
|
||||
var me = this,
|
||||
value = me.api.asc_getLocale();
|
||||
(!value) && (value = ((me.permissions.lang) ? parseInt(Common.util.LanguageInfo.getLocalLanguageCode(me.permissions.lang)) : 0x0409));
|
||||
|
||||
if (this._state.langId !== value) {
|
||||
this._state.langId = value;
|
||||
|
||||
var info = new Asc.asc_CFormatCellsInfo();
|
||||
info.asc_setType(Asc.c_oAscNumFormatType.None);
|
||||
info.asc_setSymbol(this._state.langId);
|
||||
var arr = this.api.asc_getFormatCells(info); // all formats
|
||||
for (var i=0; i<menu.items.length-2; i++) {
|
||||
menu.items[i].options.format = arr[i];
|
||||
}
|
||||
}
|
||||
|
||||
var val = menu.options.numformatinfo;
|
||||
val = (val) ? val.asc_getType() : -1;
|
||||
for (var i=0; i<menu.items.length-2; i++) {
|
||||
var mnu = menu.items[i];
|
||||
mnu.options.exampleval = me.api.asc_getLocaleExample(mnu.options.format);
|
||||
$(mnu.el).find('label').text(mnu.options.exampleval);
|
||||
mnu.setChecked(val == mnu.value);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
SetDisabled: function(state, canProtect) {
|
||||
this._isDisabled = state;
|
||||
this._canProtect = canProtect;
|
||||
|
|
|
@ -404,6 +404,106 @@ define([
|
|||
})
|
||||
});
|
||||
|
||||
var numFormatTemplate = _.template('<a id="<%= id %>" tabindex="-1" type="menuitem">'+
|
||||
'<div style="position: relative;">'+
|
||||
'<div style="position: absolute; left: 0; width: 100px;"><%= caption %></div>' +
|
||||
'<label style="width: 100%; max-width: 300px; overflow: hidden; text-overflow: ellipsis; text-align: right; vertical-align: bottom; padding-left: 100px; color: silver;cursor: pointer;"><%= options.exampleval ? options.exampleval : "" %></label>' +
|
||||
'</div></a>');
|
||||
|
||||
me.pmiNumFormat = new Common.UI.MenuItem({
|
||||
caption: me.txtNumFormat,
|
||||
menu: new Common.UI.Menu({
|
||||
menuAlign: 'tl-tr',
|
||||
items: [
|
||||
{
|
||||
caption: this.txtGeneral,
|
||||
template: numFormatTemplate,
|
||||
checkable: true,
|
||||
format: 'General',
|
||||
exampleval: '100',
|
||||
value: Asc.c_oAscNumFormatType.General
|
||||
},
|
||||
{
|
||||
caption: this.txtNumber,
|
||||
template: numFormatTemplate,
|
||||
checkable: true,
|
||||
format: '0.00',
|
||||
exampleval: '100,00',
|
||||
value: Asc.c_oAscNumFormatType.Number
|
||||
},
|
||||
{
|
||||
caption: this.txtScientific,
|
||||
template: numFormatTemplate,
|
||||
checkable: true,
|
||||
format: '0.00E+00',
|
||||
exampleval: '1,00E+02',
|
||||
value: Asc.c_oAscNumFormatType.Scientific
|
||||
},
|
||||
{
|
||||
caption: this.txtAccounting,
|
||||
template: numFormatTemplate,
|
||||
checkable: true,
|
||||
format: '_($* #,##0.00_);_($* (#,##0.00);_($* "-"??_);_(@_)',
|
||||
exampleval: '100,00 $',
|
||||
value: Asc.c_oAscNumFormatType.Accounting
|
||||
},
|
||||
{
|
||||
caption: this.txtCurrency,
|
||||
template: numFormatTemplate,
|
||||
checkable: true,
|
||||
format: '$#,##0.00',
|
||||
exampleval: '100,00 $',
|
||||
value: Asc.c_oAscNumFormatType.Currency
|
||||
},
|
||||
{
|
||||
caption: this.txtDate,
|
||||
template: numFormatTemplate,
|
||||
checkable: true,
|
||||
format: 'MM-dd-yyyy',
|
||||
exampleval: '04-09-1900',
|
||||
value: Asc.c_oAscNumFormatType.Date
|
||||
},
|
||||
{
|
||||
caption: this.txtTime,
|
||||
template: numFormatTemplate,
|
||||
checkable: true,
|
||||
format: 'HH:MM:ss',
|
||||
exampleval: '00:00:00',
|
||||
value: Asc.c_oAscNumFormatType.Time
|
||||
},
|
||||
{
|
||||
caption: this.txtPercentage,
|
||||
template: numFormatTemplate,
|
||||
checkable: true,
|
||||
format: '0.00%',
|
||||
exampleval: '100,00%',
|
||||
value: Asc.c_oAscNumFormatType.Percent
|
||||
},
|
||||
{
|
||||
caption: this.txtFraction,
|
||||
template: numFormatTemplate,
|
||||
checkable: true,
|
||||
format: '# ?/?',
|
||||
exampleval: '100',
|
||||
value: Asc.c_oAscNumFormatType.Fraction
|
||||
},
|
||||
{
|
||||
caption: this.txtText,
|
||||
template: numFormatTemplate,
|
||||
checkable: true,
|
||||
format: '@',
|
||||
exampleval: '100',
|
||||
value: Asc.c_oAscNumFormatType.Text
|
||||
},
|
||||
{caption: '--'},
|
||||
me.pmiAdvancedNumFormat = new Common.UI.MenuItem({
|
||||
caption: me.textMoreFormats,
|
||||
value: 'advanced'
|
||||
})
|
||||
]
|
||||
})
|
||||
});
|
||||
|
||||
me.ssMenu = new Common.UI.Menu({
|
||||
id : 'id-context-menu-cell',
|
||||
items : [
|
||||
|
@ -427,6 +527,7 @@ define([
|
|||
{caption: '--'},
|
||||
me.pmiAddComment,
|
||||
me.pmiCellMenuSeparator,
|
||||
me.pmiNumFormat,
|
||||
me.pmiEntriesList,
|
||||
me.pmiAddNamedRange,
|
||||
me.pmiInsFunction,
|
||||
|
@ -489,6 +590,21 @@ define([
|
|||
me.menuSignatureEditSetup = new Common.UI.MenuItem({caption: this.strSetup, value: 2 });
|
||||
me.menuEditSignSeparator = new Common.UI.MenuItem({ caption: '--' });
|
||||
|
||||
me.menuImgOriginalSize = new Common.UI.MenuItem({
|
||||
caption : me.originalSizeText
|
||||
});
|
||||
|
||||
me.menuImgReplace = new Common.UI.MenuItem({
|
||||
caption : me.textReplace,
|
||||
menu : new Common.UI.Menu({
|
||||
menuAlign: 'tl-tr',
|
||||
items: [
|
||||
new Common.UI.MenuItem({caption : this.textFromFile, value: 'file'}),
|
||||
new Common.UI.MenuItem({caption : this.textFromUrl, value: 'url'})
|
||||
]
|
||||
})
|
||||
});
|
||||
|
||||
this.imgMenu = new Common.UI.Menu({
|
||||
items: [
|
||||
me.pmiImgCut,
|
||||
|
@ -525,6 +641,8 @@ define([
|
|||
me.mnuShapeSeparator,
|
||||
me.mnuChartEdit,
|
||||
me.mnuShapeAdvanced,
|
||||
me.menuImgOriginalSize,
|
||||
me.menuImgReplace,
|
||||
me.mnuImgAdvanced
|
||||
]
|
||||
});
|
||||
|
@ -811,7 +929,23 @@ define([
|
|||
strSign: 'Sign',
|
||||
strDetails: 'Signature Details',
|
||||
strSetup: 'Signature Setup',
|
||||
strDelete: 'Remove Signature'
|
||||
strDelete: 'Remove Signature',
|
||||
originalSizeText: 'Default Size',
|
||||
textReplace: 'Replace image',
|
||||
textFromUrl: 'From URL',
|
||||
textFromFile: 'From File',
|
||||
txtNumFormat: 'Number Format',
|
||||
txtGeneral: 'General',
|
||||
txtNumber: 'Number',
|
||||
txtScientific: 'Scientific',
|
||||
txtAccounting: 'Accounting',
|
||||
txtCurrency: 'Currency',
|
||||
txtDate: 'Date',
|
||||
txtTime: 'Time',
|
||||
txtPercentage: 'Percentage',
|
||||
txtFraction: 'Fraction',
|
||||
txtText: 'Text',
|
||||
textMoreFormats: 'More formats'
|
||||
|
||||
}, SSE.Views.DocumentHolder || {}));
|
||||
});
|
|
@ -262,6 +262,18 @@ define([
|
|||
lock : [_set.editCell, _set.selChart, _set.selChartText, _set.selShape, _set.selShapeText, _set.selImage, _set.lostConnect, _set.coAuth]
|
||||
});
|
||||
|
||||
var formatTemplate =
|
||||
_.template([
|
||||
'<% _.each(items, function(item) { %>',
|
||||
'<li id="<%= item.id %>" data-value="<%= item.value %>"><a tabindex="-1" type="menuitem">',
|
||||
'<div style="position: relative;"><div style="position: absolute; left: 0; width: 100px;"><%= scope.getDisplayValue(item) %></div>',
|
||||
'<div style="display: inline-block; width: 100%; max-width: 300px; overflow: hidden; text-overflow: ellipsis; text-align: right; vertical-align: bottom; padding-left: 100px; color: silver;"><%= item.exampleval ? item.exampleval : "" %></div>',
|
||||
'</div></a></li>',
|
||||
'<% }); %>',
|
||||
'<li class="divider">',
|
||||
'<li id="id-toolbar-mnu-item-more-formats" data-value="-1"><a tabindex="-1" type="menuitem">' + me.textMoreFormats + '</a></li>'
|
||||
].join(''));
|
||||
|
||||
me.cmbNumberFormat = new Common.UI.ComboBox({
|
||||
cls : 'input-group-nr',
|
||||
menuStyle : 'min-width: 180px;',
|
||||
|
|
|
@ -110,6 +110,9 @@
|
|||
"Common.Views.OpenDialog.txtTab": "Tab",
|
||||
"Common.Views.OpenDialog.txtTitle": "Choose %1 options",
|
||||
"Common.Views.OpenDialog.txtTitleProtected": "Protected File",
|
||||
"Common.Views.OpenDialog.txtComma": "Comma",
|
||||
"Common.Views.OpenDialog.txtColon": "Colon",
|
||||
"Common.Views.OpenDialog.txtSemicolon": "Semicolon",
|
||||
"Common.Views.PasswordDialog.cancelButtonText": "Cancel",
|
||||
"Common.Views.PasswordDialog.okButtonText": "OK",
|
||||
"Common.Views.PasswordDialog.txtDescription": "Set a password to protect this document",
|
||||
|
@ -1168,6 +1171,22 @@
|
|||
"SSE.Views.DocumentHolder.txtUngroup": "Ungroup",
|
||||
"SSE.Views.DocumentHolder.txtWidth": "Width",
|
||||
"SSE.Views.DocumentHolder.vertAlignText": "Vertical Alignment",
|
||||
"SSE.Views.DocumentHolder.originalSizeText": "Default Size",
|
||||
"SSE.Views.DocumentHolder.textReplace": "Replace image",
|
||||
"SSE.Views.DocumentHolder.textFromUrl": "From URL",
|
||||
"SSE.Views.DocumentHolder.textFromFile": "From File",
|
||||
"SSE.Views.DocumentHolder.txtNumFormat": "Number Format",
|
||||
"SSE.Views.DocumentHolder.txtGeneral": "General",
|
||||
"SSE.Views.DocumentHolder.txtNumber": "Number",
|
||||
"SSE.Views.DocumentHolder.txtScientific": "Scientific",
|
||||
"SSE.Views.DocumentHolder.txtAccounting": "Accounting",
|
||||
"SSE.Views.DocumentHolder.txtCurrency": "Currency",
|
||||
"SSE.Views.DocumentHolder.txtDate": "Date",
|
||||
"SSE.Views.DocumentHolder.txtTime": "Time",
|
||||
"SSE.Views.DocumentHolder.txtPercentage": "Percentage",
|
||||
"SSE.Views.DocumentHolder.txtFraction": "Fraction",
|
||||
"SSE.Views.DocumentHolder.txtText": "Text",
|
||||
"SSE.Views.DocumentHolder.textMoreFormats": "More formats",
|
||||
"SSE.Views.FileMenu.btnBackCaption": "Go to Documents",
|
||||
"SSE.Views.FileMenu.btnCloseMenuCaption": "Close Menu",
|
||||
"SSE.Views.FileMenu.btnCreateNewCaption": "Create New",
|
||||
|
|
Loading…
Reference in a new issue