Add angular-tld and its dependencies
This commit is contained in:
28
webadmin/src/3rdparty/js/angular-tld.js
vendored
Normal file
28
webadmin/src/3rdparty/js/angular-tld.js
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
angular.module('ngTld', [])
|
||||
.factory('ngTld', ngTld)
|
||||
.directive('checkTld', checkTld);
|
||||
|
||||
function ngTld() {
|
||||
var tldExists = function($path) {
|
||||
return tld.tldExists($path.$viewValue);
|
||||
}
|
||||
|
||||
return {
|
||||
tldExists: tldExists,
|
||||
}
|
||||
}
|
||||
|
||||
function checkTld(ngTld) {
|
||||
return {
|
||||
restrict: 'A',
|
||||
require: 'ngModel',
|
||||
link: function(scope, element, attr, ngModel) {
|
||||
ngModel.$validators.invalidTld = function(modelValue, viewValue) {
|
||||
var status = true;
|
||||
status = ngTld.tldExists(ngModel);
|
||||
return status;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
1913
webadmin/src/3rdparty/js/tld.js
vendored
Normal file
1913
webadmin/src/3rdparty/js/tld.js
vendored
Normal file
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user