r83383 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r83382‎ | r83383 | r83384 >
Date:14:34, 6 March 2011
Author:krinkle
Status:ok
Tags:
Comment:
Fixed (bug 27652) [jQuery.client] versionBase is wrong for versions higher with two or more digits
* A userAgent like the following:
> "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_8; nl-nl) AppleWebKit/533.19.4 (KHTML, like Gecko) Version/5.0.3 Safari/533.19.4"
Will now have a versionBase of "10" instead of "1".
* A few JSHint warnings fixed (missing semicolon)
Modified paths:
  • /trunk/phase3/resources/jquery/jquery.client.js (modified) (history)

Diff [purge]

Index: trunk/phase3/resources/jquery/jquery.client.js
@@ -125,6 +125,7 @@
126126 if ( name === 'opera' && version >= 9.8) {
127127 version = userAgent.match( /version\/([0-9\.]*)/i )[1] || 10;
128128 }
 129+ var versionNumber = parseFloat( version, 10 ) || 0.0;
129130
130131 /* Caching */
131132
@@ -134,8 +135,8 @@
135136 'layoutVersion': layoutversion,
136137 'platform': platform,
137138 'version': version,
138 - 'versionBase': ( version !== x ? new String( version ).substr( 0, 1 ) : x ),
139 - 'versionNumber': ( parseFloat( version, 10 ) || 0.0 )
 139+ 'versionBase': ( version !== x ? Math.floor( versionNumber ).toString() : x ),
 140+ 'versionNumber': versionNumber
140141 };
141142 }
142143 return profile;
@@ -191,7 +192,7 @@
192193 }
193194 }
194195 return true;
195 - }
 196+ };
196197 } )();
197198
198199 $( document ).ready( function() {

Follow-up revisions

RevisionCommit summaryAuthorDate
r91415jquery.client unit testing...krinkle19:11, 4 July 2011

Status & tagging log