Merge branch 'develop' into feature/desktop-new

This commit is contained in:
Maxim Kadushkin 2018-02-13 11:26:16 +03:00
commit 8be206fa33
42 changed files with 654 additions and 338 deletions

View file

@ -189,6 +189,7 @@
_config.editorConfig.canHistoryRestore = _config.events && !!_config.events.onRequestRestore; _config.editorConfig.canHistoryRestore = _config.events && !!_config.events.onRequestRestore;
_config.editorConfig.canSendEmailAddresses = _config.events && !!_config.events.onRequestEmailAddresses; _config.editorConfig.canSendEmailAddresses = _config.events && !!_config.events.onRequestEmailAddresses;
_config.editorConfig.canRequestEditRights = _config.events && !!_config.events.onRequestEditRights; _config.editorConfig.canRequestEditRights = _config.events && !!_config.events.onRequestEditRights;
_config.editorConfig.canRequestClose = _config.events && !!_config.events.onRequestClose;
_config.frameEditorId = placeholderId; _config.frameEditorId = placeholderId;
_config.events && !!_config.events.onReady && console.log("Obsolete: The onReady event is deprecated. Please use onAppReady instead."); _config.events && !!_config.events.onReady && console.log("Obsolete: The onReady event is deprecated. Please use onAppReady instead.");

View file

@ -250,6 +250,10 @@ if (Common === undefined) {
_postMessage({ event: 'onDocumentReady' }); _postMessage({ event: 'onDocumentReady' });
}, },
requestClose: function() {
_postMessage({event: 'onRequestClose'});
},
on: function(event, handler){ on: function(event, handler){
var localHandler = function(event, data){ var localHandler = function(event, data){
handler.call(me, data) handler.call(me, data)

View file

@ -191,7 +191,10 @@ define([
event.preventDefault(); event.preventDefault();
event.stopPropagation(); event.stopPropagation();
if (this.initConfig.closable !== false) { 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; return false;
} }

View file

@ -219,7 +219,8 @@ define([
appConfig = mode; appConfig = mode;
var me = this; var me = this;
me.btnGoBack.updateHint(me.textBack); if ( !me.branding.goback )
me.btnGoBack.updateHint(me.textBack);
me.btnGoBack.on('click', function (e) { me.btnGoBack.on('click', function (e) {
Common.NotificationCenter.trigger('goback', true); Common.NotificationCenter.trigger('goback', true);
}); });
@ -511,11 +512,17 @@ define([
this.branding = value; this.branding = value;
if (value && value.logo && value.logo.image) { if ( value ) {
element = $('#header-logo'); if ( value.logo && value.logo.image ) {
if ( element ) { element = $('#header-logo');
element.html('<img src="' + value.logo.image + '" style="max-width:100px; max-height:20px; margin: 0;"/>'); if (element) {
element.css({'background-image': 'none', width: 'auto'}); 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);
} }
} }
}, },

View file

@ -54,14 +54,15 @@ define([
_options = {}; _options = {};
_.extend(_options, { _.extend(_options, {
closable: false, closable : false,
width : 250, width : 250,
height : (options.type == Asc.c_oAscAdvancedOptionsID.CSV) ? 205 : 155, height : (options.type == Asc.c_oAscAdvancedOptionsID.CSV) ? 205 : 155,
contentWidth : 390, contentWidth : 390,
header : true, header : true,
cls : 'open-dlg', cls : 'open-dlg',
contentTemplate : '', 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); }, options);
@ -84,18 +85,21 @@ define([
'<% } %>', '<% } %>',
'</div>', '</div>',
'</div>', '</div>',
'<div class="separator horizontal"/>', '<div class="separator horizontal"/>',
'<div class="footer center">', '<div class="footer center">',
'<button class="btn normal dlg-btn primary" result="ok" style="margin-right:10px;">' + t.okButtonText + '</button>', '<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>' '</div>'
].join(''); ].join('');
this.handler = options.handler; this.handler = _options.handler;
this.type = options.type; this.type = _options.type;
this.codepages = options.codepages; this.closable = _options.closable;
this.settings = options.settings; this.codepages = _options.codepages;
this.validatePwd = options.validatePwd || false; this.settings = _options.settings;
this.validatePwd = _options.validatePwd || false;
_options.tpl = _.template(this.template)(_options); _options.tpl = _.template(this.template)(_options);
@ -106,7 +110,8 @@ define([
if (this.$window) { if (this.$window) {
var me = this; var me = this;
this.$window.find('.tool').hide(); if (!this.closable)
this.$window.find('.tool').hide();
this.$window.find('.dlg-btn').on('click', _.bind(this.onBtnClick, this)); this.$window.find('.dlg-btn').on('click', _.bind(this.onBtnClick, this));
if (this.type == Asc.c_oAscAdvancedOptionsID.DRM) { if (this.type == Asc.c_oAscAdvancedOptionsID.DRM) {
this.inputPwd = new Common.UI.InputField({ this.inputPwd = new Common.UI.InputField({
@ -120,11 +125,11 @@ define([
this.$window.find('input').on('keypress', _.bind(this.onKeyPress, this)); this.$window.find('input').on('keypress', _.bind(this.onKeyPress, this));
} else { } else {
this.initCodePages(); this.initCodePages();
this.onPrimary = function() {
me.onBtnClick();
return false;
};
} }
this.onPrimary = function() {
me._handleInput('ok');
return false;
};
} }
}, },
@ -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.handler) {
if (this.cmbEncoding) { if (this.cmbEncoding) {
var delimiter = this.cmbDelimiter ? this.cmbDelimiter.getValue() : null, var delimiter = this.cmbDelimiter ? this.cmbDelimiter.getValue() : null,
delimiterChar = (delimiter == -1) ? this.inputDelimiter.getValue() : null; delimiterChar = (delimiter == -1) ? this.inputDelimiter.getValue() : null;
(delimiter == -1) && (delimiter = null); (delimiter == -1) && (delimiter = null);
this.handler.call(this, this.cmbEncoding.getValue(), delimiter, delimiterChar); this.handler.call(this, this.cmbEncoding.getValue(), delimiter, delimiterChar);
} else } else {
this.handler.call(this, this.inputPwd.getValue()); this.handler.call(this, state, this.inputPwd.getValue());
}
} }
this.close(); this.close();
}, },
onKeyPress: function(event) {
if (event.keyCode == Common.UI.Keys.RETURN)
this.onBtnClick();
},
initCodePages: function () { initCodePages: function () {
var i, c, codepage, encodedata = [], listItems = [], length = 0; var i, c, codepage, encodedata = [], listItems = [], length = 0;
@ -381,7 +397,8 @@ define([
txtPassword : "Password", txtPassword : "Password",
txtTitleProtected : "Protected File", txtTitleProtected : "Protected File",
txtOther: 'Other', txtOther: 'Other',
txtIncorrectPwd: 'Password is incorrect.' txtIncorrectPwd: 'Password is incorrect.',
closeButtonText: 'Close File'
}, Common.Views.OpenDialog || {})); }, 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

View file

@ -316,3 +316,4 @@
.button-normal-icon(~'x-huge .btn-grand-totals', 52, @toolbar-big-icon-size); .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(~'x-huge .btn-contents', 53, @toolbar-big-icon-size);
.button-normal-icon(btn-controls, 54, @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);

View file

@ -610,6 +610,8 @@ define([
}, },
onShortcut: function(s, e) { onShortcut: function(s, e) {
if (!this.mode) return;
switch (s) { switch (s) {
case 'replace': case 'replace':
case 'search': case 'search':

View file

@ -761,6 +761,12 @@ define([
title = this.loadingDocumentTitleText; title = this.loadingDocumentTitleText;
text = this.loadingDocumentTextText; text = this.loadingDocumentTextText;
break; break;
default:
if (typeof action.id == 'string'){
title = action.id;
text = action.id;
}
break;
} }
if (action.type == Asc.c_oAscAsyncActionType['BlockInteraction']) { if (action.type == Asc.c_oAscAsyncActionType['BlockInteraction']) {
@ -1066,6 +1072,7 @@ define([
this.appOptions.isOffline = this.api.asc_isOffline(); this.appOptions.isOffline = this.api.asc_isOffline();
this.appOptions.isReviewOnly = this.permissions.review === true && this.permissions.edit === false; this.appOptions.isReviewOnly = this.permissions.review === true && this.permissions.edit === false;
this.appOptions.canRequestEditRights = this.editorConfig.canRequestEditRights; 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.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.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 (!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) { } else if (type == Asc.c_oAscAdvancedOptionsID.DRM) {
me._state.openDlg = new Common.Views.OpenDialog({ me._state.openDlg = new Common.Views.OpenDialog({
closable: me.appOptions.canRequestClose,
type: type, type: type,
validatePwd: !!me._state.isDRM, validatePwd: !!me._state.isDRM,
handler: function (value) { handler: function (result, value) {
me.isShowOpenDialog = false; me.isShowOpenDialog = false;
if (me && me.api) { if (result == 'ok') {
me.api.asc_setAdvancedOptions(type, new Asc.asc_CDRMAdvancedOptions(value)); if (me.api) {
me.loadMask && me.loadMask.show(); me.api.asc_setAdvancedOptions(type, new Asc.asc_CDRMAdvancedOptions(value));
} me.loadMask && me.loadMask.show();
}
} else
Common.Gateway.requestClose();
me._state.openDlg = null; me._state.openDlg = null;
} }
}); });

View file

@ -260,6 +260,7 @@ define([
this.rightmenu.paragraphSettings.updateMetricUnit(); this.rightmenu.paragraphSettings.updateMetricUnit();
this.rightmenu.chartSettings.updateMetricUnit(); this.rightmenu.chartSettings.updateMetricUnit();
this.rightmenu.imageSettings.updateMetricUnit(); this.rightmenu.imageSettings.updateMetricUnit();
this.rightmenu.tableSettings.updateMetricUnit();
}, },
createDelayedElements: function() { createDelayedElements: function() {

View file

@ -134,18 +134,18 @@
<tr class="shape-only"> <tr class="shape-only">
<td class="padding-small"></td> <td class="padding-small"></td>
</tr> </tr>
<tr class="shape-only"> <tr class="change-type">
<td class="padding-small"> <td class="padding-small">
<div class="separator horizontal"></div> <div class="separator horizontal"></div>
</td> </td>
</tr> </tr>
<tr class="shape-only change-type"> <tr class="change-type">
<td class="padding-small"> <td class="padding-small">
<label class="header" style="margin-top: 3px;"><%= scope.strChange %></label> <label class="header" style="margin-top: 3px;"><%= scope.strChange %></label>
<div id="shape-btn-change" style="display: inline-block; float:right;"></div> <div id="shape-btn-change" style="display: inline-block; float:right;"></div>
</td> </td>
</tr> </tr>
<tr class="shape-only change-type"> <tr class="shape-only">
<td class="padding-small"> <td class="padding-small">
<div class="separator horizontal"></div> <div class="separator horizontal"></div>
</td> </td>

View file

@ -95,14 +95,9 @@
</td> </td>
</tr> </tr>
<tr> <tr>
<td colspan=2> <td class="padding-small" colspan=2>
<label class="header"><%= scope.textWrap %></label> <label class="header" style="margin-top: 3px;"><%= scope.textEdit %></label>
</td> <div id="table-btn-edit" style="display: inline-block; float:right;"></div>
</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> </td>
</tr> </tr>
<tr> <tr>
@ -110,10 +105,31 @@
<div class="separator horizontal"></div> <div class="separator horizontal"></div>
</td> </td>
</tr> </tr>
<tr>
<td colspan=2>
<label class="header"><%= scope.textCellSize %></label>
</td>
</tr>
<tr> <tr>
<td class="padding-small" colspan=2> <td class="padding-small" colspan=2>
<label class="header" style="margin-top: 3px;"><%= scope.textEdit %></label> <label style="margin-top: 3px;"><%= scope.textHeight %></label>
<div id="table-btn-edit" style="display: inline-block; float:right;"></div> <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> </td>
</tr> </tr>
<tr> <tr>

View file

@ -137,6 +137,8 @@ define([
if (shapeprops) { if (shapeprops) {
if (shapeprops.get_FromChart()) if (shapeprops.get_FromChart())
menu_props.imgProps.isChart = true; menu_props.imgProps.isChart = true;
else if (shapeprops.get_FromImage())
menu_props.imgProps.isOnlyImg = true;
else else
menu_props.imgProps.isShape = true; menu_props.imgProps.isShape = true;
} else if ( chartprops ) } else if ( chartprops )
@ -1519,6 +1521,7 @@ define([
this.api.asc_registerCallback('asc_onDialogAddHyperlink', onDialogAddHyperlink); this.api.asc_registerCallback('asc_onDialogAddHyperlink', onDialogAddHyperlink);
this.api.asc_registerCallback('asc_doubleClickOnChart', onDoubleClickOnChart); this.api.asc_registerCallback('asc_doubleClickOnChart', onDoubleClickOnChart);
this.api.asc_registerCallback('asc_onSpellCheckVariantsFound', _.bind(onSpellCheckVariantsFound, this)); 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)); this.api.asc_registerCallback('asc_onCoAuthoringDisconnect', _.bind(onCoAuthoringDisconnect, this));
Common.NotificationCenter.on('api:disconnect', _.bind(onCoAuthoringDisconnect, this)); Common.NotificationCenter.on('api:disconnect', _.bind(onCoAuthoringDisconnect, this));
@ -1595,27 +1598,6 @@ define([
window.currentStyleName = name; 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){ advancedParagraphClick: function(item, e, eOpt){
var win, me = this; var win, me = this;
if (me.api){ if (me.api){
@ -1652,6 +1634,7 @@ define([
if (win) { if (win) {
win.show(); 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){ editHyperlink: function(item, e, eOpt){
var win, me = this; var win, me = this;
if (me.api){ if (me.api){
@ -1806,14 +1876,14 @@ define([
me.api.asc_SetContentControlProperties(value, props.get_InternalId()); me.api.asc_SetContentControlProperties(value, props.get_InternalId());
} }
Common.NotificationCenter.trigger('edit:complete', me.toolbar); me.fireEvent('editcomplete', me);
} }
})).show(); })).show();
} else if (item.value == 'remove') { } else if (item.value == 'remove') {
this.api.asc_RemoveContentControlWrapper(props.get_InternalId()); this.api.asc_RemoveContentControlWrapper(props.get_InternalId());
} }
} }
Common.NotificationCenter.trigger('edit:complete', this.toolbar); me.fireEvent('editcomplete', me);
}, },
createDelayedElementsViewer: function() { createDelayedElementsViewer: function() {
@ -2266,8 +2336,7 @@ define([
menuChartEdit.setVisible(!_.isNull(value.imgProps.value.get_ChartProperties()) && !onlyCommonProps); menuChartEdit.setVisible(!_.isNull(value.imgProps.value.get_ChartProperties()) && !onlyCommonProps);
me.menuOriginalSize.setVisible(_.isNull(value.imgProps.value.get_ChartProperties()) && _.isNull(value.imgProps.value.get_ShapeProperties()) && me.menuOriginalSize.setVisible(value.imgProps.isOnlyImg);
!onlyCommonProps);
me.pictureMenu.items[10].setVisible(menuChartEdit.isVisible() || me.menuOriginalSize.isVisible()); me.pictureMenu.items[10].setVisible(menuChartEdit.isVisible() || me.menuOriginalSize.isVisible());
var islocked = value.imgProps.locked || (value.headerProps!==undefined && value.headerProps.locked); var islocked = value.imgProps.locked || (value.headerProps!==undefined && value.headerProps.locked);
@ -2327,51 +2396,6 @@ define([
/* table menu*/ /* 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({ var mnuTableMerge = new Common.UI.MenuItem({
caption : me.mergeCellsText caption : me.mergeCellsText
}).on('click', function(item) { }).on('click', function(item) {
@ -2438,45 +2462,7 @@ define([
var menuTableAdvanced = new Common.UI.MenuItem({ var menuTableAdvanced = new Common.UI.MenuItem({
caption : me.advancedTableText caption : me.advancedTableText
}).on('click', function(item, e, eOpt){ }).on('click', _.bind(me.advancedTableClick, me));
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();
}
});
var menuParagraphAdvancedInTable = new Common.UI.MenuItem({ var menuParagraphAdvancedInTable = new Common.UI.MenuItem({
caption : me.advancedParagraphText caption : me.advancedParagraphText
@ -2641,6 +2627,22 @@ define([
caption : '--' 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) { var tableDirection = function(item, e) {
if (me.api) { if (me.api) {
var properties = new Asc.CTableProp(); var properties = new Asc.CTableProp();
@ -2700,14 +2702,6 @@ define([
me.menuTableCellCenter.setChecked(align == Asc.c_oAscVertAlignJc.Center); me.menuTableCellCenter.setChecked(align == Asc.c_oAscVertAlignJc.Center);
me.menuTableCellBottom.setChecked(align == Asc.c_oAscVertAlignJc.Bottom); 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(); var dir = value.tableProps.value.get_CellsTextDirection();
me.menuTableDirectH.setChecked(dir == Asc.c_oAscCellTextDirection.LRTB); me.menuTableDirectH.setChecked(dir == Asc.c_oAscCellTextDirection.LRTB);
me.menuTableDirect90.setChecked(dir == Asc.c_oAscCellTextDirection.TBRL); me.menuTableDirect90.setChecked(dir == Asc.c_oAscCellTextDirection.TBRL);
@ -2722,11 +2716,11 @@ define([
mnuTableSplit.setDisabled(disabled || !me.api.CheckBeforeSplitCells()); mnuTableSplit.setDisabled(disabled || !me.api.CheckBeforeSplitCells());
} }
menuTableDistRows.setDisabled(disabled);
menuTableDistCols.setDisabled(disabled);
menuTableCellAlign.setDisabled(disabled); menuTableCellAlign.setDisabled(disabled);
menuTableDirection.setDisabled(disabled); menuTableDirection.setDisabled(disabled);
menuTableWrapInline.setDisabled(disabled);
menuTableWrapFlow.setDisabled(disabled || !value.tableProps.value.get_CanBeFlow());
menuTableAdvanced.setDisabled(disabled); menuTableAdvanced.setDisabled(disabled);
var cancopy = me.api && me.api.can_CopyCut(); var cancopy = me.api && me.api.can_CopyCut();
@ -2902,12 +2896,12 @@ define([
mnuTableMerge, mnuTableMerge,
mnuTableSplit, mnuTableSplit,
{ caption: '--' }, { caption: '--' },
menuTableDistRows,
menuTableDistCols,
{ caption: '--' },
menuTableCellAlign, menuTableCellAlign,
menuTableDirection, menuTableDirection,
{ caption: '--' }, { caption: '--' },
menuTableWrapInline,
menuTableWrapFlow,
{ caption: '--' },
menuTableAdvanced, menuTableAdvanced,
{ caption: '--' }, { caption: '--' },
/** coauthoring begin **/ /** coauthoring begin **/
@ -3476,8 +3470,6 @@ define([
mergeCellsText : 'Merge Cells', mergeCellsText : 'Merge Cells',
splitCellsText : 'Split Cell...', splitCellsText : 'Split Cell...',
splitCellTitleText : 'Split Cell', splitCellTitleText : 'Split Cell',
flowoverText : 'Wrapping Style - Flow',
inlineText : 'Wrapping Style - Inline',
originalSizeText : 'Default Size', originalSizeText : 'Default Size',
advancedText : 'Advanced Settings', advancedText : 'Advanced Settings',
breakBeforeText : 'Page break before', breakBeforeText : 'Page break before',
@ -3637,7 +3629,9 @@ define([
textRemove: 'Remove', textRemove: 'Remove',
textSettings: 'Settings', textSettings: 'Settings',
textRemoveControl: 'Remove content control', textRemoveControl: 'Remove content control',
textEditControls: 'Content control settings' textEditControls: 'Content control settings',
textDistributeRows: 'Distribute rows',
textDistributeCols: 'Distribute columns'
}, DE.Views.DocumentHolder || {})); }, DE.Views.DocumentHolder || {}));
}); });

View file

@ -221,7 +221,7 @@ define([
}, },
show: function(panel, opts) { 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'; var defPanel = (this.mode.canDownload && (!this.mode.isDesktopApp || !this.mode.isOffline)) ? 'saveas' : 'info';
if (!panel) if (!panel)

View file

@ -755,11 +755,17 @@ define([
this._noApply = true; this._noApply = true;
this.disableControls(this._locked, !shapeprops.get_CanFill()); this.disableControls(this._locked, !shapeprops.get_CanFill());
this.hideShapeOnlySettings(shapeprops.get_FromChart()); this.hideShapeOnlySettings(shapeprops.get_FromChart() || shapeprops.get_FromImage());
this.hideChangeTypeSettings(shapetype=='line' || shapetype=='bentConnector2' || shapetype=='bentConnector3'
|| shapetype=='bentConnector4' || shapetype=='bentConnector5' || shapetype=='curvedConnector2' var hidechangetype = shapeprops.get_FromChart() || shapetype=='line' || shapetype=='bentConnector2' || shapetype=='bentConnector3'
|| shapetype=='curvedConnector3' || shapetype=='curvedConnector4' || shapetype=='curvedConnector5' || shapetype=='bentConnector4' || shapetype=='bentConnector5' || shapetype=='curvedConnector2'
|| shapetype=='straightConnector1'); || shapetype=='curvedConnector3' || shapetype=='curvedConnector4' || shapetype=='curvedConnector5'
|| 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(); var value = props.get_WrappingStyle();
if (this._state.WrappingStyle!==value) { if (this._state.WrappingStyle!==value) {
@ -1522,22 +1528,27 @@ define([
shapesStore = this.application.getCollection('ShapeGroups'); shapesStore = this.application.getCollection('ShapeGroups');
var count = shapesStore.length; var count = shapesStore.length;
for (var i=0; i<count-1; i++) { for (var i=-1; i<count-1 && count>0; i++) {
var shapeGroup = shapesStore.at(i); var shapeGroup = shapesStore.at(i>-1 ? i : i+1);
var menuItem = new Common.UI.MenuItem({ var menuItem = new Common.UI.MenuItem({
caption: shapeGroup.get('groupName'), caption: shapeGroup.get('groupName'),
menu: new Common.UI.Menu({ menu: new Common.UI.Menu({
menuAlign: 'tr-tl', menuAlign: 'tr-tl',
items: [ 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); me.btnChangeShape.menu.addItem(menuItem);
var store = shapeGroup.get('groupStore');
if (i<0) {
store = store.clone();
store.shift();
}
var shapePicker = new Common.UI.DataView({ var shapePicker = new Common.UI.DataView({
el: $('#id-shape-menu-shapegroup' + i), el: $('#id-shape-menu-shapegroup' + (i+1)),
store: shapeGroup.get('groupStore'), store: store,
parentMenu: menuItem.menu, parentMenu: menuItem.menu,
showLast: false, showLast: false,
itemTemplate: _.template('<div class="item-shape"><img src="<%= imageUrl %>" id="<%= id %>"></div>') itemTemplate: _.template('<div class="item-shape"><img src="<%= imageUrl %>" id="<%= id %>"></div>')

View file

@ -358,6 +358,12 @@ define([
this.chLinks.setValue((value !== null && value !== undefined) ? value : 'indeterminate', true); this.chLinks.setValue((value !== null && value !== undefined) ? value : 'indeterminate', true);
value = props.get_StylesType(); value = props.get_StylesType();
this.cmbStyles.setValue((value!==null) ? value : Asc.c_oAscTOCStylesType.Current); 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(), var start = props.get_OutlineStart(),
end = props.get_OutlineEnd(), end = props.get_OutlineEnd(),
@ -446,11 +452,11 @@ define([
if (!props) { if (!props) {
this._originalProps.put_OutlineRange(this.startLevel, this.endLevel); this._originalProps.put_OutlineRange(this.startLevel, this.endLevel);
this._originalProps.put_Hyperlink(this.chLinks.getValue() == 'checked'); this._originalProps.put_Hyperlink(this.chLinks.getValue() == 'checked');
} this._originalProps.put_ShowPageNumbers(this.chPages.getValue() == 'checked');
this._originalProps.put_ShowPageNumbers(this.chPages.getValue() == 'checked'); if (this.chPages.getValue() == 'checked') {
if (this.chPages.getValue() == 'checked') { this._originalProps.put_RightAlignTab(this.chAlign.getValue() == 'checked');
this._originalProps.put_RightAlignTab(this.chAlign.getValue() == 'checked'); this._originalProps.put_TabLeader(this.cmbLeader.getValue());
this._originalProps.put_TabLeader(this.cmbLeader.getValue()); }
} }
// this.api.SetDrawImagePlaceContents('tableofcontents-img', this._originalProps); // this.api.SetDrawImagePlaceContents('tableofcontents-img', this._originalProps);

View file

@ -79,14 +79,13 @@ define([
CheckFirst: false, CheckFirst: false,
CheckLast: false, CheckLast: false,
CheckColBanded: false, CheckColBanded: false,
WrapStyle: -1,
CanBeFlow: true,
TableAlignment: -1,
TableIndent: 0,
BackColor: '#000000', BackColor: '#000000',
RepeatRow: false, RepeatRow: false,
DisabledControls: false DisabledControls: false,
Width: null,
Height: null
}; };
this.spinners = [];
this.lockedControls = []; this.lockedControls = [];
this._locked = false; this._locked = false;
this._originalLook = new Asc.CTablePropLook(); this._originalLook = new Asc.CTablePropLook();
@ -96,7 +95,6 @@ define([
this.CellColor = {Value: 1, Color: 'transparent'}; // value=1 - цвет определен - прозрачный или другой, value=0 - цвет не определен, рисуем прозрачным this.CellColor = {Value: 1, Color: 'transparent'}; // value=1 - цвет определен - прозрачный или другой, value=0 - цвет не определен, рисуем прозрачным
this.BorderSize = 1; this.BorderSize = 1;
this._noApply = false; this._noApply = false;
this._wrapHandled = false;
this.render(); this.render();
}, },
@ -140,28 +138,10 @@ define([
this.fireEvent('editcomplete', this); 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) { onCheckRepeatRowChange: function(field, newValue, oldValue, eOpts) {
if (this.api) { if (this.api) {
var properties = new Asc.CTableProp(); var properties = new Asc.CTableProp();
properties.put_RowsInHeader((field.getValue()=='checked') ? 1 : 0 ); properties.put_RowsInHeader(field.getValue()=='checked');
this.api.tblApply(properties); this.api.tblApply(properties);
} }
this.fireEvent('editcomplete', this); this.fireEvent('editcomplete', this);
@ -259,8 +239,6 @@ define([
setApi: function(o) { setApi: function(o) {
this.api = o; this.api = o;
if (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)); this.api.asc_registerCallback('asc_onInitTableTemplates', _.bind(this._onInitTemplates, this));
} }
return this; return this;
@ -310,32 +288,6 @@ define([
this.chLast.on('change', _.bind(this.onCheckTemplateChange, this, 4)); this.chLast.on('change', _.bind(this.onCheckTemplateChange, this, 4));
this.chColBanded.on('change', _.bind(this.onCheckTemplateChange, this, 5)); 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 = [ var _arrBorderPosition = [
['l', 'btn-borders-small btn-position-left', 'table-button-border-left', this.tipLeft], ['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], ['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.chRepeatRow.on('change', _.bind(this.onCheckRepeatRowChange, this));
this.lockedControls.push(this.chRepeatRow); 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.linkAdvanced = $('#table-advanced-link');
$(this.el).on('click', '#table-advanced-link', _.bind(this.openAdvancedSettings, this)); $(this.el).on('click', '#table-advanced-link', _.bind(this.openAdvancedSettings, this));
}, },
@ -424,6 +426,7 @@ define([
createDelayedElements: function() { createDelayedElements: function() {
this.createDelayedControls(); this.createDelayedControls();
this.UpdateThemeColors(); this.UpdateThemeColors();
this.updateMetricUnit();
this._initSettings = false; this._initSettings = false;
}, },
@ -438,17 +441,18 @@ define([
this._originalProps = new Asc.CTableProp(props); this._originalProps = new Asc.CTableProp(props);
this._originalProps.put_CellSelect(true); this._originalProps.put_CellSelect(true);
this._TblWrapStyleChanged(props.get_TableWrap()); var value = props.get_ColumnWidth();
if ((this._state.Width === undefined || value === undefined)&&(this._state.Width!==value) ||
var value = props.get_CanBeFlow() && !this._locked; Math.abs(this._state.Width-value)>0.001) {
if ( this._state.CanBeFlow!==value ) { this.numWidth.setValue((value !== null && value !== undefined) ? Common.Utils.Metric.fnRecalcFromMM(value) : '', true);
this.btnWrapParallel.setDisabled(!value); this._state.Width=value;
this._state.CanBeFlow=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 //for table-template
value = props.get_TableStyle(); value = props.get_TableStyle();
@ -558,15 +562,23 @@ define([
value = props.get_RowsInHeader(); value = props.get_RowsInHeader();
if ( this._state.RepeatRow!==value ) { if ( this._state.RepeatRow!==value ) {
if ( value !== null ) this.chRepeatRow.setValue(!!value, true);
this.chRepeatRow.setValue((value>0) ? 1 : 0, true); this.chRepeatRow.setDisabled(value === null);
else
this.chRepeatRow.setValue('indeterminate', true);
this._state.RepeatRow=value; 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) { _UpdateBordersStyle: function(border) {
this.CellBorders = new Asc.CBorders(); this.CellBorders = new Asc.CBorders();
var updateBorders = this.CellBorders; 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() { UpdateThemeColors: function() {
if (!this.btnBackColor) { if (!this.btnBackColor) {
// create color buttons // create color buttons
@ -777,12 +774,9 @@ define([
} }
}, },
textWrap: 'Text Wrapping',
textBorders: 'Border\'s Style', textBorders: 'Border\'s Style',
textBorderColor: 'Color', textBorderColor: 'Color',
textBackColor: 'Background color', textBackColor: 'Background color',
textWrapParallelTooltip: 'Flow table',
textWrapNoneTooltip: 'Inline table',
textEdit: 'Rows & Columns', textEdit: 'Rows & Columns',
selectRowText : 'Select Row', selectRowText : 'Select Row',
selectColumnText : 'Select Column', selectColumnText : 'Select Column',
@ -823,7 +817,12 @@ define([
tipInner: 'Set Inner Lines Only', tipInner: 'Set Inner Lines Only',
tipInnerVert: 'Set Vertical Inner Lines Only', tipInnerVert: 'Set Vertical Inner Lines Only',
tipInnerHor: 'Set Horizontal 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 || {})); }, DE.Views.TableSettings || {}));
}); });

View file

@ -183,6 +183,7 @@
"Common.Views.OpenDialog.txtPassword": "Password", "Common.Views.OpenDialog.txtPassword": "Password",
"Common.Views.OpenDialog.txtTitle": "Choose %1 options", "Common.Views.OpenDialog.txtTitle": "Choose %1 options",
"Common.Views.OpenDialog.txtTitleProtected": "Protected File", "Common.Views.OpenDialog.txtTitleProtected": "Protected File",
"Common.Views.OpenDialog.closeButtonText": "Close File",
"Common.Views.PasswordDialog.cancelButtonText": "Cancel", "Common.Views.PasswordDialog.cancelButtonText": "Cancel",
"Common.Views.PasswordDialog.okButtonText": "OK", "Common.Views.PasswordDialog.okButtonText": "OK",
"Common.Views.PasswordDialog.txtDescription": "A password is required to open this document", "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.editFooterText": "Edit Footer",
"DE.Views.DocumentHolder.editHeaderText": "Edit Header", "DE.Views.DocumentHolder.editHeaderText": "Edit Header",
"DE.Views.DocumentHolder.editHyperlinkText": "Edit Hyperlink", "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.guestText": "Guest",
"DE.Views.DocumentHolder.hyperlinkText": "Hyperlink", "DE.Views.DocumentHolder.hyperlinkText": "Hyperlink",
"DE.Views.DocumentHolder.ignoreAllSpellText": "Ignore All", "DE.Views.DocumentHolder.ignoreAllSpellText": "Ignore All",
"DE.Views.DocumentHolder.ignoreSpellText": "Ignore", "DE.Views.DocumentHolder.ignoreSpellText": "Ignore",
"DE.Views.DocumentHolder.imageText": "Image Advanced Settings", "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.insertColumnLeftText": "Column Left",
"DE.Views.DocumentHolder.insertColumnRightText": "Column Right", "DE.Views.DocumentHolder.insertColumnRightText": "Column Right",
"DE.Views.DocumentHolder.insertColumnText": "Insert Column", "DE.Views.DocumentHolder.insertColumnText": "Insert Column",
@ -992,6 +993,8 @@
"DE.Views.DocumentHolder.textNest": "Nest table", "DE.Views.DocumentHolder.textNest": "Nest table",
"DE.Views.DocumentHolder.updateStyleText": "Update %1 style", "DE.Views.DocumentHolder.updateStyleText": "Update %1 style",
"DE.Views.DocumentHolder.vertAlignText": "Vertical Alignment", "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.cancelButtonText": "Cancel",
"DE.Views.DropcapSettingsAdvanced.okButtonText": "Ok", "DE.Views.DropcapSettingsAdvanced.okButtonText": "Ok",
"DE.Views.DropcapSettingsAdvanced.strBorders": "Borders & Fill", "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.textSelectBorders": "Select borders you want to change applying style chosen above",
"DE.Views.TableSettings.textTemplate": "Select From Template", "DE.Views.TableSettings.textTemplate": "Select From Template",
"DE.Views.TableSettings.textTotal": "Total", "DE.Views.TableSettings.textTotal": "Total",
"DE.Views.TableSettings.textWrap": "Wrapping Style", "del_DE.Views.TableSettings.textWrap": "Wrapping Style",
"DE.Views.TableSettings.textWrapNoneTooltip": "Inline table", "del_DE.Views.TableSettings.textWrapNoneTooltip": "Inline table",
"DE.Views.TableSettings.textWrapParallelTooltip": "Flow 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.tipAll": "Set outer border and all inner lines",
"DE.Views.TableSettings.tipBottom": "Set outer bottom border only", "DE.Views.TableSettings.tipBottom": "Set outer bottom border only",
"DE.Views.TableSettings.tipInner": "Set inner lines only", "DE.Views.TableSettings.tipInner": "Set inner lines only",

View file

@ -442,6 +442,12 @@ define([
title = me.loadingDocumentTitleText; title = me.loadingDocumentTitleText;
text = me.loadingDocumentTextText; text = me.loadingDocumentTextText;
break; break;
default:
if (typeof action.id == 'string'){
title = action.id;
text = action.id;
}
break;
} }
if (action.type == Asc.c_oAscAsyncActionType['BlockInteraction']) { if (action.type == Asc.c_oAscAsyncActionType['BlockInteraction']) {

View file

@ -463,6 +463,8 @@ define([
}, },
onShortcut: function(s, e) { onShortcut: function(s, e) {
if (!this.mode) return;
var previewPanel = PE.getController('Viewport').getView('DocumentPreview'); var previewPanel = PE.getController('Viewport').getView('DocumentPreview');
switch (s) { switch (s) {

View file

@ -547,6 +547,12 @@ define([
title = this.loadingDocumentTitleText; title = this.loadingDocumentTitleText;
text = this.loadingDocumentTextText; text = this.loadingDocumentTextText;
break; break;
default:
if (typeof action.id == 'string'){
title = action.id;
text = action.id;
}
break;
} }
if (action.type == Asc.c_oAscAsyncActionType['BlockInteraction']) { if (action.type == Asc.c_oAscAsyncActionType['BlockInteraction']) {
@ -832,6 +838,7 @@ define([
this.appOptions.canCoAuthoring = !this.appOptions.isLightVersion; this.appOptions.canCoAuthoring = !this.appOptions.isLightVersion;
/** coauthoring end **/ /** coauthoring end **/
this.appOptions.canRequestEditRights = this.editorConfig.canRequestEditRights; this.appOptions.canRequestEditRights = this.editorConfig.canRequestEditRights;
this.appOptions.canRequestClose = this.editorConfig.canRequestClose;
this.appOptions.canEdit = this.permissions.edit !== false && // can edit this.appOptions.canEdit = this.permissions.edit !== false && // can edit
(this.editorConfig.canRequestEditRights || this.editorConfig.mode !== 'view'); // if mode=="view" -> canRequestEditRights must be defined (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'; this.appOptions.isEdit = this.appOptions.canLicense && this.appOptions.canEdit && this.editorConfig.mode !== 'view';
@ -1712,14 +1719,18 @@ define([
me = this; me = this;
if (type == Asc.c_oAscAdvancedOptionsID.DRM) { if (type == Asc.c_oAscAdvancedOptionsID.DRM) {
me._state.openDlg = new Common.Views.OpenDialog({ me._state.openDlg = new Common.Views.OpenDialog({
closable: me.appOptions.canRequestClose,
type: type, type: type,
validatePwd: !!me._state.isDRM, validatePwd: !!me._state.isDRM,
handler: function (value) { handler: function (result, value) {
me.isShowOpenDialog = false; me.isShowOpenDialog = false;
if (me && me.api) { if (result == 'ok') {
me.api.asc_setAdvancedOptions(type, new Asc.asc_CDRMAdvancedOptions(value)); if (me.api) {
me.loadMask && me.loadMask.show(); me.api.asc_setAdvancedOptions(type, new Asc.asc_CDRMAdvancedOptions(value));
} me.loadMask && me.loadMask.show();
}
} else
Common.Gateway.requestClose();
me._state.openDlg = null; me._state.openDlg = null;
} }
}); });

View file

@ -273,6 +273,7 @@ define([
this.rightmenu.paragraphSettings.updateMetricUnit(); this.rightmenu.paragraphSettings.updateMetricUnit();
this.rightmenu.chartSettings.updateMetricUnit(); this.rightmenu.chartSettings.updateMetricUnit();
this.rightmenu.imageSettings.updateMetricUnit(); this.rightmenu.imageSettings.updateMetricUnit();
this.rightmenu.tableSettings.updateMetricUnit();
}, },
fillTextArt: function() { fillTextArt: function() {

View file

@ -97,7 +97,7 @@
</td> </td>
</tr> </tr>
<tr> <tr>
<td> <td class="padding-small">
<div style="display:inline-block;width:100px;vertical-align: middle;"> <div style="display:inline-block;width:100px;vertical-align: middle;">
<label class="input-label" style=""><%= scope.strSize %></label> <label class="input-label" style=""><%= scope.strSize %></label>
<div id="shape-combo-border-size" style="width: 93px;"></div> <div id="shape-combo-border-size" style="width: 93px;"></div>
@ -116,21 +116,18 @@
</div> </div>
</td> </td>
</tr> </tr>
<tr class="shape-only"> <tr class="change-type">
<td class="padding-small"></td>
</tr>
<tr class="shape-only">
<td class="padding-small"> <td class="padding-small">
<div class="separator horizontal"></div> <div class="separator horizontal"></div>
</td> </td>
</tr> </tr>
<tr class="shape-only change-type"> <tr class="change-type">
<td class="padding-small"> <td class="padding-small">
<label class="header" style="margin-top: 3px;"><%= scope.strChange %></label> <label class="header" style="margin-top: 3px;"><%= scope.strChange %></label>
<div id="shape-btn-change" style="display: inline-block; float:right;"></div> <div id="shape-btn-change" style="display: inline-block; float:right;"></div>
</td> </td>
</tr> </tr>
<tr class="shape-only change-type"> <tr class="shape-only">
<td class="padding-small"> <td class="padding-small">
<div class="separator horizontal"></div> <div class="separator horizontal"></div>
</td> </td>

View file

@ -105,6 +105,38 @@
<div class="separator horizontal"></div> <div class="separator horizontal"></div>
</td> </td>
</tr> </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> <tr>
<td align="center" colspan=2> <td align="center" colspan=2>
<label class="link" id="table-advanced-link"><%= scope.textAdvanced %></label> <label class="link" id="table-advanced-link"><%= scope.textAdvanced %></label>

View file

@ -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({ me.menuSpellTable = new Common.UI.MenuItem({
caption : me.loadSpellText, caption : me.loadSpellText,
disabled : true disabled : true
@ -2910,7 +2926,7 @@ define([
return; return;
var isEquation= (value.mathProps && value.mathProps.value); 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); me.tableMenu.items[i].setVisible(!isEquation);
} }
@ -2924,6 +2940,8 @@ define([
mnuTableMerge.setDisabled(value.tableProps.locked || disabled || !me.api.CheckBeforeMergeCells()); mnuTableMerge.setDisabled(value.tableProps.locked || disabled || !me.api.CheckBeforeMergeCells());
mnuTableSplit.setDisabled(value.tableProps.locked || disabled || !me.api.CheckBeforeSplitCells()); 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[7].setDisabled(value.tableProps.locked || disabled);
me.tableMenu.items[8].setDisabled(value.tableProps.locked || disabled); me.tableMenu.items[8].setDisabled(value.tableProps.locked || disabled);
@ -3068,6 +3086,9 @@ define([
mnuTableMerge, mnuTableMerge,
mnuTableSplit, mnuTableSplit,
{ caption: '--' }, { caption: '--' },
menuTableDistRows,
menuTableDistCols,
{ caption: '--' },
menuTableCellAlign, menuTableCellAlign,
{ caption: '--' }, { caption: '--' },
menuTableAdvanced, menuTableAdvanced,
@ -3101,12 +3122,12 @@ define([
disabled = imgdisabled || shapedisabled || chartdisabled || (value.slideProps!==undefined && value.slideProps.locked); disabled = imgdisabled || shapedisabled || chartdisabled || (value.slideProps!==undefined && value.slideProps.locked);
// image properties // 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()) if (menuImgOriginalSize.isVisible())
menuImgOriginalSize.setDisabled(disabled || _.isNull(value.imgProps.value.get_ImageUrl()) || _.isUndefined(value.imgProps.value.get_ImageUrl())); 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)); menuShapeAdvanced.setVisible(_.isUndefined(value.imgProps) && _.isUndefined(value.chartProps));
menuChartEdit.setVisible(_.isUndefined(value.imgProps) && !_.isUndefined(value.chartProps) && (_.isUndefined(value.shapeProps) || value.shapeProps.isChart)); menuChartEdit.setVisible(_.isUndefined(value.imgProps) && !_.isUndefined(value.chartProps) && (_.isUndefined(value.shapeProps) || value.shapeProps.isChart));
menuImgShapeSeparator.setVisible(menuImageAdvanced.isVisible() || menuShapeAdvanced.isVisible() || menuChartEdit.isVisible()); menuImgShapeSeparator.setVisible(menuImageAdvanced.isVisible() || menuShapeAdvanced.isVisible() || menuChartEdit.isVisible());
@ -3375,7 +3396,9 @@ define([
txtKeepTextOnly: 'Keep text only', txtKeepTextOnly: 'Keep text only',
txtPastePicture: 'Picture', txtPastePicture: 'Picture',
txtPasteSourceFormat: 'Keep source formatting', txtPasteSourceFormat: 'Keep source formatting',
txtPasteDestFormat: 'Use destination theme' txtPasteDestFormat: 'Use destination theme',
textDistributeRows: 'Distribute rows',
textDistributeCols: 'Distribute columns'
}, PE.Views.DocumentHolder || {})); }, PE.Views.DocumentHolder || {}));
}); });

View file

@ -216,7 +216,7 @@ define([
}, },
show: function(panel) { 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'; var defPanel = (this.mode.canDownload && (!this.mode.isDesktopApp || !this.mode.isOffline)) ? 'saveas' : 'info';
if (!panel) if (!panel)

View file

@ -302,12 +302,10 @@ define([
}, },
disableMenu: function(menu, disable) { disableMenu: function(menu, disable) {
this.btnSearch.setDisabled(disable);
this.btnThumbs.setDisabled(disable); this.btnThumbs.setDisabled(disable);
this.btnAbout.setDisabled(disable); this.btnAbout.setDisabled(disable);
this.btnSupport.setDisabled(disable); this.btnSupport.setDisabled(disable);
/** coauthoring begin **/ /** coauthoring begin **/
this.btnComments.setDisabled(disable);
this.btnChat.setDisabled(disable); this.btnChat.setDisabled(disable);
/** coauthoring end **/ /** coauthoring end **/
this.btnPlugins.setDisabled(disable); this.btnPlugins.setDisabled(disable);

View file

@ -687,11 +687,17 @@ define([
var shapetype = props.asc_getType(); var shapetype = props.asc_getType();
this.disableControls(this._locked==true, props.get_CanFill() !== true); this.disableControls(this._locked==true, props.get_CanFill() !== true);
this.hideShapeOnlySettings(props.get_FromChart()); this.hideShapeOnlySettings(props.get_FromChart() || props.get_FromImage());
this.hideChangeTypeSettings(shapetype=='line' || shapetype=='bentConnector2' || shapetype=='bentConnector3'
|| shapetype=='bentConnector4' || shapetype=='bentConnector5' || shapetype=='curvedConnector2' var hidechangetype = props.get_FromChart() || shapetype=='line' || shapetype=='bentConnector2' || shapetype=='bentConnector3'
|| shapetype=='curvedConnector3' || shapetype=='curvedConnector4' || shapetype=='curvedConnector5' || shapetype=='bentConnector4' || shapetype=='bentConnector5' || shapetype=='curvedConnector2'
|| shapetype=='straightConnector1'); || 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 // background colors
var rec = null; var rec = null;
@ -1395,22 +1401,27 @@ define([
shapesStore = this.application.getCollection('ShapeGroups'); shapesStore = this.application.getCollection('ShapeGroups');
var count = shapesStore.length; var count = shapesStore.length;
for (var i=0; i<count-1; i++) { for (var i=-1; i<count-1 && count>0; i++) {
var shapeGroup = shapesStore.at(i); var shapeGroup = shapesStore.at(i>-1 ? i : i+1);
var menuItem = new Common.UI.MenuItem({ var menuItem = new Common.UI.MenuItem({
caption: shapeGroup.get('groupName'), caption: shapeGroup.get('groupName'),
menu: new Common.UI.Menu({ menu: new Common.UI.Menu({
menuAlign: 'tr-tl', menuAlign: 'tr-tl',
items: [ 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); me.btnChangeShape.menu.addItem(menuItem);
var store = shapeGroup.get('groupStore');
if (i<0) {
store = store.clone();
store.shift();
}
var shapePicker = new Common.UI.DataView({ var shapePicker = new Common.UI.DataView({
el: $('#id-shape-menu-shapegroup' + i), el: $('#id-shape-menu-shapegroup' + (i+1)),
store: shapeGroup.get('groupStore'), store: store,
parentMenu: menuItem.menu, parentMenu: menuItem.menu,
showLast: false, showLast: false,
itemTemplate: _.template('<div class="item-shape"><img src="<%= imageUrl %>" id="<%= id %>"></div>') itemTemplate: _.template('<div class="item-shape"><img src="<%= imageUrl %>" id="<%= id %>"></div>')

View file

@ -80,8 +80,11 @@ define([
CheckLast: false, CheckLast: false,
CheckColBanded: false, CheckColBanded: false,
BackColor: '#000000', BackColor: '#000000',
DisabledControls: false DisabledControls: false,
Width: null,
Height: null
}; };
this.spinners = [];
this.lockedControls = []; this.lockedControls = [];
this._locked = false; this._locked = false;
this._originalLook = new Asc.CTablePropLook(); this._originalLook = new Asc.CTablePropLook();
@ -350,6 +353,56 @@ define([
this.btnEdit.menu.on('item:click', _.bind(this.onEditClick, this)); this.btnEdit.menu.on('item:click', _.bind(this.onEditClick, this));
this.lockedControls.push(this.btnEdit); 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.linkAdvanced = $('#table-advanced-link');
$(this.el).on('click', '#table-advanced-link', _.bind(this.openAdvancedSettings, this)); $(this.el).on('click', '#table-advanced-link', _.bind(this.openAdvancedSettings, this));
}, },
@ -365,8 +418,21 @@ define([
this._originalProps = new Asc.CTableProp(props); this._originalProps = new Asc.CTableProp(props);
this._originalProps.put_CellSelect(true); 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 //for table-template
var value = props.get_TableStyle(); value = props.get_TableStyle();
if (this._state.TemplateId!==value || this._isTemplatesChanged) { if (this._state.TemplateId!==value || this._isTemplatesChanged) {
this.cmbTableTemplate.suspendEvents(); this.cmbTableTemplate.suspendEvents();
var rec = this.cmbTableTemplate.menuPicker.store.findWhere({ 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) { _UpdateBordersStyle: function(border) {
this.CellBorders = new Asc.CBorders(); this.CellBorders = new Asc.CBorders();
var updateBorders = this.CellBorders; var updateBorders = this.CellBorders;
@ -530,6 +606,7 @@ define([
createDelayedElements: function() { createDelayedElements: function() {
this.createDelayedControls(); this.createDelayedControls();
this.UpdateThemeColors(); this.UpdateThemeColors();
this.updateMetricUnit();
this._initSettings = false; this._initSettings = false;
}, },
@ -707,7 +784,12 @@ define([
tipInner: 'Set Inner Lines Only', tipInner: 'Set Inner Lines Only',
tipInnerVert: 'Set Vertical Inner Lines Only', tipInnerVert: 'Set Vertical Inner Lines Only',
tipInnerHor: 'Set Horizontal 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 || {})); }, PE.Views.TableSettings || {}));
}); });

View file

@ -116,6 +116,7 @@
"Common.Views.OpenDialog.txtPassword": "Password", "Common.Views.OpenDialog.txtPassword": "Password",
"Common.Views.OpenDialog.txtTitle": "Choose %1 options", "Common.Views.OpenDialog.txtTitle": "Choose %1 options",
"Common.Views.OpenDialog.txtTitleProtected": "Protected File", "Common.Views.OpenDialog.txtTitleProtected": "Protected File",
"Common.Views.OpenDialog.closeButtonText": "Close File",
"Common.Views.PasswordDialog.cancelButtonText": "Cancel", "Common.Views.PasswordDialog.cancelButtonText": "Cancel",
"Common.Views.PasswordDialog.okButtonText": "OK", "Common.Views.PasswordDialog.okButtonText": "OK",
"Common.Views.PasswordDialog.txtDescription": "A password is required to open this document", "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.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.textAltTitle": "Title",
"PE.Views.ChartSettingsAdvanced.textTitle": "Chart - Advanced Settings", "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.aboveText": "Above",
"PE.Views.DocumentHolder.addCommentText": "Add Comment", "PE.Views.DocumentHolder.addCommentText": "Add Comment",
"PE.Views.DocumentHolder.advancedImageText": "Image Advanced Settings", "PE.Views.DocumentHolder.advancedImageText": "Image Advanced Settings",
@ -1263,6 +1266,11 @@
"PE.Views.Statusbar.tipZoomIn": "Zoom in", "PE.Views.Statusbar.tipZoomIn": "Zoom in",
"PE.Views.Statusbar.tipZoomOut": "Zoom out", "PE.Views.Statusbar.tipZoomOut": "Zoom out",
"PE.Views.Statusbar.txtPageNumInvalid": "Invalid slide number", "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.deleteColumnText": "Delete Column",
"PE.Views.TableSettings.deleteRowText": "Delete Row", "PE.Views.TableSettings.deleteRowText": "Delete Row",
"PE.Views.TableSettings.deleteTableText": "Delete Table", "PE.Views.TableSettings.deleteTableText": "Delete Table",

View file

@ -425,6 +425,12 @@ define([
title = me.loadingDocumentTitleText; title = me.loadingDocumentTitleText;
text = me.loadingDocumentTextText; text = me.loadingDocumentTextText;
break; break;
default:
if (typeof action.id == 'string'){
title = action.id;
text = action.id;
}
break;
} }
if (action.type == Asc.c_oAscAsyncActionType['BlockInteraction']) { if (action.type == Asc.c_oAscAsyncActionType['BlockInteraction']) {

View file

@ -1249,7 +1249,7 @@ define([
}, },
fillMenuProps: function(cellinfo, showMenu, event){ 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, documentHolder = this.documentHolder,
seltype = cellinfo.asc_getFlags().asc_getSelectionType(), seltype = cellinfo.asc_getFlags().asc_getSelectionType(),
isCellLocked = cellinfo.asc_getLocked(), isCellLocked = cellinfo.asc_getLocked(),
@ -1285,6 +1285,8 @@ define([
if (shapeprops) { if (shapeprops) {
if (shapeprops.asc_getFromChart()) if (shapeprops.asc_getFromChart())
ischartmenu = true; ischartmenu = true;
else if (shapeprops.asc_getFromImage())
isimageonly = true;
else { else {
documentHolder.mnuShapeAdvanced.shapeInfo = elValue; documentHolder.mnuShapeAdvanced.shapeInfo = elValue;
isshapemenu = true; isshapemenu = true;
@ -1310,7 +1312,7 @@ define([
documentHolder.mnuChartEdit.setDisabled(isObjLocked); documentHolder.mnuChartEdit.setDisabled(isObjLocked);
documentHolder.pmiImgCut.setDisabled(isObjLocked); documentHolder.pmiImgCut.setDisabled(isObjLocked);
documentHolder.pmiImgPaste.setDisabled(isObjLocked); documentHolder.pmiImgPaste.setDisabled(isObjLocked);
documentHolder.mnuImgAdvanced.setVisible(isimagemenu && !isshapemenu && !ischartmenu); documentHolder.mnuImgAdvanced.setVisible(isimagemenu && (!isshapemenu || isimageonly) && !ischartmenu);
documentHolder.mnuImgAdvanced.setDisabled(isObjLocked); documentHolder.mnuImgAdvanced.setDisabled(isObjLocked);
var isInSign = !!signGuid; var isInSign = !!signGuid;

View file

@ -662,6 +662,8 @@ define([
/** coauthoring end **/ /** coauthoring end **/
onShortcut: function(s, e) { onShortcut: function(s, e) {
if (!this.mode) return;
if (this.mode.isEditDiagram && s!='escape') return false; if (this.mode.isEditDiagram && s!='escape') return false;
if (this.mode.isEditMailMerge && s!='escape' && s!='search') return false; if (this.mode.isEditMailMerge && s!='escape' && s!='search') return false;

View file

@ -564,6 +564,11 @@ define([
case LoadingDocument: case LoadingDocument:
title = this.loadingDocumentTitleText; title = this.loadingDocumentTitleText;
break; break;
default:
if (typeof action.id == 'string'){
title = action.id;
}
break;
} }
if (action.type == Asc.c_oAscAsyncActionType.BlockInteraction) { if (action.type == Asc.c_oAscAsyncActionType.BlockInteraction) {
@ -883,6 +888,7 @@ define([
this.appOptions.canModifyFilter = true; this.appOptions.canModifyFilter = true;
this.appOptions.canRequestEditRights = this.editorConfig.canRequestEditRights; this.appOptions.canRequestEditRights = this.editorConfig.canRequestEditRights;
this.appOptions.canRequestClose = this.editorConfig.canRequestClose;
this.appOptions.canEdit = this.permissions.edit !== false && // can edit this.appOptions.canEdit = this.permissions.edit !== false && // can edit
(this.editorConfig.canRequestEditRights || this.editorConfig.mode !== 'view'); // if mode=="view" -> canRequestEditRights must be defined (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'; 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) { } else if (type == Asc.c_oAscAdvancedOptionsID.DRM) {
me._state.openDlg = new Common.Views.OpenDialog({ me._state.openDlg = new Common.Views.OpenDialog({
closable: me.appOptions.canRequestClose,
type: type, type: type,
validatePwd: !!me._state.isDRM, validatePwd: !!me._state.isDRM,
handler: function (value) { handler: function (result, value) {
me.isShowOpenDialog = false; me.isShowOpenDialog = false;
if (me && me.api) { if (result == 'ok') {
me.api.asc_setAdvancedOptions(type, new Asc.asc_CDRMAdvancedOptions(value)); if (me && me.api) {
me.loadMask && me.loadMask.show(); me.api.asc_setAdvancedOptions(type, new Asc.asc_CDRMAdvancedOptions(value));
} me.loadMask && me.loadMask.show();
}
} else
Common.Gateway.requestClose();
me._state.openDlg = null; me._state.openDlg = null;
} }
}); });

View file

@ -59,6 +59,7 @@ define([
'pivottable:rowscolumns': _.bind(this.onCheckTemplateChange, this), 'pivottable:rowscolumns': _.bind(this.onCheckTemplateChange, this),
'pivottable:create': _.bind(this.onCreateClick, this), 'pivottable:create': _.bind(this.onCreateClick, this),
'pivottable:refresh': _.bind(this.onRefreshClick, this), 'pivottable:refresh': _.bind(this.onRefreshClick, this),
'pivottable:select': _.bind(this.onSelectClick, this),
'pivottable:style': _.bind(this.onPivotStyleSelect, this), 'pivottable:style': _.bind(this.onPivotStyleSelect, this),
'pivottable:layout': _.bind(this.onPivotLayout, this), 'pivottable:layout': _.bind(this.onPivotLayout, this),
'pivottable:blankrows': _.bind(this.onPivotBlankRows, this), 'pivottable:blankrows': _.bind(this.onPivotBlankRows, this),
@ -143,6 +144,13 @@ define([
Common.NotificationCenter.trigger('edit:complete', this); 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){ onPivotStyleSelect: function(record){
if (this.api) { if (this.api) {
this._originalProps.asc_getStyleInfo().asc_setName(this.api, this._originalProps, record.get('name')); this._originalProps.asc_getStyleInfo().asc_setName(this.api, this._originalProps, record.get('name'));

View file

@ -97,7 +97,7 @@
</td> </td>
</tr> </tr>
<tr> <tr>
<td> <td class="padding-small">
<div style="display:inline-block;width:100px;vertical-align: middle;"> <div style="display:inline-block;width:100px;vertical-align: middle;">
<label class="input-label" style=""><%= scope.strSize %></label> <label class="input-label" style=""><%= scope.strSize %></label>
<div id="shape-combo-border-size" style="width: 93px;"></div> <div id="shape-combo-border-size" style="width: 93px;"></div>
@ -116,21 +116,18 @@
</div> </div>
</td> </td>
</tr> </tr>
<tr class="shape-only"> <tr class="change-type">
<td class="padding-small"></td>
</tr>
<tr class="shape-only">
<td class="padding-small"> <td class="padding-small">
<div class="separator horizontal"></div> <div class="separator horizontal"></div>
</td> </td>
</tr> </tr>
<tr class="shape-only change-type"> <tr class="change-type">
<td class="padding-small"> <td class="padding-small">
<label class="header" style="margin-top: 3px;"><%= scope.strChange %></label> <label class="header" style="margin-top: 3px;"><%= scope.strChange %></label>
<div id="shape-btn-change" style="display: inline-block; float:right;"></div> <div id="shape-btn-change" style="display: inline-block; float:right;"></div>
</td> </td>
</tr> </tr>
<tr class="shape-only change-type"> <tr class="shape-only">
<td class="padding-small"> <td class="padding-small">
<div class="separator horizontal"></div> <div class="separator horizontal"></div>
</td> </td>

View file

@ -205,7 +205,7 @@ define([
}, },
show: function(panel) { 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'; var defPanel = (this.mode.canDownload && (!this.mode.isDesktopApp || !this.mode.isOffline)) ? 'saveas' : 'info';
if (!panel) if (!panel)
@ -220,7 +220,7 @@ define([
hide: function() { hide: function() {
this.$el.hide(); this.$el.hide();
this.api.asc_enableKeyEvents(true); this.api && this.api.asc_enableKeyEvents(true);
this.fireEvent('menu:hide', [this]); this.fireEvent('menu:hide', [this]);
}, },

View file

@ -67,6 +67,10 @@ define([
'<span id="slot-btn-refresh-pivot" class="btn-slot text x-huge"></span>' + '<span id="slot-btn-refresh-pivot" class="btn-slot text x-huge"></span>' +
'</div>' + '</div>' +
'<div class="separator long"/>' + '<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="group">' +
'<div class="elset">' + '<div class="elset">' +
'<span class="btn-slot text" id="slot-chk-header-row"></span>' + '<span class="btn-slot text" id="slot-chk-header-row"></span>' +
@ -114,6 +118,10 @@ define([
me.fireEvent('pivottable:refresh'); me.fireEvent('pivottable:refresh');
}); });
this.btnSelectPivot.on('click', function (e) {
me.fireEvent('pivottable:select');
});
this.chRowHeader.on('change', function (field, value) { this.chRowHeader.on('change', function (field, value) {
me.fireEvent('pivottable:rowscolumns', [0, value]); me.fireEvent('pivottable:rowscolumns', [0, value]);
}); });
@ -243,6 +251,13 @@ define([
}); });
// this.lockedControls.push(this.btnRefreshPivot); // 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({ this.pivotStyles = new Common.UI.ComboDataView({
cls : 'combo-pivot-template', cls : 'combo-pivot-template',
enableKeyEvents : true, enableKeyEvents : true,
@ -270,6 +285,7 @@ define([
})).then(function(){ })).then(function(){
me.btnAddPivot.updateHint(me.tipCreatePivot); me.btnAddPivot.updateHint(me.tipCreatePivot);
me.btnRefreshPivot.updateHint(me.tipRefresh); me.btnRefreshPivot.updateHint(me.tipRefresh);
me.btnSelectPivot.updateHint(me.tipSelect);
me.btnPivotLayout.updateHint(me.capLayout); me.btnPivotLayout.updateHint(me.capLayout);
me.btnPivotBlankRows.updateHint(me.capBlankRows); me.btnPivotBlankRows.updateHint(me.capBlankRows);
me.btnPivotSubtotals.updateHint(me.tipSubtotals); me.btnPivotSubtotals.updateHint(me.tipSubtotals);
@ -289,6 +305,7 @@ define([
this.btnAddPivot.render(this.$el.find('#slot-btn-add-pivot')); this.btnAddPivot.render(this.$el.find('#slot-btn-add-pivot'));
this.btnRefreshPivot.render(this.$el.find('#slot-btn-refresh-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.btnPivotLayout.render(this.$el.find('#slot-btn-pivot-report-layout'));
this.btnPivotBlankRows.render(this.$el.find('#slot-btn-pivot-blank-rows')); this.btnPivotBlankRows.render(this.$el.find('#slot-btn-pivot-blank-rows'));
this.btnPivotSubtotals.render(this.$el.find('#slot-btn-pivot-subtotals')); this.btnPivotSubtotals.render(this.$el.find('#slot-btn-pivot-subtotals'));
@ -341,7 +358,9 @@ define([
txtRefresh: 'Refresh', txtRefresh: 'Refresh',
tipRefresh: 'Update the information from data source', tipRefresh: 'Update the information from data source',
tipGrandTotals: 'Show or hide grand totals', 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 || {})); }()), SSE.Views.PivotTable || {}));
}); });

View file

@ -711,11 +711,17 @@ define([
this._noApply = true; this._noApply = true;
this.disableControls(this._locked, !shapeprops.asc_getCanFill()); this.disableControls(this._locked, !shapeprops.asc_getCanFill());
this.hideShapeOnlySettings(shapeprops.asc_getFromChart()); this.hideShapeOnlySettings(shapeprops.asc_getFromChart() || shapeprops.asc_getFromImage());
this.hideChangeTypeSettings(shapetype=='line' || shapetype=='bentConnector2' || shapetype=='bentConnector3'
|| shapetype=='bentConnector4' || shapetype=='bentConnector5' || shapetype=='curvedConnector2' var hidechangetype = shapeprops.get_FromChart() || shapetype=='line' || shapetype=='bentConnector2' || shapetype=='bentConnector3'
|| shapetype=='curvedConnector3' || shapetype=='curvedConnector4' || shapetype=='curvedConnector5' || shapetype=='bentConnector4' || shapetype=='bentConnector5' || shapetype=='curvedConnector2'
|| shapetype=='straightConnector1'); || shapetype=='curvedConnector3' || shapetype=='curvedConnector4' || shapetype=='curvedConnector5'
|| 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 // background colors
var rec = null; var rec = null;
@ -1420,22 +1426,27 @@ define([
shapesStore = this.application.getCollection('ShapeGroups'); shapesStore = this.application.getCollection('ShapeGroups');
var count = shapesStore.length; var count = shapesStore.length;
for (var i=0; i<count-1; i++) { for (var i=-1; i<count-1 && count>0; i++) {
var shapeGroup = shapesStore.at(i); var shapeGroup = shapesStore.at(i>-1 ? i : i+1);
var menuItem = new Common.UI.MenuItem({ var menuItem = new Common.UI.MenuItem({
caption: shapeGroup.get('groupName'), caption: shapeGroup.get('groupName'),
menu: new Common.UI.Menu({ menu: new Common.UI.Menu({
menuAlign: 'tr-tl', menuAlign: 'tr-tl',
items: [ 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); me.btnChangeShape.menu.addItem(menuItem);
var store = shapeGroup.get('groupStore');
if (i<0) {
store = store.clone();
store.shift();
}
var shapePicker = new Common.UI.DataView({ var shapePicker = new Common.UI.DataView({
el: $('#id-shape-menu-shapegroup' + i), el: $('#id-shape-menu-shapegroup' + (i+1)),
store: shapeGroup.get('groupStore'), store: store,
parentMenu: menuItem.menu, parentMenu: menuItem.menu,
showLast: false, showLast: false,
itemTemplate: _.template('<div class="item-shape"><img src="<%= imageUrl %>" id="<%= id %>"></div>') itemTemplate: _.template('<div class="item-shape"><img src="<%= imageUrl %>" id="<%= id %>"></div>')

View file

@ -102,6 +102,7 @@
"Common.Views.OpenDialog.txtTab": "Tab", "Common.Views.OpenDialog.txtTab": "Tab",
"Common.Views.OpenDialog.txtTitle": "Choose %1 options", "Common.Views.OpenDialog.txtTitle": "Choose %1 options",
"Common.Views.OpenDialog.txtTitleProtected": "Protected File", "Common.Views.OpenDialog.txtTitleProtected": "Protected File",
"Common.Views.OpenDialog.closeButtonText": "Close File",
"Common.Views.PasswordDialog.cancelButtonText": "Cancel", "Common.Views.PasswordDialog.cancelButtonText": "Cancel",
"Common.Views.PasswordDialog.okButtonText": "OK", "Common.Views.PasswordDialog.okButtonText": "OK",
"Common.Views.PasswordDialog.txtDescription": "A password is required to open this document", "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.tipRefresh": "Update the information from data source",
"SSE.Views.PivotTable.tipGrandTotals": "Show or hide grand totals", "SSE.Views.PivotTable.tipGrandTotals": "Show or hide grand totals",
"SSE.Views.PivotTable.tipSubtotals": "Show or hide subtotals", "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.btnPrint": "Save & Print",
"SSE.Views.PrintSettings.cancelButtonText": "Cancel", "SSE.Views.PrintSettings.cancelButtonText": "Cancel",
"SSE.Views.PrintSettings.strBottom": "Bottom", "SSE.Views.PrintSettings.strBottom": "Bottom",

View file

@ -440,6 +440,12 @@ define([
title = me.loadingDocumentTitleText; title = me.loadingDocumentTitleText;
text = me.loadingDocumentTextText; text = me.loadingDocumentTextText;
break; break;
default:
if (typeof action.id == 'string'){
title = action.id;
text = action.id;
}
break;
} }
if (action.type == Asc.c_oAscAsyncActionType.BlockInteraction) { if (action.type == Asc.c_oAscAsyncActionType.BlockInteraction) {