r40349 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r40348‎ | r40349 | r40350 >
Date:00:18, 3 September 2008
Author:simetrical
Status:old
Tags:
Comment:
Style: use local variable, use else if
Modified paths:
  • /trunk/phase3/skins/common/wikibits.js (modified) (history)

Diff [purge]

Index: trunk/phase3/skins/common/wikibits.js
@@ -606,17 +606,17 @@
607607 }
608608 }
609609
610 - sortfn = ts_sort_caseinsensitive;
 610+ var sortfn = ts_sort_caseinsensitive;
611611 if (itm.match(/^\d\d[\/. -][a-zA-Z]{3}[\/. -]\d\d\d\d$/))
612612 sortfn = ts_sort_date;
613 - if (itm.match(/^\d\d[\/.-]\d\d[\/.-]\d\d\d\d$/))
 613+ else if (itm.match(/^\d\d[\/.-]\d\d[\/.-]\d\d\d\d$/))
614614 sortfn = ts_sort_date;
615 - if (itm.match(/^\d\d[\/.-]\d\d[\/.-]\d\d$/))
 615+ else if (itm.match(/^\d\d[\/.-]\d\d[\/.-]\d\d$/))
616616 sortfn = ts_sort_date;
617617 // pound dollar euro yen currency cents
618 - if (itm.match(/(^[\u00a3$\u20ac\u00a4\u00a5]|\u00a2$)/))
 618+ else if (itm.match(/(^[\u00a3$\u20ac\u00a4\u00a5]|\u00a2$)/))
619619 sortfn = ts_sort_currency;
620 - if (itm.match(/^[\d.,eE+-]+\%?$/))
 620+ else if (itm.match(/^[\d.,eE+-]+\%?$/))
621621 sortfn = ts_sort_numeric;
622622
623623 var reverse = (span.getAttribute("sortdir") == 'down');