diff options
author | Luke Shumaker <LukeShu@sbcglobal.net> | 2013-04-23 21:57:59 -0400 |
---|---|---|
committer | Luke Shumaker <LukeShu@sbcglobal.net> | 2013-04-23 21:57:59 -0400 |
commit | 55b776d58999412cd6bf0787a41d6ab00bf80fb6 (patch) | |
tree | e6c151ee22207465346b230f92a42d75576409d1 /sitestatic | |
parent | 4578eb77da75c24f9b366c2ade46f55b0702b340 (diff) | |
parent | ac1c00ee86cc0e355af5e4e6be47ca861091356b (diff) |
Merge branch 'archweb' into archweb-generic2
Diffstat (limited to 'sitestatic')
-rw-r--r-- | sitestatic/archweb.js | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/sitestatic/archweb.js b/sitestatic/archweb.js index f7be50d8..be6f5256 100644 --- a/sitestatic/archweb.js +++ b/sitestatic/archweb.js @@ -31,6 +31,7 @@ if (typeof $ !== 'undefined' && typeof $.tablesorter !== 'undefined') { }, type: 'numeric' }); + $.tablesorter.addParser({ id: 'todostatus', is: function(s) { return false; }, @@ -44,6 +45,7 @@ if (typeof $ !== 'undefined' && typeof $.tablesorter !== 'undefined') { }, type: 'numeric' }); + $.tablesorter.addParser({ /* sorts numeric, but put '', 'unknown', and '∞' last. */ id: 'mostlydigit', @@ -60,6 +62,7 @@ if (typeof $ !== 'undefined' && typeof $.tablesorter !== 'undefined') { }, type: 'numeric' }); + $.tablesorter.addParser({ /* sorts duration; put '', 'unknown', and '∞' last. */ id: 'duration', @@ -93,6 +96,7 @@ if (typeof $ !== 'undefined' && typeof $.tablesorter !== 'undefined') { }, type: 'numeric' }); + $.tablesorter.addParser({ id: 'longDateTime', re: /^(\d{4})-(\d{2})-(\d{2}) ([012]\d):([0-5]\d)(:([0-5]\d))?( (\w+))?$/, @@ -116,6 +120,7 @@ if (typeof $ !== 'undefined' && typeof $.tablesorter !== 'undefined') { }, type: 'numeric' }); + $.tablesorter.addParser({ id: 'filesize', re: /^(\d+(?:\.\d+)?) (bytes?|[KMGTPEZY]i?B)$/, @@ -161,6 +166,17 @@ if (typeof $ !== 'undefined' && typeof $.tablesorter !== 'undefined') { }, type: 'numeric' }); + + $.tablesorter.removeParser = function(id) { + $.tablesorter.parsers = $.grep($.tablesorter.parsers, + function(ele, i) { + return ele.id !== id; + }); + }; + + // We don't use currency, and the parser is over-zealous at deciding it + // matches. Kill it from the parser selection. + $.tablesorter.removeParser('currency'); } (function($) { |