1
0
mirror of http://git.whoc.org.uk/git/password-manager.git synced 2025-10-29 18:37:35 +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
4 changed files with 22 additions and 2 deletions

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;
};