gpgme/lang/js/testapplication.js
raimund.renkert@intevation.de eef3a509fa
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.
2018-04-10 18:47:59 +02:00

22 lines
674 B
JavaScript

/**
* 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);
});