PageSourceSearch

https://independentaustralia.net/_js/com-ia.js?t=18

js independentaustralia.net collected 2026-10-02 02:27:28 UTC 13,923 bytes, 430 lines download raw bytes

1/**
2 * @author Lance Snider - [email protected]
3 */
4
5//editable vars
6var goalAmount = 3000;//how much are you trying to get
7//var currentAmount = 1267;//how much do you currently have (if you want to define in js, not html)
8var animationTime = 3000;//in milliseconds
9var numberPrefix = "";//what comes before the number (set to "" if no prefix)
10var numberSuffix = "";//what goes after the number
11var tickMarkSegementCount = 4;//each segement adds 40px to the height
12var widthOfNumbers = 50;//the width in px of the numbers on the left
13
14//standard resolution images
15var glassTopImg = "/t/therm/glassTop.png";
16var glassBodyImg = "/t/therm/glassBody.png";
17var redVerticalImg = "/t/therm/redVertical.png";
18var tooltipFGImg = "/t/therm/tickShine.png";
19var glassBottomImg = "/t/therm/glassBottom.png";
20var tootipPointImg = "/t/therm/tooltipPoint.png";
21var tooltipMiddleImg = "/t/therm/tooltipMiddle.png";
22var tooltipButtImg = "/t/therm/tooltipButt.png";
23
24//high res images
25var glassTopImg2x = "/t/therm/glassTop2x.png";
26var glassBodyImg2x = "/t/therm/glassBody2x.png";
27var redVerticalImg2x = "/t/therm/redVertical2x.png";
28var tooltipFGImg2x = "/t/therm/tickShine2x.png";
29var glassBottomImg2x = "/t/therm/glassBottom2x.png";
30var tootipPointImg2x = "/t/therm/tooltipPoint2x.png";
31var tooltipMiddleImg2x = "/t/therm/tooltipMiddle2x.png";
32var tooltipButtImg2x = "/t/therm/tooltipButt2x.png";
33
34/////////////////////////////////////////
35// ------ don't edit below here ------ //
36/////////////////////////////////////////
37
38var arrayOfImages;
39var imgsLoaded = 0;
40var tickHeight = 40;
41var mercuryHeightEmpty = 0;
42var numberStartY = 6;
43var thermTopHeight = 13;
44var thermBottomHeight = 51;
45var tooltipOffset = 15;
46var heightOfBody;
47var mercuryId;
48var tooltipId;
49var resolution2x = false;
50
51//start once the page is loaded
52$( document ).ready(function() {
53	determineImageSet();
54});
55
56//this checks if it's the high or normal resolution images
57function determineImageSet(){
58
59	resolution2x = window.devicePixelRatio == 2;//check if resolution2x
60
61	if(resolution2x){
62		//switch the regular for 2x res graphics
63		glassTopImg = glassTopImg2x;
64		glassBodyImg = glassBodyImg2x;
65		redVerticalImg = redVerticalImg2x;
66		glassBottomImg = glassBottomImg2x;
67		tootipPointImg = tootipPointImg2x;
68		tooltipButtImg = tooltipButtImg2x;
69	}
70
71	createGraphics();
72}
73
74
75//visually create the thermometer
76function createGraphics(){
77
78	//add the html
79	$("#goal-thermometer").html(
80		"<div id='therm-numbers'>" +
81		"</div>" +
82		"<div id='therm-graphics'>" +
83		"<img id='therm-top' src='"+glassTopImg+"'></img>" +
84		"<img id='therm-body-bg' src='"+glassBodyImg+"' ></img>" +
85		"<img id='therm-body-mercury' src='"+redVerticalImg+"'></img>" +
86		"<div id='therm-body-fore'></div>" +
87		"<img id='therm-bottom' src='"+glassBottomImg+"'></img>" +
88		"<div id='therm-tooltip'>" +
89		"<img class='tip-left' src='"+tootipPointImg+"'></img>" +
90		"<div class='tip-middle'><p>0</p></div>" +
91		"<img class='tip-right' src='"+tooltipButtImg+"'></img>" +
92		"</div>" +
93		"</div>"
94	);
95
96	//preload and add the background images
97	$('<img/>').attr('src', tooltipFGImg).on("load",function(){
98		$(this).remove();
99		$("#therm-body-fore").css("background-image", "url('"+tooltipFGImg+"')");
100		checkIfAllImagesLoaded();
101	});
102
103	$('<img/>').attr('src', tooltipMiddleImg).on("load",function(){
104		$(this).remove();
105		$("#therm-tooltip .tip-middle").css("background-image", "url('" + tooltipMiddleImg + "')");
106		checkIfAllImagesLoaded();
107	});
108
109	//adjust the css
110	heightOfBody = tickMarkSegementCount * tickHeight;
111	$("#therm-graphics").css("left", widthOfNumbers)
112	$("#therm-body-bg").css("height", heightOfBody);
113	$("#goal-thermometer").css("height",  heightOfBody + thermTopHeight + thermBottomHeight);
114	$("#therm-body-fore").css("height", heightOfBody);
115	$("#therm-bottom").css("top", heightOfBody + thermTopHeight);
116	mercuryId = $("#therm-body-mercury");
117	mercuryId.css("top", heightOfBody + thermTopHeight);
118	tooltipId = $("#therm-tooltip");
119	tooltipId.css("top", heightOfBody + thermTopHeight - tooltipOffset);
120
121	//add the numbers to the left
122	var numbersDiv = $("#therm-numbers");
123	var countPerTick = goalAmount/tickMarkSegementCount;
124	var commaSepCountPerTick = commaSeparateNumber(countPerTick);
125
126	//add the number
127	for ( var i = 0; i < tickMarkSegementCount; i++ ) {
128
129		var yPos = tickHeight * i + numberStartY;
130		var style = $("<style>.pos" + i + " { top: " + yPos + "px; width:"+widthOfNumbers+"px }</style>");
131		$("html > head").append(style);
132		var dollarText = commaSeparateNumber(goalAmount - countPerTick * i);
133		$( numbersDiv ).append( "<div class='therm-number pos" + i + "'>" +dollarText+ "</div>" );
134
135	}
136
137	//check that the images are loaded before anything
138	arrayOfImages = new Array( "#therm-top", "#therm-body-bg", "#therm-body-mercury", "#therm-bottom", ".tip-left", ".tip-right");
139	preload(arrayOfImages);
140
141};
142
143//check if each image is preloaded
144function preload(arrayOfImages) {
145
146	for(i=0;i<arrayOfImages.length;i++){
147		$(arrayOfImages[i]).on("load",function() {   checkIfAllImagesLoaded();  });
148	}
149
150}
151
152//check that all the images are preloaded
153function checkIfAllImagesLoaded(){
154	imgsLoaded++;
155	if(imgsLoaded == arrayOfImages.length+2){
156
157		$( "#goal-thermometer" ).fadeTo( "fast" , 1, function() {
158			animateThermometer();
159		});
160
161	}
162}
163
164
165//animate the thermometer
166function animateThermometer(){
167	var percentageComplete = currentAmount/goalAmount;
168	var mercuryHeight = Math.round(heightOfBody * percentageComplete);
169	var newMercuryTop = heightOfBody + thermTopHeight - mercuryHeight;
170
171	mercuryId.animate({height:mercuryHeight +1, top:newMercuryTop }, animationTime);
172	tooltipId.animate({top:newMercuryTop - tooltipOffset}, {duration:animationTime});
173
174	var tooltipTxt = $("#therm-tooltip .tip-middle p");
175
176	//change the tooltip number as it moves
177	$({tipAmount: 0}).animate({
178		tipAmount: currentAmount
179	}, {
180		duration:animationTime,
181		step:function(){
182			tooltipTxt.html(commaSeparateNumber(this.tipAmount));
183		},
184		complete:function(){
185			tooltipTxt.html(commaSeparateNumber(currentAmount));
186		}
187	});
188
189
190}
191
192//format the numbers with $ and commas
193function commaSeparateNumber(val){
194	val = Math.round(val);
195	while (/(\d+)(\d{3})/.test(val.toString())){
196		val = val.toString().replace(/(\d+)(\d{3})/, '$1'+','+'$2');
197	}
198	return numberPrefix + val + numberSuffix;
199}
200
201
202function seoFriendly(data) {
203	return data.toLowerCase().replace(/\s/, '-').replace(/[^0-9a-z-_]/, '');
204}
205
206function inlineYoutube(video) {
207	// remove content to show animation for slow loading connections
208	$(".youtubeLink[data-youtube-holder='" + video + "'] > .img-youtube, .youtubeLink[data-youtube-holder='" + video + "'] > .btn-yt").remove();
209	videoReplace = '<iframe title="YouTube video player" src="https://www.youtube-nocookie.com/embed/' + video + '?rel=0&amp;wmode=opaque&amp;autoplay=1" frameborder="0" allowfullscreen></iframe>';
210	$(".youtubeLink[data-youtube-holder='" + video + "']").html(videoReplace);
211}
212
213// replace youtube
214$(".btn-yt").on("click", function() {
215	inlineYoutube($(this).attr("data-youtube-name"));
216});
217
218// remove selected url strings ie cachebreak for the moment
219$(window).on('load', function() {
220	var urlParams;
221	(window.onpopstate = function() {
222		var match, pl = /\+/g, // Regex for replacing addition symbol with a space
223			search = /([^&=]+)=?([^&]*)/g, decode = function(s) {
224				return decodeURIComponent(s.replace(pl, " "));
225			}, query = window.location.search.substring(1);
226
227		urlParams = {};
228		while ( match = search.exec(query))
229			urlParams[decode(match[1])] = decode(match[2]);
230	})();
231
232	windowURL = window.location.href.split('?');
233
234	if ("cachebreak" in urlParams) {
235		$.ajax({
236			url: '/purge-cache.php',
237			method: 'POST',
238			data: { url: windowURL[0] },
239			headers: {
240				'X-Requested-With': 'XMLHttpRequest'
241			}
242		});
243		window.history.pushState('', '', windowURL[0]);
244	}
245
246});
247
248$(document).ready(function() {
249
250	$("#ticker").grouploop({
251		velocity: 1,
252		forward: false,
253		pauseOnHover: true,
254		childNode: ".item",
255		childWrapper: ".item-wrap",
256		stickFirstItem: false
257	});
258
259	$("a[href='#']").click(function(e) {
260		e.preventDefault();
261	});
262
263	$('.bs-component [data-toggle="popover"]').popover();
264	$('.bs-component [data-toggle="tooltip"]').tooltip();
265
266	$('#dismiss, .overlay').on('click', function() {
267		// hide sidebar
268		$('#sidebar').removeClass('active');
269		// hide overlay
270		$('.overlay').removeClass('active');
271	});
272
273	$('#sidebarCollapse').on('click', function() {
274		// open sidebar
275		$('#sidebar').addClass('active');
276		// fade in the overlay
277		$('.overlay').addClass('active');
278		$('.collapse.in').toggleClass('in');
279		$('a[aria-expanded=true]').attr('aria-expanded', 'false');
280	});
281
282	$('a.dropdown-toggle').on('click', function() {
283		if ($(this).children('.nav-icon').attr('class') == 'fas fa-chevron-down nav-icon') {
284			$(this).children('.nav-icon').attr({
285				'class' : 'fas fa-chevron-right nav-icon'
286			});
287		} else {
288			$(this).children('.nav-icon').attr({
289				'class' : 'fas fa-chevron-down nav-icon'
290			});
291		}
292	});
293
294	$('.search-open').on('click', function() {
295		$('.search-tophead').addClass('search-visible');
296	});
297	$('.search-close').on('click', function() {
298		$('.search-tophead').removeClass('search-visible');
299	});
300
301	$(window).scroll(function() {
302		var height = $(window).scrollTop();
303
304		if (height > 600) {
305			$('.sticky-top').addClass('bottom-shadow');
306		} else {
307			$('.sticky-top').removeClass('bottom-shadow');
308		}
309	});
310
311});
312
313
314/*!
315Name: jQuery grouploop plugin
316Verison: 1.0.3
317Author: Scott Alguire
318Repository: https://github.com/scottalguire/grouploop
319*/
320! function(f) {
321	f.fn.extend({
322		grouploop: function(i) {
323			var n, e, t, r = f.extend({
324					velocity: 2,
325					forward: !0,
326					childNode: ".item",
327					childWrapper: ".item-wrap",
328					pauseOnHover: !0,
329					complete: null,
330					stickFirstItem: !1
331				}, i),
332				o = this,
333				d = f(window).width() < 768 ? 3 * f(window).width() : f(window).width(),
334				c = r.velocity,
335				a = f(window).width() < 768 ? 3 * f(o).width() : f(o).width(),
336				s = f(o).find(r.childWrapper + " " + r.childNode).first(),
337				p = f(o).find(r.childWrapper + " " + r.childNode).length;
338
339			function h() {
340				e = a / (p - 1), o.css("position", "relative"), s.remove(), s.css({
341					position: "absolute",
342					top: "0",
343					left: "0",
344					width: e,
345					height: "100%",
346					"z-index": "999"
347				}), s.prependTo(o).find(r.childWrapper)
348			}
349
350			function l() {
351				r.forward ? n <= 0 ? (n += 1 * c, f(o).find(r.childWrapper).css("transform", "translateX(" + n + "px)")) : (f(o).find(r.childWrapper).css("transform", "translateX(" + -d - e + ")"), n = -d) : -d <= n ? (n -= 1 * c, f(o).find(r.childWrapper).css("transform", "translateX(" + n + "px)")) : (f(o).find(r.childWrapper).css("transform", "translateX(0)"), n = 0), t = window.requestAnimationFrame(l)
352			}
353			return r.stickFirstItem ? h() : e = 0, window.addEventListener("resize", function() {
354				(d = f(window).width()) < 768 ? (console.log("Small breakpoint. Wrapper width is currently doubled."), d *= 2, a = 2 * f(o).width()) : (d = f(window).width(), a = f(o).width()), r.stickFirstItem && h()
355			}), r.forward ? (n = -d, f(o).each(function(i, n) {
356				f(n).find(r.childWrapper).each(function(i, n) {
357					f(f(n).find(f(r.childNode).get().reverse())).each(function() {
358						f(this).clone().prependTo(n)
359					})
360				})
361			})) : (n = "none" !== f(o).find(r.childWrapper).css("transform") ? f(o).find(r.childWrapper).css("transform").split(/[()]/
361)[1].split(",")[8] : 0, f(o).each(function(i, n) {
362				f(n).find(r.childWrapper).each(function(i, n) {
363					f(n).find(r.childNode).each(function() {
364						f(this).clone().appendTo(n)
365					})
366				})
367			})), t = window.requestAnimationFrame(l), r.pauseOnHover && f(this).hover(function() {
368				cancelAnimationFrame(t)
369			}, function() {
370				t = window.requestAnimationFrame(l)
371			}), this.each(function() {
372				f.isFunction(r.complete) && r.complete.call(this)
373			})
374		}
375	})
376}(jQuery);
377
378var urlParamsSub;
379(window.onpopstate = function() {
380	var match, pl = /\+/g, // Regex for replacing addition symbol with a space
381		search = /([^&=]+)=?([^&]*)/g, decode = function(s) {
382			return decodeURIComponent(s.replace(pl, " "));
383		}, query = window.location.search.substring(1);
384
385	urlParamsSub = {};
386	while ( match = search.exec(query))
387		urlParamsSub[decode(match[1])] = decode(match[2]);
388})();
389
390
391//update members links
392document.addEventListener('DOMContentLoaded', function() {
393	const primaryLoginBtn = document.querySelector('#member-login-primary');
394	const secondaryLoginBtn = document.querySelector('#member-login-secondary');
395
396	async function checkLoginStatus() {
397		try {
398			const response = await fetch('/check-member-status.php', {
399				method: 'GET',
400				credentials: 'same-origin'
401			});
402
403			if (!response.ok) throw new Error('Network response was not ok');
404
405			const data = await response.json();
406
407			// Update primary button
408			primaryLoginBtn.innerHTML = data.isLoggedIn
409				? '<i class="fas fa-user-lock"></i> <span>MEMBERS</span>'
410				: '<i class="fas fa-lock"></i> <span>LOGIN</span>';
411			primaryLoginBtn.href = data.isLoggedIn
412				? '/members-area/members-home'
413				: '/member-login';
414
415			// Update secondary button
416			secondaryLoginBtn.innerHTML = data.isLoggedIn
417				? '<span>MEMBERS AREA</span>'
418				: '<span>LOGIN</span>';
419			secondaryLoginBtn.href = data.isLoggedIn
420				? '/members-area/members-home'
421				: '/member-login';
422		} catch (error) {
423			console.error('Error:', error);
424		}
425	}
426
427	checkLoginStatus();
428	setInterval(checkLoginStatus, 300000);
429});
430

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.