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

This commit is contained in:
Julia Radzhabova 2017-04-19 14:22:31 +03:00
parent e1d553049b
commit ecae264fd3
9 changed files with 13 additions and 31 deletions

View file

@ -511,15 +511,7 @@ define([
_setReviewStatus(false);
} else {
me.api.asc_HaveRevisionsChanges() && me.view.markChanges(true);
var value = Common.localStorage.getItem("de-track-changes");
if ( value!== null && parseInt(value) == 1) {
_setReviewStatus(true);
} else {
_setReviewStatus(false);
}
_setReviewStatus(Common.localStorage.getBool("de-track-changes"));
}
if ( Common.localStorage.getBool("de-settings-spellcheck") )

View file

@ -792,8 +792,7 @@ define([
me.updateWindowTitle(true);
value = Common.localStorage.getItem("de-settings-inputmode");
me.api.SetTextBoxInputMode(value!==null && parseInt(value) == 1);
me.api.SetTextBoxInputMode(Common.localStorage.getBool("de-settings-inputmode"));
/** coauthoring begin **/
if (me.appOptions.isEdit && !me.appOptions.isOffline && me.appOptions.canCoAuthoring) {
@ -1124,8 +1123,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('de-hidden-rulers');
me.api.asc_SetViewRulers(value===null || parseInt(value) === 0);
me.api.asc_SetViewRulers(!Common.localStorage.getBool('de-hidden-rulers'));
me.api.asc_registerCallback('asc_onDocumentModifiedChanged', _.bind(me.onDocumentModifiedChanged, me));
me.api.asc_registerCallback('asc_onDocumentCanSaveChanged', _.bind(me.onDocumentCanSaveChanged, me));

View file

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

View file

@ -134,7 +134,7 @@ define([
_process_changestip();
} else
if ( me.api.asc_IsTrackRevisions() ) {
if ( Common.localStorage.getItem("de-track-changes") ) {
if ( Common.localStorage.getBool("de-track-changes") ) {
// show tooltip "track changes in this document"
_process_changestip();
} else {
@ -253,11 +253,11 @@ define([
Common.localStorage.setItem(storage, 1);
tip.hide();
me.btnTurnReview.updateHint(this.tipReview);
me.btnTurnReview.updateHint(me.tipReview);
},
'closeclick': function() {
tip.hide();
me.btnTurnReview.updateHint(this.tipReview);
me.btnTurnReview.updateHint(me.tipReview);
}
});

View file

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

View file

@ -1693,8 +1693,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("de-hide-copywarning");
if (!(value && parseInt(value) == 1)) {
if (!Common.localStorage.getBool("de-hide-copywarning")) {
(new Common.Views.CopyWarningDialog({
handler: function(dontshow) {
if (dontshow) Common.localStorage.setItem("de-hide-copywarning", 1);

View file

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

View file

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

View file

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