diff --git a/js/app/directives/credentialfield.js b/js/app/directives/credentialfield.js index 02306e7c..1271c9b5 100644 --- a/js/app/directives/credentialfield.js +++ b/js/app/directives/credentialfield.js @@ -18,18 +18,29 @@ angular.module('passmanApp') replace: 'true', template: "" + '' + - '
' + + '
' + '*' + '{{value}}' + '
' + '
' + '
' + + '
' + '
' + '
', link: function (scope, elem, attrs, modelCtrl) { + var expression = /(https?:\/\/(?:www\.|(?!www))[^\s\.]+\.[^\s]{2,}|www\.[^\s]+\.[^\s]{2,})/gi; + var regex = new RegExp(expression); + scope.$watch("value", function () { - if (scope.secret) { - scope.valueVisible = false; + if(scope.value) { + if (scope.secret) { + scope.valueVisible = false; + } + if (scope.value.match(regex)) { + console.log('is link') + scope.isLink = true; + + } } }); if (!scope.toggle) {