Style: use local variable, use else if
authorAryeh Gregor <simetrical@users.mediawiki.org>
Wed, 3 Sep 2008 00:18:11 +0000 (00:18 +0000)
committerAryeh Gregor <simetrical@users.mediawiki.org>
Wed, 3 Sep 2008 00:18:11 +0000 (00:18 +0000)
skins/common/wikibits.js

index 4dbf5ba..9a5dc13 100644 (file)
@@ -606,17 +606,17 @@ function ts_resortTable(lnk) {
                }
        }
 
-       sortfn = ts_sort_caseinsensitive;
+       var sortfn = ts_sort_caseinsensitive;
        if (itm.match(/^\d\d[\/. -][a-zA-Z]{3}[\/. -]\d\d\d\d$/))
                sortfn = ts_sort_date;
-       if (itm.match(/^\d\d[\/.-]\d\d[\/.-]\d\d\d\d$/))
+       else if (itm.match(/^\d\d[\/.-]\d\d[\/.-]\d\d\d\d$/))
                sortfn = ts_sort_date;
-       if (itm.match(/^\d\d[\/.-]\d\d[\/.-]\d\d$/))
+       else if (itm.match(/^\d\d[\/.-]\d\d[\/.-]\d\d$/))
                sortfn = ts_sort_date;
        // pound dollar euro yen currency cents
-       if (itm.match(/(^[\u00a3$\u20ac\u00a4\u00a5]|\u00a2$)/))
+       else if (itm.match(/(^[\u00a3$\u20ac\u00a4\u00a5]|\u00a2$)/))
                sortfn = ts_sort_currency;
-       if (itm.match(/^[\d.,eE+-]+\%?$/))
+       else if (itm.match(/^[\d.,eE+-]+\%?$/))
                sortfn = ts_sort_numeric;
 
        var reverse = (span.getAttribute("sortdir") == 'down');