aboutsummaryrefslogtreecommitdiffstats
path: root/lang/js/DemoExtension/maindemo.js
diff options
context:
space:
mode:
authorMaximilian Krambach <[email protected]>2018-06-13 13:22:03 +0000
committerMaximilian Krambach <[email protected]>2018-06-13 13:22:03 +0000
commitaed402c5d572b60246f1f8e57ae269f8c91b0b7c (patch)
treedb92714ef1e5f2b9aafa819db5f9fd3c7dd45187 /lang/js/DemoExtension/maindemo.js
parentjs: less confusing icons for test/Demo extension (diff)
downloadgpgme-aed402c5d572b60246f1f8e57ae269f8c91b0b7c.tar.gz
gpgme-aed402c5d572b60246f1f8e57ae269f8c91b0b7c.zip
js: getDefaultKey and verify fix
-- * DemoExtension/maindemo.js - added a Demo for retrieving the default signing key * src/Errors.js - add a new Error if no default key can be determined * src/Key.js added documentation and a TODO marker for hasSecret. * src/Keyring.js implemented getDefaultKey * src/permittedOperations.js: Added missing entry for verify, added config_opt
Diffstat (limited to 'lang/js/DemoExtension/maindemo.js')
-rw-r--r--lang/js/DemoExtension/maindemo.js14
1 files changed, 12 insertions, 2 deletions
diff --git a/lang/js/DemoExtension/maindemo.js b/lang/js/DemoExtension/maindemo.js
index 5cde1ce8..67b811f6 100644
--- a/lang/js/DemoExtension/maindemo.js
+++ b/lang/js/DemoExtension/maindemo.js
@@ -36,7 +36,7 @@ document.addEventListener('DOMContentLoaded', function() {
'answer').value = answer.data;
}
}, function(errormsg){
- alert( errormsg.code + ' ' + errormsg.msg);
+ alert( errormsg.message);
});
});
@@ -50,8 +50,18 @@ document.addEventListener('DOMContentLoaded', function() {
'answer').value = answer.data;
}
}, function(errormsg){
- alert( errormsg.code + ' ' + errormsg.msg);
+ alert(errormsg.message);
});
});
+
+ document.getElementById('getdefaultkey').addEventListener('click',
+ function(){
+ gpgmejs.Keyring.getDefaultKey().then(function(answer){
+ document.getElementById('defaultkey').innerHtml =
+ answer.fingerprint;
+ }, function(errormsg){
+ alert(errormsg.message);
+ });
+ });
});
});