aboutsummaryrefslogtreecommitdiffstats
path: root/SDNC-GUI-253/webapp/node_modules/ng-ip-address/ngIpAddress.min.js
diff options
context:
space:
mode:
Diffstat (limited to 'SDNC-GUI-253/webapp/node_modules/ng-ip-address/ngIpAddress.min.js')
-rw-r--r--SDNC-GUI-253/webapp/node_modules/ng-ip-address/ngIpAddress.min.js1
1 files changed, 1 insertions, 0 deletions
diff --git a/SDNC-GUI-253/webapp/node_modules/ng-ip-address/ngIpAddress.min.js b/SDNC-GUI-253/webapp/node_modules/ng-ip-address/ngIpAddress.min.js
new file mode 100644
index 0000000..fa1a020
--- /dev/null
+++ b/SDNC-GUI-253/webapp/node_modules/ng-ip-address/ngIpAddress.min.js
@@ -0,0 +1 @@
+!function(){"use strict";angular.module("ng-ip-address",[]).directive("ngIpAddress",function(){return{restrict:"A",require:"?ngModel",scope:{config:"=?ngIpConfig"},link:function(e,i,n,r){function t(e){return!isNaN(parseFloat(e))&&isFinite(e)}if(r){var l=!1,c=!1,s=new RegExp("^0","g"),a=new RegExp("^\\.","g"),o=new RegExp("\\.\\.+","g"),h=new RegExp(":","g"),u=new RegExp("^:","g"),p=0,w=!1;e.$watchCollection("config",function(e){e?(c="boolean"==typeof e.requirePort&&e.requirePort,l=c||"boolean"==typeof e.allowPort&&e.allowPort):(l=!1,c=!1),l||!r.$viewValue?r.$parsers[0](r.$viewValue):r.$setViewValue(r.$viewValue.replace(h,""))}),i.bind("keydown",function(e){17!==e.which&&91!==e.which||(w=!0)}),i.bind("keyup",function(e){17!==e.which&&91!==e.which||(w=!1)}),i.bind("keypress",function(e){(e.which<46&&0!==e.which&&8!==e.which&&13!==e.which||47===e.which||58===e.which&&!l||e.which>58&&(!w||99!==e.which&&118!==e.which&&120!==e.which))&&e.preventDefault()}),r.$parsers.push(function(e){if(!e)return r.$setValidity("ipAddress",!0),e;p=i[0].selectionStart;var n=!0,w=null,g=(e=(e=e.replace(a,"")).replace(o,".")).split("."),f=g.length;f<4?n=!1:f>4&&(g.length=4,f=4);for(var d=0;d<f;d++){var $=g[d];if(l)if(d<3)$=$.replace(h,"");else if(-1!==($=$.replace(u,"")).indexOf(":")){var v=$.split(":");$=v[0],(!(w=v[1].replace(s,"").substring(0,5))||!t($)||w>65535)&&(n=!1)}else c&&(n=!1);$.length>1?(!t($=$.replace(s,"").substring(0,3))||$>255)&&(n=!1):$||(n=!1),g[d]=$}return e=g.join("."),null!==w&&(e+=":"+w),r.$setValidity("ipAddress",n),r.$setViewValue(e),r.$render(),i[0].setSelectionRange(p,p),e})}}}})}(); \ No newline at end of file