[PE][SSE] Refactoring
This commit is contained in:
parent
76d599fcdd
commit
e34ca695e3
|
@ -782,24 +782,7 @@ define([
|
||||||
Common.Utils.InternalSettings.set("pe-settings-paste-button", parseInt(value));
|
Common.Utils.InternalSettings.set("pe-settings-paste-button", parseInt(value));
|
||||||
me.api.asc_setVisiblePasteButton(!!parseInt(value));
|
me.api.asc_setVisiblePasteButton(!!parseInt(value));
|
||||||
|
|
||||||
// autocorrection
|
me.loadAutoCorrectSettings();
|
||||||
value = Common.localStorage.getItem("pe-settings-math-correct-add");
|
|
||||||
Common.Utils.InternalSettings.set("pe-settings-math-correct-add", value);
|
|
||||||
var arrAdd = value ? JSON.parse(value) : [];
|
|
||||||
value = Common.localStorage.getItem("pe-settings-math-correct-rem");
|
|
||||||
Common.Utils.InternalSettings.set("pe-settings-math-correct-rem", value);
|
|
||||||
var arrRem = value ? JSON.parse(value) : [];
|
|
||||||
value = Common.localStorage.getBool("pe-settings-math-correct-replace-type", true); // replace on type
|
|
||||||
Common.Utils.InternalSettings.set("pe-settings-math-correct-replace-type", value);
|
|
||||||
me.api.asc_refreshOnStartAutoCorrectMathSymbols(arrRem, arrAdd, value);
|
|
||||||
|
|
||||||
value = Common.localStorage.getItem("pe-settings-rec-functions-add");
|
|
||||||
Common.Utils.InternalSettings.set("pe-settings-rec-functions-add", value);
|
|
||||||
arrAdd = value ? JSON.parse(value) : [];
|
|
||||||
value = Common.localStorage.getItem("pe-settings-rec-functions-rem");
|
|
||||||
Common.Utils.InternalSettings.set("pe-settings-rec-functions-rem", value);
|
|
||||||
arrRem = value ? JSON.parse(value) : [];
|
|
||||||
me.api.asc_refreshOnStartAutoCorrectMathFunctions(arrRem, arrAdd);
|
|
||||||
|
|
||||||
if (me.needToUpdateVersion)
|
if (me.needToUpdateVersion)
|
||||||
Common.NotificationCenter.trigger('api:disconnect');
|
Common.NotificationCenter.trigger('api:disconnect');
|
||||||
|
@ -1955,6 +1938,28 @@ define([
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
loadAutoCorrectSettings: function() {
|
||||||
|
// autocorrection
|
||||||
|
var me = this;
|
||||||
|
var value = Common.localStorage.getItem("pe-settings-math-correct-add");
|
||||||
|
Common.Utils.InternalSettings.set("pe-settings-math-correct-add", value);
|
||||||
|
var arrAdd = value ? JSON.parse(value) : [];
|
||||||
|
value = Common.localStorage.getItem("pe-settings-math-correct-rem");
|
||||||
|
Common.Utils.InternalSettings.set("pe-settings-math-correct-rem", value);
|
||||||
|
var arrRem = value ? JSON.parse(value) : [];
|
||||||
|
value = Common.localStorage.getBool("pe-settings-math-correct-replace-type", true); // replace on type
|
||||||
|
Common.Utils.InternalSettings.set("pe-settings-math-correct-replace-type", value);
|
||||||
|
me.api.asc_refreshOnStartAutoCorrectMathSymbols(arrRem, arrAdd, value);
|
||||||
|
|
||||||
|
value = Common.localStorage.getItem("pe-settings-rec-functions-add");
|
||||||
|
Common.Utils.InternalSettings.set("pe-settings-rec-functions-add", value);
|
||||||
|
arrAdd = value ? JSON.parse(value) : [];
|
||||||
|
value = Common.localStorage.getItem("pe-settings-rec-functions-rem");
|
||||||
|
Common.Utils.InternalSettings.set("pe-settings-rec-functions-rem", value);
|
||||||
|
arrRem = value ? JSON.parse(value) : [];
|
||||||
|
me.api.asc_refreshOnStartAutoCorrectMathFunctions(arrRem, arrAdd);
|
||||||
|
},
|
||||||
|
|
||||||
// Translation
|
// Translation
|
||||||
leavePageText: 'You have unsaved changes in this document. Click \'Stay on this Page\' then \'Save\' to save them. Click \'Leave this Page\' to discard all the unsaved changes.',
|
leavePageText: 'You have unsaved changes in this document. Click \'Stay on this Page\' then \'Save\' to save them. Click \'Leave this Page\' to discard all the unsaved changes.',
|
||||||
criticalErrorTitle: 'Error',
|
criticalErrorTitle: 'Error',
|
||||||
|
|
|
@ -820,24 +820,7 @@ define([
|
||||||
Common.Utils.InternalSettings.set("sse-settings-paste-button", parseInt(value));
|
Common.Utils.InternalSettings.set("sse-settings-paste-button", parseInt(value));
|
||||||
me.api.asc_setVisiblePasteButton(!!parseInt(value));
|
me.api.asc_setVisiblePasteButton(!!parseInt(value));
|
||||||
|
|
||||||
// autocorrection
|
me.loadAutoCorrectSettings();
|
||||||
value = Common.localStorage.getItem("sse-settings-math-correct-add");
|
|
||||||
Common.Utils.InternalSettings.set("sse-settings-math-correct-add", value);
|
|
||||||
var arrAdd = value ? JSON.parse(value) : [];
|
|
||||||
value = Common.localStorage.getItem("sse-settings-math-correct-rem");
|
|
||||||
Common.Utils.InternalSettings.set("sse-settings-math-correct-rem", value);
|
|
||||||
var arrRem = value ? JSON.parse(value) : [];
|
|
||||||
value = Common.localStorage.getBool("sse-settings-math-correct-replace-type", true); // replace on type
|
|
||||||
Common.Utils.InternalSettings.set("sse-settings-math-correct-replace-type", value);
|
|
||||||
me.api.asc_refreshOnStartAutoCorrectMathSymbols(arrRem, arrAdd, value);
|
|
||||||
|
|
||||||
value = Common.localStorage.getItem("sse-settings-rec-functions-add");
|
|
||||||
Common.Utils.InternalSettings.set("sse-settings-rec-functions-add", value);
|
|
||||||
arrAdd = value ? JSON.parse(value) : [];
|
|
||||||
value = Common.localStorage.getItem("sse-settings-rec-functions-rem");
|
|
||||||
Common.Utils.InternalSettings.set("sse-settings-rec-functions-rem", value);
|
|
||||||
arrRem = value ? JSON.parse(value) : [];
|
|
||||||
me.api.asc_refreshOnStartAutoCorrectMathFunctions(arrRem, arrAdd);
|
|
||||||
|
|
||||||
if (me.needToUpdateVersion) {
|
if (me.needToUpdateVersion) {
|
||||||
Common.NotificationCenter.trigger('api:disconnect');
|
Common.NotificationCenter.trigger('api:disconnect');
|
||||||
|
@ -2262,6 +2245,28 @@ define([
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
loadAutoCorrectSettings: function() {
|
||||||
|
// autocorrection
|
||||||
|
var me = this;
|
||||||
|
var value = Common.localStorage.getItem("sse-settings-math-correct-add");
|
||||||
|
Common.Utils.InternalSettings.set("sse-settings-math-correct-add", value);
|
||||||
|
var arrAdd = value ? JSON.parse(value) : [];
|
||||||
|
value = Common.localStorage.getItem("sse-settings-math-correct-rem");
|
||||||
|
Common.Utils.InternalSettings.set("sse-settings-math-correct-rem", value);
|
||||||
|
var arrRem = value ? JSON.parse(value) : [];
|
||||||
|
value = Common.localStorage.getBool("sse-settings-math-correct-replace-type", true); // replace on type
|
||||||
|
Common.Utils.InternalSettings.set("sse-settings-math-correct-replace-type", value);
|
||||||
|
me.api.asc_refreshOnStartAutoCorrectMathSymbols(arrRem, arrAdd, value);
|
||||||
|
|
||||||
|
value = Common.localStorage.getItem("sse-settings-rec-functions-add");
|
||||||
|
Common.Utils.InternalSettings.set("sse-settings-rec-functions-add", value);
|
||||||
|
arrAdd = value ? JSON.parse(value) : [];
|
||||||
|
value = Common.localStorage.getItem("sse-settings-rec-functions-rem");
|
||||||
|
Common.Utils.InternalSettings.set("sse-settings-rec-functions-rem", value);
|
||||||
|
arrRem = value ? JSON.parse(value) : [];
|
||||||
|
me.api.asc_refreshOnStartAutoCorrectMathFunctions(arrRem, arrAdd);
|
||||||
|
},
|
||||||
|
|
||||||
leavePageText: 'You have unsaved changes in this document. Click \'Stay on this Page\' then \'Save\' to save them. Click \'Leave this Page\' to discard all the unsaved changes.',
|
leavePageText: 'You have unsaved changes in this document. Click \'Stay on this Page\' then \'Save\' to save them. Click \'Leave this Page\' to discard all the unsaved changes.',
|
||||||
criticalErrorTitle: 'Error',
|
criticalErrorTitle: 'Error',
|
||||||
notcriticalErrorTitle: 'Warning',
|
notcriticalErrorTitle: 'Warning',
|
||||||
|
|
Loading…
Reference in a new issue