From 790ab4a726b119f91ee6ee1a0f102e3e1cc33100 Mon Sep 17 00:00:00 2001 From: Maxim Kadushkin Date: Wed, 14 Nov 2018 18:11:36 +0300 Subject: [PATCH] [SSE] support for R1C1 reference style --- .../main/app/controller/LeftMenu.js | 4 ++++ .../spreadsheeteditor/main/app/controller/Main.js | 4 ++++ .../main/app/view/FileMenuPanels.js | 15 ++++++++++++++- apps/spreadsheeteditor/main/locale/en.json | 2 ++ apps/spreadsheeteditor/main/locale/ru.json | 2 ++ 5 files changed, 26 insertions(+), 1 deletion(-) diff --git a/apps/spreadsheeteditor/main/app/controller/LeftMenu.js b/apps/spreadsheeteditor/main/app/controller/LeftMenu.js index c1d730f21..96375f753 100644 --- a/apps/spreadsheeteditor/main/app/controller/LeftMenu.js +++ b/apps/spreadsheeteditor/main/app/controller/LeftMenu.js @@ -285,6 +285,10 @@ define([ value = resolved = true; (value) ? this.api.asc_showComments(resolved) : this.api.asc_hideComments(); + value = Common.localStorage.getBool("sse-settings-r1c1"); + Common.Utils.InternalSettings.set("sse-settings-r1c1", value); + this.api.asc_setR1C1Mode(value); + if (this.mode.isEdit && !this.mode.isOffline && this.mode.canCoAuthoring) { value = Common.localStorage.getBool("sse-settings-coauthmode", true); Common.Utils.InternalSettings.set("sse-settings-coauthmode", value); diff --git a/apps/spreadsheeteditor/main/app/controller/Main.js b/apps/spreadsheeteditor/main/app/controller/Main.js index bc17b0990..7f86fea36 100644 --- a/apps/spreadsheeteditor/main/app/controller/Main.js +++ b/apps/spreadsheeteditor/main/app/controller/Main.js @@ -329,6 +329,10 @@ define([ } if (value) this.api.asc_setLocalization(value); + value = Common.localStorage.getBool("sse-settings-r1c1"); + Common.Utils.InternalSettings.set("sse-settings-r1c1", value); + this.api.asc_setR1C1Mode(value); + if (this.appOptions.location == 'us' || this.appOptions.location == 'ca') Common.Utils.Metric.setDefaultMetric(Common.Utils.Metric.c_MetricUnits.inch); diff --git a/apps/spreadsheeteditor/main/app/view/FileMenuPanels.js b/apps/spreadsheeteditor/main/app/view/FileMenuPanels.js index 31b9a8e72..534cf86cf 100644 --- a/apps/spreadsheeteditor/main/app/view/FileMenuPanels.js +++ b/apps/spreadsheeteditor/main/app/view/FileMenuPanels.js @@ -453,6 +453,10 @@ define([ '', '', '','', + '', + '', + '
', + '','', '', '', '', @@ -513,6 +517,11 @@ define([ labelText: this.strResolvedComment }); + this.chR1C1Style = new Common.UI.CheckBox({ + el: $('#fms-chb-r1c1-style'), + labelText: this.strR1C1 + }); + this.cmbCoAuthMode = new Common.UI.ComboBox({ el : $('#fms-cmb-coauth-mode'), style : 'width: 160px;', @@ -694,6 +703,7 @@ define([ /** coauthoring begin **/ this.chLiveComment.setValue(Common.Utils.InternalSettings.get("sse-settings-livecomment")); this.chResolvedComment.setValue(Common.Utils.InternalSettings.get("sse-settings-resolvedcomment")); + this.chR1C1Style.setValue(Common.Utils.InternalSettings.get("sse-settings-r1c1")); var fast_coauth = Common.Utils.InternalSettings.get("sse-settings-coauthmode"); item = this.cmbCoAuthMode.store.findWhere({value: fast_coauth ? 1 : 0}); @@ -745,6 +755,7 @@ define([ if (this.mode.isEdit && !this.mode.isOffline && this.mode.canCoAuthoring) Common.localStorage.setItem("sse-settings-coauthmode", this.cmbCoAuthMode.getValue()); /** coauthoring end **/ + Common.localStorage.setItem("sse-settings-r1c1", this.chR1C1Style.isChecked() ? 1 : 0); Common.localStorage.setItem("sse-settings-fontrender", this.cmbFontRender.getValue()); Common.localStorage.setItem("sse-settings-unit", this.cmbUnit.getValue()); Common.localStorage.setItem("sse-settings-autosave", this.chAutosave.isChecked() ? 1 : 0); @@ -829,7 +840,9 @@ define([ txtInch: 'Inch', textForceSave: 'Save to Server', strForcesave: 'Always save to server (otherwise save to server on document close)', - strResolvedComment: 'Turn on display of the resolved comments' + strResolvedComment: 'Turn on display of the resolved comments', + textRefStyle: 'Reference Style', + strR1C1: 'Turn on R1C1 style' }, SSE.Views.FileMenuPanels.MainSettingsGeneral || {})); SSE.Views.FileMenuPanels.RecentFiles = Common.UI.BaseView.extend({ diff --git a/apps/spreadsheeteditor/main/locale/en.json b/apps/spreadsheeteditor/main/locale/en.json index 02d958f54..14939b136 100644 --- a/apps/spreadsheeteditor/main/locale/en.json +++ b/apps/spreadsheeteditor/main/locale/en.json @@ -1322,6 +1322,8 @@ "SSE.Views.FileMenuPanels.MainSettingsGeneral.txtPt": "Point", "SSE.Views.FileMenuPanels.MainSettingsGeneral.txtRu": "Russian", "SSE.Views.FileMenuPanels.MainSettingsGeneral.txtWin": "as Windows", + "SSE.Views.FileMenuPanels.MainSettingsGeneral.textRefStyle": "Reference Style", + "SSE.Views.FileMenuPanels.MainSettingsGeneral.strR1C1": "Turn on R1C1 style", "SSE.Views.FileMenuPanels.ProtectDoc.notcriticalErrorTitle": "Warning", "SSE.Views.FileMenuPanels.ProtectDoc.strEncrypt": "With password", "SSE.Views.FileMenuPanels.ProtectDoc.strProtect": "Protect Spreadsheet", diff --git a/apps/spreadsheeteditor/main/locale/ru.json b/apps/spreadsheeteditor/main/locale/ru.json index c73e25be9..2eab1582c 100644 --- a/apps/spreadsheeteditor/main/locale/ru.json +++ b/apps/spreadsheeteditor/main/locale/ru.json @@ -1322,6 +1322,8 @@ "SSE.Views.FileMenuPanels.MainSettingsGeneral.txtPt": "Пункт", "SSE.Views.FileMenuPanels.MainSettingsGeneral.txtRu": "Русский", "SSE.Views.FileMenuPanels.MainSettingsGeneral.txtWin": "как Windows", + "SSE.Views.FileMenuPanels.MainSettingsGeneral.textRefStyle": "Стиль ссылок", + "SSE.Views.FileMenuPanels.MainSettingsGeneral.strR1C1": "Включить стиль R1C1", "SSE.Views.FileMenuPanels.ProtectDoc.notcriticalErrorTitle": "Внимание", "SSE.Views.FileMenuPanels.ProtectDoc.strEncrypt": "C помощью пароля", "SSE.Views.FileMenuPanels.ProtectDoc.strProtect": "Защитить электронную таблицу",