Difference between revisions of "MediaWiki:Common.js"

From Utpalasia Wiki
Jump to navigation Jump to search
(switch to 768)
Line 14: Line 14:
 
   || ua.match(/Symbian/i)) */
 
   || ua.match(/Symbian/i)) */
  
   /*if(document.documentElement.clientWidth <= 1000)
+
   if(document.documentElement.clientWidth < 768)
 
   {
 
   {
 
     window.location.replace(document.URL + "?useformat=mobile");
 
     window.location.replace(document.URL + "?useformat=mobile");
   }*/
+
   }
 
}
 
}

Revision as of 20:15, 6 April 2013

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

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)
  {
    window.location.replace(document.URL + "?useformat=mobile");
  }
}