1
0
mirror of http://git.whoc.org.uk/git/password-manager.git synced 2024-11-14 07:39:02 +01:00

Added url field action handler

This commit is contained in:
Giulio Cesare Solaroli 2015-03-23 00:29:51 +01:00
parent bf3ec41e1b
commit 40d20bb3ac
No known key found for this signature in database
GPG Key ID: 22E34C908F02CBA2
4 changed files with 22 additions and 2 deletions

View File

@ -2441,6 +2441,8 @@ div.cardList.narrow {
font-size: 15pt;
margin: 6px;
cursor: default; }
.content .cardField .fieldAction span.action.URL {
cursor: pointer; }
.content .cardField .fieldAction span.action.PASSWORD {
cursor: pointer; }
.content .cardField .fieldAction span.action.PASSWORD.active {

File diff suppressed because one or more lines are too long

View File

@ -66,12 +66,26 @@ Clipperz.PM.UI.Components.Cards.View = React.createClass({
};
},
handleLinkFieldAction: function (aField) {
return function () {
var url;
url = aField['value'];
if (/^https?\:\/\//.test(url) == false) {
url = 'http://' + url;
}
window.open(url);
}
},
handleFieldAction: function (aField) {
var result;
if (aField['actionType'] == 'PASSWORD') {
result = this.handlePasswordFieldAction(aField);
// } else if (aField['actionType'] == 'URL') {
} else if (aField['actionType'] == 'URL') {
result = this.handleLinkFieldAction(aField);
} else {
result = MochiKit.Base.noop;
};

View File

@ -508,6 +508,10 @@ $cardViewBasePadding: 10px;
cursor: default;
&.URL {
cursor: pointer;
}
&.PASSWORD {
cursor: pointer;