Difference between revisions of "MediaWiki:Common.js"

From Utpalasia Wiki
Jump to navigation Jump to search
(changed query string used to switch to mobile)
(slight adjustment to max width conditional to match CSS media query (for consistency))
Line 1: Line 1:
 
/* Any JavaScript here will be loaded for all users on every page load. */
 
/* Any JavaScript here will be loaded for all users on every page load. */
  
if(document.documentElement.clientWidth < 788 && document.URL.search("mobile") == -1)
+
if(document.documentElement.clientWidth <= 787 && document.URL.search("mobile") == -1)
 
{
 
{
 
/*alert("Hi!");*/
 
/*alert("Hi!");*/
 
   window.location.replace(document.URL + "?useformat=mobile");
 
   window.location.replace(document.URL + "?useformat=mobile");
 
}
 
}

Revision as of 15:35, 4 April 2013

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

if(document.documentElement.clientWidth <= 787 && document.URL.search("mobile") == -1)
{
/*alert("Hi!");*/
  window.location.replace(document.URL + "?useformat=mobile");
}