PageSourceSearch

https://mbsonline.gov.au/internet/mbsonline/publishing.nsf/Attachm…/site.js/$FILE/site.js?OpenElement&v=1.2

js mbsonline.gov.au collected 2026-10-02 05:33:05 UTC 7,920 bytes, 266 lines download raw bytes

1// Local functions to transform footer
2jQuery.fn.extend({
3	collapsefooter : function () {
4		var section = $(this).find(".divided.span2");
5		var count = 0;
6		$.each(section, function (i, node) {
7			var h2 = $(node).find("h2");
8			anchor = $(h2).text().substr(0, 3);
9			var ul = $(node).find("ul");
10			//var selected = count==0 ? " in" : "";
11			//var state = count==0 ? "" : " collapsed";
12			var heading = '<div class="accordion"><h2><a class="accordion-toggle collapsed" data-toggle="collapse" href="#' + anchor + '">' + h2.text() + '</a></h2>';
13			var contents = '<div id="' + anchor + '" class="accordion-body collapse"><ul>' + ul.html() + '</ul></div></div>';
14			$(this).hide();
15			$(this).after(heading + contents);
16			count++;
17		});
18		$(".footer").addClass("collapsed");
19	}
20});
21
22jQuery.fn.extend({
23	expandfooter : function () {
24		$(".footer .accordion").remove();
25		$(".divided.span2").show();
26		$(".footer").removeClass("collapsed");
27	}
28});
29
30// Function to execute breakpoint changes
31function mqCheck() {
32	var search = $("#search");
33	var searchinput = $("#searchinput");
34	var formwrap = $("#form-wrap");
35	var globalnav = $(".global-navigation .nav");
36	var portfolio = $(".portfolio");
37	var portfolioToggle = $(".global-navigation .portfolio-toggle");
38	var sideNav = $(".aside .sidebar-navigation");
39	var portfolio = $("#portfolio-content");
40	
41	// Table wrap
42	$(".content table:not(.table-sort,.dataTable)").each(function () {
43		$(this).tablewrap($(this).width(), $(this).parent().width());
44	});
45
46	// Desktop
47	//if (matchMedia('(min-width: 980px)').matches || document.documentElement.clientWidth >= 980) {
48	if ($(document).width() >= 980) {
49		if(!(mode == "desktop")){
50			mode = "desktop";
51			
52			// Footer
53			if ($(".footer .accordion").exists()) {
54				$(".footer").expandfooter();
55				$(".footer .span4").show();
56			}		
57			
58			// Portfolio
59			if($(portfolio).exists()){
60				$(portfolio).appendTo($(".portfolio.top .inject"));
61			} else {
62				//inject("/internet/r/publishing.nsf/xml/ajaxPortfolioLinks",".portfolio.top .inject", "inside");
63			}
64		}
65	}
66	
67	// Up to portrait tablet
68	//if (matchMedia('(max-width: 979px)').matches || document.documentElement.clientWidth < 980) {
69	if ($(document).width() < 980) {
70		if(!(mode == "<portTab")){
71			mode = "<portTab";
72
73			// Footer
74			if (!$(".footer").hasClass("collapsed")) {
75				$(".footer").collapsefooter();
76				$(".footer .span4").hide();
77				$(".footer .bottom-locked").appendTo(".footer .row-fluid");
78			}
79			
80			// Portfolio
81			if($(portfolio).exists()){
82				$(portfolio).appendTo($(".portfolio.bottom .inject"));
83				//console.log("Moved portfolio to bottom");
84			} else {
85				//inject("/internet/r/publishing.nsf/xml/ajaxPortfolioLinks",".portfolio.bottom .inject", "inside");
86				//console.log("Inserted portfolio into bottom");
87			}
88		}
89	}
90	
91	// > mobile
92	//if (matchMedia('(min-width: 768px)').matches || document.documentElement.clientWidth >= 768) {
93	if ($(document).width() >= 768) {
94		if(!(navmode == ">mobile")){
95			navmode = "?mobile";
96			if($(sideNav).exists()){
97				$(".aside .sidebar-navigation").show();
98				$("#mob-nav").remove();
99			}
100		}
101	}
102	
103	// Up to mobile
104	//if (matchMedia('(max-width: 767px)').matches || document.documentElement.clientWidth < 768) {
105	if ($(document).width() < 768) {
106		if(!(navmode == "mobile")){
107			navmode = "mobile";
108			if($(sideNav).exists()){
109				sidenavToMobile(sideNav);
110				$(sideNav).hide();
111			}
112		}
113	}
114}
115
116// Script start -----------------
117var mode;
118var navmode;
119
120$(function () {
121	
122	// Init
123    mqCheck();
124	
125	// Resize function calls
126	$(window).resize(function () {
127		mqCheck();
128	});
129	
130	// Hide 'in this section' if 0 or 1 link only
131	if ($(".section-content ul li").size() < 2) {
132		$(".section-content").remove();
133	}
134	
135	// Remove nested active state from right navigation
136	if ($(".sidebar-navigation li.active").size() > 1) {
137		$(".sidebar-navigation li.active:not(:last)").removeClass("active");
138	}
139	
140	// Carousel
141	$(".carousel").carousel({
142		interval: 7000
143	});
144	
145	$(".carousel-anim").click(function(e){
146		e.preventDefault();
147		carouselAnim($(this).text());
148	});
149	
150	$(".carousel").bind('slid', function() {
151		carouselAnim("Play");
152	});
153	
154
155	// Update expand/minus icon while clicked on expand/minus icon in style-large-doc
156	$(".sidebar-navigation .accordion-toggle").on('click', function (e) {
157		$(this).toggleClass("icon-plus-sign icon-minus-sign");
158		//console.log("Clicked long doc expand minus icon");
159	});
160
161	// Focus and select content from textarea by click on cpy button on badge thank you page
162	$("#cpy").on('click', function (e) {
163		$("#widgetCode").focus();
164		$("#widgetCode").select();
165	});
166	
167	// Add class="externallink" to all links in content footer
168	$(".content a[href*='http://']:not([href*='"+location.hostname.replace("www.","")+"']), .content a[href*='https://']:not([href*='"+location.hostname.replace("www.","")+"'])").each(function(){
169		if ($(this).attr("id") != "rs") {
170			$(this).addClass("externallink");
171		}
172	});
173	
174	//replace pagination link
175	$(".pagination .pagelinkall a").each(function () {
176		$(this).wrap("<li/>");
177	});
178	
179	$(".pagination .pagelinkall b").each(function () {
180		$(this).wrap("<li class='active'/>");
181		$(this).wrap("<a href='#' />");		
182	});
183	
184	$(".pagination .pagelinkall").each(function () {
185		var pagination = $(this).html();		
186		$(".pagination .pagelinkall").after(pagination);
187		$(".pagination .pagelinkall").remove();
188	});
189	
190	// Global portfolio header mech
191	$(document).on("click", ".portfolio-toggle", function (e) {
192		e.preventDefault();
193		$(".portfolio .inject").slideToggle(700);		
194		//scroll to portfolio content
195		$('html, body').animate({scrollTop:$(".portfolio.bottom").position().top}, 'slow');
196	});
197	
198	// Readspeaker
199	$("#rs").click(function (e) {
200		e.preventDefault();	
201		if(location.hostname !== "mbsonline.gov.au"){
202			$(this).tooltip({title:"The screen reading service only functions on the live website"}).tooltip('show');
203		} else {
204			readpage($(this).attr("href"), 'xp1');
205		}
206	});
207	
208	//wrap div with iframe embed and object
209	$('.content iframe, .content embed, .content object').each(function () {
210		$(this).wrap('<div class="video-container" />');
211	});
212	
213	// dataTables
214	$("table.table-sort, table.dataTable").each(function(){
215		//legacy
216		if($(this).hasClass("table-sort")){
217			$(this).removeClass("table-sort").addClass("dataTable");
218		}
219		$(this).dataTable();
220	});
221	
222	//document links check link is document type are pdf, doc, docx, xls, xlsx
223	$(".content a[href$='.pdf'], .content a[href$='.docx'], .content a[href$='.doc'], .content a[href$='.xls'], .content a[href$='.xlsx'], .content a[href$='.xlsm'], .content a[href$='.ppt'], .content a[href$='.exe'], .content a[href$='.zip']").each(function () {
224		$(this).doclinks();
225	});
226	
227	// Fix inline border attr (legacy)
228	$("table[border]").attr("border","0");
229	
230	// Page feedback form
231	$("#feedback").click(function(e){
232		e.preventDefault();
233		$("#subscribe-form").slideToggle(700, function(){
234			$("#feedback").toggleClass("open");	
235		});
236	});
237	
238	// tooltip hover popup trigger
239	$('[rel=tooltip]').tooltip();
240	
241	// Form validation using dha function
242	$(".content form, .feedback form, .footer form").each(function() {
243		$(this).dhaValidate();
244	});
245	
246	// AJAX alert
247	if ($("#ajax-alert").exists()) {
248		ajaxAlert();
249	}
250	
251	//show hide search options
252	/*$("#searchinput").on('click hover keyup', function () {
253		$(".search-options").show();
254	});
255	$("#searchinput").blur(function () {
256		$(".search-options").hide();
257	});*/
258
259	// Fix skip-to focus in Chrome & IE
260    $("#content, #navigation").attr("tabindex","-1");
261    $(".js-skip").click(function () {
262      var id = $(this).attr("href");
263      $(id).focus();
264    });
265	
266});

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.