X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=carousel.js;h=109f21a72f684c2c6cb68ed6ba81e162b73815eb;hb=165775c5c9cde9d59b980cc100f3f5b5a8c1e436;hp=0dda4750cfa8f57b2a5809ba4ab03bb1f2b58ad6;hpb=51ba87c23eea6fc022edbea3bebda6fbfd14ab91;p=ultimatescore diff --git a/carousel.js b/carousel.js index 0dda475..109f21a 100644 --- a/carousel.js +++ b/carousel.js @@ -717,7 +717,14 @@ function showschedule(page) { let teams = []; let games = []; - let num_left = 5; + let groups_to_get = [ + 'Group A', + 'Group B', + // 'Group C', + // 'Playoffs 9th-13th', + 'Playoffs' + ]; + let num_left = groups_to_get.length; let cb = function(response, group_name) { teams = teams.concat(parse_teams_from_spreadsheet(response)); @@ -727,11 +734,9 @@ function showschedule(page) } }; - get_group('Group A', cb); - get_group('Group B', cb); - get_group('Group C', cb); - get_group('Playoffs', cb); - get_group('Playoffs 9th-13th', cb); + for (const group of groups_to_get) { + get_group(group, cb); + } }; function do_series(series) @@ -753,7 +758,14 @@ function showcarousel() let games_per_group = []; let combined_teams = []; let combined_games = []; - let num_left = 5; + let groups_to_get = [ + 'Group A', + 'Group B', + // 'Group C', + // 'Playoffs 9th-13th', + 'Playoffs' + ]; + let num_left = groups_to_get.length; let cb = function(response, group_name) { let teams = parse_teams_from_spreadsheet(response); @@ -769,10 +781,6 @@ function showcarousel() [ 13000, function() { display_group_parsed(teams_per_group['Group A'], games_per_group['Group A'], 'Group A'); } ], [ 2000, function() { hidetable(); } ], [ 13000, function() { display_group_parsed(teams_per_group['Group B'], games_per_group['Group B'], 'Group B'); } ], - [ 2000, function() { hidetable(); } ], - [ 13000, function() { display_group_parsed(teams_per_group['Group C'], games_per_group['Group C'], 'Group C'); } ], - [ 2000, function() { hidetable(); } ], - [ 13000, function() { display_group_parsed(teams_per_group['Playoffs 9th-13th'], games_per_group['Playoffs 9th-13th'], 'Playoffs 9th–13th'); } ], [ 2000, function() { hidetable(); } ] ]; let num_pages = find_num_pages(combined_games); @@ -785,11 +793,9 @@ function showcarousel() } }; - get_group('Group A', cb); - get_group('Group B', cb); - get_group('Group C', cb); - get_group('Playoffs 9th-13th', cb); - get_group('Playoffs', cb); + for (const group of groups_to_get) { + get_group(group, cb); + } }; function stopcarousel()