Index: trunk/phase3/resources/jquery/jquery.tablesorter.js |
— | — | @@ -421,7 +421,7 @@ |
422 | 422 | // We allow a trailing percent sign, which we just strip. This works fine |
423 | 423 | // if percents and regular numbers aren't being mixed. |
424 | 424 | ts.numberRegex = new RegExp("^(" + "[-+\u2212]?[0-9][0-9,]*(\\.[0-9,]*)?(E[-+\u2212]?[0-9][0-9,]*)?" + // Fortran-style scientific |
425 | | - "|" + "[-+\u2212]?" + digitClass + "+[\\s\\xa0]*%?" + // Generic localised |
| 425 | + "|" + "[-+\u2212]?" + digitClass + "+[\\s]*%?" + // Generic localised |
426 | 426 | ")$", "i"); |
427 | 427 | } |
428 | 428 | |
— | — | @@ -470,16 +470,19 @@ |
471 | 471 | |
472 | 472 | function buildCollationTable() { |
473 | 473 | ts.collationTable = mw.config.get('tableSorterCollation'); |
474 | | - if ( typeof ts.collationTable === "object" ) { |
475 | | - ts.collationRegex = []; |
| 474 | + ts.collationRegex = null; |
| 475 | + if ( ts.collationTable ) { |
| 476 | + var keys = []; |
476 | 477 | |
477 | 478 | //Build array of key names |
478 | 479 | for ( var key in ts.collationTable ) { |
479 | 480 | if ( ts.collationTable.hasOwnProperty(key) ) { //to be safe |
480 | | - ts.collationRegex.push(key); |
| 481 | + keys.push(key); |
481 | 482 | } |
482 | 483 | } |
483 | | - ts.collationRegex = new RegExp( '[' + ts.collationRegex.join('') + ']', 'ig' ); |
| 484 | + if (keys.length) { |
| 485 | + ts.collationRegex = new RegExp( '[' + ts.collationRegex.join('') + ']', 'ig' ); |
| 486 | + } |
484 | 487 | } |
485 | 488 | } |
486 | 489 | |