mirror of
https://github.com/ONLYOFFICE/web-apps.git
synced 2026-07-24 05:25:41 +08:00
[DE mobile] refactoring
This commit is contained in:
@ -24,18 +24,22 @@ function isLocalStorageAvailable() {
|
||||
}
|
||||
}
|
||||
|
||||
if(!window.lang) {
|
||||
window.lang = (/(?:&|^)lang=([^&]+)&?/i).exec(window.location.search.substring(1));
|
||||
window.lang = window.lang ? window.lang[1] : '';
|
||||
{
|
||||
let lang = (/(?:&|^)lang=([^&]+)&?/i).exec(window.location.search.substring(1));
|
||||
lang = ((lang && lang[1]) || window.Common.Locale.defaultLang).split(/[\-\_]/)[0];
|
||||
Common.Locale.currentLang = lang;
|
||||
Common.Locale.isCurrentLangRtl = lang.lastIndexOf('ar', 0) === 0;
|
||||
}
|
||||
|
||||
window.lang && (window.lang = window.lang.split(/[\-\_]/)[0].toLowerCase());
|
||||
|
||||
if(isLocalStorageAvailable()) {
|
||||
const modeDirection = localStorage.getItem('mobile-mode-direction');
|
||||
let modeDirection = localStorage.getItem('mobile-mode-direction');
|
||||
|
||||
if(modeDirection === 'rtl' || (window.lang === 'ar' && !modeDirection)) {
|
||||
!modeDirection && localStorage.setItem('mobile-mode-direction', 'rtl');
|
||||
if( !modeDirection && Common.Locale.isCurrentLangRtl ) {
|
||||
localStorage.setItem('mobile-mode-direction', 'rtl');
|
||||
modeDirection = 'rtl';
|
||||
}
|
||||
|
||||
if(modeDirection === 'rtl') {
|
||||
load_stylesheet('./css/framework7-rtl.css');
|
||||
document.body.classList.add('rtl');
|
||||
} else {
|
||||
|
||||
@ -23,6 +23,9 @@
|
||||
<!-- built styles file will be auto injected -->
|
||||
</head>
|
||||
<body>
|
||||
<script>
|
||||
window.Common = {Locale: {defaultLang: <%= htmlWebpackPlugin.options.system.env.defaultLang %>}};
|
||||
</script>
|
||||
<% if ( htmlWebpackPlugin.options.skeleton.htmlscript ) { %>
|
||||
<script>
|
||||
window.asceditor = 'word';
|
||||
@ -91,11 +94,7 @@
|
||||
.replace(/>/g, '>');
|
||||
}
|
||||
|
||||
window.Common = {Locale: {defaultLang: <%= htmlWebpackPlugin.options.system.env.defaultLang %>}};
|
||||
let params = getUrlParams(),
|
||||
lang = (params["lang"] || window.Common.Locale.defaultLang).split(/[\-\_]/)[0];
|
||||
|
||||
window.Common.Locale.currentLang = lang;
|
||||
let params = getUrlParams();
|
||||
window.frameEditorId = params["frameEditorId"];
|
||||
window.parentOrigin = params["parentOrigin"];
|
||||
</script>
|
||||
|
||||
@ -25,8 +25,6 @@ const PageApplicationSettings = props => {
|
||||
|
||||
// set mode
|
||||
const appOptions = props.storeAppOptions;
|
||||
const currentLang = appOptions.lang;
|
||||
const isRtlLang = currentLang && /^(ar)$/i.test(currentLang);
|
||||
const colorTheme = storeThemes.colorTheme;
|
||||
const themes = storeThemes.themes;
|
||||
const typeTheme = colorTheme.type;
|
||||
@ -114,7 +112,7 @@ const PageApplicationSettings = props => {
|
||||
}}></ListItem>
|
||||
</List>
|
||||
}
|
||||
{isRtlLang &&
|
||||
{Common.Locale.isCurrentLangRtl &&
|
||||
<>
|
||||
<List>
|
||||
<ListItem>
|
||||
|
||||
Reference in New Issue
Block a user