[SSE] By bug 59219 (make PDF settings)

This commit is contained in:
JuliaSvinareva 2022-11-21 22:57:12 +03:00
parent 63f2801a99
commit ed909d24b9
5 changed files with 67 additions and 7 deletions

View file

@ -274,7 +274,7 @@ define([
menu.cmbSheet.setValue(item.get('value')); menu.cmbSheet.setValue(item.get('value'));
this.comboSheetsChange(menu, menu.cmbSheet, item.toJSON()); this.comboSheetsChange(menu, menu.cmbSheet, item.toJSON());
} }
//menu.cmbSheet.setDisabled(printtype !== Asc.c_oAscPrintType.EntireWorkbook); menu.cmbSheet.setDisabled(printtype === Asc.c_oAscPrintType.Selection || printtype === Asc.c_oAscPrintType.ActiveSheets && menu.cmbSheet.store.length < 2);
menu.chIgnorePrintArea.setDisabled(printtype == Asc.c_oAscPrintType.Selection); menu.chIgnorePrintArea.setDisabled(printtype == Asc.c_oAscPrintType.Selection);
if (!isDlg) { if (!isDlg) {
@ -406,6 +406,9 @@ define([
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()); this.adjPrintParams.asc_setIgnorePrintArea(this.printSettingsDlg.getIgnorePrintArea());
this.adjPrintParams.asc_setActiveSheetsArray(SSE.getController('Statusbar').getSelectTabs());
this.adjPrintParams.asc_setStartPageIndex(this.printSettingsDlg.getPagesFrom() - 1);
this.adjPrintParams.asc_setEndPageIndex(this.printSettingsDlg.getPagesTo() - 1);
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

@ -2,8 +2,13 @@
<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>
<div id="printadv-dlg-chb-ignore" style="margin-top: 5px;"></div> <div id="printadv-dlg-chb-ignore" style="margin-top: 5px;"></div>
<div id="printadv-dlg-pages">
<label><%= scope.textPages %></label>
<div id="printadv-dlg-spin-pages-from"></div>
<label><%= scope.textTo %></label>
<div id="printadv-dlg-spin-pages-to"></div>
</div>
</div> </div>
<div class="padding-small"></div>
<div class="padding-large inner-content" > <div class="padding-large inner-content" >
<div id="printadv-dlg-combo-sheets" class="input-group-nr"></div> <div id="printadv-dlg-combo-sheets" class="input-group-nr"></div>
</div> </div>

View file

@ -62,7 +62,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: 54px; line-height: 42px;" class="div-category">' + ((this.type == 'print') ? this.textPrintRange : this.textRange)+ '</div>', '<div style="height: 84px; 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>',
@ -96,7 +96,7 @@ define([ 'text!spreadsheeteditor/main/app/template/PrintSettings.template',
takeFocusOnClose: true, takeFocusOnClose: true,
cls : 'input-group-nr', cls : 'input-group-nr',
data : [ data : [
{ value: Asc.c_oAscPrintType.ActiveSheets, displayValue: this.textCurrentSheet }, { value: Asc.c_oAscPrintType.ActiveSheets, displayValue: this.textActiveSheets },
{ value: Asc.c_oAscPrintType.EntireWorkbook, displayValue: this.textAllSheets }, { value: Asc.c_oAscPrintType.EntireWorkbook, displayValue: this.textAllSheets },
{ value: Asc.c_oAscPrintType.Selection, displayValue: this.textSelection } { value: Asc.c_oAscPrintType.Selection, displayValue: this.textSelection }
] ]
@ -108,6 +108,32 @@ define([ 'text!spreadsheeteditor/main/app/template/PrintSettings.template',
labelText: this.textIgnore labelText: this.textIgnore
}); });
this.spnPagesFrom = new Common.UI.MetricSpinner({
el: $('#printadv-dlg-spin-pages-from'),
step: 1,
width: 60,
defaultUnit : '',
value: '1',
maxValue: 1000,
minValue: 1,
dataHint: '2',
dataHintDirection: 'bottom',
dataHintOffset: 'big'
});
this.spnPagesTo = new Common.UI.MetricSpinner({
el: $('#printadv-dlg-spin-pages-to'),
step: 1,
width: 60,
defaultUnit : '',
value: '1',
maxValue: 1000,
minValue: 1,
dataHint: '2',
dataHintDirection: 'bottom',
dataHintOffset: 'big'
});
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;',
@ -326,6 +352,14 @@ define([ 'text!spreadsheeteditor/main/app/template/PrintSettings.template',
return (this.chIgnorePrintArea.getValue()=='checked'); return (this.chIgnorePrintArea.getValue()=='checked');
}, },
getPagesFrom: function () {
return this.spnPagesFrom.getValue();
},
getPagesTo: function () {
return this.spnPagesTo.getValue();
},
comboRangeChange: function(combo, record) { comboRangeChange: function(combo, record) {
this.fireEvent('changerange', this); this.fireEvent('changerange', this);
}, },
@ -355,13 +389,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(314); this.setHeight(344);
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(585); this.setHeight(615);
btn.setCaption(this.textHideDetails); btn.setCaption(this.textHideDetails);
Common.localStorage.setItem("sse-hide-print-settings", 0); Common.localStorage.setItem("sse-hide-print-settings", 0);
} }
@ -384,6 +418,7 @@ define([ 'text!spreadsheeteditor/main/app/template/PrintSettings.template',
textPrintRange: 'Print Range', textPrintRange: 'Print Range',
textLayout: 'Layout', textLayout: 'Layout',
textCurrentSheet: 'Current Sheet', textCurrentSheet: 'Current Sheet',
textActiveSheets: 'Active Sheets',
textAllSheets: 'All Sheets', textAllSheets: 'All Sheets',
textSelection: 'Selection', textSelection: 'Selection',
textActualSize: 'Actual Size', textActualSize: 'Actual Size',
@ -406,7 +441,9 @@ define([ 'text!spreadsheeteditor/main/app/template/PrintSettings.template',
strPrintTitles: 'Print Titles', strPrintTitles: 'Print Titles',
textRepeatTop: 'Repeat rows at top', textRepeatTop: 'Repeat rows at top',
textRepeatLeft: 'Repeat columns at left', textRepeatLeft: 'Repeat columns at left',
textRepeat: 'Repeat...' textRepeat: 'Repeat...',
textPages: 'Pages:',
textTo: 'to'
}, SSE.Views.PrintSettings || {})); }, SSE.Views.PrintSettings || {}));
}); });

View file

@ -3018,6 +3018,7 @@
"SSE.Views.PrintSettings.textActualSize": "Actual Size", "SSE.Views.PrintSettings.textActualSize": "Actual Size",
"SSE.Views.PrintSettings.textAllSheets": "All Sheets", "SSE.Views.PrintSettings.textAllSheets": "All Sheets",
"SSE.Views.PrintSettings.textCurrentSheet": "Current Sheet", "SSE.Views.PrintSettings.textCurrentSheet": "Current Sheet",
"SSE.Views.PrintSettings.textActiveSheets": "Active Sheets",
"SSE.Views.PrintSettings.textCustom": "Custom", "SSE.Views.PrintSettings.textCustom": "Custom",
"SSE.Views.PrintSettings.textCustomOptions": "Custom Options", "SSE.Views.PrintSettings.textCustomOptions": "Custom Options",
"SSE.Views.PrintSettings.textFitCols": "Fit All Columns on One Page", "SSE.Views.PrintSettings.textFitCols": "Fit All Columns on One Page",
@ -3043,6 +3044,8 @@
"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.textPages": "Pages:",
"SSE.Views.PrintSettings.textTo": "to",
"SSE.Views.PrintTitlesDialog.textFirstCol": "First column", "SSE.Views.PrintTitlesDialog.textFirstCol": "First column",
"SSE.Views.PrintTitlesDialog.textFirstRow": "First row", "SSE.Views.PrintTitlesDialog.textFirstRow": "First row",
"SSE.Views.PrintTitlesDialog.textFrozenCols": "Frozen columns", "SSE.Views.PrintTitlesDialog.textFrozenCols": "Frozen columns",

View file

@ -85,3 +85,15 @@
border: @scaled-one-px-value-ie solid @border-regular-control-ie; border: @scaled-one-px-value-ie solid @border-regular-control-ie;
border: @scaled-one-px-value solid @border-regular-control; border: @scaled-one-px-value solid @border-regular-control;
} }
#printadv-dlg-pages {
margin-top: 16px;
label, #printadv-dlg-spin-pages-from {
margin-right: 6px;
}
label, div {
display: inline-block;
}
}