diff --git a/js/app/directives/credentialfield.js b/js/app/directives/credentialfield.js index feb54fd0..1812c64b 100644 --- a/js/app/directives/credentialfield.js +++ b/js/app/directives/credentialfield.js @@ -50,11 +50,12 @@ '' + '
' + '
' + - '
' + - '
' + + '
' + + '
' + + '
' + '
', link: function (scope) { - var expression = /(https?:\/\/(?:www\.|(?!www))[^\s\.]+\.[^\s]{2,}|www\.[^\s]+\.[^\s]{2,})/gi; + var expression = /(https?:\/\/(?:www\.|(?!www))[^\s\.]+\.[^\s]{2,}|www\.[^\s]+\.[^\s]{2,})/gi; var regex = new RegExp(expression); $translate(['toggle.visibility','copy.field', 'copy', 'copied']).then(function (translations) { scope.tggltxt = translations['toggle.visibility']; @@ -68,16 +69,13 @@ } if (regex.test(scope.value)) { scope.isLink = true; - } else if (regex.test('http://'+scope.value) && scope.isURL){ - //This part is added to check if the user did not add http or https to the url and match it nonetheless - scope.isLink = true; } else { - scope.isLink = false; - } - if(scope.value.substr(0,4) !== 'http'){ - var val = scope.value; - scope.value =val.substr(val.indexOf("://")+3,val.length); + scope.isLink = false; + if(regex.test('https://'+scope.value)){ + scope.isPartialLink = true; + } } + } }); if (!scope.toggle) { diff --git a/templates/views/partials/credential_template.html b/templates/views/partials/credential_template.html index 4defeb17..5f7c4ac5 100644 --- a/templates/views/partials/credential_template.html +++ b/templates/views/partials/credential_template.html @@ -1,47 +1,53 @@
{{ 'label' | translate }}
-
+
+ +
{{ 'account' | translate }}
-
+
+ +
{{ 'password' | translate }}
- - - +
{{'otp' | translate}}
-
+
+ +
{{'email' | translate}}
-
+
+ +
{{ 'url' | translate}}
-
+
+ +
{{'notes' | translate}}
-
+
+ +