MediaWiki:Common.js: Difference between revisions

From Exagear International
Jump to navigation Jump to search
No edit summary
Tag: Manual revert
No edit summary
Line 4: Line 4:


var language = navigator.language || navigator.browserLanguage;
var language = navigator.language || navigator.browserLanguage;
var language = navigator.language


// alert(language);
// alert(language);
Line 9: Line 11:
if (language.indexOf('ru') > -1) {
if (language.indexOf('ru') > -1) {
document.location.href = 'https://www.exagear.wiki/index.php?title=Main_Page(ru)';
document.location.href = 'https://www.exagear.wiki/index.php?title=Main_Page(ru)';
document.location = 'https://www.exagear.wiki/index.php?title=Main_Page(ru)';
} else {
} else {
document.location.href = 'https://www.exagear.wiki/index.php?title=Main_Page(en)';
document.location.href = 'https://www.exagear.wiki/index.php?title=Main_Page(en)';
document.location = 'https://www.exagear.wiki/index.php?title=Main_Page(en)';
}
}
}
}

Revision as of 13:55, 15 October 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;
var language = navigator.language 


// alert(language);

if (language.indexOf('ru') > -1) {
document.location.href = 'https://www.exagear.wiki/index.php?title=Main_Page(ru)';
document.location = 'https://www.exagear.wiki/index.php?title=Main_Page(ru)';
} else {
document.location.href = 'https://www.exagear.wiki/index.php?title=Main_Page(en)';
document.location = 'https://www.exagear.wiki/index.php?title=Main_Page(en)';
}
}