[PE] Common.localStorage.getItem -> Common.localStorage.getBool.

This commit is contained in:
Julia Radzhabova 2017-04-21 12:56:11 +03:00
parent 5e10e45349
commit b6ac8cffff
7 changed files with 13 additions and 23 deletions

View file

@ -563,8 +563,7 @@ define([
appHeader.setDocumentCaption( me.api.asc_getDocumentName() );
me.updateWindowTitle(true);
value = Common.localStorage.getItem("pe-settings-inputmode");
me.api.SetTextBoxInputMode(value!==null && parseInt(value) == 1);
me.api.SetTextBoxInputMode(Common.localStorage.getBool("pe-settings-inputmode"));
/** coauthoring begin **/
if (me.appOptions.isEdit && !me.appOptions.isOffline && me.appOptions.canCoAuthoring) {
@ -775,16 +774,16 @@ define([
applyModeCommonElements: function() {
window.editor_elements_prepared = true;
var value = Common.localStorage.getItem("pe-hidden-title");
value = this.appOptions.isEdit && (value!==null && parseInt(value) == 1);
// var value = Common.localStorage.getItem("pe-hidden-title");
// value = this.appOptions.isEdit && (value!==null && parseInt(value) == 1);
var app = this.getApplication(),
viewport = app.getController('Viewport').getView('Viewport'),
statusbarView = app.getController('Statusbar').getView('Statusbar'),
documentHolder = app.getController('DocumentHolder').getView('DocumentHolder');
appHeader.setHeaderCaption(this.appOptions.isEdit ? 'Presentation Editor' : 'Presentation Viewer');
appHeader.setVisible(!this.appOptions.nativeApp && !value && !this.appOptions.isDesktopApp);
// appHeader.setHeaderCaption(this.appOptions.isEdit ? 'Presentation Editor' : 'Presentation Viewer');
// appHeader.setVisible(!this.appOptions.nativeApp && !value && !this.appOptions.isDesktopApp);
viewport && viewport.setMode(this.appOptions, true);
statusbarView && statusbarView.setMode(this.appOptions);
@ -859,8 +858,7 @@ define([
Common.Utils.Metric.setCurrentMetric(value);
me.api.asc_SetDocumentUnits((value==Common.Utils.Metric.c_MetricUnits.inch) ? Asc.c_oAscDocumentUnits.Inch : ((value==Common.Utils.Metric.c_MetricUnits.pt) ? Asc.c_oAscDocumentUnits.Point : Asc.c_oAscDocumentUnits.Millimeter));
value = Common.localStorage.getItem('pe-hidden-rulers');
if (me.api.asc_SetViewRulers) me.api.asc_SetViewRulers(value===null || parseInt(value) === 0);
if (me.api.asc_SetViewRulers) me.api.asc_SetViewRulers(!Common.localStorage.getBool('pe-hidden-rulers'));
me.api.asc_registerCallback('asc_onChangeObjectLock', _.bind(me._onChangeObjectLock, me));
me.api.asc_registerCallback('asc_onDocumentModifiedChanged', _.bind(me.onDocumentModifiedChanged, me));

View file

@ -249,10 +249,7 @@ define([
this.rightmenu.shapeSettings.createDelayedElements();
var selectedElements = this.api.getSelectedElements();
if (selectedElements.length>0) {
var open = Common.localStorage.getItem("pe-hide-right-settings");
open = (open===null || parseInt(open) == 0);
this.onFocusObject(selectedElements, open);
this.onFocusObject(selectedElements, !Common.localStorage.getBool("pe-hide-right-settings"));
}
}
},

View file

@ -923,8 +923,7 @@ define([
if (me.api) {
var res = (copy) ? me.api.Copy() : me.api.Paste();
if (!res) {
var value = Common.localStorage.getItem("pe-hide-copywarning");
if (!(value && parseInt(value) == 1)) {
if (!Common.localStorage.getBool("pe-hide-copywarning")) {
(new Common.Views.CopyWarningDialog({
handler: function(dontshow) {
if (dontshow) Common.localStorage.setItem("pe-hide-copywarning", 1);

View file

@ -1481,8 +1481,7 @@ define([
if (me.api) {
var res = (item.value == 'cut') ? me.api.Cut() : ((item.value == 'copy') ? me.api.Copy() : me.api.Paste());
if (!res) {
var value = Common.localStorage.getItem("pe-hide-copywarning");
if (!(value && parseInt(value) == 1)) {
if (!Common.localStorage.getBool("pe-hide-copywarning")) {
(new Common.Views.CopyWarningDialog({
handler: function(dontshow) {
if (dontshow) Common.localStorage.setItem("pe-hide-copywarning", 1);

View file

@ -276,10 +276,9 @@ define([
},
updateSettings: function() {
var value = Common.localStorage.getItem("pe-settings-inputmode");
this.chInputMode.setValue(value!==null && parseInt(value) == 1);
this.chInputMode.setValue(Common.localStorage.getBool("pe-settings-inputmode"));
value = Common.localStorage.getItem("pe-settings-zoom");
var value = Common.localStorage.getItem("pe-settings-zoom");
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')) : (value>0 ? value+'%' : 100));

View file

@ -148,8 +148,7 @@ define([
this.trigger('render:before', this);
var open = Common.localStorage.getItem("pe-hide-right-settings");
open = (open===null || parseInt(open) == 0);
var open = !Common.localStorage.getBool("pe-hide-right-settings");
el.css('width', ((open) ? MENU_SCALE_PART : SCALE_MIN) + 'px');
el.show();

View file

@ -444,8 +444,7 @@ define([
me.updateWindowTitle(true);
value = Common.localStorage.getItem("pe-settings-inputmode");
me.api.SetTextBoxInputMode(value!==null && parseInt(value) == 1);
me.api.SetTextBoxInputMode(Common.localStorage.getBool("pe-settings-inputmode"));
/** coauthoring begin **/
if (me.appOptions.isEdit && me.appOptions.canLicense && !me.appOptions.isOffline && me.appOptions.canCoAuthoring) {