]> git.sesse.net Git - ultimatescore/blob - quickhelp.js
Add a quick reference HTML page for quick lower thirds.
[ultimatescore] / quickhelp.js
1
2 function make_ul_help(response, group_name, id) {
3         var h1 = document.getElementById(id + "heading");
4         h1.innerHTML = group_name;
5
6         var ul = document.getElementById(id);
7         ul.innerHTML = "";
8         for (var p in response) {
9                 if (response.hasOwnProperty(p)) {
10                         var li = document.createElement('li');
11                         li.innerHTML = "<strong>" + p + ":</strong> " + response[p].raw_text;
12                         ul.appendChild(li);
13                 }
14         }
15 }
16
17 function updatequickhelp(id, prefix) {
18         var e = document.getElementById(id + 'select');
19         var code = e.options[e.selectedIndex].text;
20         load_l3(code, prefix, function(response, group_name) { make_ul_help(response, group_name, id); });
21 }
22
23 updatequickhelp('team1', 'A');
24 updatequickhelp('team2', 'B');
25 load_l3('Calls', 'C', function(response, group_name) { make_ul_help(response, group_name, 'calls'); });
26