You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Plugins/sorting/absolute.min.js

2 lines
1.8 KiB
JavaScript

/*! © SpryMedia Ltd - datatables.net/license */
!function(a){var o,n;"function"==typeof define&&define.amd?define(["jquery","datatables.net"],function(e){return a(e,window,document)}):"object"==typeof exports?(o=require("jquery"),n=function(e,t){t.fn.dataTable||require("datatables.net")(e,t)},"undefined"==typeof window?module.exports=function(e,t){return e=e||window,t=t||o(e),n(e,t),a(t,0,e.document)}:(n(window,o),module.exports=a(o,window,window.document))):a(jQuery,window,document)}(function(e,t,a,r){"use strict";function o(e){Array.isArray(e)||(e=[e]);for(var o={name:"absoluteOrder"+s++,alwaysTop:{},alwaysBottom:{},asc:function(e,t,a){},desc:function(e,t,a){}},t=0,a=e.length;t<a;t++){var n=e[t];"string"==typeof n?o.alwaysTop[n]=!0:n.position===r||"top"===n.position?o.alwaysTop[n.value]=!0:o.alwaysBottom[n.value]=!0}return o.asc=function(e,t,a){return o.alwaysTop[e]&&o.alwaysTop[t]||o.alwaysBottom[e]&&o.alwaysBottom[t]?0:o.alwaysTop[e]||o.alwaysBottom[t]?-1:o.alwaysBottom[e]||o.alwaysTop[t]?1:(a&&("string"==typeof e&&(e=+e.replace(/[^\d\-\.]/g,"")),"string"==typeof t)&&(t=+t.replace(/[^\d\-\.]/g,"")),e<t?-1:t<e?1:0)},o.desc=function(e,t,a){return o.alwaysTop[e]&&o.alwaysTop[t]||o.alwaysBottom[e]&&o.alwaysBottom[t]?0:o.alwaysTop[e]||o.alwaysBottom[t]?-1:o.alwaysBottom[e]||o.alwaysTop[t]||(a&&("string"==typeof e&&(e=+e.replace(/[^\d\-\.]/g,"")),"string"==typeof t)&&(t=+t.replace(/[^\d\-\.]/g,"")),e<t)?1:t<e?-1:0},o}var n=e.fn.dataTable,s=0;return n.absoluteOrder=function(e){e=o(e);return n.ext.type.order[e.name+"-asc"]=e.asc,n.ext.type.order[e.name+"-desc"]=e.desc,e.name},n.absoluteOrderNumber=function(e){var a=o(e);return n.ext.type.order[a.name+"-asc"]=function(e,t){return a.asc(e,t,!0)},n.ext.type.order[a.name+"-desc"]=function(e,t){return a.desc(e,t,!0)},a.name},n});