[SSE] Add print option "Ignore print area"

This commit is contained in:
Julia Radzhabova 2019-03-19 17:33:09 +03:00
parent 55dc6ae0cd
commit 69f542f555
5 changed files with 28 additions and 7 deletions

View file

@ -163,6 +163,7 @@ define([
fillPrintOptions: function(props) { fillPrintOptions: function(props) {
this.printSettingsDlg.setRange(props.asc_getPrintType()); this.printSettingsDlg.setRange(props.asc_getPrintType());
this.printSettingsDlg.setIgnorePrintArea(!!props.asc_getIgnorePrintArea());
this.onChangeRange(); this.onChangeRange();
}, },
@ -175,6 +176,7 @@ define([
this.comboSheetsChange(this.printSettingsDlg, this.printSettingsDlg.cmbSheet, item.toJSON()); this.comboSheetsChange(this.printSettingsDlg, this.printSettingsDlg.cmbSheet, item.toJSON());
} }
this.printSettingsDlg.cmbSheet.setDisabled(printtype !== Asc.c_oAscPrintType.EntireWorkbook); this.printSettingsDlg.cmbSheet.setDisabled(printtype !== Asc.c_oAscPrintType.EntireWorkbook);
this.printSettingsDlg.chIgnorePrintArea.setDisabled(printtype == Asc.c_oAscPrintType.Selection);
}, },
getPageOptions: function(panel) { getPageOptions: function(panel) {
@ -261,6 +263,7 @@ define([
var printtype = this.printSettingsDlg.getRange(); var printtype = this.printSettingsDlg.getRange();
this.adjPrintParams.asc_setPrintType(printtype); this.adjPrintParams.asc_setPrintType(printtype);
this.adjPrintParams.asc_setPageOptionsMap(this._changedProps); this.adjPrintParams.asc_setPageOptionsMap(this._changedProps);
this.adjPrintParams.asc_setIgnorePrintArea(this.printSettingsDlg.getIgnorePrintArea());
Common.localStorage.setItem("sse-print-settings-range", printtype); Common.localStorage.setItem("sse-print-settings-range", printtype);
if ( this.printSettingsDlg.type=='print' ) if ( this.printSettingsDlg.type=='print' )

View file

@ -1,7 +1,9 @@
<div class="settings-panel active"> <div class="settings-panel active">
<div class="padding-large inner-content" > <div class="padding-large inner-content" >
<div id="printadv-dlg-combo-range" class="input-group-nr" /> </div> <div id="printadv-dlg-combo-range" class="input-group-nr" />
<div class="padding-large"/> <div id="printadv-dlg-chb-ignore" style="margin-top: 5px;"/>
</div>
<div class="padding-small"/>
<div class="padding-large inner-content" > <div class="padding-large inner-content" >
<div id="printadv-dlg-combo-sheets" class="input-group-nr" /> <div id="printadv-dlg-combo-sheets" class="input-group-nr" />
</div> </div>

View file

@ -51,7 +51,7 @@ define([ 'text!spreadsheeteditor/main/app/template/PrintSettings.template',
options: { options: {
alias: 'PrintSettings', alias: 'PrintSettings',
contentWidth: 280, contentWidth: 280,
height: 471 height: 475
}, },
initialize : function(options) { initialize : function(options) {
@ -61,7 +61,7 @@ define([ 'text!spreadsheeteditor/main/app/template/PrintSettings.template',
template: [ template: [
'<div class="box" style="height:' + (this.options.height-85) + 'px;">', '<div class="box" style="height:' + (this.options.height-85) + 'px;">',
'<div class="menu-panel" style="overflow: hidden;">', '<div class="menu-panel" style="overflow: hidden;">',
'<div style="height: 42px; line-height: 42px;" class="div-category">' + ((this.type == 'print') ? this.textPrintRange : this.textRange)+ '</div>', '<div style="height: 54px; line-height: 42px;" class="div-category">' + ((this.type == 'print') ? this.textPrintRange : this.textRange)+ '</div>',
'<div style="height: 52px; line-height: 66px;" class="div-category">' + this.textSettings + '</div>', '<div style="height: 52px; line-height: 66px;" class="div-category">' + this.textSettings + '</div>',
'<div style="height: 38px; line-height: 38px;" class="div-category">' + this.textPageSize + '</div>', '<div style="height: 38px; line-height: 38px;" class="div-category">' + this.textPageSize + '</div>',
'<div style="height: 38px; line-height: 38px;" class="div-category">' + this.textPageOrientation + '</div>', '<div style="height: 38px; line-height: 38px;" class="div-category">' + this.textPageOrientation + '</div>',
@ -100,6 +100,11 @@ define([ 'text!spreadsheeteditor/main/app/template/PrintSettings.template',
}); });
this.cmbRange.on('selected', _.bind(this.comboRangeChange, this)); this.cmbRange.on('selected', _.bind(this.comboRangeChange, this));
this.chIgnorePrintArea = new Common.UI.CheckBox({
el: $('#printadv-dlg-chb-ignore'),
labelText: this.textIgnore
});
this.cmbSheet = new Common.UI.ComboBox({ this.cmbSheet = new Common.UI.ComboBox({
el : $('#printadv-dlg-combo-sheets'), el : $('#printadv-dlg-combo-sheets'),
style : 'width: 242px;', style : 'width: 242px;',
@ -234,6 +239,14 @@ define([ 'text!spreadsheeteditor/main/app/template/PrintSettings.template',
return this.cmbRange.getValue(); return this.cmbRange.getValue();
}, },
setIgnorePrintArea: function(value) {
this.chIgnorePrintArea.setValue(value);
},
getIgnorePrintArea: function() {
return (this.chIgnorePrintArea.getValue()=='checked');
},
comboRangeChange: function(combo, record) { comboRangeChange: function(combo, record) {
this.fireEvent('changerange', this); this.fireEvent('changerange', this);
}, },
@ -263,13 +276,13 @@ define([ 'text!spreadsheeteditor/main/app/template/PrintSettings.template',
if (!this.extended) { if (!this.extended) {
this.extended = true; this.extended = true;
this.panelDetails.css({'display': 'none'}); this.panelDetails.css({'display': 'none'});
this.setHeight(303); this.setHeight(314);
btn.setCaption(this.textShowDetails); btn.setCaption(this.textShowDetails);
Common.localStorage.setItem("sse-hide-print-settings", 1); Common.localStorage.setItem("sse-hide-print-settings", 1);
} else { } else {
this.extended = false; this.extended = false;
this.panelDetails.css({'display': 'block'}); this.panelDetails.css({'display': 'block'});
this.setHeight(471); this.setHeight(475);
btn.setCaption(this.textHideDetails); btn.setCaption(this.textHideDetails);
Common.localStorage.setItem("sse-hide-print-settings", 0); Common.localStorage.setItem("sse-hide-print-settings", 0);
} }
@ -308,7 +321,8 @@ define([ 'text!spreadsheeteditor/main/app/template/PrintSettings.template',
textShowHeadings: 'Show Rows and Columns Headings', textShowHeadings: 'Show Rows and Columns Headings',
strShow: 'Show', strShow: 'Show',
btnDownload: 'Save & Download', btnDownload: 'Save & Download',
textRange: 'Range' textRange: 'Range',
textIgnore: 'Ignore Print Area'
}, SSE.Views.PrintSettings || {})); }, SSE.Views.PrintSettings || {}));
}); });

View file

@ -1818,6 +1818,7 @@
"SSE.Views.PrintSettings.textShowHeadings": "Show Rows and Columns Headings", "SSE.Views.PrintSettings.textShowHeadings": "Show Rows and Columns Headings",
"SSE.Views.PrintSettings.textTitle": "Print Settings", "SSE.Views.PrintSettings.textTitle": "Print Settings",
"SSE.Views.PrintSettings.textTitlePDF": "PDF Settings", "SSE.Views.PrintSettings.textTitlePDF": "PDF Settings",
"SSE.Views.PrintSettings.textIgnore": "Ignore Print Area",
"SSE.Views.RightMenu.txtCellSettings": "Cell settings", "SSE.Views.RightMenu.txtCellSettings": "Cell settings",
"SSE.Views.RightMenu.txtChartSettings": "Chart settings", "SSE.Views.RightMenu.txtChartSettings": "Chart settings",
"SSE.Views.RightMenu.txtImageSettings": "Image settings", "SSE.Views.RightMenu.txtImageSettings": "Image settings",

View file

@ -1818,6 +1818,7 @@
"SSE.Views.PrintSettings.textShowHeadings": "Показать заголовки строк и столбцов", "SSE.Views.PrintSettings.textShowHeadings": "Показать заголовки строк и столбцов",
"SSE.Views.PrintSettings.textTitle": "Параметры печати", "SSE.Views.PrintSettings.textTitle": "Параметры печати",
"SSE.Views.PrintSettings.textTitlePDF": "Параметры PDF", "SSE.Views.PrintSettings.textTitlePDF": "Параметры PDF",
"SSE.Views.PrintSettings.textIgnore": "Игнорировать область печати",
"SSE.Views.RightMenu.txtCellSettings": "Параметры ячейки", "SSE.Views.RightMenu.txtCellSettings": "Параметры ячейки",
"SSE.Views.RightMenu.txtChartSettings": "Параметры диаграммы", "SSE.Views.RightMenu.txtChartSettings": "Параметры диаграммы",
"SSE.Views.RightMenu.txtImageSettings": "Параметры изображения", "SSE.Views.RightMenu.txtImageSettings": "Параметры изображения",