http://www.mediawiki.org/wiki/Special:Code/MediaWiki/90630
Revision: 90630
Author: brion
Date: 2011-06-22 23:19:00 +0000 (Wed, 22 Jun 2011)
Log Message:
-----------
Followup r86088, r87244, r90612: fix jquery.tablesorter for null collation
table on IE
Attempt to build a regex from an empty list failed when calling new RegEx('[]',
'ig') on IE 6/7/8.
Now allowing null for the object, and also not trying to create the regex even
if we have an empty object just in case.
Modified Paths:
--------------
trunk/phase3/resources/jquery/jquery.tablesorter.js
Modified: trunk/phase3/resources/jquery/jquery.tablesorter.js
===================================================================
--- trunk/phase3/resources/jquery/jquery.tablesorter.js 2011-06-22 23:12:05 UTC
(rev 90629)
+++ trunk/phase3/resources/jquery/jquery.tablesorter.js 2011-06-22 23:19:00 UTC
(rev 90630)
@@ -421,7 +421,7 @@
// We allow a trailing percent sign, which we
just strip. This works fine
// if percents and regular numbers aren't being
mixed.
ts.numberRegex = new RegExp("^(" +
"[-+\u2212]?[0-9][0-9,]*(\\.[0-9,]*)?(E[-+\u2212]?[0-9][0-9,]*)?" + //
Fortran-style scientific
- "|" + "[-+\u2212]?" + digitClass +
"+[\\s\\xa0]*%?" + // Generic localised
+ "|" + "[-+\u2212]?" + digitClass + "+[\\s]*%?"
+ // Generic localised
")$", "i");
}
@@ -470,16 +470,19 @@
function buildCollationTable() {
ts.collationTable =
mw.config.get('tableSorterCollation');
- if ( typeof ts.collationTable === "object" ) {
- ts.collationRegex = [];
+ ts.collationRegex = null;
+ if ( ts.collationTable ) {
+ var keys = [];
//Build array of key names
for ( var key in ts.collationTable ) {
if (
ts.collationTable.hasOwnProperty(key) ) { //to be safe
-
ts.collationRegex.push(key);
+ keys.push(key);
}
}
- ts.collationRegex = new RegExp( '[' +
ts.collationRegex.join('') + ']', 'ig' );
+ if (keys.length) {
+ ts.collationRegex = new RegExp(
'[' + ts.collationRegex.join('') + ']', 'ig' );
+ }
}
}
_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs