Difference between revisions of "MediaWiki:Common.js"

From Utpalasia Wiki
Jump to navigation Jump to search
(temp removal)
(testing SO solution)
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.URL.search("mobile") == -1)
 
if(document.URL.search("mobile") == -1)
 
{
 
{
 +
  var size = window.getComputedStyle(document.body,':after').getPropertyValue('content');
  
   if(document.documentElement.clientWidth <= 735)
+
   if (size.indexOf('smallscreen') !=-1)
 
   {
 
   {
     window.location.replace(document.URL + "?useformat=mobile");
+
     /*window.location.replace(document.URL + "?useformat=mobile");*/
 +
    alert("Small screen detected.");
 
   }
 
   }
 
}
 
}
*/
 

Revision as of 11:45, 7 April 2013

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

if(document.URL.search("mobile") == -1)
{
  var size = window.getComputedStyle(document.body,':after').getPropertyValue('content');

  if (size.indexOf('smallscreen') !=-1)
  {
    /*window.location.replace(document.URL + "?useformat=mobile");*/
    alert("Small screen detected.");
  }
}