diff --git a/js/app/directives/credentialfield.js b/js/app/directives/credentialfield.js index 44a6c276..c0a9490e 100644 --- a/js/app/directives/credentialfield.js +++ b/js/app/directives/credentialfield.js @@ -36,7 +36,8 @@ value: '=value', secret: '=secret', inputField: '=useInput', - inputFieldplaceholder: '=inputPlaceholder' + inputFieldplaceholder: '=inputPlaceholder', + isURLFIELD: '=url', }, restrict: 'A', replace: 'true', @@ -49,8 +50,9 @@ '' + '
' + '
' + - '
' + - '
' + + '
' + + '
' + + '
' + '
', link: function (scope) { var expression = /(https?:\/\/(?:www\.|(?!www))[^\s\.]+\.[^\s]{2,}|www\.[^\s]+\.[^\s]{2,})/gi; @@ -67,10 +69,13 @@ } if (regex.test(scope.value)) { scope.isLink = true; - if(scope.value.substr(0,4) !== 'http'){ - scope.value = 'http://'+scope.value; + } else { + 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 0a7df654..7ffa8672 100644 --- a/templates/views/partials/credential_template.html +++ b/templates/views/partials/credential_template.html @@ -1,8 +1,9 @@
{{ 'label' | translate }}
-
+
+ +
@@ -12,42 +13,46 @@
{{ 'account' | translate }}
-
+
+ +
{{ 'password' | translate }}
- - - +
{{'otp' | translate}}
-
+
+ +
{{'email' | translate}}
-
+
+ +
{{ 'url' | translate}}
-
+
+ +
{{'notes' | translate}}
-
+
+ +