diff --git a/apps/api/documents/api.js b/apps/api/documents/api.js
index c592dd587e..a0b6496359 100644
--- a/apps/api/documents/api.js
+++ b/apps/api/documents/api.js
@@ -189,6 +189,7 @@
_config.editorConfig.canHistoryRestore = _config.events && !!_config.events.onRequestRestore;
_config.editorConfig.canSendEmailAddresses = _config.events && !!_config.events.onRequestEmailAddresses;
_config.editorConfig.canRequestEditRights = _config.events && !!_config.events.onRequestEditRights;
+ _config.editorConfig.canRequestClose = _config.events && !!_config.events.onRequestClose;
_config.frameEditorId = placeholderId;
_config.events && !!_config.events.onReady && console.log("Obsolete: The onReady event is deprecated. Please use onAppReady instead.");
diff --git a/apps/common/Gateway.js b/apps/common/Gateway.js
index 71d36ecc1d..5e06dbdd89 100644
--- a/apps/common/Gateway.js
+++ b/apps/common/Gateway.js
@@ -250,6 +250,10 @@ if (Common === undefined) {
_postMessage({ event: 'onDocumentReady' });
},
+ requestClose: function() {
+ _postMessage({event: 'onRequestClose'});
+ },
+
on: function(event, handler){
var localHandler = function(event, data){
handler.call(me, data)
diff --git a/apps/common/main/lib/component/Window.js b/apps/common/main/lib/component/Window.js
index acfec692b7..e4387beaa6 100644
--- a/apps/common/main/lib/component/Window.js
+++ b/apps/common/main/lib/component/Window.js
@@ -191,7 +191,10 @@ define([
event.preventDefault();
event.stopPropagation();
if (this.initConfig.closable !== false) {
- this.initConfig.toolclose=='hide' ? this.hide() : this.close();
+ if (this.initConfig.toolcallback)
+ this.initConfig.toolcallback.call(this);
+ else
+ (this.initConfig.toolclose=='hide') ? this.hide() : this.close();
}
return false;
}
diff --git a/apps/common/main/lib/view/Header.js b/apps/common/main/lib/view/Header.js
index f19778d6f9..083b94536d 100644
--- a/apps/common/main/lib/view/Header.js
+++ b/apps/common/main/lib/view/Header.js
@@ -219,7 +219,8 @@ define([
appConfig = mode;
var me = this;
- me.btnGoBack.updateHint(me.textBack);
+ if ( !me.branding.goback )
+ me.btnGoBack.updateHint(me.textBack);
me.btnGoBack.on('click', function (e) {
Common.NotificationCenter.trigger('goback', true);
});
@@ -511,11 +512,17 @@ define([
this.branding = value;
- if (value && value.logo && value.logo.image) {
- element = $('#header-logo');
- if ( element ) {
- element.html('
');
- element.css({'background-image': 'none', width: 'auto'});
+ if ( value ) {
+ if ( value.logo && value.logo.image ) {
+ element = $('#header-logo');
+ if (element) {
+ element.html('
');
+ element.css({'background-image': 'none', width: 'auto'});
+ }
+ }
+
+ if ( !!value.goback ) {
+ this.btnGoBack.updateHint(value.goback.text);
}
}
},
diff --git a/apps/common/main/lib/view/OpenDialog.js b/apps/common/main/lib/view/OpenDialog.js
index 43a8ddf7f1..462f7f0289 100644
--- a/apps/common/main/lib/view/OpenDialog.js
+++ b/apps/common/main/lib/view/OpenDialog.js
@@ -54,14 +54,15 @@ define([
_options = {};
_.extend(_options, {
- closable: false,
+ closable : false,
width : 250,
height : (options.type == Asc.c_oAscAdvancedOptionsID.CSV) ? 205 : 155,
contentWidth : 390,
header : true,
cls : 'open-dlg',
contentTemplate : '',
- title : (options.type == Asc.c_oAscAdvancedOptionsID.DRM) ? t.txtTitleProtected : t.txtTitle.replace('%1', (options.type == Asc.c_oAscAdvancedOptionsID.CSV) ? 'CSV' : 'TXT')
+ title : (options.type == Asc.c_oAscAdvancedOptionsID.DRM) ? t.txtTitleProtected : t.txtTitle.replace('%1', (options.type == Asc.c_oAscAdvancedOptionsID.CSV) ? 'CSV' : 'TXT'),
+ toolcallback : _.bind(t.onToolClose, t)
}, options);
@@ -84,18 +85,21 @@ define([
'<% } %>',
'',
'',
-
'
diff --git a/apps/presentationeditor/main/app/view/DocumentHolder.js b/apps/presentationeditor/main/app/view/DocumentHolder.js
index 8ce3c5fda0..7e56c8200d 100644
--- a/apps/presentationeditor/main/app/view/DocumentHolder.js
+++ b/apps/presentationeditor/main/app/view/DocumentHolder.js
@@ -2116,6 +2116,22 @@ define([
})()
});
+ var menuTableDistRows = new Common.UI.MenuItem({
+ caption : me.textDistributeRows
+ }).on('click', _.bind(function(){
+ if (me.api)
+ me.api.asc_DistributeTableCells(false);
+ me.fireEvent('editcomplete', me);
+ }, me));
+
+ var menuTableDistCols = new Common.UI.MenuItem({
+ caption : me.textDistributeCols
+ }).on('click', _.bind(function(){
+ if (me.api)
+ me.api.asc_DistributeTableCells(true);
+ me.fireEvent('editcomplete', me);
+ }, me));
+
me.menuSpellTable = new Common.UI.MenuItem({
caption : me.loadSpellText,
disabled : true
@@ -2910,7 +2926,7 @@ define([
return;
var isEquation= (value.mathProps && value.mathProps.value);
- for (var i = 6; i < 16; i++) {
+ for (var i = 6; i < 19; i++) {
me.tableMenu.items[i].setVisible(!isEquation);
}
@@ -2924,6 +2940,8 @@ define([
mnuTableMerge.setDisabled(value.tableProps.locked || disabled || !me.api.CheckBeforeMergeCells());
mnuTableSplit.setDisabled(value.tableProps.locked || disabled || !me.api.CheckBeforeSplitCells());
}
+ menuTableDistRows.setDisabled(value.tableProps.locked || disabled);
+ menuTableDistCols.setDisabled(value.tableProps.locked || disabled);
me.tableMenu.items[7].setDisabled(value.tableProps.locked || disabled);
me.tableMenu.items[8].setDisabled(value.tableProps.locked || disabled);
@@ -3068,6 +3086,9 @@ define([
mnuTableMerge,
mnuTableSplit,
{ caption: '--' },
+ menuTableDistRows,
+ menuTableDistCols,
+ { caption: '--' },
menuTableCellAlign,
{ caption: '--' },
menuTableAdvanced,
@@ -3101,12 +3122,12 @@ define([
disabled = imgdisabled || shapedisabled || chartdisabled || (value.slideProps!==undefined && value.slideProps.locked);
// image properties
- menuImgOriginalSize.setVisible(_.isUndefined(value.shapeProps) && _.isUndefined(value.chartProps));
+ menuImgOriginalSize.setVisible((_.isUndefined(value.shapeProps) || value.shapeProps.value.get_FromImage()) && _.isUndefined(value.chartProps));
if (menuImgOriginalSize.isVisible())
menuImgOriginalSize.setDisabled(disabled || _.isNull(value.imgProps.value.get_ImageUrl()) || _.isUndefined(value.imgProps.value.get_ImageUrl()));
- menuImageAdvanced.setVisible(_.isUndefined(value.shapeProps) && _.isUndefined(value.chartProps));
+ menuImageAdvanced.setVisible((_.isUndefined(value.shapeProps) || value.shapeProps.value.get_FromImage()) && _.isUndefined(value.chartProps));
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());
@@ -3375,7 +3396,9 @@ define([
txtKeepTextOnly: 'Keep text only',
txtPastePicture: 'Picture',
txtPasteSourceFormat: 'Keep source formatting',
- txtPasteDestFormat: 'Use destination theme'
+ txtPasteDestFormat: 'Use destination theme',
+ textDistributeRows: 'Distribute rows',
+ textDistributeCols: 'Distribute columns'
}, PE.Views.DocumentHolder || {}));
});
\ No newline at end of file
diff --git a/apps/presentationeditor/main/app/view/FileMenu.js b/apps/presentationeditor/main/app/view/FileMenu.js
index bc10f274a9..91ca8a3838 100644
--- a/apps/presentationeditor/main/app/view/FileMenu.js
+++ b/apps/presentationeditor/main/app/view/FileMenu.js
@@ -216,7 +216,7 @@ define([
},
show: function(panel) {
- if (this.isVisible() && panel===undefined) return;
+ if (this.isVisible() && panel===undefined || !this.mode) return;
var defPanel = (this.mode.canDownload && (!this.mode.isDesktopApp || !this.mode.isOffline)) ? 'saveas' : 'info';
if (!panel)
diff --git a/apps/presentationeditor/main/app/view/LeftMenu.js b/apps/presentationeditor/main/app/view/LeftMenu.js
index 5bd9deb5c1..d72f0912a3 100644
--- a/apps/presentationeditor/main/app/view/LeftMenu.js
+++ b/apps/presentationeditor/main/app/view/LeftMenu.js
@@ -302,12 +302,10 @@ define([
},
disableMenu: function(menu, disable) {
- this.btnSearch.setDisabled(disable);
this.btnThumbs.setDisabled(disable);
this.btnAbout.setDisabled(disable);
this.btnSupport.setDisabled(disable);
/** coauthoring begin **/
- this.btnComments.setDisabled(disable);
this.btnChat.setDisabled(disable);
/** coauthoring end **/
this.btnPlugins.setDisabled(disable);
diff --git a/apps/presentationeditor/main/app/view/ShapeSettings.js b/apps/presentationeditor/main/app/view/ShapeSettings.js
index 3d96ff7918..3a20fbd5f7 100644
--- a/apps/presentationeditor/main/app/view/ShapeSettings.js
+++ b/apps/presentationeditor/main/app/view/ShapeSettings.js
@@ -687,11 +687,17 @@ define([
var shapetype = props.asc_getType();
this.disableControls(this._locked==true, props.get_CanFill() !== true);
- this.hideShapeOnlySettings(props.get_FromChart());
- this.hideChangeTypeSettings(shapetype=='line' || shapetype=='bentConnector2' || shapetype=='bentConnector3'
- || shapetype=='bentConnector4' || shapetype=='bentConnector5' || shapetype=='curvedConnector2'
- || shapetype=='curvedConnector3' || shapetype=='curvedConnector4' || shapetype=='curvedConnector5'
- || shapetype=='straightConnector1');
+ this.hideShapeOnlySettings(props.get_FromChart() || props.get_FromImage());
+
+ var hidechangetype = props.get_FromChart() || shapetype=='line' || shapetype=='bentConnector2' || shapetype=='bentConnector3'
+ || shapetype=='bentConnector4' || shapetype=='bentConnector5' || shapetype=='curvedConnector2'
+ || shapetype=='curvedConnector3' || shapetype=='curvedConnector4' || shapetype=='curvedConnector5'
+ || shapetype=='straightConnector1';
+ this.hideChangeTypeSettings(hidechangetype);
+ if (!hidechangetype) {
+ this.btnChangeShape.menu.items[0].setVisible(props.get_FromImage());
+ this.btnChangeShape.menu.items[1].setVisible(!props.get_FromImage());
+ }
// background colors
var rec = null;
@@ -1395,22 +1401,27 @@ define([
shapesStore = this.application.getCollection('ShapeGroups');
var count = shapesStore.length;
- for (var i=0; i0; i++) {
+ var shapeGroup = shapesStore.at(i>-1 ? i : i+1);
var menuItem = new Common.UI.MenuItem({
caption: shapeGroup.get('groupName'),
menu: new Common.UI.Menu({
menuAlign: 'tr-tl',
items: [
- { template: _.template('') }
+ { template: _.template('') }
]
})
});
me.btnChangeShape.menu.addItem(menuItem);
+ var store = shapeGroup.get('groupStore');
+ if (i<0) {
+ store = store.clone();
+ store.shift();
+ }
var shapePicker = new Common.UI.DataView({
- el: $('#id-shape-menu-shapegroup' + i),
- store: shapeGroup.get('groupStore'),
+ el: $('#id-shape-menu-shapegroup' + (i+1)),
+ store: store,
parentMenu: menuItem.menu,
showLast: false,
itemTemplate: _.template(' ')
diff --git a/apps/presentationeditor/main/app/view/TableSettings.js b/apps/presentationeditor/main/app/view/TableSettings.js
index 815b667609..251b624cdf 100644
--- a/apps/presentationeditor/main/app/view/TableSettings.js
+++ b/apps/presentationeditor/main/app/view/TableSettings.js
@@ -80,8 +80,11 @@ define([
CheckLast: false,
CheckColBanded: false,
BackColor: '#000000',
- DisabledControls: false
+ DisabledControls: false,
+ Width: null,
+ Height: null
};
+ this.spinners = [];
this.lockedControls = [];
this._locked = false;
this._originalLook = new Asc.CTablePropLook();
@@ -350,6 +353,56 @@ define([
this.btnEdit.menu.on('item:click', _.bind(this.onEditClick, this));
this.lockedControls.push(this.btnEdit);
+ this.numHeight = new Common.UI.MetricSpinner({
+ el: $('#table-spin-cell-height'),
+ step: .1,
+ width: 115,
+ defaultUnit : "cm",
+ value: '1 cm',
+ maxValue: 55.88,
+ minValue: 0
+ });
+ this.numHeight.on('change', _.bind(function(field, newValue, oldValue, eOpts){
+ var _props = new Asc.CTableProp();
+ _props.put_RowHeight(Common.Utils.Metric.fnRecalcToMM(field.getNumberValue()));
+ this.api.tblApply(_props);
+ }, this));
+ this.lockedControls.push(this.numHeight);
+ this.spinners.push(this.numHeight);
+
+ this.numWidth = new Common.UI.MetricSpinner({
+ el: $('#table-spin-cell-width'),
+ step: .1,
+ width: 115,
+ defaultUnit : "cm",
+ value: '1 cm',
+ maxValue: 55.88,
+ minValue: 0
+ });
+ this.numWidth.on('change', _.bind(function(field, newValue, oldValue, eOpts){
+ var _props = new Asc.CTableProp();
+ _props.put_ColumnWidth(Common.Utils.Metric.fnRecalcToMM(field.getNumberValue()));
+ this.api.tblApply(_props);
+ }, this));
+ this.lockedControls.push(this.numWidth);
+ this.spinners.push(this.numWidth);
+
+ this.btnDistributeRows = new Common.UI.Button({
+ el: $('#table-btn-distrub-rows')
+ });
+ this.lockedControls.push(this.btnDistributeRows);
+ this.btnDistributeRows.on('click', _.bind(function(btn){
+ this.api.asc_DistributeTableCells(false);
+ }, this));
+
+ this.btnDistributeCols = new Common.UI.Button({
+ el: $('#table-btn-distrub-cols')
+ });
+ this.lockedControls.push(this.btnDistributeCols);
+ this.btnDistributeCols.on('click', _.bind(function(btn){
+ this.api.asc_DistributeTableCells(true);
+ }, this));
+
this.linkAdvanced = $('#table-advanced-link');
$(this.el).on('click', '#table-advanced-link', _.bind(this.openAdvancedSettings, this));
},
@@ -365,8 +418,21 @@ define([
this._originalProps = new Asc.CTableProp(props);
this._originalProps.put_CellSelect(true);
+ var value = props.get_ColumnWidth();
+ if ((this._state.Width === undefined || value === undefined)&&(this._state.Width!==value) ||
+ Math.abs(this._state.Width-value)>0.001) {
+ this.numWidth.setValue((value !== null && value !== undefined) ? Common.Utils.Metric.fnRecalcFromMM(value) : '', true);
+ this._state.Width=value;
+ }
+ value = props.get_RowHeight();
+ if ((this._state.Height === undefined || value === undefined)&&(this._state.Height!==value) ||
+ Math.abs(this._state.Height-value)>0.001) {
+ this.numHeight.setValue((value !== null && value !== undefined) ? Common.Utils.Metric.fnRecalcFromMM(value) : '', true);
+ this._state.Height=value;
+ }
+
//for table-template
- var value = props.get_TableStyle();
+ value = props.get_TableStyle();
if (this._state.TemplateId!==value || this._isTemplatesChanged) {
this.cmbTableTemplate.suspendEvents();
var rec = this.cmbTableTemplate.menuPicker.store.findWhere({
@@ -473,6 +539,16 @@ define([
}
},
+ updateMetricUnit: function() {
+ if (this.spinners) {
+ for (var i=0; i canRequestEditRights must be defined
this.appOptions.isEdit = (this.appOptions.canLicense || this.appOptions.isEditDiagram || this.appOptions.isEditMailMerge) && this.permissions.edit !== false && this.editorConfig.mode !== 'view';
@@ -1534,14 +1540,18 @@ define([
});
} else if (type == Asc.c_oAscAdvancedOptionsID.DRM) {
me._state.openDlg = new Common.Views.OpenDialog({
+ closable: me.appOptions.canRequestClose,
type: type,
validatePwd: !!me._state.isDRM,
- handler: function (value) {
+ handler: function (result, value) {
me.isShowOpenDialog = false;
- if (me && me.api) {
- me.api.asc_setAdvancedOptions(type, new Asc.asc_CDRMAdvancedOptions(value));
- me.loadMask && me.loadMask.show();
- }
+ if (result == 'ok') {
+ if (me && me.api) {
+ me.api.asc_setAdvancedOptions(type, new Asc.asc_CDRMAdvancedOptions(value));
+ me.loadMask && me.loadMask.show();
+ }
+ } else
+ Common.Gateway.requestClose();
me._state.openDlg = null;
}
});
diff --git a/apps/spreadsheeteditor/main/app/controller/PivotTable.js b/apps/spreadsheeteditor/main/app/controller/PivotTable.js
index ee2b75727c..5f336a5929 100644
--- a/apps/spreadsheeteditor/main/app/controller/PivotTable.js
+++ b/apps/spreadsheeteditor/main/app/controller/PivotTable.js
@@ -59,6 +59,7 @@ define([
'pivottable:rowscolumns': _.bind(this.onCheckTemplateChange, this),
'pivottable:create': _.bind(this.onCreateClick, this),
'pivottable:refresh': _.bind(this.onRefreshClick, this),
+ 'pivottable:select': _.bind(this.onSelectClick, this),
'pivottable:style': _.bind(this.onPivotStyleSelect, this),
'pivottable:layout': _.bind(this.onPivotLayout, this),
'pivottable:blankrows': _.bind(this.onPivotBlankRows, this),
@@ -143,6 +144,13 @@ define([
Common.NotificationCenter.trigger('edit:complete', this);
},
+ onSelectClick: function(btn, opts){
+ if (this.api) {
+ this._originalProps.asc_select(this.api);
+ }
+ Common.NotificationCenter.trigger('edit:complete', this);
+ },
+
onPivotStyleSelect: function(record){
if (this.api) {
this._originalProps.asc_getStyleInfo().asc_setName(this.api, this._originalProps, record.get('name'));
diff --git a/apps/spreadsheeteditor/main/app/template/ShapeSettings.template b/apps/spreadsheeteditor/main/app/template/ShapeSettings.template
index 13fc671a51..f86e7770a5 100644
--- a/apps/spreadsheeteditor/main/app/template/ShapeSettings.template
+++ b/apps/spreadsheeteditor/main/app/template/ShapeSettings.template
@@ -97,7 +97,7 @@
|