-
Notifications
You must be signed in to change notification settings - Fork 0
/
score_ui.js
39 lines (25 loc) · 1.11 KB
/
score_ui.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
/*----------------------------------------------------------------------------------------------------------------------------------*/
score_ui_new = function(performance) {
var table = document.createElement("table");
var tr = document.createElement("tr");
var td = document.createElement("td");
td.appendChild(document.createTextNode("Score:"));
table.appendChild(tr);
tr.appendChild(td);
tr = document.createElement("tr");
td = document.createElement("td");
var p = document.createElement("p");
p.innerHTML = performance.score;
td.appendChild(p);
tr.appendChild(td);
table.appendChild(tr);
table.border = "0";
performance.add_notify_score(update_score_ui, p);
update_score_ui(p, performance);
return table;
}
/*----------------------------------------------------------------------------------------------------------------------------------*/
function update_score_ui(p, performance) {
p.innerHTML = Math.round(performance.score * 100) / 100;
}
/*----------------------------------------------------------------------------------------------------------------------------------*/