Web edits
[beagleboard.org.git] / static / dataTables.titleSort.js
blobd50afac4ed69ba198876628b5674d30c8b52909f
1 jQuery.extend( jQuery.fn.dataTableExt.oSort, {
2     "title-string-pre": function ( a ) {
3         var retThis = a.match(/title="(.*?)"/)
4         if (typeof(retThis) != "undefined" && retThis != null)
5         return retThis[1].toLowerCase();
6         else
7          return $(a).prop("title").toLowerCase();
8     },
9  
10     "title-string-asc": function ( a, b ) {
11         return ((a < b) ? -1 : ((a > b) ? 1 : 0));
12     },
14     "title-string-desc": function ( a, b ) {
15         return ((a < b) ? 1 : ((a > b) ? -1 : 0));
16     }
17 } );
20 jQuery.extend( jQuery.fn.dataTableExt.oSort, {
21     "title-numeric-pre": function ( a ) {
22         var x = a.match(/title="*(-?[0-9\.]+)/)[1];
23         return parseFloat( x );
24     },
26     "title-numeric-asc": function ( a, b ) {
27         return ((a < b) ? -1 : ((a > b) ? 1 : 0));
28     },
30     "title-numeric-desc": function ( a, b ) {
31         return ((a < b) ? 1 : ((a > b) ? -1 : 0));
32     }
33 } );