Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/passman.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/js/app
diff options
context:
space:
mode:
authorfnuesse <felix.nuesse@t-online.de>2019-05-12 20:09:49 +0300
committerfnuesse <felix.nuesse@t-online.de>2019-05-12 20:09:49 +0300
commit20e2b514b89d4044a54ab3d78cba15df396440be (patch)
treec2f1eafa25b6e3d4a335484236c93d6dd3df4726 /js/app
parent3f6d7c76dff4b20e9387c84a7dd4bbe1d4937d56 (diff)
parenta765f32aa0df1e14510c4c012f8cf9b4aee9b741 (diff)
Merge remote-tracking branch 'origin/master' into master16.3
Diffstat (limited to 'js/app')
-rw-r--r--js/app/directives/credentialfield.js15
1 files changed, 10 insertions, 5 deletions
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 @@
'</div>' +
'<div class="tools">' +
'<div class="cell" ng-if="toggle" tooltip="tggltxt" ng-click="toggleVisibility()"><i class="fa" ng-class="{\'fa-eye\': !valueVisible, \'fa-eye-slash\': valueVisible }"></i></div>' +
- '<div class="cell" ng-if="isLink"><a ng-href="{{value}}" target="_blank" rel="nofollow noopener noreferrer"><i tooltip="\'Open in new window\'" class="link fa fa-external-link"></i></a></div>' +
- '<div class="cell" ngclipboard-success="onSuccess(e);" ngclipboard-error="onError(e);" ngclipboard data-clipboard-text="{{value}}"><i tooltip="copy_msg" class="fa fa-files-o"></i></div>' +
+ '<div class="cell" ng-if="isURLFIELD && isLink"><a ng-href="{{value}}" target="_blank" rel="nofollow noopener noreferrer"><i tooltip="\'Open in new window\'" class="link fa fa-external-link"></i></a></div>' +
+ '<div class="cell" ng-if="isURLFIELD && isPartialLink"><a ng-href="//{{value}}" target="_blank" rel="nofollow noopener noreferrer"><i tooltip="\'Open in new window\'" class="link fa fa-external-link"></i></a></div>' +
+ '<div class="cell" ngclipboard-success="onSuccess(e);" ngclipboard-error="onError(e);" ngclipboard data-clipboard-text="{{value}}"><i tooltip="copy_msg" class="fa fa-files-o"></i></div>' +
'</div></span>',
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) {