From a7e46280003b363acf1d267d2cfc13a01769dcb6 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Thu, 5 Oct 2017 17:51:15 +0300 Subject: [PATCH] [DE] Added Sogou Pinyin input in Chrome. --- .../main/app/controller/LeftMenu.js | 3 +++ apps/documenteditor/main/app/controller/Main.js | 4 ++++ .../main/app/view/FileMenuPanels.js | 16 +++++++++++++++- apps/documenteditor/main/locale/en.json | 1 + 4 files changed, 23 insertions(+), 1 deletion(-) diff --git a/apps/documenteditor/main/app/controller/LeftMenu.js b/apps/documenteditor/main/app/controller/LeftMenu.js index 31ecfc3e7..e5ff63785 100644 --- a/apps/documenteditor/main/app/controller/LeftMenu.js +++ b/apps/documenteditor/main/app/controller/LeftMenu.js @@ -299,6 +299,9 @@ define([ var value; this.api.SetTextBoxInputMode(Common.localStorage.getBool("de-settings-inputmode")); + if (Common.Utils.isChrome) + window["AscInputMethod"]["SogouPinyin"] = Common.localStorage.getBool("de-settings-inputsogou"); + /** coauthoring begin **/ if (this.mode.isEdit && !this.mode.isOffline && this.mode.canCoAuthoring) { var fast_coauth = Common.localStorage.getBool("de-settings-coauthmode", true); diff --git a/apps/documenteditor/main/app/controller/Main.js b/apps/documenteditor/main/app/controller/Main.js index 5fc6b164d..81bd0771d 100644 --- a/apps/documenteditor/main/app/controller/Main.js +++ b/apps/documenteditor/main/app/controller/Main.js @@ -800,6 +800,10 @@ define([ me.api.SetTextBoxInputMode(Common.localStorage.getBool("de-settings-inputmode")); + if (Common.Utils.isChrome) { + window["AscInputMethod"]["SogouPinyin"] = Common.localStorage.getBool("de-settings-inputsogou"); + } + /** coauthoring begin **/ if (me.appOptions.isEdit && !me.appOptions.isOffline && me.appOptions.canCoAuthoring) { value = Common.localStorage.getItem("de-settings-coauthmode"); diff --git a/apps/documenteditor/main/app/view/FileMenuPanels.js b/apps/documenteditor/main/app/view/FileMenuPanels.js index a2953db42..a43602008 100644 --- a/apps/documenteditor/main/app/view/FileMenuPanels.js +++ b/apps/documenteditor/main/app/view/FileMenuPanels.js @@ -128,6 +128,10 @@ define([ '', '
', '','', + '', + '', + '
', + '','', '', '', '', @@ -185,6 +189,11 @@ define([ labelText: this.strInputMode }); + this.chInputSogou = new Common.UI.CheckBox({ + el: $('#fms-chb-input-sogou'), + labelText: this.strInputSogou + }); + /** coauthoring begin **/ this.chLiveComment = new Common.UI.CheckBox({ el: $('#fms-chb-live-comment'), @@ -339,10 +348,13 @@ define([ $('tr.coauth.changes', this.el)[mode.isEdit && !mode.isOffline && mode.canCoAuthoring ? 'show' : 'hide'](); $('tr.comments', this.el)[mode.canCoAuthoring && mode.canComments ? 'show' : 'hide'](); /** coauthoring end **/ + + $('tr.sogou', this.el)[mode.isEdit && Common.Utils.isChrome ?'show':'hide'](); }, updateSettings: function() { this.chInputMode.setValue(Common.localStorage.getBool("de-settings-inputmode")); + Common.Utils.isChrome && this.chInputSogou.setValue(Common.localStorage.getBool("de-settings-inputsogou")); 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); @@ -393,6 +405,7 @@ define([ applySettings: function() { Common.localStorage.setItem("de-settings-inputmode", this.chInputMode.isChecked() ? 1 : 0); + Common.Utils.isChrome && Common.localStorage.setItem("de-settings-inputsogou", this.chInputSogou.isChecked() ? 1 : 0); Common.localStorage.setItem("de-settings-zoom", this.cmbZoom.getValue()); /** coauthoring begin **/ Common.localStorage.setItem("de-settings-livecomment", this.chLiveComment.isChecked() ? 1 : 0); @@ -470,7 +483,8 @@ define([ txtFitWidth: 'Fit to Width', 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', + strInputSogou: 'Turn on Sogou Pinyin input' }, DE.Views.FileMenuPanels.Settings || {})); DE.Views.FileMenuPanels.RecentFiles = Common.UI.BaseView.extend({ diff --git a/apps/documenteditor/main/locale/en.json b/apps/documenteditor/main/locale/en.json index f15a493ba..c8b492a0c 100644 --- a/apps/documenteditor/main/locale/en.json +++ b/apps/documenteditor/main/locale/en.json @@ -994,6 +994,7 @@ "DE.Views.FileMenuPanels.Settings.strFontRender": "Font Hinting", "DE.Views.FileMenuPanels.Settings.strForcesave": "Always save to server (otherwise save to server on document close)", "DE.Views.FileMenuPanels.Settings.strInputMode": "Turn on hieroglyphs", + "DE.Views.FileMenuPanels.Settings.strInputSogou": "Turn on Sogou Pinyin input", "DE.Views.FileMenuPanels.Settings.strLiveComment": "Turn on display of the comments", "DE.Views.FileMenuPanels.Settings.strResolvedComment": "Turn on display of the resolved comments", "DE.Views.FileMenuPanels.Settings.strShowChanges": "Realtime Collaboration Changes",