MediaWiki:Mobile.js: Difference between revisions

From Exagear International
Jump to navigation Jump to search
No edit summary
No edit summary
 
(7 intermediate revisions by 2 users not shown)
Line 13: Line 13:


} 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';


}
}
Line 20: Line 20:




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


if(
if(
window.location.href=="https://www.exagear.wiki/index.php?title=Main_Page(en)"  
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(/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)){
if(
  // true for mobile device
window.location.href=="https://www.exagear.wiki/index.php?title=Main_Page(ru)&mobileaction=toggle_view_mobile"
  var x = document.getElementById("page-actions");
)
  x.style.display = "none";
{var plusLinks = document.querySelectorAll('.pre-content');
var firstLink = plusLinks[0];
firstLink.setAttribute('class', 'hidethis');
}
}


 
// ########################
 
if(
if(
window.location.href=="https://www.exagear.wiki/index.php?title=Main_Page(ru)"  
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];
if(/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)){
firstLink.setAttribute('class', 'hidethis');
  // 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)"
)
{var plusLinks = document.querySelectorAll('.pre-content');
var firstLink = plusLinks[0];
firstLink.setAttribute('class', 'hidethis');
}
}

Latest revision as of 12:59, 19 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;



// 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');
}