1
0
mirror of https://github.com/billz/raspap-webgui.git synced 2023-10-10 13:37:24 +02:00
raspap-webgui/bower_components/datatables-plugins/type-detection/ip-address.js
2015-02-25 14:08:14 +01:00

19 lines
411 B
JavaScript
Executable File

/**
* Automatically detect IP addresses in dot notation. Goes perfectly with the
* IP address sorting function.
*
* @name IP address detection
* @summary Detect data which is in IP address notation
* @author Brad Wasson
*/
jQuery.fn.dataTableExt.aTypes.unshift(
function ( sData )
{
if (/^\d{1,3}[\.]\d{1,3}[\.]\d{1,3}[\.]\d{1,3}$/.test(sData)) {
return 'ip-address';
}
return null;
}
);