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