r84177 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r84176‎ | r84177 | r84178 >
Date:16:20, 17 March 2011
Author:hcatlin
Status:ok
Tags:
Comment:
MobileRedirect: Merging in werdnas changes from r83579 to trunk version of the script
Modified paths:
  • /trunk/extensions/WikimediaMobile/MobileRedirect.js (modified) (history)

Diff [purge]

Index: trunk/extensions/WikimediaMobile/MobileRedirect.js
@@ -8,12 +8,10 @@
99 if ( /(iPhone|iPod|Android.*Mobile|webOS|NetFront|Opera Mini|SEMC-Browser|PlayStation Portable|Nintendo Wii|BlackBerry)/
1010 .test( navigator.userAgent ) )
1111 {
12 -
1312 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!
14 - && (wgNamespaceNumber >= 0) // Don't redirect special pages
15 - && (wgAction == "view")) // Don't redirect URLs that aren't simple page views
 13+ && (!document.getElementsByClassName || document.getElementsByClassName( 'ns--1' ).length == 0)
 14+ && (document.location.href.indexOf( 'action=' ) == -1 || document.location.href.indexOf( 'action=view' ) != -1 )) // Don't redirect URLs that aren't simple page views
1615 {
17 -
1816 // If we've made it here, then we are going ahead with the redirect
1917
2018 // If we are NOT on the main page, then set the pageName!

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r835791.17wmf1: Live hack for mobile redirect script: wg* variables aren't availabl...catrope11:54, 9 March 2011

Status & tagging log