Merge branch 'develop' into feature/desktop-new
This commit is contained in:
commit
8be206fa33
|
@ -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.");
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -219,6 +219,7 @@ define([
|
|||
appConfig = mode;
|
||||
|
||||
var me = this;
|
||||
if ( !me.branding.goback )
|
||||
me.btnGoBack.updateHint(me.textBack);
|
||||
me.btnGoBack.on('click', function (e) {
|
||||
Common.NotificationCenter.trigger('goback', true);
|
||||
|
@ -511,13 +512,19 @@ define([
|
|||
|
||||
this.branding = value;
|
||||
|
||||
if (value && value.logo && value.logo.image) {
|
||||
if ( value ) {
|
||||
if ( value.logo && value.logo.image ) {
|
||||
element = $('#header-logo');
|
||||
if ( element ) {
|
||||
if (element) {
|
||||
element.html('<img src="' + value.logo.image + '" style="max-width:100px; max-height:20px; margin: 0;"/>');
|
||||
element.css({'background-image': 'none', width: 'auto'});
|
||||
}
|
||||
}
|
||||
|
||||
if ( !!value.goback ) {
|
||||
this.btnGoBack.updateHint(value.goback.text);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
setDocumentCaption: function(value) {
|
||||
|
|
|
@ -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([
|
|||
'<% } %>',
|
||||
'</div>',
|
||||
'</div>',
|
||||
|
||||
'<div class="separator horizontal"/>',
|
||||
'<div class="footer center">',
|
||||
'<button class="btn normal dlg-btn primary" result="ok" style="margin-right:10px;">' + t.okButtonText + '</button>',
|
||||
'<% if (closable) { %>',
|
||||
'<button class="btn normal dlg-btn" result="cancel">' + t.closeButtonText + '</button>',
|
||||
'<% } %>',
|
||||
'</div>'
|
||||
].join('');
|
||||
|
||||
this.handler = options.handler;
|
||||
this.type = options.type;
|
||||
this.codepages = options.codepages;
|
||||
this.settings = options.settings;
|
||||
this.validatePwd = options.validatePwd || false;
|
||||
this.handler = _options.handler;
|
||||
this.type = _options.type;
|
||||
this.closable = _options.closable;
|
||||
this.codepages = _options.codepages;
|
||||
this.settings = _options.settings;
|
||||
this.validatePwd = _options.validatePwd || false;
|
||||
|
||||
_options.tpl = _.template(this.template)(_options);
|
||||
|
||||
|
@ -106,6 +110,7 @@ define([
|
|||
|
||||
if (this.$window) {
|
||||
var me = this;
|
||||
if (!this.closable)
|
||||
this.$window.find('.tool').hide();
|
||||
this.$window.find('.dlg-btn').on('click', _.bind(this.onBtnClick, this));
|
||||
if (this.type == Asc.c_oAscAdvancedOptionsID.DRM) {
|
||||
|
@ -120,12 +125,12 @@ define([
|
|||
this.$window.find('input').on('keypress', _.bind(this.onKeyPress, this));
|
||||
} else {
|
||||
this.initCodePages();
|
||||
}
|
||||
this.onPrimary = function() {
|
||||
me.onBtnClick();
|
||||
me._handleInput('ok');
|
||||
return false;
|
||||
};
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
show: function() {
|
||||
|
@ -141,25 +146,36 @@ define([
|
|||
}
|
||||
},
|
||||
|
||||
onBtnClick: function (event) {
|
||||
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);
|
||||
},
|
||||
|
||||
onToolClose: function() {
|
||||
this._handleInput('cancel');
|
||||
},
|
||||
|
||||
_handleInput: function(state) {
|
||||
if (this.handler) {
|
||||
if (this.cmbEncoding) {
|
||||
var delimiter = this.cmbDelimiter ? this.cmbDelimiter.getValue() : null,
|
||||
delimiterChar = (delimiter == -1) ? this.inputDelimiter.getValue() : null;
|
||||
(delimiter == -1) && (delimiter = null);
|
||||
this.handler.call(this, this.cmbEncoding.getValue(), delimiter, delimiterChar);
|
||||
} else
|
||||
this.handler.call(this, this.inputPwd.getValue());
|
||||
} else {
|
||||
this.handler.call(this, state, this.inputPwd.getValue());
|
||||
}
|
||||
}
|
||||
|
||||
this.close();
|
||||
},
|
||||
|
||||
onKeyPress: function(event) {
|
||||
if (event.keyCode == Common.UI.Keys.RETURN)
|
||||
this.onBtnClick();
|
||||
},
|
||||
|
||||
initCodePages: function () {
|
||||
var i, c, codepage, encodedata = [], listItems = [], length = 0;
|
||||
|
||||
|
@ -381,7 +397,8 @@ define([
|
|||
txtPassword : "Password",
|
||||
txtTitleProtected : "Protected File",
|
||||
txtOther: 'Other',
|
||||
txtIncorrectPwd: 'Password is incorrect.'
|
||||
txtIncorrectPwd: 'Password is incorrect.',
|
||||
closeButtonText: 'Close File'
|
||||
|
||||
}, Common.Views.OpenDialog || {}));
|
||||
});
|
Binary file not shown.
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 9 KiB |
Binary file not shown.
Before Width: | Height: | Size: 30 KiB After Width: | Height: | Size: 18 KiB |
|
@ -316,3 +316,4 @@
|
|||
.button-normal-icon(~'x-huge .btn-grand-totals', 52, @toolbar-big-icon-size);
|
||||
.button-normal-icon(~'x-huge .btn-contents', 53, @toolbar-big-icon-size);
|
||||
.button-normal-icon(btn-controls, 54, @toolbar-big-icon-size);
|
||||
.button-normal-icon(~'x-huge .btn-select-pivot', 55, @toolbar-big-icon-size);
|
||||
|
|
|
@ -610,6 +610,8 @@ define([
|
|||
},
|
||||
|
||||
onShortcut: function(s, e) {
|
||||
if (!this.mode) return;
|
||||
|
||||
switch (s) {
|
||||
case 'replace':
|
||||
case 'search':
|
||||
|
|
|
@ -761,6 +761,12 @@ define([
|
|||
title = this.loadingDocumentTitleText;
|
||||
text = this.loadingDocumentTextText;
|
||||
break;
|
||||
default:
|
||||
if (typeof action.id == 'string'){
|
||||
title = action.id;
|
||||
text = action.id;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
if (action.type == Asc.c_oAscAsyncActionType['BlockInteraction']) {
|
||||
|
@ -1066,6 +1072,7 @@ define([
|
|||
this.appOptions.isOffline = this.api.asc_isOffline();
|
||||
this.appOptions.isReviewOnly = this.permissions.review === true && this.permissions.edit === false;
|
||||
this.appOptions.canRequestEditRights = this.editorConfig.canRequestEditRights;
|
||||
this.appOptions.canRequestClose = this.editorConfig.canRequestClose;
|
||||
this.appOptions.canEdit = (this.permissions.edit !== false || this.permissions.review === true) && // can edit or review
|
||||
(this.editorConfig.canRequestEditRights || this.editorConfig.mode !== 'view') && // if mode=="view" -> canRequestEditRights must be defined
|
||||
(!this.appOptions.isReviewOnly || this.appOptions.canLicense); // if isReviewOnly==true -> canLicense must be true
|
||||
|
@ -1862,14 +1869,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) {
|
||||
if (result == 'ok') {
|
||||
if (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;
|
||||
}
|
||||
});
|
||||
|
|
|
@ -260,6 +260,7 @@ define([
|
|||
this.rightmenu.paragraphSettings.updateMetricUnit();
|
||||
this.rightmenu.chartSettings.updateMetricUnit();
|
||||
this.rightmenu.imageSettings.updateMetricUnit();
|
||||
this.rightmenu.tableSettings.updateMetricUnit();
|
||||
},
|
||||
|
||||
createDelayedElements: function() {
|
||||
|
|
|
@ -134,18 +134,18 @@
|
|||
<tr class="shape-only">
|
||||
<td class="padding-small"></td>
|
||||
</tr>
|
||||
<tr class="shape-only">
|
||||
<tr class="change-type">
|
||||
<td class="padding-small">
|
||||
<div class="separator horizontal"></div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="shape-only change-type">
|
||||
<tr class="change-type">
|
||||
<td class="padding-small">
|
||||
<label class="header" style="margin-top: 3px;"><%= scope.strChange %></label>
|
||||
<div id="shape-btn-change" style="display: inline-block; float:right;"></div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="shape-only change-type">
|
||||
<tr class="shape-only">
|
||||
<td class="padding-small">
|
||||
<div class="separator horizontal"></div>
|
||||
</td>
|
||||
|
|
|
@ -95,14 +95,9 @@
|
|||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan=2>
|
||||
<label class="header"><%= scope.textWrap %></label>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="padding-small">
|
||||
<div id="table-button-wrap-none" style="display: inline-block; margin-right:5px;"></div>
|
||||
<div id="table-button-wrap-parallel" style="display: inline-block; margin-right:5px;"></div>
|
||||
<td class="padding-small" colspan=2>
|
||||
<label class="header" style="margin-top: 3px;"><%= scope.textEdit %></label>
|
||||
<div id="table-btn-edit" style="display: inline-block; float:right;"></div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@ -110,10 +105,31 @@
|
|||
<div class="separator horizontal"></div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan=2>
|
||||
<label class="header"><%= scope.textCellSize %></label>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="padding-small" colspan=2>
|
||||
<label class="header" style="margin-top: 3px;"><%= scope.textEdit %></label>
|
||||
<div id="table-btn-edit" style="display: inline-block; float:right;"></div>
|
||||
<label style="margin-top: 3px;"><%= scope.textHeight %></label>
|
||||
<div id="table-spin-cell-height" style="display: inline-block; float:right;"></div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="padding-small" colspan=2>
|
||||
<label style="margin-top: 3px;"><%= scope.textWidth %></label>
|
||||
<div id="table-spin-cell-width" style="display: inline-block; float:right;"></div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="padding-small" colspan=2>
|
||||
<button type="button" class="btn btn-text-default" id="table-btn-distrub-rows" style="width:100%;"><%= scope.textDistributeRows %></button>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="padding-small" colspan=2>
|
||||
<button type="button" class="btn btn-text-default" id="table-btn-distrub-cols" style="width:100%;"><%= scope.textDistributeCols %></button>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
|
|
@ -137,6 +137,8 @@ define([
|
|||
if (shapeprops) {
|
||||
if (shapeprops.get_FromChart())
|
||||
menu_props.imgProps.isChart = true;
|
||||
else if (shapeprops.get_FromImage())
|
||||
menu_props.imgProps.isOnlyImg = true;
|
||||
else
|
||||
menu_props.imgProps.isShape = true;
|
||||
} else if ( chartprops )
|
||||
|
@ -1519,6 +1521,7 @@ define([
|
|||
this.api.asc_registerCallback('asc_onDialogAddHyperlink', onDialogAddHyperlink);
|
||||
this.api.asc_registerCallback('asc_doubleClickOnChart', onDoubleClickOnChart);
|
||||
this.api.asc_registerCallback('asc_onSpellCheckVariantsFound', _.bind(onSpellCheckVariantsFound, this));
|
||||
this.api.asc_registerCallback('asc_onRulerDblClick', _.bind(this.onRulerDblClick, this));
|
||||
}
|
||||
this.api.asc_registerCallback('asc_onCoAuthoringDisconnect', _.bind(onCoAuthoringDisconnect, this));
|
||||
Common.NotificationCenter.on('api:disconnect', _.bind(onCoAuthoringDisconnect, this));
|
||||
|
@ -1595,27 +1598,6 @@ define([
|
|||
window.currentStyleName = name;
|
||||
},
|
||||
|
||||
_applyTableWrap: function(wrap, align){
|
||||
var selectedElements = this.api.getSelectedElements();
|
||||
if (selectedElements && _.isArray(selectedElements)){
|
||||
for (var i = selectedElements.length - 1; i >= 0; i--) {
|
||||
var elType, elValue;
|
||||
elType = selectedElements[i].get_ObjectType();
|
||||
elValue = selectedElements[i].get_ObjectValue();
|
||||
if (Asc.c_oAscTypeSelectElement.Table == elType) {
|
||||
var properties = new Asc.CTableProp();
|
||||
properties.put_TableWrap(wrap);
|
||||
if (wrap == c_tableWrap.TABLE_WRAP_NONE) {
|
||||
properties.put_TableAlignment(align);
|
||||
properties.put_TableIndent(0);
|
||||
}
|
||||
this.api.tblApply(properties);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
advancedParagraphClick: function(item, e, eOpt){
|
||||
var win, me = this;
|
||||
if (me.api){
|
||||
|
@ -1652,6 +1634,7 @@ define([
|
|||
|
||||
if (win) {
|
||||
win.show();
|
||||
return win;
|
||||
}
|
||||
},
|
||||
|
||||
|
@ -1694,6 +1677,93 @@ define([
|
|||
}
|
||||
},
|
||||
|
||||
advancedTableClick: function(item, e, eOpt){
|
||||
var win, me = this;
|
||||
if (me.api){
|
||||
var selectedElements = me.api.getSelectedElements();
|
||||
|
||||
if (selectedElements && _.isArray(selectedElements)){
|
||||
for (var i = selectedElements.length - 1; i >= 0; i--) {
|
||||
var elType, elValue;
|
||||
|
||||
elType = selectedElements[i].get_ObjectType();
|
||||
elValue = selectedElements[i].get_ObjectValue();
|
||||
|
||||
if (Asc.c_oAscTypeSelectElement.Table == elType) {
|
||||
win = new DE.Views.TableSettingsAdvanced({
|
||||
tableStylerRows : (elValue.get_CellBorders().get_InsideH()===null && elValue.get_CellSelect()==true) ? 1 : 2,
|
||||
tableStylerColumns : (elValue.get_CellBorders().get_InsideV()===null && elValue.get_CellSelect()==true) ? 1 : 2,
|
||||
tableProps : elValue,
|
||||
borderProps : me.borderAdvancedProps,
|
||||
sectionProps : me.api.asc_GetSectionProps(),
|
||||
handler : function(result, value) {
|
||||
if (result == 'ok') {
|
||||
if (me.api) {
|
||||
me.borderAdvancedProps = value.borderProps;
|
||||
me.api.tblApply(value.tableProps);
|
||||
}
|
||||
}
|
||||
me.fireEvent('editcomplete', me);
|
||||
}
|
||||
});
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (win) {
|
||||
win.show();
|
||||
return win;
|
||||
}
|
||||
},
|
||||
|
||||
onRulerDblClick: function(type) {
|
||||
var win, me = this;
|
||||
if (type == 'tables') {
|
||||
win = this.advancedTableClick();
|
||||
if (win)
|
||||
win.setActiveCategory(4);
|
||||
} else if (type == 'indents' || type == 'tabs') {
|
||||
win = this.advancedParagraphClick({isChart: false});
|
||||
if (win)
|
||||
win.setActiveCategory(type == 'indents' ? 0 : 3);
|
||||
} else if (type == 'margins') {
|
||||
win = new DE.Views.PageMarginsDialog({
|
||||
handler: function(dlg, result) {
|
||||
if (result == 'ok') {
|
||||
var props = dlg.getSettings();
|
||||
var mnu = DE.getController('Toolbar').toolbar.btnPageMargins.menu.items[0];
|
||||
mnu.setVisible(true);
|
||||
mnu.setChecked(true);
|
||||
mnu.options.value = mnu.value = [props.get_TopMargin(), props.get_LeftMargin(), props.get_BottomMargin(), props.get_RightMargin()];
|
||||
$(mnu.el).html(mnu.template({id: Common.UI.getId(), caption : mnu.caption, options : mnu.options}));
|
||||
Common.localStorage.setItem("de-pgmargins-top", props.get_TopMargin());
|
||||
Common.localStorage.setItem("de-pgmargins-left", props.get_LeftMargin());
|
||||
Common.localStorage.setItem("de-pgmargins-bottom", props.get_BottomMargin());
|
||||
Common.localStorage.setItem("de-pgmargins-right", props.get_RightMargin());
|
||||
|
||||
me.api.asc_SetSectionProps(props);
|
||||
me.fireEvent('editcomplete', me);
|
||||
}
|
||||
}
|
||||
});
|
||||
win.show();
|
||||
win.setSettings(me.api.asc_GetSectionProps());
|
||||
} else if (type == 'columns') {
|
||||
win = new DE.Views.CustomColumnsDialog({
|
||||
handler: function(dlg, result) {
|
||||
if (result == 'ok') {
|
||||
me.api.asc_SetColumnsProps(dlg.getSettings());
|
||||
me.fireEvent('editcomplete', me);
|
||||
}
|
||||
}
|
||||
});
|
||||
win.show();
|
||||
win.setSettings(me.api.asc_GetColumnsProps());
|
||||
}
|
||||
},
|
||||
|
||||
editHyperlink: function(item, e, eOpt){
|
||||
var win, me = this;
|
||||
if (me.api){
|
||||
|
@ -1806,14 +1876,14 @@ define([
|
|||
me.api.asc_SetContentControlProperties(value, props.get_InternalId());
|
||||
}
|
||||
|
||||
Common.NotificationCenter.trigger('edit:complete', me.toolbar);
|
||||
me.fireEvent('editcomplete', me);
|
||||
}
|
||||
})).show();
|
||||
} else if (item.value == 'remove') {
|
||||
this.api.asc_RemoveContentControlWrapper(props.get_InternalId());
|
||||
}
|
||||
}
|
||||
Common.NotificationCenter.trigger('edit:complete', this.toolbar);
|
||||
me.fireEvent('editcomplete', me);
|
||||
},
|
||||
|
||||
createDelayedElementsViewer: function() {
|
||||
|
@ -2266,8 +2336,7 @@ define([
|
|||
|
||||
menuChartEdit.setVisible(!_.isNull(value.imgProps.value.get_ChartProperties()) && !onlyCommonProps);
|
||||
|
||||
me.menuOriginalSize.setVisible(_.isNull(value.imgProps.value.get_ChartProperties()) && _.isNull(value.imgProps.value.get_ShapeProperties()) &&
|
||||
!onlyCommonProps);
|
||||
me.menuOriginalSize.setVisible(value.imgProps.isOnlyImg);
|
||||
me.pictureMenu.items[10].setVisible(menuChartEdit.isVisible() || me.menuOriginalSize.isVisible());
|
||||
|
||||
var islocked = value.imgProps.locked || (value.headerProps!==undefined && value.headerProps.locked);
|
||||
|
@ -2327,51 +2396,6 @@ define([
|
|||
|
||||
/* table menu*/
|
||||
|
||||
var tableAlign = function(item, e) {
|
||||
me._applyTableWrap(c_tableWrap.TABLE_WRAP_NONE, item.options.align);
|
||||
};
|
||||
|
||||
var menuTableWrapInline = new Common.UI.MenuItem({
|
||||
caption : me.inlineText,
|
||||
toggleGroup : 'popuptablewrapping',
|
||||
checkable : true,
|
||||
menu : new Common.UI.Menu({
|
||||
menuAlign: 'tl-tr',
|
||||
items : [
|
||||
me.menuTableAlignLeft = new Common.UI.MenuItem({
|
||||
caption : me.textShapeAlignLeft,
|
||||
toggleGroup : 'popuptablealign',
|
||||
checkable : true,
|
||||
checked : false,
|
||||
align : c_tableAlign.TABLE_ALIGN_LEFT
|
||||
}).on('click', _.bind(tableAlign, me)),
|
||||
me.menuTableAlignCenter = new Common.UI.MenuItem({
|
||||
caption : me.textShapeAlignCenter,
|
||||
toggleGroup : 'popuptablealign',
|
||||
checkable : true,
|
||||
checked : false,
|
||||
align : c_tableAlign.TABLE_ALIGN_CENTER
|
||||
}).on('click', _.bind(tableAlign, me)),
|
||||
me.menuTableAlignRight = new Common.UI.MenuItem({
|
||||
caption : me.textShapeAlignRight,
|
||||
toggleGroup : 'popuptablealign',
|
||||
checkable : true,
|
||||
checked : false,
|
||||
align : c_tableAlign.TABLE_ALIGN_RIGHT
|
||||
}).on('click', _.bind(tableAlign, me))
|
||||
]
|
||||
})
|
||||
});
|
||||
|
||||
var menuTableWrapFlow = new Common.UI.MenuItem({
|
||||
caption : me.flowoverText,
|
||||
toggleGroup : 'popuptablewrapping',
|
||||
checkable : true,
|
||||
checked : true
|
||||
}).on('click', function(item) {
|
||||
me._applyTableWrap(c_tableWrap.TABLE_WRAP_PARALLEL);
|
||||
});
|
||||
|
||||
var mnuTableMerge = new Common.UI.MenuItem({
|
||||
caption : me.mergeCellsText
|
||||
}).on('click', function(item) {
|
||||
|
@ -2438,45 +2462,7 @@ define([
|
|||
|
||||
var menuTableAdvanced = new Common.UI.MenuItem({
|
||||
caption : me.advancedTableText
|
||||
}).on('click', function(item, e, eOpt){
|
||||
var win;
|
||||
if (me.api){
|
||||
var selectedElements = me.api.getSelectedElements();
|
||||
|
||||
if (selectedElements && _.isArray(selectedElements)){
|
||||
for (var i = selectedElements.length - 1; i >= 0; i--) {
|
||||
var elType, elValue;
|
||||
|
||||
elType = selectedElements[i].get_ObjectType();
|
||||
elValue = selectedElements[i].get_ObjectValue();
|
||||
|
||||
if (Asc.c_oAscTypeSelectElement.Table == elType) {
|
||||
win = new DE.Views.TableSettingsAdvanced({
|
||||
tableStylerRows : (elValue.get_CellBorders().get_InsideH()===null && elValue.get_CellSelect()==true) ? 1 : 2,
|
||||
tableStylerColumns : (elValue.get_CellBorders().get_InsideV()===null && elValue.get_CellSelect()==true) ? 1 : 2,
|
||||
tableProps : elValue,
|
||||
borderProps : me.borderAdvancedProps,
|
||||
sectionProps : me.api.asc_GetSectionProps(),
|
||||
handler : function(result, value) {
|
||||
if (result == 'ok') {
|
||||
if (me.api) {
|
||||
me.borderAdvancedProps = value.borderProps;
|
||||
me.api.tblApply(value.tableProps);
|
||||
}
|
||||
}
|
||||
me.fireEvent('editcomplete', me);
|
||||
}
|
||||
});
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (win) {
|
||||
win.show();
|
||||
}
|
||||
});
|
||||
}).on('click', _.bind(me.advancedTableClick, me));
|
||||
|
||||
var menuParagraphAdvancedInTable = new Common.UI.MenuItem({
|
||||
caption : me.advancedParagraphText
|
||||
|
@ -2641,6 +2627,22 @@ define([
|
|||
caption : '--'
|
||||
});
|
||||
|
||||
var menuTableDistRows = new Common.UI.MenuItem({
|
||||
caption : me.textDistributeRows
|
||||
}).on('click', _.bind(function(){
|
||||
if (me.api)
|
||||
me.api.asc_DistributeTableCells(false);
|
||||
me.fireEvent('editcomplete', me);
|
||||
}, me));
|
||||
|
||||
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));
|
||||
|
||||
var tableDirection = function(item, e) {
|
||||
if (me.api) {
|
||||
var properties = new Asc.CTableProp();
|
||||
|
@ -2700,14 +2702,6 @@ define([
|
|||
me.menuTableCellCenter.setChecked(align == Asc.c_oAscVertAlignJc.Center);
|
||||
me.menuTableCellBottom.setChecked(align == Asc.c_oAscVertAlignJc.Bottom);
|
||||
|
||||
var flow = (value.tableProps.value.get_TableWrap() == c_tableWrap.TABLE_WRAP_PARALLEL);
|
||||
(flow) ? menuTableWrapFlow.setChecked(true) : menuTableWrapInline.setChecked(true);
|
||||
|
||||
align = value.tableProps.value.get_TableAlignment();
|
||||
me.menuTableAlignLeft.setChecked((flow) ? false : (align === c_tableAlign.TABLE_ALIGN_LEFT));
|
||||
me.menuTableAlignCenter.setChecked((flow) ? false : (align === c_tableAlign.TABLE_ALIGN_CENTER));
|
||||
me.menuTableAlignRight.setChecked((flow) ? false : (align === c_tableAlign.TABLE_ALIGN_RIGHT));
|
||||
|
||||
var dir = value.tableProps.value.get_CellsTextDirection();
|
||||
me.menuTableDirectH.setChecked(dir == Asc.c_oAscCellTextDirection.LRTB);
|
||||
me.menuTableDirect90.setChecked(dir == Asc.c_oAscCellTextDirection.TBRL);
|
||||
|
@ -2722,11 +2716,11 @@ define([
|
|||
mnuTableSplit.setDisabled(disabled || !me.api.CheckBeforeSplitCells());
|
||||
}
|
||||
|
||||
menuTableDistRows.setDisabled(disabled);
|
||||
menuTableDistCols.setDisabled(disabled);
|
||||
menuTableCellAlign.setDisabled(disabled);
|
||||
menuTableDirection.setDisabled(disabled);
|
||||
|
||||
menuTableWrapInline.setDisabled(disabled);
|
||||
menuTableWrapFlow.setDisabled(disabled || !value.tableProps.value.get_CanBeFlow());
|
||||
menuTableAdvanced.setDisabled(disabled);
|
||||
|
||||
var cancopy = me.api && me.api.can_CopyCut();
|
||||
|
@ -2902,12 +2896,12 @@ define([
|
|||
mnuTableMerge,
|
||||
mnuTableSplit,
|
||||
{ caption: '--' },
|
||||
menuTableDistRows,
|
||||
menuTableDistCols,
|
||||
{ caption: '--' },
|
||||
menuTableCellAlign,
|
||||
menuTableDirection,
|
||||
{ caption: '--' },
|
||||
menuTableWrapInline,
|
||||
menuTableWrapFlow,
|
||||
{ caption: '--' },
|
||||
menuTableAdvanced,
|
||||
{ caption: '--' },
|
||||
/** coauthoring begin **/
|
||||
|
@ -3476,8 +3470,6 @@ define([
|
|||
mergeCellsText : 'Merge Cells',
|
||||
splitCellsText : 'Split Cell...',
|
||||
splitCellTitleText : 'Split Cell',
|
||||
flowoverText : 'Wrapping Style - Flow',
|
||||
inlineText : 'Wrapping Style - Inline',
|
||||
originalSizeText : 'Default Size',
|
||||
advancedText : 'Advanced Settings',
|
||||
breakBeforeText : 'Page break before',
|
||||
|
@ -3637,7 +3629,9 @@ define([
|
|||
textRemove: 'Remove',
|
||||
textSettings: 'Settings',
|
||||
textRemoveControl: 'Remove content control',
|
||||
textEditControls: 'Content control settings'
|
||||
textEditControls: 'Content control settings',
|
||||
textDistributeRows: 'Distribute rows',
|
||||
textDistributeCols: 'Distribute columns'
|
||||
|
||||
}, DE.Views.DocumentHolder || {}));
|
||||
});
|
|
@ -221,7 +221,7 @@ define([
|
|||
},
|
||||
|
||||
show: function(panel, opts) {
|
||||
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)
|
||||
|
|
|
@ -755,11 +755,17 @@ define([
|
|||
this._noApply = true;
|
||||
|
||||
this.disableControls(this._locked, !shapeprops.get_CanFill());
|
||||
this.hideShapeOnlySettings(shapeprops.get_FromChart());
|
||||
this.hideChangeTypeSettings(shapetype=='line' || shapetype=='bentConnector2' || shapetype=='bentConnector3'
|
||||
this.hideShapeOnlySettings(shapeprops.get_FromChart() || shapeprops.get_FromImage());
|
||||
|
||||
var hidechangetype = shapeprops.get_FromChart() || shapetype=='line' || shapetype=='bentConnector2' || shapetype=='bentConnector3'
|
||||
|| shapetype=='bentConnector4' || shapetype=='bentConnector5' || shapetype=='curvedConnector2'
|
||||
|| shapetype=='curvedConnector3' || shapetype=='curvedConnector4' || shapetype=='curvedConnector5'
|
||||
|| shapetype=='straightConnector1');
|
||||
|| shapetype=='straightConnector1';
|
||||
this.hideChangeTypeSettings(hidechangetype);
|
||||
if (!hidechangetype) {
|
||||
this.btnChangeShape.menu.items[0].setVisible(shapeprops.get_FromImage());
|
||||
this.btnChangeShape.menu.items[1].setVisible(!shapeprops.get_FromImage());
|
||||
}
|
||||
|
||||
var value = props.get_WrappingStyle();
|
||||
if (this._state.WrappingStyle!==value) {
|
||||
|
@ -1522,22 +1528,27 @@ define([
|
|||
shapesStore = this.application.getCollection('ShapeGroups');
|
||||
|
||||
var count = shapesStore.length;
|
||||
for (var i=0; i<count-1; i++) {
|
||||
var shapeGroup = shapesStore.at(i);
|
||||
for (var i=-1; i<count-1 && count>0; 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('<div id="id-shape-menu-shapegroup' + i + '" class="menu-shape" style="width: ' + (shapeGroup.get('groupWidth') - 8) + 'px; margin-left: 5px;"></div>') }
|
||||
{ template: _.template('<div id="id-shape-menu-shapegroup' + (i+1) + '" class="menu-shape" style="width: ' + (shapeGroup.get('groupWidth') - 8) + 'px; margin-left: 5px;"></div>') }
|
||||
]
|
||||
})
|
||||
});
|
||||
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('<div class="item-shape"><img src="<%= imageUrl %>" id="<%= id %>"></div>')
|
||||
|
|
|
@ -358,6 +358,12 @@ define([
|
|||
this.chLinks.setValue((value !== null && value !== undefined) ? value : 'indeterminate', true);
|
||||
value = props.get_StylesType();
|
||||
this.cmbStyles.setValue((value!==null) ? value : Asc.c_oAscTOCStylesType.Current);
|
||||
value = props.get_ShowPageNumbers();
|
||||
this.chPages.setValue((value !== null && value !== undefined) ? value : 'indeterminate');
|
||||
if (this.chPages.getValue() == 'checked') {
|
||||
value = props.get_RightAlignTab();
|
||||
this.chAlign.setValue((value !== null && value !== undefined) ? value : 'indeterminate');
|
||||
}
|
||||
|
||||
var start = props.get_OutlineStart(),
|
||||
end = props.get_OutlineEnd(),
|
||||
|
@ -446,12 +452,12 @@ define([
|
|||
if (!props) {
|
||||
this._originalProps.put_OutlineRange(this.startLevel, this.endLevel);
|
||||
this._originalProps.put_Hyperlink(this.chLinks.getValue() == 'checked');
|
||||
}
|
||||
this._originalProps.put_ShowPageNumbers(this.chPages.getValue() == 'checked');
|
||||
if (this.chPages.getValue() == 'checked') {
|
||||
this._originalProps.put_RightAlignTab(this.chAlign.getValue() == 'checked');
|
||||
this._originalProps.put_TabLeader(this.cmbLeader.getValue());
|
||||
}
|
||||
}
|
||||
|
||||
// this.api.SetDrawImagePlaceContents('tableofcontents-img', this._originalProps);
|
||||
|
||||
|
|
|
@ -79,14 +79,13 @@ define([
|
|||
CheckFirst: false,
|
||||
CheckLast: false,
|
||||
CheckColBanded: false,
|
||||
WrapStyle: -1,
|
||||
CanBeFlow: true,
|
||||
TableAlignment: -1,
|
||||
TableIndent: 0,
|
||||
BackColor: '#000000',
|
||||
RepeatRow: false,
|
||||
DisabledControls: false
|
||||
DisabledControls: false,
|
||||
Width: null,
|
||||
Height: null
|
||||
};
|
||||
this.spinners = [];
|
||||
this.lockedControls = [];
|
||||
this._locked = false;
|
||||
this._originalLook = new Asc.CTablePropLook();
|
||||
|
@ -96,7 +95,6 @@ define([
|
|||
this.CellColor = {Value: 1, Color: 'transparent'}; // value=1 - цвет определен - прозрачный или другой, value=0 - цвет не определен, рисуем прозрачным
|
||||
this.BorderSize = 1;
|
||||
this._noApply = false;
|
||||
this._wrapHandled = false;
|
||||
|
||||
this.render();
|
||||
},
|
||||
|
@ -140,28 +138,10 @@ define([
|
|||
this.fireEvent('editcomplete', this);
|
||||
},
|
||||
|
||||
onBtnWrapClick: function(btn, e) {
|
||||
if (this.api && btn.pressed && !this._noApply) {
|
||||
var properties = new Asc.CTableProp();
|
||||
properties.put_TableWrap(btn.options.posId);
|
||||
if (btn.options.posId == c_tableWrap.TABLE_WRAP_NONE) {
|
||||
if (this._state.TableAlignment<0)
|
||||
this._state.TableAlignment = c_tableAlign.TABLE_ALIGN_LEFT;
|
||||
properties.put_TableAlignment(this._state.TableAlignment);
|
||||
properties.put_TableIndent(this._state.TableIndent);
|
||||
}
|
||||
properties.put_CellSelect(true);
|
||||
this.api.tblApply(properties);
|
||||
}
|
||||
if (this._wrapHandled) { this._wrapHandled = false; return; }
|
||||
this._wrapHandled = true;
|
||||
this.fireEvent('editcomplete', this);
|
||||
},
|
||||
|
||||
onCheckRepeatRowChange: function(field, newValue, oldValue, eOpts) {
|
||||
if (this.api) {
|
||||
var properties = new Asc.CTableProp();
|
||||
properties.put_RowsInHeader((field.getValue()=='checked') ? 1 : 0 );
|
||||
properties.put_RowsInHeader(field.getValue()=='checked');
|
||||
this.api.tblApply(properties);
|
||||
}
|
||||
this.fireEvent('editcomplete', this);
|
||||
|
@ -259,8 +239,6 @@ define([
|
|||
setApi: function(o) {
|
||||
this.api = o;
|
||||
if (o) {
|
||||
this.api.asc_registerCallback('asc_onTblWrapStyleChanged', _.bind(this._TblWrapStyleChanged, this));
|
||||
this.api.asc_registerCallback('asc_onTblAlignChanged', _.bind(this._TblAlignChanged, this));
|
||||
this.api.asc_registerCallback('asc_onInitTableTemplates', _.bind(this._onInitTemplates, this));
|
||||
}
|
||||
return this;
|
||||
|
@ -310,32 +288,6 @@ define([
|
|||
this.chLast.on('change', _.bind(this.onCheckTemplateChange, this, 4));
|
||||
this.chColBanded.on('change', _.bind(this.onCheckTemplateChange, this, 5));
|
||||
|
||||
this.btnWrapNone = new Common.UI.Button({
|
||||
cls: 'btn-options huge',
|
||||
iconCls: 'icon-right-panel btn-wrap-none',
|
||||
posId: c_tableWrap.TABLE_WRAP_NONE,
|
||||
hint: this.textWrapNoneTooltip,
|
||||
enableToggle: true,
|
||||
allowDepress: false,
|
||||
toggleGroup : 'tablewrapGroup'
|
||||
});
|
||||
this.btnWrapNone.render( $('#table-button-wrap-none')) ;
|
||||
this.btnWrapNone.on('click', _.bind(this.onBtnWrapClick, this));
|
||||
this.lockedControls.push(this.btnWrapNone);
|
||||
|
||||
this.btnWrapParallel = new Common.UI.Button({
|
||||
cls: 'btn-options huge',
|
||||
iconCls: 'icon-right-panel btn-wrap-parallel',
|
||||
posId: c_tableWrap.TABLE_WRAP_PARALLEL,
|
||||
hint: this.textWrapParallelTooltip,
|
||||
enableToggle: true,
|
||||
allowDepress: false,
|
||||
toggleGroup : 'tablewrapGroup'
|
||||
});
|
||||
this.btnWrapParallel.render( $('#table-button-wrap-parallel')) ;
|
||||
this.btnWrapParallel.on('click', _.bind(this.onBtnWrapClick, this));
|
||||
this.lockedControls.push(this.btnWrapParallel);
|
||||
|
||||
var _arrBorderPosition = [
|
||||
['l', 'btn-borders-small btn-position-left', 'table-button-border-left', this.tipLeft],
|
||||
['c','btn-borders-small btn-position-inner-vert', 'table-button-border-inner-vert', this.tipInnerVert],
|
||||
|
@ -417,6 +369,56 @@ define([
|
|||
this.chRepeatRow.on('change', _.bind(this.onCheckRepeatRowChange, this));
|
||||
this.lockedControls.push(this.chRepeatRow);
|
||||
|
||||
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));
|
||||
},
|
||||
|
@ -424,6 +426,7 @@ define([
|
|||
createDelayedElements: function() {
|
||||
this.createDelayedControls();
|
||||
this.UpdateThemeColors();
|
||||
this.updateMetricUnit();
|
||||
this._initSettings = false;
|
||||
},
|
||||
|
||||
|
@ -438,17 +441,18 @@ define([
|
|||
this._originalProps = new Asc.CTableProp(props);
|
||||
this._originalProps.put_CellSelect(true);
|
||||
|
||||
this._TblWrapStyleChanged(props.get_TableWrap());
|
||||
|
||||
var value = props.get_CanBeFlow() && !this._locked;
|
||||
if ( this._state.CanBeFlow!==value ) {
|
||||
this.btnWrapParallel.setDisabled(!value);
|
||||
this._state.CanBeFlow=value;
|
||||
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;
|
||||
}
|
||||
|
||||
// align props
|
||||
this._TblAlignChanged(props.get_TableAlignment());
|
||||
this._state.TableIndent = (props.get_TableAlignment() !== c_tableAlign.TABLE_ALIGN_LEFT) ? 0 : props.get_TableIndent();
|
||||
|
||||
//for table-template
|
||||
value = props.get_TableStyle();
|
||||
|
@ -558,15 +562,23 @@ define([
|
|||
|
||||
value = props.get_RowsInHeader();
|
||||
if ( this._state.RepeatRow!==value ) {
|
||||
if ( value !== null )
|
||||
this.chRepeatRow.setValue((value>0) ? 1 : 0, true);
|
||||
else
|
||||
this.chRepeatRow.setValue('indeterminate', true);
|
||||
this.chRepeatRow.setValue(!!value, true);
|
||||
this.chRepeatRow.setDisabled(value === null);
|
||||
this._state.RepeatRow=value;
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
updateMetricUnit: function() {
|
||||
if (this.spinners) {
|
||||
for (var i=0; i<this.spinners.length; i++) {
|
||||
var spinner = this.spinners[i];
|
||||
spinner.setDefaultUnit(Common.Utils.Metric.getCurrentMetricName());
|
||||
spinner.setStep(Common.Utils.Metric.getCurrentMetric()==Common.Utils.Metric.c_MetricUnits.pt ? 1 : 0.1);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
_UpdateBordersStyle: function(border) {
|
||||
this.CellBorders = new Asc.CBorders();
|
||||
var updateBorders = this.CellBorders;
|
||||
|
@ -621,21 +633,6 @@ define([
|
|||
}
|
||||
},
|
||||
|
||||
_TblWrapStyleChanged: function(style) {
|
||||
if (!this.btnWrapNone || !this.btnWrapParallel) return;
|
||||
if ( this._state.WrapStyle!==style ) {
|
||||
this._noApply = true;
|
||||
this.btnWrapNone.toggle((style==c_tableWrap.TABLE_WRAP_NONE), true);
|
||||
this.btnWrapParallel.toggle((style==c_tableWrap.TABLE_WRAP_PARALLEL), true);
|
||||
this._noApply = false;
|
||||
this._state.WrapStyle=style;
|
||||
}
|
||||
},
|
||||
|
||||
_TblAlignChanged: function(style) {
|
||||
this._state.TableAlignment=style;
|
||||
},
|
||||
|
||||
UpdateThemeColors: function() {
|
||||
if (!this.btnBackColor) {
|
||||
// create color buttons
|
||||
|
@ -777,12 +774,9 @@ define([
|
|||
}
|
||||
},
|
||||
|
||||
textWrap: 'Text Wrapping',
|
||||
textBorders: 'Border\'s Style',
|
||||
textBorderColor: 'Color',
|
||||
textBackColor: 'Background color',
|
||||
textWrapParallelTooltip: 'Flow table',
|
||||
textWrapNoneTooltip: 'Inline table',
|
||||
textEdit: 'Rows & Columns',
|
||||
selectRowText : 'Select Row',
|
||||
selectColumnText : 'Select Column',
|
||||
|
@ -823,7 +817,12 @@ define([
|
|||
tipInner: 'Set Inner Lines Only',
|
||||
tipInnerVert: 'Set Vertical Inner Lines Only',
|
||||
tipInnerHor: 'Set Horizontal Inner Lines Only',
|
||||
tipOuter: 'Set Outer Border Only'
|
||||
tipOuter: 'Set Outer Border Only',
|
||||
textCellSize: 'Cell Size',
|
||||
textHeight: 'Height',
|
||||
textWidth: 'Width',
|
||||
textDistributeRows: 'Distribute rows',
|
||||
textDistributeCols: 'Distribute columns'
|
||||
|
||||
}, DE.Views.TableSettings || {}));
|
||||
});
|
|
@ -183,6 +183,7 @@
|
|||
"Common.Views.OpenDialog.txtPassword": "Password",
|
||||
"Common.Views.OpenDialog.txtTitle": "Choose %1 options",
|
||||
"Common.Views.OpenDialog.txtTitleProtected": "Protected File",
|
||||
"Common.Views.OpenDialog.closeButtonText": "Close File",
|
||||
"Common.Views.PasswordDialog.cancelButtonText": "Cancel",
|
||||
"Common.Views.PasswordDialog.okButtonText": "OK",
|
||||
"Common.Views.PasswordDialog.txtDescription": "A password is required to open this document",
|
||||
|
@ -839,13 +840,13 @@
|
|||
"DE.Views.DocumentHolder.editFooterText": "Edit Footer",
|
||||
"DE.Views.DocumentHolder.editHeaderText": "Edit Header",
|
||||
"DE.Views.DocumentHolder.editHyperlinkText": "Edit Hyperlink",
|
||||
"DE.Views.DocumentHolder.flowoverText": "Wrapping Style - Flow",
|
||||
"del_DE.Views.DocumentHolder.flowoverText": "Wrapping Style - Flow",
|
||||
"DE.Views.DocumentHolder.guestText": "Guest",
|
||||
"DE.Views.DocumentHolder.hyperlinkText": "Hyperlink",
|
||||
"DE.Views.DocumentHolder.ignoreAllSpellText": "Ignore All",
|
||||
"DE.Views.DocumentHolder.ignoreSpellText": "Ignore",
|
||||
"DE.Views.DocumentHolder.imageText": "Image Advanced Settings",
|
||||
"DE.Views.DocumentHolder.inlineText": "Wrapping Style - Inline",
|
||||
"del_DE.Views.DocumentHolder.inlineText": "Wrapping Style - Inline",
|
||||
"DE.Views.DocumentHolder.insertColumnLeftText": "Column Left",
|
||||
"DE.Views.DocumentHolder.insertColumnRightText": "Column Right",
|
||||
"DE.Views.DocumentHolder.insertColumnText": "Insert Column",
|
||||
|
@ -992,6 +993,8 @@
|
|||
"DE.Views.DocumentHolder.textNest": "Nest table",
|
||||
"DE.Views.DocumentHolder.updateStyleText": "Update %1 style",
|
||||
"DE.Views.DocumentHolder.vertAlignText": "Vertical Alignment",
|
||||
"DE.Views.DocumentHolder.textDistributeRows": "Distribute rows",
|
||||
"DE.Views.DocumentHolder.textDistributeCols": "Distribute columns",
|
||||
"DE.Views.DropcapSettingsAdvanced.cancelButtonText": "Cancel",
|
||||
"DE.Views.DropcapSettingsAdvanced.okButtonText": "Ok",
|
||||
"DE.Views.DropcapSettingsAdvanced.strBorders": "Borders & Fill",
|
||||
|
@ -1567,9 +1570,14 @@
|
|||
"DE.Views.TableSettings.textSelectBorders": "Select borders you want to change applying style chosen above",
|
||||
"DE.Views.TableSettings.textTemplate": "Select From Template",
|
||||
"DE.Views.TableSettings.textTotal": "Total",
|
||||
"DE.Views.TableSettings.textWrap": "Wrapping Style",
|
||||
"DE.Views.TableSettings.textWrapNoneTooltip": "Inline table",
|
||||
"DE.Views.TableSettings.textWrapParallelTooltip": "Flow table",
|
||||
"del_DE.Views.TableSettings.textWrap": "Wrapping Style",
|
||||
"del_DE.Views.TableSettings.textWrapNoneTooltip": "Inline table",
|
||||
"del_DE.Views.TableSettings.textWrapParallelTooltip": "Flow table",
|
||||
"DE.Views.TableSettings.textCellSize": "Cell Size",
|
||||
"DE.Views.TableSettings.textHeight": "Height",
|
||||
"DE.Views.TableSettings.textWidth": "Width",
|
||||
"DE.Views.TableSettings.textDistributeRows": "Distribute rows",
|
||||
"DE.Views.TableSettings.textDistributeCols": "Distribute columns",
|
||||
"DE.Views.TableSettings.tipAll": "Set outer border and all inner lines",
|
||||
"DE.Views.TableSettings.tipBottom": "Set outer bottom border only",
|
||||
"DE.Views.TableSettings.tipInner": "Set inner lines only",
|
||||
|
|
|
@ -442,6 +442,12 @@ define([
|
|||
title = me.loadingDocumentTitleText;
|
||||
text = me.loadingDocumentTextText;
|
||||
break;
|
||||
default:
|
||||
if (typeof action.id == 'string'){
|
||||
title = action.id;
|
||||
text = action.id;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
if (action.type == Asc.c_oAscAsyncActionType['BlockInteraction']) {
|
||||
|
|
|
@ -463,6 +463,8 @@ define([
|
|||
},
|
||||
|
||||
onShortcut: function(s, e) {
|
||||
if (!this.mode) return;
|
||||
|
||||
var previewPanel = PE.getController('Viewport').getView('DocumentPreview');
|
||||
|
||||
switch (s) {
|
||||
|
|
|
@ -547,6 +547,12 @@ define([
|
|||
title = this.loadingDocumentTitleText;
|
||||
text = this.loadingDocumentTextText;
|
||||
break;
|
||||
default:
|
||||
if (typeof action.id == 'string'){
|
||||
title = action.id;
|
||||
text = action.id;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
if (action.type == Asc.c_oAscAsyncActionType['BlockInteraction']) {
|
||||
|
@ -832,6 +838,7 @@ define([
|
|||
this.appOptions.canCoAuthoring = !this.appOptions.isLightVersion;
|
||||
/** coauthoring end **/
|
||||
this.appOptions.canRequestEditRights = this.editorConfig.canRequestEditRights;
|
||||
this.appOptions.canRequestClose = this.editorConfig.canRequestClose;
|
||||
this.appOptions.canEdit = this.permissions.edit !== false && // can edit
|
||||
(this.editorConfig.canRequestEditRights || this.editorConfig.mode !== 'view'); // if mode=="view" -> canRequestEditRights must be defined
|
||||
this.appOptions.isEdit = this.appOptions.canLicense && this.appOptions.canEdit && this.editorConfig.mode !== 'view';
|
||||
|
@ -1712,14 +1719,18 @@ define([
|
|||
me = this;
|
||||
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) {
|
||||
if (result == 'ok') {
|
||||
if (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;
|
||||
}
|
||||
});
|
||||
|
|
|
@ -273,6 +273,7 @@ define([
|
|||
this.rightmenu.paragraphSettings.updateMetricUnit();
|
||||
this.rightmenu.chartSettings.updateMetricUnit();
|
||||
this.rightmenu.imageSettings.updateMetricUnit();
|
||||
this.rightmenu.tableSettings.updateMetricUnit();
|
||||
},
|
||||
|
||||
fillTextArt: function() {
|
||||
|
|
|
@ -97,7 +97,7 @@
|
|||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<td class="padding-small">
|
||||
<div style="display:inline-block;width:100px;vertical-align: middle;">
|
||||
<label class="input-label" style=""><%= scope.strSize %></label>
|
||||
<div id="shape-combo-border-size" style="width: 93px;"></div>
|
||||
|
@ -116,21 +116,18 @@
|
|||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="shape-only">
|
||||
<td class="padding-small"></td>
|
||||
</tr>
|
||||
<tr class="shape-only">
|
||||
<tr class="change-type">
|
||||
<td class="padding-small">
|
||||
<div class="separator horizontal"></div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="shape-only change-type">
|
||||
<tr class="change-type">
|
||||
<td class="padding-small">
|
||||
<label class="header" style="margin-top: 3px;"><%= scope.strChange %></label>
|
||||
<div id="shape-btn-change" style="display: inline-block; float:right;"></div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="shape-only change-type">
|
||||
<tr class="shape-only">
|
||||
<td class="padding-small">
|
||||
<div class="separator horizontal"></div>
|
||||
</td>
|
||||
|
|
|
@ -105,6 +105,38 @@
|
|||
<div class="separator horizontal"></div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan=2>
|
||||
<label class="header"><%= scope.textCellSize %></label>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="padding-small" colspan=2>
|
||||
<label style="margin-top: 3px;"><%= scope.textHeight %></label>
|
||||
<div id="table-spin-cell-height" style="display: inline-block; float:right;"></div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="padding-small" colspan=2>
|
||||
<label style="margin-top: 3px;"><%= scope.textWidth %></label>
|
||||
<div id="table-spin-cell-width" style="display: inline-block; float:right;"></div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="padding-small" colspan=2>
|
||||
<button type="button" class="btn btn-text-default" id="table-btn-distrub-rows" style="width:100%;"><%= scope.textDistributeRows %></button>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="padding-small" colspan=2>
|
||||
<button type="button" class="btn btn-text-default" id="table-btn-distrub-cols" style="width:100%;"><%= scope.textDistributeCols %></button>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="padding-small" colspan=2>
|
||||
<div class="separator horizontal"></div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center" colspan=2>
|
||||
<label class="link" id="table-advanced-link"><%= scope.textAdvanced %></label>
|
||||
|
|
|
@ -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 || {}));
|
||||
});
|
|
@ -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)
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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'
|
||||
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');
|
||||
|| 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; i<count-1; i++) {
|
||||
var shapeGroup = shapesStore.at(i);
|
||||
for (var i=-1; i<count-1 && count>0; 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('<div id="id-shape-menu-shapegroup' + i + '" class="menu-shape" style="width: ' + (shapeGroup.get('groupWidth') - 8) + 'px; margin-left: 5px;"></div>') }
|
||||
{ template: _.template('<div id="id-shape-menu-shapegroup' + (i+1) + '" class="menu-shape" style="width: ' + (shapeGroup.get('groupWidth') - 8) + 'px; margin-left: 5px;"></div>') }
|
||||
]
|
||||
})
|
||||
});
|
||||
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('<div class="item-shape"><img src="<%= imageUrl %>" id="<%= id %>"></div>')
|
||||
|
|
|
@ -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<this.spinners.length; i++) {
|
||||
var spinner = this.spinners[i];
|
||||
spinner.setDefaultUnit(Common.Utils.Metric.getCurrentMetricName());
|
||||
spinner.setStep(Common.Utils.Metric.getCurrentMetric()==Common.Utils.Metric.c_MetricUnits.pt ? 1 : 0.1);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
_UpdateBordersStyle: function(border) {
|
||||
this.CellBorders = new Asc.CBorders();
|
||||
var updateBorders = this.CellBorders;
|
||||
|
@ -530,6 +606,7 @@ define([
|
|||
createDelayedElements: function() {
|
||||
this.createDelayedControls();
|
||||
this.UpdateThemeColors();
|
||||
this.updateMetricUnit();
|
||||
this._initSettings = false;
|
||||
},
|
||||
|
||||
|
@ -707,7 +784,12 @@ define([
|
|||
tipInner: 'Set Inner Lines Only',
|
||||
tipInnerVert: 'Set Vertical Inner Lines Only',
|
||||
tipInnerHor: 'Set Horizontal Inner Lines Only',
|
||||
tipOuter: 'Set Outer Border Only'
|
||||
tipOuter: 'Set Outer Border Only',
|
||||
textCellSize: 'Cell Size',
|
||||
textHeight: 'Height',
|
||||
textWidth: 'Width',
|
||||
textDistributeRows: 'Distribute rows',
|
||||
textDistributeCols: 'Distribute columns'
|
||||
|
||||
}, PE.Views.TableSettings || {}));
|
||||
});
|
|
@ -116,6 +116,7 @@
|
|||
"Common.Views.OpenDialog.txtPassword": "Password",
|
||||
"Common.Views.OpenDialog.txtTitle": "Choose %1 options",
|
||||
"Common.Views.OpenDialog.txtTitleProtected": "Protected File",
|
||||
"Common.Views.OpenDialog.closeButtonText": "Close File",
|
||||
"Common.Views.PasswordDialog.cancelButtonText": "Cancel",
|
||||
"Common.Views.PasswordDialog.okButtonText": "OK",
|
||||
"Common.Views.PasswordDialog.txtDescription": "A password is required to open this document",
|
||||
|
@ -720,6 +721,8 @@
|
|||
"PE.Views.ChartSettingsAdvanced.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.",
|
||||
"PE.Views.ChartSettingsAdvanced.textAltTitle": "Title",
|
||||
"PE.Views.ChartSettingsAdvanced.textTitle": "Chart - Advanced Settings",
|
||||
"PE.Views.DocumentHolder.textDistributeRows": "Distribute rows",
|
||||
"PE.Views.DocumentHolder.textDistributeCols": "Distribute columns",
|
||||
"PE.Views.DocumentHolder.aboveText": "Above",
|
||||
"PE.Views.DocumentHolder.addCommentText": "Add Comment",
|
||||
"PE.Views.DocumentHolder.advancedImageText": "Image Advanced Settings",
|
||||
|
@ -1263,6 +1266,11 @@
|
|||
"PE.Views.Statusbar.tipZoomIn": "Zoom in",
|
||||
"PE.Views.Statusbar.tipZoomOut": "Zoom out",
|
||||
"PE.Views.Statusbar.txtPageNumInvalid": "Invalid slide number",
|
||||
"PE.Views.TableSettings.textCellSize": "Cell Size",
|
||||
"PE.Views.TableSettings.textHeight": "Height",
|
||||
"PE.Views.TableSettings.textWidth": "Width",
|
||||
"PE.Views.TableSettings.textDistributeRows": "Distribute rows",
|
||||
"PE.Views.TableSettings.textDistributeCols": "Distribute columns",
|
||||
"PE.Views.TableSettings.deleteColumnText": "Delete Column",
|
||||
"PE.Views.TableSettings.deleteRowText": "Delete Row",
|
||||
"PE.Views.TableSettings.deleteTableText": "Delete Table",
|
||||
|
|
|
@ -425,6 +425,12 @@ define([
|
|||
title = me.loadingDocumentTitleText;
|
||||
text = me.loadingDocumentTextText;
|
||||
break;
|
||||
default:
|
||||
if (typeof action.id == 'string'){
|
||||
title = action.id;
|
||||
text = action.id;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
if (action.type == Asc.c_oAscAsyncActionType['BlockInteraction']) {
|
||||
|
|
|
@ -1249,7 +1249,7 @@ define([
|
|||
},
|
||||
|
||||
fillMenuProps: function(cellinfo, showMenu, event){
|
||||
var iscellmenu, isrowmenu, iscolmenu, isallmenu, ischartmenu, isimagemenu, istextshapemenu, isshapemenu, istextchartmenu,
|
||||
var iscellmenu, isrowmenu, iscolmenu, isallmenu, ischartmenu, isimagemenu, istextshapemenu, isshapemenu, istextchartmenu, isimageonly,
|
||||
documentHolder = this.documentHolder,
|
||||
seltype = cellinfo.asc_getFlags().asc_getSelectionType(),
|
||||
isCellLocked = cellinfo.asc_getLocked(),
|
||||
|
@ -1285,6 +1285,8 @@ define([
|
|||
if (shapeprops) {
|
||||
if (shapeprops.asc_getFromChart())
|
||||
ischartmenu = true;
|
||||
else if (shapeprops.asc_getFromImage())
|
||||
isimageonly = true;
|
||||
else {
|
||||
documentHolder.mnuShapeAdvanced.shapeInfo = elValue;
|
||||
isshapemenu = true;
|
||||
|
@ -1310,7 +1312,7 @@ define([
|
|||
documentHolder.mnuChartEdit.setDisabled(isObjLocked);
|
||||
documentHolder.pmiImgCut.setDisabled(isObjLocked);
|
||||
documentHolder.pmiImgPaste.setDisabled(isObjLocked);
|
||||
documentHolder.mnuImgAdvanced.setVisible(isimagemenu && !isshapemenu && !ischartmenu);
|
||||
documentHolder.mnuImgAdvanced.setVisible(isimagemenu && (!isshapemenu || isimageonly) && !ischartmenu);
|
||||
documentHolder.mnuImgAdvanced.setDisabled(isObjLocked);
|
||||
|
||||
var isInSign = !!signGuid;
|
||||
|
|
|
@ -662,6 +662,8 @@ define([
|
|||
/** coauthoring end **/
|
||||
|
||||
onShortcut: function(s, e) {
|
||||
if (!this.mode) return;
|
||||
|
||||
if (this.mode.isEditDiagram && s!='escape') return false;
|
||||
if (this.mode.isEditMailMerge && s!='escape' && s!='search') return false;
|
||||
|
||||
|
|
|
@ -564,6 +564,11 @@ define([
|
|||
case LoadingDocument:
|
||||
title = this.loadingDocumentTitleText;
|
||||
break;
|
||||
default:
|
||||
if (typeof action.id == 'string'){
|
||||
title = action.id;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
if (action.type == Asc.c_oAscAsyncActionType.BlockInteraction) {
|
||||
|
@ -883,6 +888,7 @@ define([
|
|||
this.appOptions.canModifyFilter = true;
|
||||
|
||||
this.appOptions.canRequestEditRights = this.editorConfig.canRequestEditRights;
|
||||
this.appOptions.canRequestClose = this.editorConfig.canRequestClose;
|
||||
this.appOptions.canEdit = this.permissions.edit !== false && // can edit
|
||||
(this.editorConfig.canRequestEditRights || this.editorConfig.mode !== 'view'); // if mode=="view" -> 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 (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;
|
||||
}
|
||||
});
|
||||
|
|
|
@ -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'));
|
||||
|
|
|
@ -97,7 +97,7 @@
|
|||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<td class="padding-small">
|
||||
<div style="display:inline-block;width:100px;vertical-align: middle;">
|
||||
<label class="input-label" style=""><%= scope.strSize %></label>
|
||||
<div id="shape-combo-border-size" style="width: 93px;"></div>
|
||||
|
@ -116,21 +116,18 @@
|
|||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="shape-only">
|
||||
<td class="padding-small"></td>
|
||||
</tr>
|
||||
<tr class="shape-only">
|
||||
<tr class="change-type">
|
||||
<td class="padding-small">
|
||||
<div class="separator horizontal"></div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="shape-only change-type">
|
||||
<tr class="change-type">
|
||||
<td class="padding-small">
|
||||
<label class="header" style="margin-top: 3px;"><%= scope.strChange %></label>
|
||||
<div id="shape-btn-change" style="display: inline-block; float:right;"></div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="shape-only change-type">
|
||||
<tr class="shape-only">
|
||||
<td class="padding-small">
|
||||
<div class="separator horizontal"></div>
|
||||
</td>
|
||||
|
|
|
@ -205,7 +205,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)
|
||||
|
@ -220,7 +220,7 @@ define([
|
|||
|
||||
hide: function() {
|
||||
this.$el.hide();
|
||||
this.api.asc_enableKeyEvents(true);
|
||||
this.api && this.api.asc_enableKeyEvents(true);
|
||||
this.fireEvent('menu:hide', [this]);
|
||||
},
|
||||
|
||||
|
|
|
@ -67,6 +67,10 @@ define([
|
|||
'<span id="slot-btn-refresh-pivot" class="btn-slot text x-huge"></span>' +
|
||||
'</div>' +
|
||||
'<div class="separator long"/>' +
|
||||
'<div class="group">' +
|
||||
'<span id="slot-btn-select-pivot" class="btn-slot text x-huge"></span>' +
|
||||
'</div>' +
|
||||
'<div class="separator long"/>' +
|
||||
'<div class="group">' +
|
||||
'<div class="elset">' +
|
||||
'<span class="btn-slot text" id="slot-chk-header-row"></span>' +
|
||||
|
@ -114,6 +118,10 @@ define([
|
|||
me.fireEvent('pivottable:refresh');
|
||||
});
|
||||
|
||||
this.btnSelectPivot.on('click', function (e) {
|
||||
me.fireEvent('pivottable:select');
|
||||
});
|
||||
|
||||
this.chRowHeader.on('change', function (field, value) {
|
||||
me.fireEvent('pivottable:rowscolumns', [0, value]);
|
||||
});
|
||||
|
@ -243,6 +251,13 @@ define([
|
|||
});
|
||||
// this.lockedControls.push(this.btnRefreshPivot);
|
||||
|
||||
this.btnSelectPivot = new Common.UI.Button({
|
||||
cls: 'btn-toolbar x-huge icon-top',
|
||||
iconCls: 'btn-select-pivot',
|
||||
caption: this.txtSelect
|
||||
});
|
||||
this.lockedControls.push(this.btnSelectPivot);
|
||||
|
||||
this.pivotStyles = new Common.UI.ComboDataView({
|
||||
cls : 'combo-pivot-template',
|
||||
enableKeyEvents : true,
|
||||
|
@ -270,6 +285,7 @@ define([
|
|||
})).then(function(){
|
||||
me.btnAddPivot.updateHint(me.tipCreatePivot);
|
||||
me.btnRefreshPivot.updateHint(me.tipRefresh);
|
||||
me.btnSelectPivot.updateHint(me.tipSelect);
|
||||
me.btnPivotLayout.updateHint(me.capLayout);
|
||||
me.btnPivotBlankRows.updateHint(me.capBlankRows);
|
||||
me.btnPivotSubtotals.updateHint(me.tipSubtotals);
|
||||
|
@ -289,6 +305,7 @@ define([
|
|||
|
||||
this.btnAddPivot.render(this.$el.find('#slot-btn-add-pivot'));
|
||||
this.btnRefreshPivot.render(this.$el.find('#slot-btn-refresh-pivot'));
|
||||
this.btnSelectPivot.render(this.$el.find('#slot-btn-select-pivot'));
|
||||
this.btnPivotLayout.render(this.$el.find('#slot-btn-pivot-report-layout'));
|
||||
this.btnPivotBlankRows.render(this.$el.find('#slot-btn-pivot-blank-rows'));
|
||||
this.btnPivotSubtotals.render(this.$el.find('#slot-btn-pivot-subtotals'));
|
||||
|
@ -341,7 +358,9 @@ define([
|
|||
txtRefresh: 'Refresh',
|
||||
tipRefresh: 'Update the information from data source',
|
||||
tipGrandTotals: 'Show or hide grand totals',
|
||||
tipSubtotals: 'Show or hide subtotals'
|
||||
tipSubtotals: 'Show or hide subtotals',
|
||||
txtSelect: 'Select',
|
||||
tipSelect: 'Select entire pivot table'
|
||||
}
|
||||
}()), SSE.Views.PivotTable || {}));
|
||||
});
|
|
@ -711,11 +711,17 @@ define([
|
|||
this._noApply = true;
|
||||
|
||||
this.disableControls(this._locked, !shapeprops.asc_getCanFill());
|
||||
this.hideShapeOnlySettings(shapeprops.asc_getFromChart());
|
||||
this.hideChangeTypeSettings(shapetype=='line' || shapetype=='bentConnector2' || shapetype=='bentConnector3'
|
||||
this.hideShapeOnlySettings(shapeprops.asc_getFromChart() || shapeprops.asc_getFromImage());
|
||||
|
||||
var hidechangetype = shapeprops.get_FromChart() || shapetype=='line' || shapetype=='bentConnector2' || shapetype=='bentConnector3'
|
||||
|| shapetype=='bentConnector4' || shapetype=='bentConnector5' || shapetype=='curvedConnector2'
|
||||
|| shapetype=='curvedConnector3' || shapetype=='curvedConnector4' || shapetype=='curvedConnector5'
|
||||
|| shapetype=='straightConnector1');
|
||||
|| shapetype=='straightConnector1';
|
||||
this.hideChangeTypeSettings(hidechangetype);
|
||||
if (!hidechangetype) {
|
||||
this.btnChangeShape.menu.items[0].setVisible(shapeprops.get_FromImage());
|
||||
this.btnChangeShape.menu.items[1].setVisible(!shapeprops.get_FromImage());
|
||||
}
|
||||
|
||||
// background colors
|
||||
var rec = null;
|
||||
|
@ -1420,22 +1426,27 @@ define([
|
|||
shapesStore = this.application.getCollection('ShapeGroups');
|
||||
|
||||
var count = shapesStore.length;
|
||||
for (var i=0; i<count-1; i++) {
|
||||
var shapeGroup = shapesStore.at(i);
|
||||
for (var i=-1; i<count-1 && count>0; 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('<div id="id-shape-menu-shapegroup' + i + '" class="menu-shape" style="width: ' + (shapeGroup.get('groupWidth') - 8) + 'px; margin-left: 5px;"></div>') }
|
||||
{ template: _.template('<div id="id-shape-menu-shapegroup' + (i+1) + '" class="menu-shape" style="width: ' + (shapeGroup.get('groupWidth') - 8) + 'px; margin-left: 5px;"></div>') }
|
||||
]
|
||||
})
|
||||
});
|
||||
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('<div class="item-shape"><img src="<%= imageUrl %>" id="<%= id %>"></div>')
|
||||
|
|
|
@ -102,6 +102,7 @@
|
|||
"Common.Views.OpenDialog.txtTab": "Tab",
|
||||
"Common.Views.OpenDialog.txtTitle": "Choose %1 options",
|
||||
"Common.Views.OpenDialog.txtTitleProtected": "Protected File",
|
||||
"Common.Views.OpenDialog.closeButtonText": "Close File",
|
||||
"Common.Views.PasswordDialog.cancelButtonText": "Cancel",
|
||||
"Common.Views.PasswordDialog.okButtonText": "OK",
|
||||
"Common.Views.PasswordDialog.txtDescription": "A password is required to open this document",
|
||||
|
@ -1499,6 +1500,8 @@
|
|||
"SSE.Views.PivotTable.tipRefresh": "Update the information from data source",
|
||||
"SSE.Views.PivotTable.tipGrandTotals": "Show or hide grand totals",
|
||||
"SSE.Views.PivotTable.tipSubtotals": "Show or hide subtotals",
|
||||
"SSE.Views.PivotTable.txtSelect": "Select",
|
||||
"SSE.Views.PivotTable.tipSelect": "Select entire pivot table",
|
||||
"SSE.Views.PrintSettings.btnPrint": "Save & Print",
|
||||
"SSE.Views.PrintSettings.cancelButtonText": "Cancel",
|
||||
"SSE.Views.PrintSettings.strBottom": "Bottom",
|
||||
|
|
|
@ -440,6 +440,12 @@ define([
|
|||
title = me.loadingDocumentTitleText;
|
||||
text = me.loadingDocumentTextText;
|
||||
break;
|
||||
default:
|
||||
if (typeof action.id == 'string'){
|
||||
title = action.id;
|
||||
text = action.id;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
if (action.type == Asc.c_oAscAsyncActionType.BlockInteraction) {
|
||||
|
|
Loading…
Reference in a new issue