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:
parent
bf3ec41e1b
commit
40d20bb3ac
@ -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
@ -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;
|
||||
};
|
||||
|
@ -508,6 +508,10 @@ $cardViewBasePadding: 10px;
|
||||
|
||||
cursor: default;
|
||||
|
||||
&.URL {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
&.PASSWORD {
|
||||
cursor: pointer;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user