http://www.mediawiki.org/wiki/Special:Code/MediaWiki/83579

Revision: 83579
Author:   catrope
Date:     2011-03-09 11:54:37 +0000 (Wed, 09 Mar 2011)
Log Message:
-----------
1.17wmf1: Live hack for mobile redirect script: wg* variables aren't available 
when running in the <head>, so use other hackery to obtain the same information

Modified Paths:
--------------
    branches/wmf/1.17wmf1/extensions/WikimediaMobile/MobileRedirect.js
    branches/wmf/1.17wmf1/extensions/WikimediaMobile/WikimediaMobile.php

Modified: branches/wmf/1.17wmf1/extensions/WikimediaMobile/MobileRedirect.js
===================================================================
--- branches/wmf/1.17wmf1/extensions/WikimediaMobile/MobileRedirect.js  
2011-03-09 09:52:20 UTC (rev 83578)
+++ branches/wmf/1.17wmf1/extensions/WikimediaMobile/MobileRedirect.js  
2011-03-09 11:54:37 UTC (rev 83579)
@@ -10,8 +10,11 @@
 {
   
   if (    (document.cookie.indexOf("irect=t") < 0)  // Don't redirect if we 
have the stop cookie ... only testing a subportion of the cookie. Should be 
REALLY unique!
-       && (wgNamespaceNumber >= 0)                 // Don't redirect special 
pages
+       /*&& (wgNamespaceNumber >= 0)                 // Don't redirect special 
pages
        && (wgAction == "view"))                    // Don't redirect URLs that 
aren't simple page views 
+       */
+       && (!document.getElementsByClassName || 
document.getElementsByClassName( 'ns--1' ).length == 0)
+       && (document.location.href.indexOf( 'action=' ) == -1 || 
document.location.href.indexOf( 'action=view' ) != -1 )
   {
   
     // If we've made it here, then we are going ahead with the redirect

Modified: branches/wmf/1.17wmf1/extensions/WikimediaMobile/WikimediaMobile.php
===================================================================
--- branches/wmf/1.17wmf1/extensions/WikimediaMobile/WikimediaMobile.php        
2011-03-09 09:52:20 UTC (rev 83578)
+++ branches/wmf/1.17wmf1/extensions/WikimediaMobile/WikimediaMobile.php        
2011-03-09 11:54:37 UTC (rev 83579)
@@ -19,7 +19,7 @@
 /**
  * Increment this when the JS file changes
  */
-$wgWikimediaMobileVersion = '4';
+$wgWikimediaMobileVersion = '5';
 
 /**
  * The base URL of the mobile gateway


_______________________________________________
MediaWiki-CVS mailing list
MediaWiki-CVS@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to