r40382 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r40381‎ | r40382 | r40383 >
Date:14:02, 3 September 2008
Author:simetrical
Status:old
Tags:
Comment:
Fix for r40379, allow commas again
Modified paths:
  • /trunk/phase3/skins/common/wikibits.js (modified) (history)

Diff [purge]

Index: trunk/phase3/skins/common/wikibits.js
@@ -618,9 +618,9 @@
619619 sortfn = ts_sort_currency;
620620 // We allow a trailing percent sign, which we just strip. This works fine
621621 // if percents and regular numbers aren't being mixed.
622 - else if (itm.match(/^[+-]?[0-9]+(\.[0-9]*)?([eE][+-]?[0-9]+)?\%?$/) ||
623 - itm.match(/^[+-]?\.[0-9]+([eE][+-]?[0-9]+)?\%?$/) ||
624 - itm.match(/^0[xX][0-9a-fA-F]+$/))
 622+ else if (itm.match(/^[+-]?[\d,]+(\.[\d,]*)?([eE][+-]?[\d,]+)?\%?$/) ||
 623+ itm.match(/^[+-]?\.[\d,]+([eE][+-]?[\d,]+)?\%?$/) ||
 624+ itm.match(/^0x[\da-f]+$/i))
625625 sortfn = ts_sort_numeric;
626626
627627 var reverse = (span.getAttribute("sortdir") == 'down');

Follow-up revisions

RevisionCommit summaryAuthorDate
r40611"," should not be sorted as a number...simetrical16:00, 8 September 2008

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r40379Use ECMAScript standard, section 9.3, to decide what's a number...simetrical13:45, 3 September 2008