Add hideRulers parameter to customization

This commit is contained in:
Julia Radzhabova 2021-02-11 20:13:47 +03:00
parent 8dfd43ec0e
commit 1de1fd9963
5 changed files with 12 additions and 5 deletions

View file

@ -155,7 +155,8 @@
macros: true // can run macros in document macros: true // can run macros in document
plugins: true // can run plugins in document plugins: true // can run plugins in document
macrosMode: 'warn' // warn about automatic macros, 'enable', 'disable', 'warn', macrosMode: 'warn' // warn about automatic macros, 'enable', 'disable', 'warn',
trackChanges: undefined // true/false - open editor with track changes mode on/off trackChanges: undefined // true/false - open editor with track changes mode on/off,
hideRulers: false, // hide or show rulers on first loading (presentation or document editor)
}, },
plugins: { plugins: {
autostart: ['asc.{FFE1F462-1EA2-4391-990D-4CC84940B754}'], autostart: ['asc.{FFE1F462-1EA2-4391-990D-4CC84940B754}'],

View file

@ -1440,7 +1440,9 @@ define([
Common.Utils.InternalSettings.set("de-settings-unit", value); Common.Utils.InternalSettings.set("de-settings-unit", 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));
me.api.asc_SetViewRulers(!Common.localStorage.getBool('de-hidden-rulers')); value = Common.localStorage.itemExists('de-hidden-rulers') ? Common.localStorage.getBool('de-hidden-rulers') : (this.appOptions.customization && !!this.appOptions.customization.hideRulers);
Common.Utils.InternalSettings.set("de-hidden-rulers", value);
me.api.asc_SetViewRulers(!value);
me.api.asc_registerCallback('asc_onDocumentCanSaveChanged', _.bind(me.onDocumentCanSaveChanged, me)); me.api.asc_registerCallback('asc_onDocumentCanSaveChanged', _.bind(me.onDocumentCanSaveChanged, me));
/** coauthoring begin **/ /** coauthoring begin **/

View file

@ -241,7 +241,7 @@ define([
var mnuitemHideRulers = new Common.UI.MenuItem({ var mnuitemHideRulers = new Common.UI.MenuItem({
caption: me.header.textHideLines, caption: me.header.textHideLines,
checked: Common.localStorage.getBool("de-hidden-rulers"), checked: Common.Utils.InternalSettings.get("de-hidden-rulers"),
checkable: true, checkable: true,
value: 'rulers' value: 'rulers'
}); });
@ -387,6 +387,7 @@ define([
case 'rulers': case 'rulers':
me.api.asc_SetViewRulers(!item.isChecked()); me.api.asc_SetViewRulers(!item.isChecked());
Common.localStorage.setBool('de-hidden-rulers', item.isChecked()); Common.localStorage.setBool('de-hidden-rulers', item.isChecked());
Common.Utils.InternalSettings.set("de-hidden-rulers", item.isChecked());
Common.NotificationCenter.trigger('layout:changed', 'rulers'); Common.NotificationCenter.trigger('layout:changed', 'rulers');
Common.NotificationCenter.trigger('edit:complete', me.header); Common.NotificationCenter.trigger('edit:complete', me.header);
break; break;

View file

@ -1135,7 +1135,9 @@ define([
Common.Utils.InternalSettings.set("pe-settings-unit", value); Common.Utils.InternalSettings.set("pe-settings-unit", 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));
if (me.api.asc_SetViewRulers) me.api.asc_SetViewRulers(!Common.localStorage.getBool('pe-hidden-rulers', true)); value = Common.localStorage.itemExists('pe-hidden-rulers') ? Common.localStorage.getBool('pe-hidden-rulers') : (!this.appOptions.customization || this.appOptions.customization.hideRulers!==false);
Common.Utils.InternalSettings.set("pe-hidden-rulers", value);
if (me.api.asc_SetViewRulers) me.api.asc_SetViewRulers(!value);
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_onDocumentCanSaveChanged', _.bind(me.onDocumentCanSaveChanged, me)); me.api.asc_registerCallback('asc_onDocumentCanSaveChanged', _.bind(me.onDocumentCanSaveChanged, me));

View file

@ -244,7 +244,7 @@ define([
var mnuitemHideRulers = new Common.UI.MenuItem({ var mnuitemHideRulers = new Common.UI.MenuItem({
caption: me.header.textHideLines, caption: me.header.textHideLines,
checked: Common.localStorage.getBool("pe-hidden-rulers", true), checked: Common.Utils.InternalSettings.get("pe-hidden-rulers"),
checkable: true, checkable: true,
value: 'rulers' value: 'rulers'
}); });
@ -430,6 +430,7 @@ define([
case 'rulers': case 'rulers':
me.api.asc_SetViewRulers(!item.isChecked()); me.api.asc_SetViewRulers(!item.isChecked());
Common.localStorage.setBool('pe-hidden-rulers', item.isChecked()); Common.localStorage.setBool('pe-hidden-rulers', item.isChecked());
Common.Utils.InternalSettings.set("pe-hidden-rulers", item.isChecked());
Common.NotificationCenter.trigger('layout:changed', 'rulers'); Common.NotificationCenter.trigger('layout:changed', 'rulers');
Common.NotificationCenter.trigger('edit:complete', me.header); Common.NotificationCenter.trigger('edit:complete', me.header);
break; break;