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.0 KiB
JavaScript

/*! © SpryMedia Ltd, Dominique Fournier, Brad Wasson, Peter Vilhan, Kevin Gilkey-Graham - datatables.net/license */
!function(n){"function"==typeof define&&define.amd?define(["datatables.net"],function(e){return n(e,window,document)}):"object"==typeof exports?module.exports=function(e,t){return e=e||window,t.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,l,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("."),u=e.split(":"),o=l="",4==n.length){for(f=0;f<n.length;f++)t=n[f],l+="000".substr(t.length)+t;i&&(l+=":"+"00000".substr(i.length)+i)}else if(0<u.length){for(var s=0,f=0;f<u.length;f++)0<f&&(o+=":"),0===(t=u[f]).length?s+=0:(o+="0000".substr(t.length)+t,s+=4);var u=o.split(":"),a=0;for(f=0;f<u.length;f++)if(0===(t=u[f]).length&&0===a)for(var d=0;d<32-s;d++)l+="0",a=1;else l+=t}return l},e});