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