app.js (933 B )


 1 (function () {
 2 	if (!window.location.search) { window.panel.paintIntro(); }
 3 	window.eventsData
 4 		.then(function (data) {
 5 			window.eventsMap.setEvents(data);
 6 			// preset the panel color for a deep-linked event that will actually be shown,
 7 			// so it never flashes antiquewhite first. A passed event is only shown (and so
 8 			// only worth presetting) in past mode, i.e. when nothing is upcoming.
 9 			var deepLinked = window.fmt.eventFromUrl(data);
10 			var shown = deepLinked && (!window.fmt.hasPassed(deepLinked) ||
11 				!window.fmt.upcomingEvents(data).length);
12 			if (shown) { window.panel.presetEventColor(deepLinked); }
13 			window.eventsMap.load();
14 		})
15 		.catch(function () {
16 			document.getElementById("text-title").textContent = "Couldn't load events";
17 			document.getElementById("text-content").textContent = "If you opened this file directly, serve it over http (./serve.py) so the browser can fetch events.json.";
18 		});
19 })();