Jump to content

MediaWiki:Common.js: Difference between revisions

From Utpalasia Wiki
switch to 768
resolution change
Line 3: Line 3:
if(document.URL.search("mobile") == -1)
if(document.URL.search("mobile") == -1)
{
{
  /* unused, but left in for documentation
  var ua = navigator.userAgent;
  if( ua.match(/Android/i)
  || ua.match(/webOS/i)
  || ua.match(/iPhone/i)
  || ua.match(/iPod/i)
  || ua.match(/BlackBerry/i)
  || ua.match(/Windows Phone/i)
  || ua.match(/Bada/i)
  || ua.match(/Symbian/i)) */


   if(document.documentElement.clientWidth < 768)
   if(document.documentElement.clientWidth < 736)
   {
   {
     window.location.replace(document.URL + "?useformat=mobile");
     window.location.replace(document.URL + "?useformat=mobile");
   }
   }
}
}

Revision as of 20:44, 6 April 2013

/* Any JavaScript here will be loaded for all users on every page load. */

if(document.URL.search("mobile") == -1)
{

  if(document.documentElement.clientWidth < 736)
  {
    window.location.replace(document.URL + "?useformat=mobile");
  }
}