summaryrefslogtreecommitdiffstats
path: root/SdncReports/SdncReportsApi/src/main/webapp/node_modules/ng-ip-address/ngIpAddress.min.js
diff options
context:
space:
mode:
authorSoumendu Sekhar Acharya <sa00498080@techmahindra.com>2018-08-01 17:21:15 +0530
committerSoumendu Sekhar Acharya <SA00498080@techmahindra.com>2018-08-24 12:55:16 +0000
commit929c1f13697f338245571694beb73adbd39a5b78 (patch)
tree4ece0941e34c012407565aa01b34235be93688ad /SdncReports/SdncReportsApi/src/main/webapp/node_modules/ng-ip-address/ngIpAddress.min.js
parentcc49cb7753ff820dada996ab1d56263243630395 (diff)
SDN-C support&provide network layer tests Using IP
SDNC-252,SDNC-253,SDNC-264,SDNC-266 are added as part of this story Change-Id: Ic65ca32c4786fac1be9269dbc6a2162b433f0630 Issue-ID: SDNC-264 Signed-off-by: Soumendu Sekhar Acharya <sa00498080@techmahindra.com> Former-commit-id: d90280efcad173fd2250b8e2e98cb8f480007657
Diffstat (limited to 'SdncReports/SdncReportsApi/src/main/webapp/node_modules/ng-ip-address/ngIpAddress.min.js')
-rw-r--r--SdncReports/SdncReportsApi/src/main/webapp/node_modules/ng-ip-address/ngIpAddress.min.js1
1 files changed, 1 insertions, 0 deletions
diff --git a/SdncReports/SdncReportsApi/src/main/webapp/node_modules/ng-ip-address/ngIpAddress.min.js b/SdncReports/SdncReportsApi/src/main/webapp/node_modules/ng-ip-address/ngIpAddress.min.js
new file mode 100644
index 00000000..fa1a0208
--- /dev/null
+++ b/SdncReports/SdncReportsApi/src/main/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