MediaWiki:Mobile.js: Difference between revisions

From Exagear International
Jump to navigation Jump to search
No edit summary
No edit summary
Line 22: Line 22:


if(
if(
window.location.href=="https://www.exagear.wiki/index.php?title=Main_Page"  
window.location.href=="https://www.exagear.wiki/index.php?title=Main_Page"
)
)
{
{
Line 31: Line 31:
   var x = document.getElementById("page-actions");
   var x = document.getElementById("page-actions");
   x.style.display = "none";
   x.style.display = "none";
  var y = document.getElementById("heading-holder");
  y.style.display = "none";
  var z = document.getElementById("pre-content ");
  z.style.display = "none";
}
}
}


Line 45: Line 56:
   var x = document.getElementById("page-actions");
   var x = document.getElementById("page-actions");
   x.style.display = "none";
   x.style.display = "none";
}




  var y = document.getElementById("heading-holder");
  y.style.display = "none";
  var z = document.getElementById("pre-content ");
  z.style.display = "none";
}
}
}

Revision as of 11:47, 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';

}
}




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


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";

   var y = document.getElementById("heading-holder");
   y.style.display = "none";

   var z = document.getElementById("pre-content ");
   z.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";


   var y = document.getElementById("heading-holder");
   y.style.display = "none";

   var z = document.getElementById("pre-content ");
   z.style.display = "none";

}
}