Archived
1
0
This repository has been archived on 2023-08-12. You can view files and clone it, but cannot push or open issues or pull requests.
nntpchan/contrib/js/cuckoo_miner.js
2016-05-17 08:55:21 +02:00

20 lines
525 B
JavaScript

onready(function(){
document.getElementById("start_miner").onclick = function() {
var btn = document.getElementById("start_miner");
var label = btn.value;
btn.value = "..."
btn.disabled = true;
var worker = new Worker("./static/mineworker.js");
worker.onmessage = function(e) {
miner_cb(e.data);
btn.value=label;
btn.disabled = false;
worker.terminate();
}
worker.postMessage(55.0); // Start the worker.
};
});
function miner_cb(s) {
document.getElementById("miner_result").value = s;
}