|
Lines 493-496
jQuery.extend( jQuery.fn.dataTableExt.oSort, {
Link Here
|
| 493 |
"title-string-desc": function ( a, b ) { |
493 |
"title-string-desc": function ( a, b ) { |
| 494 |
return ((a < b) ? 1 : ((a > b) ? -1 : 0)); |
494 |
return ((a < b) ? 1 : ((a > b) ? -1 : 0)); |
| 495 |
} |
495 |
} |
| 496 |
} ); |
496 |
} ); |
|
|
497 |
/* Plugin to allow sorting by removing prefix between NSB and NSE characters |
| 498 |
* |
| 499 |
* Ex: "\x88The \x89Lord of the rings" sorted with "L" |
| 500 |
* Mainly used in BNF catalogue |
| 501 |
* |
| 502 |
* In DataTables config: |
| 503 |
* "aoColumns": [ |
| 504 |
* { "sType": "nsb-nse" }, |
| 505 |
* ] |
| 506 |
*/ |
| 507 |
jQuery.extend( jQuery.fn.dataTableExt.oSort, { |
| 508 |
"nsb-nse-pre": function ( a ) { |
| 509 |
var pattern = new RegExp("\x88.*\x89"); |
| 510 |
return a.replace(pattern, "").toLowerCase(); |
| 511 |
}, |
| 512 |
"nsb-nse-asc": function ( a, b ) { |
| 513 |
return jQuery.fn.dataTableExt.oSort['string-asc'](a, b); |
| 514 |
}, |
| 515 |
"nsb-nse-desc": function ( a, b ) { |
| 516 |
return jQuery.fn.dataTableExt.oSort['string-desc'](a, b); |
| 517 |
} |
| 518 |
} ); |
| 519 |
|