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/ip-address.min.js

2 lines
1.1 KiB
JavaScript

/*! © SpryMedia Ltd, Dominique Fournier, Brad Wasson, Peter Vilhan, Kevin Gilkey-Graham - datatables.net/license */
!function(n){"function"==typeof define&&define.amd?define(["jquery","datatables.net"],function(e){return n(e,window,document)}):"object"==typeof exports?module.exports=function(e,t){return e=e||window,(t=t||("undefined"!=typeof window?require("jquery"):require("jquery")(e))).fn.dataTable||require("datatables.net")(e,t),n(t,0,e.document)}:n(jQuery,window,document)}(function(e,t,n,r){"use strict";e=e.fn.dataTable;return e.ext.order["ip-address-pre"]=function(e){var t,n,r,i,u,o;if(!e)return"000000000000";if(2==(r=(e=e.replace(/<[\s\S]*?>/g,"")).split(":")).length?(n=r[0].split("."),i=r[1]):n=e.split("."),s=e.split(":"),o=u="",4==n.length){for(f=0;f<n.length;f++)t=n[f],u+="000".substr(t.length)+t;i&&(u+=":"+"00000".substr(i.length)+i)}else if(0<s.length){for(var l=0,f=0;f<s.length;f++)0<f&&(o+=":"),0===(t=s[f]).length?l+=0:(o+="0000".substr(t.length)+t,l+=4);var s=o.split(":"),d=0;for(f=0;f<s.length;f++)if(0===(t=s[f]).length&&0===d)for(var a=0;a<32-l;a++)u+="0",d=1;else u+=t}return u},e});