-//get_group('Group A', display_group);
-//get_group('Group A', display_stream_schedule);
-//get_group('Group A', function(response_a) {
-// var teams = parse_teams_from_spreadsheet(response_a);
-// var games = parse_games_from_spreadsheet(response_a, 'Group A', true);
-// get_group('Group B', function(response_b) {
-// teams = teams.concat(parse_teams_from_spreadsheet(response_b));
-// games = games.concat(parse_games_from_spreadsheet(response_b, 'Group B', true));
-// get_group('Semifinals', function(response_c) {
-// teams = teams.concat(parse_teams_from_spreadsheet(response_c));
-// games = games.concat(parse_games_from_spreadsheet(response_c, 'Semifinals', true));
-// get_group('Bronze final', function(response_d) {
-// teams = teams.concat(parse_teams_from_spreadsheet(response_d));
-// games = games.concat(parse_games_from_spreadsheet(response_d, 'Bronze final', true));
-// get_group('Final', function(response_e) {
-// teams = teams.concat(parse_teams_from_spreadsheet(response_e));
-// games = games.concat(parse_games_from_spreadsheet(response_e, 'Final', true));
-// display_stream_schedule_parsed(teams, games);
-// });
-// });
-// });
-// });
-//});
+function showschedule(page)
+{
+ get_teams(function(teams) {
+ get_groups(function(groups) {
+ get_all_group_games(teams, groups, function(games) {
+ get_all_playoff_games(teams, groups, games, function(playoff_games) {
+ games = games.concat(playoff_games);
+ games = games.filter(function(game) { return game.streamday !== undefined; });
+ display_stream_schedule_parsed(teams, games, 0);
+ });
+ });
+ });
+ });
+};
+
+function do_series(series)
+{
+ do_series_internal(series, 0);
+};
+
+function do_series_internal(series, idx)
+{
+ (series[idx][1])();
+ if (idx + 1 < series.length) {
+ carousel_timeout = setTimeout(function() { do_series_internal(series, idx + 1); }, series[idx][0]);
+ }
+};
+
+function showcarousel()
+{
+ let groups_to_get = [
+ 'Group A',
+ 'Group B',
+ 'Group C',
+ 'Playoffs',
+ 'Playoffs 9th–11th',
+ 'Playoffs 12th–14th'
+ ];
+ get_teams(function(teams) {
+ get_groups(function(groups) {
+ get_all_group_games(teams, groups, function(games) {
+ get_all_playoff_games(teams, groups, games, function(playoff_games) {
+ games = games.concat(playoff_games);
+ games = games.filter(function(game) { return game.streamday !== undefined; });
+
+ let series = [
+ [ 13000, function() { display_group_parsed(filter_teams_by_group(teams, groups, 'Group A'), games, 'Group A'); } ],
+ [ 2000, function() { hidetable(); } ],
+ [ 13000, function() { display_group_parsed(filter_teams_by_group(teams, groups, 'Group B'), games, 'Group B'); } ],
+ [ 2000, function() { hidetable(); } ],
+ [ 13000, function() { display_group_parsed(filter_teams_by_group(teams, groups, 'Group C'), games, 'Group C'); } ],
+ [ 2000, function() { hidetable(); } ],
+ // We don't show the playoff groups, since we don't even know whether they have data.
+ ];
+ let num_pages = find_num_pages(games);
+ for (let page = 0; page < num_pages; ++page) {
+ series.push([ 13000, function() { display_stream_schedule_parsed(teams, games, page); } ]);
+ series.push([ 2000, function() { hidetable(); } ]);
+ }
+
+ do_series(series);
+ });
+ });
+ });
+ });
+};
+
+function stopcarousel()
+{
+ if (carousel_timeout !== null) {
+ hidetable();
+ clearTimeout(carousel_timeout);
+ carousel_timeout = null;
+ }
+};
+
+function hidescorebug()
+{
+ document.getElementById('entire-bug').style.display = 'none';
+}
+
+function showscorebug()
+{
+ document.getElementById('entire-bug').style.display = null;
+}
+
+function showmatch2()
+{
+ let css = "-webkit-animation: fade-in 1.0s ease; -webkit-animation-fill-mode: both;";
+ document.getElementById('scorebug2').style = css;
+ document.getElementById('clockbug2').style = css;
+}
+
+function hidematch2()
+{
+ let css = "-webkit-animation: fade-out 1.0s ease; -webkit-animation-fill-mode: both;";
+ document.getElementById('scorebug2').style = css;
+ document.getElementById('clockbug2').style = css;
+}
+
+function showmatch3()
+{
+ let css = "-webkit-animation: fade-in 1.0s ease; -webkit-animation-fill-mode: both;";
+ document.getElementById('scorebug3').style = css;
+ document.getElementById('clockbug3').style = css;
+}
+
+function hidematch3()
+{
+ let css = "-webkit-animation: fade-out 1.0s ease; -webkit-animation-fill-mode: both;";
+ document.getElementById('scorebug3').style = css;
+ document.getElementById('clockbug3').style = css;
+}