Jump to content

MediaWiki:Common.js: Difference between revisions

From Utpalasia Wiki
change to test redirect
formatting
Line 5: Line 5:
   var size = window.getComputedStyle(document.body,':after').getPropertyValue('content');
   var size = window.getComputedStyle(document.body,':after').getPropertyValue('content');


   if (size.indexOf('smallscreen') !=-1)
   if (size.indexOf('smallscreen') != -1)
   {
   {
     window.location.replace(document.URL + "?useformat=mobile");
     window.location.replace(document.URL + "?useformat=mobile");

Revision as of 18:22, 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.");*/
  }
}