MediaWiki:Mobile.js

From Exagear International
Revision as of 07:50, 17 October 2022 by Wikiadmin (talk | contribs)
Jump to navigation Jump to search

Note: After publishing, you may have to bypass your browser's cache to see the changes.

  • Firefox / Safari: Hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (⌘-R on a Mac)
  • Google Chrome: Press Ctrl-Shift-R (⌘-Shift-R on a Mac)
  • Internet Explorer / Edge: Hold Ctrl while clicking Refresh, or press Ctrl-F5
  • Opera: Press Ctrl-F5.
/* 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(en)';

}
}




if(
window.location.href=="https://www.exagear.wiki/index.php?title=Main_Page(en)" 
)
{


if(/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)){
  // true for mobile device
   var x = document.getElementById("page-actions");
   x.style.display = "none";
}



if(
window.location.href=="https://www.exagear.wiki/index.php?title=Main_Page(ru)" 
)
{


if(/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)){
  // true for mobile device
   var x = document.getElementById("page-actions");
   x.style.display = "none";
}


}