From: Krinkle Date: Sun, 6 Mar 2011 14:34:10 +0000 (+0000) Subject: Fixed (bug 27652) [jQuery.client] versionBase is wrong for versions higher with two... X-Git-Tag: 1.31.0-rc.0~31608 X-Git-Url: http://git.cyclocoop.org/%22%2C%20generer_url_ecrire%28?a=commitdiff_plain;h=a832f9f450e24e130ae635cfc2b96579bd856265;p=lhc%2Fweb%2Fwiklou.git 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) --- diff --git a/resources/jquery/jquery.client.js b/resources/jquery/jquery.client.js index 95407c9483..42e515c3f6 100644 --- a/resources/jquery/jquery.client.js +++ b/resources/jquery/jquery.client.js @@ -125,6 +125,7 @@ $.client = new ( function() { if ( name === 'opera' && version >= 9.8) { version = userAgent.match( /version\/([0-9\.]*)/i )[1] || 10; } + var versionNumber = parseFloat( version, 10 ) || 0.0; /* Caching */ @@ -134,8 +135,8 @@ $.client = new ( function() { 'layoutVersion': layoutversion, 'platform': platform, 'version': version, - 'versionBase': ( version !== x ? new String( version ).substr( 0, 1 ) : x ), - 'versionNumber': ( parseFloat( version, 10 ) || 0.0 ) + 'versionBase': ( version !== x ? Math.floor( versionNumber ).toString() : x ), + 'versionNumber': versionNumber }; } return profile; @@ -191,7 +192,7 @@ $.client = new ( function() { } } return true; - } + }; } )(); $( document ).ready( function() {