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

20 lines
525 B
JavaScript
Raw Normal View History

2016-05-17 11:24:46 +05:00
onready(function(){
document.getElementById("start_miner").onclick = function() {
2016-05-17 11:55:21 +05:00
var btn = document.getElementById("start_miner");
var label = btn.value;
btn.value = "..."
btn.disabled = true;
2016-05-17 11:24:46 +05:00
var worker = new Worker("./static/mineworker.js");
worker.onmessage = function(e) {
miner_cb(e.data);
2016-05-17 11:55:21 +05:00
btn.value=label;
btn.disabled = false;
2016-05-17 11:24:46 +05:00
worker.terminate();
}
worker.postMessage(55.0); // Start the worker.
};
});
function miner_cb(s) {
document.getElementById("miner_result").value = s;
}