PageSourceSearch

https://inkbunny.net/js82/page-specific/menu.js

js inkbunny.net collected 2026-09-24 08:29:09 UTC 5,471 bytes, 126 lines download raw bytes

1//Diplay site notice to logged in users.
2
3if ($('general-loggedin').getValue() == 'yes')
4{
5	if ($('sitestatus-site_notice_on').getValue() == "yes") 
6	{
7		site_notice_show();
8		
9		if ($('sitestatus-panicmodeStatus').getValue() != "yes" && $('sitestatus-timer_on').getValue() == "yes")
10		{
11			site_notice_startTimer();
12		}
13		else if ($('sitestatus-panicmodeStatus').getValue() == "yes")
14		{
15			site_notice_show_offline();
16		}
17		
18	}
19}
20
21//Apply JS events to html elements.
22$('banner_clickarea').observe('mouseover', function(event) {
23	$("bannerbrowser_div").setStyle({display: "block"});
24});
25$('banner_clickarea').observe('mouseout', function(event) {
26	$("bannerbrowser_div").setStyle({display: "none"});
27});
28$('banner-prev').observe('click', function(event) {
29	changeBannerPrev();
30});
31$('banner-rand').observe('click', function(event) {
32	changeBannerRandom();
33});
34$('banner-next').observe('click', function(event) {
35	changeBannerNext();
36});
37
38$('background-prev').observe('click', function(event) {
39	changebgPrev();
40});
41$('background-next').observe('click', function(event) {
42	changebgNext();
43});
44
45
46if ($('general-loggedin').getValue() == 'yes')
47{
48	if ($('menu-account')) $('menu-account').observe('click', function(event) {
49		$('menu-account').blur();
50	});
51	if ($('menu-post')) $('menu-post').observe('click', function(event) {
52		$('menu-post').blur();
53	});
54	if ($('menu-admin')) $('menu-admin').observe('click', function(event) {
55		$('menu-admin').blur();
56	});
57	if ($('menu-logout')) $('menu-logout').observe('click', function(event) {
58		if (confirm("Are you sure you want to Log Out?")) $("logout_form").submit();
59	});
60}
61
62//Array of all possible background names.
63bg_array = $('background-themes').getValue().split(",");
64//Figure out the index of the one we're viewing. ?>
65for (i=0; i<=bg_array.length; i++) {
66	if (bg_array[i]==global_bgtheme) bg_index = i;
67}
68
69//Notices system.
70if ($('general-loggedin').getValue() == 'yes')
71{
72	if (supports_storage) 
73	{
74		//Initialise subnotice storage objects.
75		localStorage["message_notification_new_count"] = localStorage["message_notification_new_count"] * 1 || 0;
76		localStorage["submission_notification_new_count"] = localStorage["submission_notification_new_count"] * 1 || 0;
77		localStorage["private_messages_new_count"] = localStorage["private_messages_new_count"] * 1 || 0;
78		
79		//Initialise subnotice storage objects.
80		localStorage["message_notification_new_count_lastcheck"] = localStorage["message_notification_new_count_lastcheck"] * 1 || 0;
81		
82		localStorage["message_tickets_unread_notification_new_count"] = localStorage["message_tickets_unread_notification_new_count"] * 1 || 0;
83		localStorage["message_tickets_unassigned_notification_new_count"] = localStorage["message_tickets_unassigned_notification_new_count"] * 1 || 0;
84		
85		localStorage["submission_notification_new_count_lastcheck"] = localStorage["submission_notification_new_count_lastcheck"] * 1 || 0;
86		localStorage["private_messages_new_count_lastcheck"] = localStorage["private_messages_new_count_lastcheck"] * 1 || 0;
87		
88		//Initialise subnotice displays.
89		$("message_notification_new_count").innerHTML = localStorage["message_notification_new_count"] * 1;
90		$("submission_notification_new_count").innerHTML = localStorage["submission_notification_new_count"] * 1;
91		$("private_messages_new_count").innerHTML = localStorage["private_messages_new_count"] * 1;
92		
93		dataArray = new Array();
94				
95		dataArray["unread_notices_changed_datetime"]=$('notices-unread_notices_changed_datetime').getValue();
96		dataArray["notices_unread_count_new"]=$('notices-notices_unread_count_new').getValue() * 1;
97		dataArray["tickets_unread_count_new"]=$('notices-tickets_unread_count_new').getValue() * 1;
98		dataArray["tickets_unassigned_new"]=$('notices-tickets_unassigned_new').getValue() * 1;
99		dataArray["unread_submissions_changed_datetime"]=$('notices-unread_submissions_changed_datetime').getValue();
100		dataArray["submissions_unread_count_new"]=$('notices-submissions_unread_count_new').getValue() * 1;
101		dataArray["unread_pms_changed_datetime"]=$('notices-unread_pms_changed_datetime').getValue();
102		dataArray["unread_private_messages_count_new"]=$('notices-unread_private_messages_count_new').getValue() * 1;
103		dataArray["menu_unread_count"]=$('notices-menu_unread_count').getValue() * 1;
104		dataArray["submissions_unread_count"]=$('notices-submissions_unread_count').getValue() * 1;
105		dataArray["unread_private_messages_count"]=$('notices-unread_private_messages_count').getValue() * 1;
106		
107		user_notice_updatedetails(dataArray);
108		
109		//Now that we have effectively updated all the data in storage to do with site and user notices, reset the poll time. This is to stop any superfluous extra notice checks.
110		//Get current milliseconds since epoch.
111		var newDate = new Date;
112		var curtime = newDate.getTime();
113		localStorage["site_status_lastpoll"] = curtime;
114
115	}
116	else
117	{
118		$('message_notification_unread_count').innerHTML =  $('notices-menu_unread_count').getValue() * 1;
119		$('submission_notification_unread_count').innerHTML = $('notices-submissions_unread_count').getValue() * 1;
120		if ($('notices-unread_private_messages_count').getValue() * 1 > 0) {
121			$('private_messages_unread_count').innerHTML = $('notices-unread_private_messages_count').getValue() * 1;
122		} else {
123			$('private_messages_unread_count').innerHTML = '...';
124		}
125	}
126}

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.