MediaWiki:Mobile.js

From Exagear International
Revision as of 12:59, 19 October 2022 by Wikiadmin (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
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';

}
}



// HIDING ELEMENTS
// ########################

if(
window.location.href=="https://www.exagear.wiki/index.php?title=Main_Page"
)
{
var plusLinks = document.querySelectorAll('.pre-content');
var firstLink = plusLinks[0];
firstLink.setAttribute('class', 'hidethis');
}

// ########################

if(
window.location.href=="https://www.exagear.wiki/index.php?title=Main_Page(ru)&mobileaction=toggle_view_mobile" 
)
{var plusLinks = document.querySelectorAll('.pre-content');
var firstLink = plusLinks[0];
firstLink.setAttribute('class', 'hidethis');
}

// ########################
if(
window.location.href=="https://www.exagear.wiki/index.php?title=Main_Page&mobileaction=toggle_view_mobile"
)
{
var plusLinks = document.querySelectorAll('.pre-content');
var firstLink = plusLinks[0];
firstLink.setAttribute('class', 'hidethis');
}
// ########################


if(
window.location.href=="https://www.exagear.wiki/index.php?title=Main_Page(ru)" 
)
{var plusLinks = document.querySelectorAll('.pre-content');
var firstLink = plusLinks[0];
firstLink.setAttribute('class', 'hidethis');
}