PageSourceSearch

https://buy.theatertickets.com/scripts/geoEvents.js

js theatertickets.com collected 2026-10-10 01:46:55 UTC 4,797 bytes, 137 lines download raw bytes

1$(document).ready(function () {
2	if ($("#geoEvents").length) {
3		locationUtil.latitude = $("#latitude").val();
4		locationUtil.longitude = $("#longitude").val();
5		locationUtil.locationChanged = geoEventsUtil.reloadLocalEvents;
6		geoEventsUtil.loadEvents(false);
7	}
8});
9
10var geoEventsUtil = {
11	loadEvents: function (reload) {
12		if ($("#parentCategoryId").length) {
13			var params;
14			if (locationUtil.latitude !== "0" && locationUtil.longitude !== "0") {
15				$("#geoEvents").show();
16				params = {
17					latitude: locationUtil.latitude,
18					longitude: locationUtil.longitude,
19					parentCategoryId: $("#parentCategoryId").val()
20				};
21				geoEventsUtil.getEvents(0, true, params, $("#geoLocalEvents"));
22			}
23		} else if ($("#q").length) {
24			$("#geoEvents").show();
25			params = {
26				q: $("#q").val()
27			};
28			geoEventsUtil.getEvents(0, false, params, $("#geoAllEvents"));
29
30		} else {
31			if ($("#performerId").val() !== "") {
32				$("#geoEvents").show();
33				params = {
34					latitude: locationUtil.latitude,
35					longitude: locationUtil.longitude,
36					performerId: $("#performerId").val(),
37					eventPageType: "PERFORMER"
38				};
39				geoEventsUtil.getEvents(0, true, params, $("#geoLocalEvents"));
40				if (!reload) {
41					geoEventsUtil.getEvents(0, false, params, $("#geoAllEvents"));
42				}
43			} else if ($("#venueId").val() !== "") {
44				$("#geoEvents").show();
45				params = {
46					latitude: locationUtil.latitude,
47					longitude: locationUtil.longitude,
48					venueId: $("#venueId").val(),
49					eventPageType: "VENUE"
50				};
51				if (!reload) {
52					geoEventsUtil.getEvents(0, false, params, $("#geoAllEvents"));
53				}
54			}
55
56		}
57	},
58	reloadLocalEvents: function () {
59		geoEventsUtil.loadEvents(true);
60	},
61	getEvents: function (offset, local, params, $container) {
62		var language = $("#language").val();
63		var postUrl = "/data/geo-events?";
64		if ($("base").length) {
65			postUrl = location.protocol + '//' + location.hostname + "/data/geo-events?";
66		}
67		postUrl += "&offset=" + offset;
68		postUrl += "&local=" + local;
69		$.ajax({
70			dataType: "json",
71			url: postUrl,
72			data: params,
73			method: "get",
74			beforeSend: function () {
75				var $geoEventsMore = $container.find(".geo-events-more");
76				$geoEventsMore.hide();
77				var html = "<div class='geo-events-loading-text'>" + languageUtil.getLoading(language) + "</div>";
78				$(html).insertBefore($geoEventsMore);
79			},
80			success: function (data) {
81				if (data.length > 0) {
82					var date = {};
83					var html = "";
84					$.each(data, function () {
85						date = new Date(this.date);
86						html += "<div class='geo-event'itemscope itemtype='http://schema.org/Event'>";
87						html += "<div class='geo-event-title'>";
88						html += "<a itemprop='url' href='/" + this.url;
89						html += "'><span itemprop='name'>" + this.name + "</span></a>";
90						html += "</div>";
91						html += "<div itemprop='location' itemscope itemtype='http://schema.org/Place'>";
92						html += "<span itemprop='name'>";
93						html += this.venue + "</span> -  ";
94						html += "<span itemprop='address' itemscope itemtype='http://schema.org/PostalAddress'>";
95						html += "<span itemprop='addressLocality'>" + this.city + "</span>, ";
96						html += "<span itemprop='addressRegion'>" + this.stateProvince + "</span></div>";
97						html += "<div><span>" + languageUtil.getDayNames(language)[date.getDay()] + "</span> ";
98						html += "<span itemprop='startDate'>" + languageUtil.getShortDate(date, language) + "</span>";
99						html += " <span>" + languageUtil.getFormattedTime(date, language) + "</span>";
100						if (this.ticketCount != 0) {
101							html += " <span class='hide-mobile'> | </span>";
102							html += " <span class='ticket-count'>" + languageUtil.getTicketCount(this.ticketCount, language) + "</span>";
103						}
104						html += "</div>";
105						html += "</div>";
106					});
107					if (offset === 0) {
108						html += "<div class='geo-events-more'><a href='#'>" +
109							languageUtil.getLoadMore(language) + "</a>";
110						$container.html(html);
111						$container.find(".geo-events-more a").click(function () {
112							geoEventsUtil.getEvents($(".geo-event").length, local, params, $container);
113							return false;
114						});
115					} else {
116						var $geoEventsMore = $container.find(".geo-events-more");
117						$container.find(".geo-events-loading-text").hide();
118						$geoEventsMore.show();
119						$(html).insertBefore($geoEventsMore);
120					}
121					$container.find(".geo-event:even").addClass("geo-alt-row");
122					$(".geo-event").on("click", function () {
123						window.location = $(this).find("a").attr("href");
124					});
125				} else {
126					$container.find(".geo-events-loading-text").hide();
127					if (offset === 0) {
128						$container.html(languageUtil.getNoEvents(language));
129					}
130				}
131				if (data.length < 10) {
132					$container.find(".geo-events-more").hide();
133				}
134			}
135		});
136	},
137}

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.