diff --git a/apps/common/main/lib/util/htmlutils.js b/apps/common/main/lib/util/htmlutils.js index e2c1329ed1..99e690ecac 100644 --- a/apps/common/main/lib/util/htmlutils.js +++ b/apps/common/main/lib/util/htmlutils.js @@ -1,3 +1,17 @@ +var checkLocalStorage = (function () { + try { + var storage = window['localStorage']; + return true; + } + catch(e) { + return false; + } +})(); + +if ( checkLocalStorage && localStorage.getItem("ui-rtl") === '1' ) { + document.body.setAttribute('dir', 'rtl'); + document.body.classList.add('rtl'); +} function checkScaling() { var matches = { @@ -42,16 +56,6 @@ var params = (function() { return urlParams; })(); -var checkLocalStorage = (function () { - try { - var storage = window['localStorage']; - return true; - } - catch(e) { - return false; - } -})(); - if ( window.desktop ) { var theme = desktop.theme diff --git a/apps/documenteditor/main/app/view/FileMenuPanels.js b/apps/documenteditor/main/app/view/FileMenuPanels.js index eb5ab25517..f7e1de1ff5 100644 --- a/apps/documenteditor/main/app/view/FileMenuPanels.js +++ b/apps/documenteditor/main/app/view/FileMenuPanels.js @@ -344,6 +344,9 @@ define([ '', '
', '', + '', + '
', + '', '', '', '', @@ -709,6 +712,14 @@ define([ })).on('click', _.bind(me.applySettings, me)); }); + this.chRTL = new Common.UI.CheckBox({ + el: $markup.findById('#fms-chb-rtl-ui'), + labelText: this.strRTLSupport, + dataHint: '2', + dataHintDirection: 'left', + dataHintOffset: 'small' + }); + this.pnlSettings = $markup.find('.flex-settings').addBack().filter('.flex-settings'); this.pnlApply = $markup.find('.fms-flex-apply').addBack().filter('.fms-flex-apply'); this.pnlTable = this.pnlSettings.find('table'); @@ -861,6 +872,7 @@ define([ } this.chDarkMode.setValue(Common.UI.Themes.isContentThemeDark()); this.chDarkMode.setDisabled(!Common.UI.Themes.isDarkTheme()); + this.chRTL.setValue(Common.localStorage.getBool("ui-rtl")); if (this.mode.canViewReview) { value = Common.Utils.InternalSettings.get("de-settings-review-hover-mode"); @@ -918,6 +930,7 @@ define([ } Common.localStorage.setItem("de-settings-paste-button", this.chPaste.isChecked() ? 1 : 0); + Common.localStorage.setBool("ui-rtl", this.chRTL.isChecked()); Common.localStorage.save(); @@ -988,6 +1001,7 @@ define([ textForceSave: 'Save to Server', textOldVersions: 'Make the files compatible with older MS Word versions when saved as DOCX', txtCacheMode: 'Default cache mode', + strRTLSupport: 'RTL interface', strMacrosSettings: 'Macros Settings', txtWarnMacros: 'Show Notification', txtRunMacros: 'Enable All', diff --git a/apps/presentationeditor/main/app/view/FileMenuPanels.js b/apps/presentationeditor/main/app/view/FileMenuPanels.js index bc3690f072..08ca6fcfa0 100644 --- a/apps/presentationeditor/main/app/view/FileMenuPanels.js +++ b/apps/presentationeditor/main/app/view/FileMenuPanels.js @@ -269,7 +269,9 @@ define([ '', '
', '', - + '', + '
', + '', '', '', '', @@ -540,6 +542,14 @@ define([ dataHintOffset: 'big' }); + this.chRTL = new Common.UI.CheckBox({ + el: $markup.findById('#fms-chb-rtl-ui'), + labelText: this.strRTLSupport, + dataHint: '2', + dataHintDirection: 'left', + dataHintOffset: 'small' + }); + $markup.find('.btn.primary').each(function(index, el){ (new Common.UI.Button({ el: $(el) @@ -670,6 +680,7 @@ define([ this.lblMacrosDesc.text(item ? item.get('descValue') : this.txtWarnMacrosDesc); this.chPaste.setValue(Common.Utils.InternalSettings.get("pe-settings-paste-button")); + this.chRTL.setValue(Common.localStorage.getBool("ui-rtl")); var data = []; for (var t in Common.UI.Themes.map()) { @@ -716,6 +727,7 @@ define([ Common.Utils.InternalSettings.set("pe-macros-mode", this.cmbMacros.getValue()); Common.localStorage.setItem("pe-settings-paste-button", this.chPaste.isChecked() ? 1 : 0); + Common.localStorage.setBool("ui-rtl", this.chRTL.isChecked()); Common.localStorage.save(); @@ -768,6 +780,7 @@ define([ textForceSave: 'Save to Server', txtSpellCheck: 'Spell Checking', txtCacheMode: 'Default cache mode', + strRTLSupport: 'RTL interface', strMacrosSettings: 'Macros Settings', txtWarnMacros: 'Show Notification', txtRunMacros: 'Enable All', diff --git a/apps/spreadsheeteditor/main/app/view/FileMenuPanels.js b/apps/spreadsheeteditor/main/app/view/FileMenuPanels.js index b39b9267c8..fb7ec1c323 100644 --- a/apps/spreadsheeteditor/main/app/view/FileMenuPanels.js +++ b/apps/spreadsheeteditor/main/app/view/FileMenuPanels.js @@ -244,6 +244,9 @@ define([ '', '
', '', + '', + '
', + '', '', '', '', @@ -712,6 +715,14 @@ define([ }); this.btnAutoCorrect.on('click', _.bind(this.autoCorrect, this)); + this.chRTL = new Common.UI.CheckBox({ + el: $markup.findById('#fms-chb-rtl-ui'), + labelText: this.strRTLSupport, + dataHint: '2', + dataHintDirection: 'left', + dataHintOffset: 'small' + }); + $markup.find('.btn.primary').each(function(index, el){ (new Common.UI.Button({ el: $(el) @@ -877,6 +888,7 @@ define([ this.cmbMacros.setValue(item ? item.get('value') : 0); this.chPaste.setValue(Common.Utils.InternalSettings.get("sse-settings-paste-button")); + this.chRTL.setValue(Common.localStorage.getBool("ui-rtl")); var data = []; for (var t in Common.UI.Themes.map()) { @@ -977,6 +989,7 @@ define([ Common.Utils.InternalSettings.set("sse-macros-mode", this.cmbMacros.getValue()); Common.localStorage.setItem("sse-settings-paste-button", this.chPaste.isChecked() ? 1 : 0); + Common.localStorage.setBool("ui-rtl", this.chRTL.isChecked()); Common.localStorage.save(); if (this.menu) { @@ -1103,6 +1116,7 @@ define([ strDecimalSeparator: 'Decimal separator', strThousandsSeparator: 'Thousands separator', txtCacheMode: 'Default cache mode', + strRTLSupport: 'RTL interface', strMacrosSettings: 'Macros Settings', txtWarnMacros: 'Show Notification', txtRunMacros: 'Enable All',