Merge branch 'feature/print-area' into develop

This commit is contained in:
Julia Radzhabova 2018-10-04 10:17:29 +03:00
commit 61f777e96c
6 changed files with 67 additions and 3 deletions

View file

@ -323,3 +323,4 @@
.button-normal-icon(btn-controls, 54, @toolbar-big-icon-size);
.button-normal-icon(~'x-huge .btn-select-pivot', 55, @toolbar-big-icon-size);
.button-normal-icon(~'x-huge .btn-bookmarks', 56, @toolbar-big-icon-size);
.button-normal-icon(btn-print-area, 56, @toolbar-big-icon-size);

View file

@ -1463,6 +1463,7 @@
"DE.Views.PageSizeDialog.cancelButtonText": "Cancel",
"DE.Views.PageSizeDialog.okButtonText": "Ok",
"DE.Views.PageSizeDialog.textHeight": "Height",
"DE.Views.PageSizeDialog.textPreset": "Preset",
"DE.Views.PageSizeDialog.textTitle": "Page Size",
"DE.Views.PageSizeDialog.textWidth": "Width",
"DE.Views.PageSizeDialog.txtCustom": "Custom",

View file

@ -357,6 +357,8 @@ define([
toolbar.btnPageOrient.menu.on('item:click', _.bind(this.onPageOrientSelect, this));
toolbar.btnPageMargins.menu.on('item:click', _.bind(this.onPageMarginsSelect, this));
toolbar.mnuPageSize.on('item:click', _.bind(this.onPageSizeClick, this));
toolbar.btnPrintArea.menu.on('item:click', _.bind(this.onPrintAreaClick, this));
toolbar.btnPrintArea.menu.on('show:after', _.bind(this.onPrintAreaMenuOpen, this));
toolbar.btnImgGroup.menu.on('item:click', _.bind(this.onImgGroupSelect, this));
toolbar.btnImgBackward.menu.on('item:click', _.bind(this.onImgArrangeSelect, this));
toolbar.btnImgForward.menu.on('item:click', _.bind(this.onImgArrangeSelect, this));
@ -1715,6 +1717,7 @@ define([
this.onApiPageMargins(props.asc_getPageMargins());
this.api.asc_isLayoutLocked(currentSheet) ? this.onApiLockDocumentProps(currentSheet) : this.onApiUnLockDocumentProps(currentSheet);
this.toolbar.lockToolbar(SSE.enumLock.printAreaLock, this.api.asc_isPrintAreaLocked(currentSheet), {array: [this.toolbar.btnPrintArea]});
},
onUpdateDocumentProps: function(nIndex) {
@ -3039,6 +3042,9 @@ define([
onLockDefNameManager: function(state) {
this._state.namedrange_locked = (state == Asc.c_oAscDefinedNameReason.LockDefNameManager);
this.toolbar.lockToolbar(SSE.enumLock.printAreaLock, this.api.asc_isPrintAreaLocked(this.api.asc_getActiveWorksheetIndex()), {array: [this.toolbar.btnPrintArea]});
this.toolbar.lockToolbar(SSE.enumLock.namedRangeLock, this._state.namedrange_locked, {array: [this.toolbar.btnPrintArea.menu.items[0], this.toolbar.btnPrintArea.menu.items[2]]});
},
activateControls: function() {
@ -3278,6 +3284,20 @@ define([
Common.component.Analytics.trackEvent('ToolBar', 'Objects Align');
},
onPrintAreaClick: function(menu, item) {
if (this.api) {
this.api.asc_ChangePrintArea(item.value);
Common.component.Analytics.trackEvent('ToolBar', 'Print Area');
}
Common.NotificationCenter.trigger('edit:complete', this.toolbar);
},
onPrintAreaMenuOpen: function() {
if (this.api)
this.toolbar.btnPrintArea.menu.items[2].setVisible(this.api.asc_CanAddPrintArea());
},
textEmptyImgUrl : 'You need to specify image URL.',
warnMergeLostData : 'Operation can destroy data in the selected cells.<br>Continue?',
textWarning : 'Warning',

View file

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

View file

@ -85,7 +85,9 @@ define([
disableOnStart: 'on-start',
cantGroup: 'cant-group',
cantGroupUngroup: 'cant-group-ungroup',
docPropsLock: 'doc-props-lock'
docPropsLock: 'doc-props-lock',
printAreaLock: 'print-area-lock',
namedRangeLock: 'named-range-lock'
};
SSE.Views.Toolbar = Common.UI.Mixtbar.extend(_.extend({
@ -1409,6 +1411,33 @@ define([
});
me.mnuPageSize = me.btnPageSize.menu;
me.btnPrintArea = new Common.UI.Button({
id: 'tlbtn-printarea',
cls: 'btn-toolbar x-huge icon-top',
iconCls: 'btn-print-area',
caption: me.capBtnPrintArea,
lock : [_set.selChart, _set.selChartText, _set.selShape, _set.selShapeText, _set.selImage, _set.editCell, _set.selRangeEdit, _set.printAreaLock, _set.lostConnect, _set.coAuth],
menu: new Common.UI.Menu({
cls: 'ppm-toolbar',
items: [
{
caption: me.textSetPrintArea,
lock: [_set.namedRangeLock],
value: Asc.c_oAscChangePrintAreaType.set
},
{
caption: me.textClearPrintArea,
value: Asc.c_oAscChangePrintAreaType.clear
},
{
caption: me.textAddPrintArea,
lock: [_set.namedRangeLock],
value: Asc.c_oAscChangePrintAreaType.add
}
]
})
});
me.btnImgAlign = new Common.UI.Button({
cls: 'btn-toolbar x-huge icon-top',
iconCls: 'btn-img-align',
@ -1464,7 +1493,7 @@ define([
me.btnInsertChart, me.btnColorSchemas,
me.btnAutofilter, me.btnCopy, me.btnPaste, me.listStyles, me.btnPrint,
/*me.btnSave,*/ me.btnClearStyle, me.btnCopyStyle,
me.btnPageMargins, me.btnPageSize, me.btnPageOrient, me.btnImgAlign, me.btnImgBackward, me.btnImgForward, me.btnImgGroup
me.btnPageMargins, me.btnPageSize, me.btnPageOrient, me.btnPrintArea, me.btnImgAlign, me.btnImgBackward, me.btnImgForward, me.btnImgGroup
];
var _temp_array = [me.cmbFontName, me.cmbFontSize, me.btnAlignLeft,me.btnAlignCenter,me.btnAlignRight,me.btnAlignJust,me.btnAlignTop,
@ -1635,6 +1664,7 @@ define([
_injectComponent('#slot-btn-pageorient', this.btnPageOrient);
_injectComponent('#slot-btn-pagemargins', this.btnPageMargins);
_injectComponent('#slot-btn-pagesize', this.btnPageSize);
_injectComponent('#slot-btn-printarea', this.btnPrintArea);
_injectComponent('#slot-img-align', this.btnImgAlign);
_injectComponent('#slot-img-group', this.btnImgGroup);
_injectComponent('#slot-img-movefrwd', this.btnImgForward);
@ -1711,6 +1741,7 @@ define([
_updateHint(this.btnPageOrient, this.tipPageOrient);
_updateHint(this.btnPageSize, this.tipPageSize);
_updateHint(this.btnPageMargins, this.tipPageMargins);
_updateHint(this.btnPrintArea, this.tipPrintArea);
// set menus
if (this.btnBorders && this.btnBorders.rendered) {
@ -2415,6 +2446,11 @@ define([
textRight: 'Right: ',
textPortrait: 'Portrait',
textLandscape: 'Landscape',
mniImageFromStorage: 'Image from Storage'
mniImageFromStorage: 'Image from Storage',
capBtnPrintArea: 'Print Area',
textSetPrintArea: 'Set Print Area',
textClearPrintArea: 'Clear Print Area',
textAddPrintArea: 'Add to Print Area',
tipPrintArea: 'Print Area'
}, SSE.Views.Toolbar || {}));
});

View file

@ -2084,6 +2084,11 @@
"SSE.Views.Toolbar.txtUnmerge": "Unmerge Cells",
"SSE.Views.Toolbar.txtYen": "¥ Yen",
"SSE.Views.Toolbar.mniImageFromStorage": "Image from Storage",
"SSE.Views.Toolbar.capBtnPrintArea": "Print Area",
"SSE.Views.Toolbar.textSetPrintArea": "Set Print Area",
"SSE.Views.Toolbar.textClearPrintArea": "Clear Print Area",
"SSE.Views.Toolbar.textAddPrintArea": "Add to Print Area",
"SSE.Views.Toolbar.tipPrintArea": "Print Area",
"SSE.Views.Top10FilterDialog.cancelButtonText": "Cancel",
"SSE.Views.Top10FilterDialog.okButtonText": "OK",
"SSE.Views.Top10FilterDialog.textType": "Show",