r83161 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r83160‎ | r83161 | r83162 >
Date:19:17, 3 March 2011
Author:tomasz
Status:deferred
Tags:
Comment:
Syncing up to head of trunk from 83113
Modified paths:
  • /branches/wmf/1.17wmf1/extensions/WikimediaMobile (modified) (history)
  • /branches/wmf/1.17wmf1/extensions/WikimediaMobile/MobileRedirect.js (modified) (history)
  • /branches/wmf/1.17wmf1/extensions/WikimediaMobile/WikimediaMobile.php (modified) (history)
  • /branches/wmf/1.17wmf1/extensions/WikimediaMobile/redirector_test.js (modified) (history)

Diff [purge]

Index: branches/wmf/1.17wmf1/extensions/WikimediaMobile/WikimediaMobile.php
@@ -19,7 +19,7 @@
2020 /**
2121 * Increment this when the JS file changes
2222 */
23 -$wgWikimediaMobileVersion = '3';
 23+$wgWikimediaMobileVersion = '4';
2424
2525 /**
2626 * The base URL of the mobile gateway
Index: branches/wmf/1.17wmf1/extensions/WikimediaMobile/MobileRedirect.js
@@ -9,17 +9,18 @@
1010 .test( navigator.userAgent ) )
1111 {
1212
13 - if ( (document.cookie.indexOf("eRedirect=t") < 0) // Don't redirect if we have the stop cookie ... only testing a subportion of the cookie. Should be REALLY unique!
 13+ 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!
1414 && (wgNamespaceNumber >= 0) // Don't redirect special pages
1515 && (wgAction == "view")) // Don't redirect URLs that aren't simple page views
1616 {
 17+
1718 // If we've made it here, then we are going ahead with the redirect
18 - var url = wgWikimediaMobileUrl;
 19+
1920 // If we are NOT on the main page, then set the pageName!
2021 if (wgPageName != wgMainPageTitle.replace(/ /g, '_')) {
21 - url += '/' + encodeURI(wgPageName);
 22+ wgWikimediaMobileUrl += '/' + encodeURI(wgPageName);
2223 }
2324
24 - document.location = url;
 25+ document.location = wgWikimediaMobileUrl;
2526 }
2627 }
Index: branches/wmf/1.17wmf1/extensions/WikimediaMobile/redirector_test.js
@@ -48,7 +48,7 @@
4949
5050 if(((document.location != null) && (document.location.length > 0)) == shouldRedirect) {
5151 if(options.should_redirect_to && (document.location != options.should_redirect_to)) {
52 - print("Should have been redirect to " + options.should_redirect_to)
 52+ print("Should have been redirected to " + options.should_redirect_to)
5353 print("Instead was sent to " + document.location)
5454 for(key in options)
5555 {
@@ -137,6 +137,9 @@
138138 // Android Tablet
139139 shouldIgnore({user_agent: "Mozilla/5.0 (Linux; U; Android 2.2.1; en-us; device Build/FRG83) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Safari/533.1"});
140140
 141+ shouldIgnore({user_agent: "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0; SLCC2; Media Center PC 6.0; InfoPath.3; MS-RTC LM 8; Zune 4.7"});
 142+ shouldIgnore({user_agent: "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Win64; x64; Trident/5.0"})
 143+
141144 // Fake test strings
142145
143146 // Android, but only with Mobile
Property changes on: branches/wmf/1.17wmf1/extensions/WikimediaMobile
___________________________________________________________________
Modified: svn:mergeinfo
144147 Merged /trunk/extensions/WikimediaMobile:r83114-83159

Status & tagging log