PageSourceSearch

https://pasadena.edu/_resources/js/rave-emergency.js?v=1.2

js pasadena.edu collected 2026-09-24 06:23:59 UTC 2,455 bytes, 79 lines download raw bytes

1// Passes the RAVE RSS xml to xml-json-proxy.php which returns the XML
2var url = "https://www.getrave.com/rss/pasadenacc/channel1";
3// AJAX request
4var xhr = (window.XMLHttpRequest ? new XMLHttpRequest() : new ActiveXObject("Microsoft.XMLHTTP"));
5xhr.onreadystatechange = XHRhandler;
6xhr.open("GET", "/_resources/includes/scripts/xml-json-proxy.php?url=" + escape(url), true);
7xhr.send(null);
8// handle response
9function XHRhandler() {
10	if (xhr.readyState == 4) {
11		// parse response as JSON
12		var json;
13		if (JSON && JSON.parse) {
14			json = JSON.parse(xhr.responseText);
15		} else {
16			eval("var json = " + xhr.responseText);
17		}
18		var rtitle = json.channel.item.title;
19		if (json.channel.item.description) {
20			var rdesc = json.channel.item.description;
21		} else {
22			var rdesc = '';
23		}
24		if (json.channel.item.link) {
25			var rlink = json.channel.item.link;
26		} else {
27			var rlink = '';
28		}
29		if (json.channel.image) {
30			var rimg = json.channel.image.url;
31		} else {
32			var rimg = '/_resources/img/rss/emergency-default.png';
33		}
34		if (rtitle !== "Website Emergency Off") {
35			$("#emergency-container").loadTemplate($("#emergency-template"), {
36				title: rtitle,
37				description: rdesc,
38				link: rlink,
39				image: rimg
40			});
41			$("#emergency-container").css('display', 'block');
42			// override any currently displaying general notice
43			$("#notice-container").css('display', 'none');
44			priorityNotificationOverride();
45			//console.log('one');
46		} else {
47			$("#emergency-container").css('display', 'none');
48			priorityNotificationOnOff();
49			//console.log('two');
50		}
51		// Debugging code
52		//console.log(json);
53		//alert(rtitle);
54		xhr = null;
55	} else {
56		$("#emergency-container").css('display', 'none');
57	}
58}
59
60// Priority Notification JS
61var thePriorityDiv = document.getElementById('priority-notification-container');
62var priorityNotificationStatus = thePriorityDiv.getAttribute('data-notification-status');
63
64function priorityNotificationOnOff() {
65	if(priorityNotificationStatus == "on") {
66		$('#priority-notification-container').css('display', 'block');
67		//$("#notice-container").css('display', 'none');
68	} else {
69		$('#priority-notification-container').css('display', 'none');
70	}
71}
72
73function priorityNotificationOverride() {
74	if(priorityNotificationStatus == "override"){
75		$('#priority-notification-container').css('display', 'block');
76		$("#emergency-container").css('display', 'none');
77		$("#notice-container").css('display', 'none');
78	}
79}

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.