summaryrefslogtreecommitdiffstats
path: root/SdncReports/SdncReportsApi/src/main/webapp/node_modules/ng-ip-address/ngIpAddress.vanilla.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.vanilla.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.vanilla.min.js')
-rw-r--r--SdncReports/SdncReportsApi/src/main/webapp/node_modules/ng-ip-address/ngIpAddress.vanilla.min.js1
1 files changed, 1 insertions, 0 deletions
diff --git a/SdncReports/SdncReportsApi/src/main/webapp/node_modules/ng-ip-address/ngIpAddress.vanilla.min.js b/SdncReports/SdncReportsApi/src/main/webapp/node_modules/ng-ip-address/ngIpAddress.vanilla.min.js
new file mode 100644
index 00000000..5c1f0dd2
--- /dev/null
+++ b/SdncReports/SdncReportsApi/src/main/webapp/node_modules/ng-ip-address/ngIpAddress.vanilla.min.js
@@ -0,0 +1 @@
+!function(){"use strict";angular.module("ng-ip-address",[]).directive("ngIpAddress",function(){return{restrict:"A",require:"?ngModel",link:function(e,i,n,r){function t(e){return!isNaN(parseFloat(e))&&isFinite(e)}if(r){var h=new RegExp("^0","g"),c=new RegExp("^\\.","g"),s=new RegExp("\\.\\.+","g"),u=0,a=!1;i.bind("keydown",function(e){17!==e.which&&91!==e.which||(a=!0)}),i.bind("keyup",function(e){17!==e.which&&91!==e.which||(a=!1)}),i.bind("keypress",function(e){(e.which<46&&0!==e.which&&8!==e.which&&13!==e.which||47===e.which||e.which>57&&(!a||99!==e.which&&118!==e.which&&120!==e.which))&&e.preventDefault()}),r.$parsers.push(function(e){if(!e)return r.$setValidity("ipAddress",!0),e;u=i[0].selectionStart;var n=!0,a=(e=(e=e.replace(c,"")).replace(s,".")).split("."),d=a.length;d<4?n=!1:d>4&&(a.length=4,d=4);for(var l=0;l<d;l++){var w=a[l];w.length>1?(!t(w=w.replace(h,"").substring(0,3))||w>255)&&(n=!1):w||(n=!1),a[l]=w}return e=a.join("."),r.$setValidity("ipAddress",n),r.$setViewValue(e),r.$render(),i[0].setSelectionRange(u,u),e})}}}})}(); \ No newline at end of file