Load initial zoom value from editor config.

This commit is contained in:
Julia Radzhabova 2016-09-13 11:28:21 +03:00
parent 6cf46f4442
commit 35d21fdb65
9 changed files with 30 additions and 13 deletions

View file

@ -105,7 +105,8 @@
text: 'Go to London'
},
chat: false,
comments: false
comments: false,
zoom: 100
},
plugins: {
url: '../../../../sdkjs-plugins/',

View file

@ -748,7 +748,8 @@ define([
/** coauthoring end **/
value = Common.localStorage.getItem("de-settings-zoom");
this.api.zoom((value!==null) ? parseInt(value) : 100);
var zf = (value!==null) ? parseInt(value) : (this.appOptions.customization && this.appOptions.customization.zoom ? parseInt(this.appOptions.customization.zoom) : 100);
(zf == -1) ? this.api.zoomFitToPage() : ((zf == -2) ? this.api.zoomFitToWidth() : this.api.zoom(zf>0 ? zf : 100));
value = Common.localStorage.getItem("de-show-hiddenchars");
me.api.put_ShowParaMarks((value!==null) ? eval(value) : false);

View file

@ -210,7 +210,10 @@ define([
style : 'width: 160px;',
editable : false,
cls : 'input-group-nr',
menuStyle : 'max-height: 210px;',
data : [
{ value: -1, displayValue: this.txtFitPage },
{ value: -2, displayValue: this.txtFitWidth },
{ value: 50, displayValue: "50%" },
{ value: 60, displayValue: "60%" },
{ value: 70, displayValue: "70%" },
@ -321,8 +324,9 @@ define([
this.chInputMode.setValue(value!==null && parseInt(value) == 1);
value = Common.localStorage.getItem("de-settings-zoom");
var item = this.cmbZoom.store.findWhere({value: parseInt(value)});
this.cmbZoom.setValue(item ? parseInt(item.get('value')) : 100);
value = (value!==null) ? parseInt(value) : (this.mode.customization && this.mode.customization.zoom ? parseInt(this.mode.customization.zoom) : 100);
var item = this.cmbZoom.store.findWhere({value: value});
this.cmbZoom.setValue(item ? parseInt(item.get('value')) : (value>0 ? value+'%' : 100));
/** coauthoring begin **/
value = Common.localStorage.getItem("de-settings-livecomment");
@ -432,7 +436,9 @@ define([
strStrict: 'Strict',
textAutoRecover: 'Autorecover',
strAutoRecover: 'Turn on autorecover',
txtInch: 'Inch'
txtInch: 'Inch',
txtFitPage: 'Fit Page',
txtFitWidth: 'Fit Width'
}, DE.Views.FileMenuPanels.Settings || {}));
DE.Views.FileMenuPanels.RecentFiles = Common.UI.BaseView.extend({

View file

@ -930,6 +930,8 @@
"DE.Views.FileMenuPanels.Settings.txtPt": "Point",
"DE.Views.FileMenuPanels.Settings.txtSpellCheck": "Spell Checking",
"DE.Views.FileMenuPanels.Settings.txtWin": "as Windows",
"DE.Views.FileMenuPanels.Settings.txtFitPage": "Fit Page",
"DE.Views.FileMenuPanels.Settings.txtFitWidth": "Fit Width",
"DE.Views.HeaderFooterSettings.textBottomCenter": "Bottom Center",
"DE.Views.HeaderFooterSettings.textBottomLeft": "Bottom Left",
"DE.Views.HeaderFooterSettings.textBottomRight": "Bottom Right",

View file

@ -558,8 +558,8 @@ define([
me.onLongActionEnd(Asc.c_oAscAsyncActionType['BlockInteraction'], LoadingDocument);
value = Common.localStorage.getItem("pe-settings-zoom");
var zf = (value!==null) ? parseInt(value) : -1;
(zf == -1) ? this.api.zoomFitToPage() : this.api.zoom(zf);
var zf = (value!==null) ? parseInt(value) : (this.appOptions.customization && this.appOptions.customization.zoom ? parseInt(this.appOptions.customization.zoom) : -1);
(zf == -1) ? this.api.zoomFitToPage() : ((zf == -2) ? this.api.zoomFitToWidth() : this.api.zoom(zf>0 ? zf : 100));
function checkWarns() {
if (!window['AscDesktopEditor']) {

View file

@ -164,8 +164,10 @@ define([
style : 'width: 160px;',
editable : false,
cls : 'input-group-nr',
menuStyle : 'max-height: 210px;',
data : [
{ value: -1, displayValue: this.txtFitSlide },
{ value: -2, displayValue: this.txtFitWidth },
{ value: 50, displayValue: "50%" },
{ value: 60, displayValue: "60%" },
{ value: 70, displayValue: "70%" },
@ -267,9 +269,9 @@ define([
this.chInputMode.setValue(value!==null && parseInt(value) == 1);
value = Common.localStorage.getItem("pe-settings-zoom");
value = (value!==null) ? parseInt(value) : -1;
value = (value!==null) ? parseInt(value) : (this.mode.customization && this.mode.customization.zoom ? parseInt(this.mode.customization.zoom) : -1);
var item = this.cmbZoom.store.findWhere({value: value});
this.cmbZoom.setValue(item ? parseInt(item.get('value')) : 100);
this.cmbZoom.setValue(item ? parseInt(item.get('value')) : (value>0 ? value+'%' : 100));
/** coauthoring begin **/
value = Common.localStorage.getItem("pe-settings-coauthmode");
@ -337,7 +339,8 @@ define([
strStrict: 'Strict',
textAutoRecover: 'Autorecover',
strAutoRecover: 'Turn on autorecover',
txtInch: 'Inch'
txtInch: 'Inch',
txtFitWidth: 'Fit Width'
}, PE.Views.FileMenuPanels.Settings || {}));
PE.Views.FileMenuPanels.RecentFiles = Common.UI.BaseView.extend({

View file

@ -382,6 +382,7 @@
"PE.Views.FileMenuPanels.Settings.txtAll": "View All",
"PE.Views.FileMenuPanels.Settings.txtCm": "Centimeter",
"PE.Views.FileMenuPanels.Settings.txtFitSlide": "Fit Slide",
"PE.Views.FileMenuPanels.Settings.txtFitWidth": "Fit Width",
"PE.Views.FileMenuPanels.Settings.txtInch": "Inch",
"PE.Views.FileMenuPanels.Settings.txtInput": "Alternate Input",
"PE.Views.FileMenuPanels.Settings.txtLast": "View Last",

View file

@ -556,7 +556,8 @@ define([
me.onLongActionEnd(Asc.c_oAscAsyncActionType['BlockInteraction'], LoadingDocument);
value = (this.appOptions.isEditMailMerge || this.appOptions.isEditDiagram) ? 100 : Common.localStorage.getItem("sse-settings-zoom");
this.api.asc_setZoom(!value?1:parseInt(value)/100);
var zf = (value!==null) ? parseInt(value)/100 : (this.appOptions.customization && this.appOptions.customization.zoom ? parseInt(this.appOptions.customization.zoom)/100 : 1);
this.api.asc_setZoom(zf>0 ? zf : 1);
/** coauthoring begin **/
value = Common.localStorage.getItem("sse-settings-livecomment");

View file

@ -523,6 +523,7 @@ define([
style : 'width: 160px;',
editable : false,
cls : 'input-group-nr',
menuStyle : 'max-height: 210px;',
data : [
{ value: 50, displayValue: "50%" },
{ value: 60, displayValue: "60%" },
@ -660,8 +661,9 @@ define([
updateSettings: function() {
var value = Common.localStorage.getItem("sse-settings-zoom");
var item = this.cmbZoom.store.findWhere({value: parseInt(value)});
this.cmbZoom.setValue(item ? parseInt(item.get('value')) : 100);
value = (value!==null) ? parseInt(value) : (this.mode.customization && this.mode.customization.zoom ? parseInt(this.mode.customization.zoom) : 100);
var item = this.cmbZoom.store.findWhere({value: value});
this.cmbZoom.setValue(item ? parseInt(item.get('value')) : (value>0 ? value+'%' : 100));
/** coauthoring begin **/
value = Common.localStorage.getItem("sse-settings-livecomment");