mirror of
http://git.whoc.org.uk/git/password-manager.git
synced 2024-11-14 18:09:03 +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;
|
font-size: 15pt;
|
||||||
margin: 6px;
|
margin: 6px;
|
||||||
cursor: default; }
|
cursor: default; }
|
||||||
|
.content .cardField .fieldAction span.action.URL {
|
||||||
|
cursor: pointer; }
|
||||||
.content .cardField .fieldAction span.action.PASSWORD {
|
.content .cardField .fieldAction span.action.PASSWORD {
|
||||||
cursor: pointer; }
|
cursor: pointer; }
|
||||||
.content .cardField .fieldAction span.action.PASSWORD.active {
|
.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) {
|
handleFieldAction: function (aField) {
|
||||||
var result;
|
var result;
|
||||||
|
|
||||||
if (aField['actionType'] == 'PASSWORD') {
|
if (aField['actionType'] == 'PASSWORD') {
|
||||||
result = this.handlePasswordFieldAction(aField);
|
result = this.handlePasswordFieldAction(aField);
|
||||||
// } else if (aField['actionType'] == 'URL') {
|
} else if (aField['actionType'] == 'URL') {
|
||||||
|
result = this.handleLinkFieldAction(aField);
|
||||||
} else {
|
} else {
|
||||||
result = MochiKit.Base.noop;
|
result = MochiKit.Base.noop;
|
||||||
};
|
};
|
||||||
|
@ -508,6 +508,10 @@ $cardViewBasePadding: 10px;
|
|||||||
|
|
||||||
cursor: default;
|
cursor: default;
|
||||||
|
|
||||||
|
&.URL {
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
&.PASSWORD {
|
&.PASSWORD {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user