[PE] Common.localStorage.getItem -> Common.localStorage.getBool.
This commit is contained in:
parent
5e10e45349
commit
b6ac8cffff
|
@ -563,8 +563,7 @@ define([
|
||||||
appHeader.setDocumentCaption( me.api.asc_getDocumentName() );
|
appHeader.setDocumentCaption( me.api.asc_getDocumentName() );
|
||||||
me.updateWindowTitle(true);
|
me.updateWindowTitle(true);
|
||||||
|
|
||||||
value = Common.localStorage.getItem("pe-settings-inputmode");
|
me.api.SetTextBoxInputMode(Common.localStorage.getBool("pe-settings-inputmode"));
|
||||||
me.api.SetTextBoxInputMode(value!==null && parseInt(value) == 1);
|
|
||||||
|
|
||||||
/** coauthoring begin **/
|
/** coauthoring begin **/
|
||||||
if (me.appOptions.isEdit && !me.appOptions.isOffline && me.appOptions.canCoAuthoring) {
|
if (me.appOptions.isEdit && !me.appOptions.isOffline && me.appOptions.canCoAuthoring) {
|
||||||
|
@ -775,16 +774,16 @@ define([
|
||||||
applyModeCommonElements: function() {
|
applyModeCommonElements: function() {
|
||||||
window.editor_elements_prepared = true;
|
window.editor_elements_prepared = true;
|
||||||
|
|
||||||
var value = Common.localStorage.getItem("pe-hidden-title");
|
// var value = Common.localStorage.getItem("pe-hidden-title");
|
||||||
value = this.appOptions.isEdit && (value!==null && parseInt(value) == 1);
|
// value = this.appOptions.isEdit && (value!==null && parseInt(value) == 1);
|
||||||
|
|
||||||
var app = this.getApplication(),
|
var app = this.getApplication(),
|
||||||
viewport = app.getController('Viewport').getView('Viewport'),
|
viewport = app.getController('Viewport').getView('Viewport'),
|
||||||
statusbarView = app.getController('Statusbar').getView('Statusbar'),
|
statusbarView = app.getController('Statusbar').getView('Statusbar'),
|
||||||
documentHolder = app.getController('DocumentHolder').getView('DocumentHolder');
|
documentHolder = app.getController('DocumentHolder').getView('DocumentHolder');
|
||||||
|
|
||||||
appHeader.setHeaderCaption(this.appOptions.isEdit ? 'Presentation Editor' : 'Presentation Viewer');
|
// appHeader.setHeaderCaption(this.appOptions.isEdit ? 'Presentation Editor' : 'Presentation Viewer');
|
||||||
appHeader.setVisible(!this.appOptions.nativeApp && !value && !this.appOptions.isDesktopApp);
|
// appHeader.setVisible(!this.appOptions.nativeApp && !value && !this.appOptions.isDesktopApp);
|
||||||
|
|
||||||
viewport && viewport.setMode(this.appOptions, true);
|
viewport && viewport.setMode(this.appOptions, true);
|
||||||
statusbarView && statusbarView.setMode(this.appOptions);
|
statusbarView && statusbarView.setMode(this.appOptions);
|
||||||
|
@ -859,8 +858,7 @@ define([
|
||||||
Common.Utils.Metric.setCurrentMetric(value);
|
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));
|
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(!Common.localStorage.getBool('pe-hidden-rulers'));
|
||||||
if (me.api.asc_SetViewRulers) me.api.asc_SetViewRulers(value===null || parseInt(value) === 0);
|
|
||||||
|
|
||||||
me.api.asc_registerCallback('asc_onChangeObjectLock', _.bind(me._onChangeObjectLock, me));
|
me.api.asc_registerCallback('asc_onChangeObjectLock', _.bind(me._onChangeObjectLock, me));
|
||||||
me.api.asc_registerCallback('asc_onDocumentModifiedChanged', _.bind(me.onDocumentModifiedChanged, me));
|
me.api.asc_registerCallback('asc_onDocumentModifiedChanged', _.bind(me.onDocumentModifiedChanged, me));
|
||||||
|
|
|
@ -249,10 +249,7 @@ define([
|
||||||
this.rightmenu.shapeSettings.createDelayedElements();
|
this.rightmenu.shapeSettings.createDelayedElements();
|
||||||
var selectedElements = this.api.getSelectedElements();
|
var selectedElements = this.api.getSelectedElements();
|
||||||
if (selectedElements.length>0) {
|
if (selectedElements.length>0) {
|
||||||
var open = Common.localStorage.getItem("pe-hide-right-settings");
|
this.onFocusObject(selectedElements, !Common.localStorage.getBool("pe-hide-right-settings"));
|
||||||
open = (open===null || parseInt(open) == 0);
|
|
||||||
|
|
||||||
this.onFocusObject(selectedElements, open);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
@ -923,8 +923,7 @@ define([
|
||||||
if (me.api) {
|
if (me.api) {
|
||||||
var res = (copy) ? me.api.Copy() : me.api.Paste();
|
var res = (copy) ? me.api.Copy() : me.api.Paste();
|
||||||
if (!res) {
|
if (!res) {
|
||||||
var value = Common.localStorage.getItem("pe-hide-copywarning");
|
if (!Common.localStorage.getBool("pe-hide-copywarning")) {
|
||||||
if (!(value && parseInt(value) == 1)) {
|
|
||||||
(new Common.Views.CopyWarningDialog({
|
(new Common.Views.CopyWarningDialog({
|
||||||
handler: function(dontshow) {
|
handler: function(dontshow) {
|
||||||
if (dontshow) Common.localStorage.setItem("pe-hide-copywarning", 1);
|
if (dontshow) Common.localStorage.setItem("pe-hide-copywarning", 1);
|
||||||
|
|
|
@ -1481,8 +1481,7 @@ define([
|
||||||
if (me.api) {
|
if (me.api) {
|
||||||
var res = (item.value == 'cut') ? me.api.Cut() : ((item.value == 'copy') ? me.api.Copy() : me.api.Paste());
|
var res = (item.value == 'cut') ? me.api.Cut() : ((item.value == 'copy') ? me.api.Copy() : me.api.Paste());
|
||||||
if (!res) {
|
if (!res) {
|
||||||
var value = Common.localStorage.getItem("pe-hide-copywarning");
|
if (!Common.localStorage.getBool("pe-hide-copywarning")) {
|
||||||
if (!(value && parseInt(value) == 1)) {
|
|
||||||
(new Common.Views.CopyWarningDialog({
|
(new Common.Views.CopyWarningDialog({
|
||||||
handler: function(dontshow) {
|
handler: function(dontshow) {
|
||||||
if (dontshow) Common.localStorage.setItem("pe-hide-copywarning", 1);
|
if (dontshow) Common.localStorage.setItem("pe-hide-copywarning", 1);
|
||||||
|
|
|
@ -276,10 +276,9 @@ define([
|
||||||
},
|
},
|
||||||
|
|
||||||
updateSettings: function() {
|
updateSettings: function() {
|
||||||
var value = Common.localStorage.getItem("pe-settings-inputmode");
|
this.chInputMode.setValue(Common.localStorage.getBool("pe-settings-inputmode"));
|
||||||
this.chInputMode.setValue(value!==null && parseInt(value) == 1);
|
|
||||||
|
|
||||||
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);
|
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});
|
var item = this.cmbZoom.store.findWhere({value: value});
|
||||||
this.cmbZoom.setValue(item ? parseInt(item.get('value')) : (value>0 ? value+'%' : 100));
|
this.cmbZoom.setValue(item ? parseInt(item.get('value')) : (value>0 ? value+'%' : 100));
|
||||||
|
|
|
@ -148,8 +148,7 @@ define([
|
||||||
|
|
||||||
this.trigger('render:before', this);
|
this.trigger('render:before', this);
|
||||||
|
|
||||||
var open = Common.localStorage.getItem("pe-hide-right-settings");
|
var open = !Common.localStorage.getBool("pe-hide-right-settings");
|
||||||
open = (open===null || parseInt(open) == 0);
|
|
||||||
el.css('width', ((open) ? MENU_SCALE_PART : SCALE_MIN) + 'px');
|
el.css('width', ((open) ? MENU_SCALE_PART : SCALE_MIN) + 'px');
|
||||||
el.show();
|
el.show();
|
||||||
|
|
||||||
|
|
|
@ -444,8 +444,7 @@ define([
|
||||||
|
|
||||||
me.updateWindowTitle(true);
|
me.updateWindowTitle(true);
|
||||||
|
|
||||||
value = Common.localStorage.getItem("pe-settings-inputmode");
|
me.api.SetTextBoxInputMode(Common.localStorage.getBool("pe-settings-inputmode"));
|
||||||
me.api.SetTextBoxInputMode(value!==null && parseInt(value) == 1);
|
|
||||||
|
|
||||||
/** coauthoring begin **/
|
/** coauthoring begin **/
|
||||||
if (me.appOptions.isEdit && me.appOptions.canLicense && !me.appOptions.isOffline && me.appOptions.canCoAuthoring) {
|
if (me.appOptions.isEdit && me.appOptions.canLicense && !me.appOptions.isOffline && me.appOptions.canCoAuthoring) {
|
||||||
|
|
Loading…
Reference in a new issue