-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsubscore_ui.js
44 lines (26 loc) · 1.21 KB
/
subscore_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
40
41
42
43
44
/*----------------------------------------------------------------------------------------------------------------------------------*/
subscore_ui_new = function(performance) {
var table = document.createElement("table");
var tr = document.createElement("tr");
var td = document.createElement("td");
td.appendChild(document.createTextNode("Subscore:"));
table.appendChild(tr);
tr.appendChild(td);
tr = document.createElement("tr");
td = document.createElement("td");
var p = document.createElement("p");
p.innerHTML = performance.subscore;
td.appendChild(p);
tr.appendChild(td);
table.appendChild(tr);
table.border = "0";
var data = {p: p, performance: performance};
performance.poet.notify_score.add_notify(update_subscore_ui, data);
update_subscore_ui(data, performance.poet);
return table;
}
/*----------------------------------------------------------------------------------------------------------------------------------*/
function update_subscore_ui(data, poet) {
data.p.innerHTML = Math.round(data.performance.subscore * 100) / 100;
}
/*----------------------------------------------------------------------------------------------------------------------------------*/