This repository has been archived on 2023-08-12. You can view files and clone it. You cannot open issues or pull requests or push a commit.
2016-05-17 08:24:46 +02:00
|
|
|
onready(function(){
|
|
|
|
|
document.getElementById("start_miner").onclick = function() {
|
2016-05-17 08:55:21 +02:00
|
|
|
var btn = document.getElementById("start_miner");
|
|
|
|
|
var label = btn.value;
|
|
|
|
|
btn.value = "..."
|
|
|
|
|
btn.disabled = true;
|
2016-05-17 08:24:46 +02:00
|
|
|
var worker = new Worker("./static/mineworker.js");
|
|
|
|
|
worker.onmessage = function(e) {
|
|
|
|
|
miner_cb(e.data);
|
2016-05-17 08:55:21 +02:00
|
|
|
btn.value=label;
|
|
|
|
|
btn.disabled = false;
|
2016-05-17 08:24:46 +02:00
|
|
|
worker.terminate();
|
|
|
|
|
}
|
|
|
|
|
worker.postMessage(55.0); // Start the worker.
|
|
|
|
|
};
|
|
|
|
|
});
|
|
|
|
|
function miner_cb(s) {
|
|
|
|
|
document.getElementById("miner_result").value = s;
|
|
|
|
|
}
|