diff --git a/webadmin/src/js/index.js b/webadmin/src/js/index.js index 462b941ab..477c68f17 100644 --- a/webadmin/src/js/index.js +++ b/webadmin/src/js/index.js @@ -470,35 +470,3 @@ app.directive('tagInput', function () { '' }; }); - -app.directive('domainValidator', function() { - return { - - // limit usage to argument only - restrict: 'A', - - // require NgModelController, i.e. require a controller of ngModel directive - require: 'ngModel', - - // create linking function and pass in our NgModelController as a 4th argument - link: function(scope, element, attr, ngModel) { - function validator(value) { - - if (value.indexOf('.cloudron.') === -1 && /^(([a-zA-Z]{1})|([a-zA-Z]{1}[a-zA-Z]{1})|([a-zA-Z]{1}[0-9]{1})|([0-9]{1}[a-zA-Z]{1})|([a-zA-Z0-9][a-zA-Z0-9-_]{1,61}[a-zA-Z0-9]))\.([a-zA-Z]{2,6}|[a-zA-Z0-9-]{2,30}\.[a-zA-Z]{2,3})$/.test(value)) { - ngModel.$setValidity('invalidDomain', true); - } else { - ngModel.$setValidity('invalidDomain', false); - } - - // we need to return our value, to be displayed to the user(value of the input) - return value ? value : undefined; - } - - //For DOM -> model validation - ngModel.$parsers.unshift(validator); - - //For model -> DOM validation - ngModel.$formatters.unshift(validator); - } - }; -}); diff --git a/webadmin/src/views/certs.html b/webadmin/src/views/certs.html index 5e094d30b..caf1fec9f 100644 --- a/webadmin/src/views/certs.html +++ b/webadmin/src/views/certs.html @@ -11,7 +11,7 @@
- +