MediaWiki:Common.js: Difference between revisions
Jump to navigation
Jump to search
(Created page with "ββAny JavaScript here will be loaded for all users on every page load.: if ( mw.config.get( 'wgIsMainPage' )) { var language = navigator.language || navigator.browserLanguage; // alert(language); if (language.indexOf('ru') > -1) { document.location.href = 'https://www.exagear.wiki/index.php?title=Test_Main_Page(ru)'; } else { document.location.href = 'https://www.exagear.wiki/index.php?title=Test_Main_Page(en)'; } }") |
No edit summary Tag: Manual revert |
||
(15 intermediate revisions by 2 users not shown) | |||
Line 4: | Line 4: | ||
var language = navigator.language || navigator.browserLanguage; | var language = navigator.language || navigator.browserLanguage; | ||
// alert(language); | // alert(language); | ||
if (language.indexOf('ru') > -1) { | if (language.indexOf('ru') > -1) { | ||
document.location.href = 'https://www.exagear.wiki/index.php?title= | document.location.href = 'https://www.exagear.wiki/index.php?title=Main_Page(ru)'; | ||
} else { | } else { | ||
document.location.href = 'https://www.exagear.wiki/index.php?title= | document.location.href = 'https://www.exagear.wiki/index.php?title=Main_Page'; | ||
} | } | ||
} | } |
Latest revision as of 00:00, 30 November 2022
/* Any JavaScript here will be loaded for all users on every page load. */ if ( mw.config.get( 'wgIsMainPage' )) { var language = navigator.language || navigator.browserLanguage; // alert(language); if (language.indexOf('ru') > -1) { document.location.href = 'https://www.exagear.wiki/index.php?title=Main_Page(ru)'; } else { document.location.href = 'https://www.exagear.wiki/index.php?title=Main_Page'; } }