-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathui.js
45 lines (33 loc) · 1.38 KB
/
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
45
/*----------------------------------------------------------------------------------------------------------------------------------*/
function create_input(ui, onchange) {
var input = document.createElement("input");
input.style.width = "50px";
input.type = "number";
//input.value = "0";
input.ui = ui;
input.setAttribute("onchange", onchange);
return input;
}
/*----------------------------------------------------------------------------------------------------------------------------------*/
function insert_into_table(table, input_table) {
var td = document.createElement("td");
td.appendChild(input_table);
table.tr.appendChild(td);
table.appendChild(table.tr);
}
/*----------------------------------------------------------------------------------------------------------------------------------*/
function build_input_table(label, input) {
var table = document.createElement("table");
var tr = document.createElement("tr");
var td = document.createElement("td");
td.appendChild(document.createTextNode(label));
tr.appendChild(td);
table.appendChild(tr);
tr = document.createElement("tr");
td = document.createElement("td");
td.appendChild(input);
tr.appendChild(td);
table.appendChild(tr);
return table;
}
/*----------------------------------------------------------------------------------------------------------------------------------*/