diff options
author | [email protected] <[email protected]> | 2018-04-10 09:33:14 +0000 |
---|---|---|
committer | Werner Koch <[email protected]> | 2018-04-10 16:47:59 +0000 |
commit | eef3a509fa5744e5f09ec8084985e6070b78226b (patch) | |
tree | d5fe58d4e50c56a2a750bac81d79266a71e5ec01 /lang/js/testapplication.js | |
parent | qt: Add test for resetting config value (diff) | |
download | gpgme-eef3a509fa5744e5f09ec8084985e6070b78226b.tar.gz gpgme-eef3a509fa5744e5f09ec8084985e6070b78226b.zip |
js: Initial commit for JavaScript Native Messaging API
--
Note this code misses all the legal boilerplate; please add this as
soon as possible and provide a DCO so we can merge it into master.
I also removed the dist/ directory because that was not source code.
Diffstat (limited to '')
-rw-r--r-- | lang/js/testapplication.js | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/lang/js/testapplication.js b/lang/js/testapplication.js new file mode 100644 index 00000000..d01aca99 --- /dev/null +++ b/lang/js/testapplication.js @@ -0,0 +1,21 @@ +/** +* Testing nativeMessaging. This is a temporary plugin using the gpgmejs + implemetation as contained in src/ +*/ +function buttonclicked(event){ + let data = document.getElementById("text0").value; + let keyId = document.getElementById("key").value; + let enc = Gpgmejs.encrypt(data, [keyId]).then(function(answer){ + console.log(answer); + console.log(answer.type); + console.log(answer.data); + alert(answer.data); + }, function(errormsg){ + alert('Error: '+ errormsg); + }); +}; + +document.addEventListener('DOMContentLoaded', function() { + document.getElementById("button0").addEventListener("click", + buttonclicked); + }); |