PageSourceSearch

https://ridenota.org/_assets_/js/scripts.js

js ridenota.org collected 2026-10-07 03:44:32 UTC 19,080 bytes, 614 lines download raw bytes

1/*-----------------------------------------------------------------------------------
2
3	Theme Name: Ride Nota
4	Front-end developer: Muhammad Farhan Ali
5	Author Design: Jessie Eskildsen
6	Author URI: https://www.revize.com/
7	Date: 06/03/2025
8-----------------------------------------------------------------------------------*/
9
10(function($) {
11
12	'use strict';
13
14	var $window = $(window),
15	$body = $('body'),
16	$html = $('html'),
17	$rzBarWrap = $('#rz-bar-wrap'),
18	$rzBtnsContainer = $('.rz-btns-container');
19
20	// RZ Class + remove revize bar
21	if(typeof RZ !== "undefined"){
22		if(RZ.login){
23			$body.addClass("user-logged-in");
24		} else{
25			$body.addClass("user-not-d-in");
26		}
27	}
28	
29	// needed for revize bar
30	$('[data-toggle="tooltip"]').tooltip({trigger:"hover"})
31	
32	//make menu Mega
33	$("#nav>li>ul").filter(function () {
34		return $(this).find('li').length >= 1
35	}).addClass("make-mage").parent().addClass("static");
36
37	$(window).on("scroll", function() {
38		if($(window).scrollTop() > 0) {
39			$(".sticky-header").addClass("sticky-top");
40		} else {
41		   $(".sticky-header").removeClass("sticky-top");
42		}
43	});
44
45	$('.mega-content-header').each(function(){
46		var megaHeaderIndex = $(this).parent().index();
47		console.log(megaHeaderIndex)
48		$(this).text($('#nav>li').eq(megaHeaderIndex).children('a,span').text() + ' menu');
49	})
50	
51	$('.mega-content').each(function(){
52		var megaContentIndex = $(this).index();
53		console.log(megaContentIndex);
54		$(this).clone();
55		$('#nav>li').eq(megaContentIndex).children('ul').prepend($(this).clone())
56	});
57
58	// Clone icons to each navigation link/span
59	$('#navicons li').each(function(){
60		var navIconIndex = $(this).index();
61		$(this).find('img').prependTo($('#nav>li').eq(navIconIndex).children('a,span'));
62	});
63
64	// Keyboard Navigation: Nav, flyout
65	var isClick = false;
66	$("#nav li a, #flyout  li a, a, button, .toggle, .toggle2").on('focusin', function(e) {
67		if( isClick === false ) {
68			$(".focused").removeClass("focused");
69			$(e.currentTarget).parents("#nav li, #flyout li").addClass("focused");
70			$(".opened:not(.focused) ul:visible,.opened2:not(.focused) ul:visible").slideUp().parent().removeClass("opened opened2");
71		} else {
72			$(".focused").removeClass("focused");
73			isClick = false;
74		}
75	});
76
77	// for revize buttons container
78	$rzBtnsContainer.each(function(){
79		var $container = $(this);
80		if($container.html().trim()!=""){
81			$container.closest(".has-edit-buttons").addClass('yes-has-edit-buttons');
82		}
83	});
84	$(".has-edit-buttons").not(".yes-has-edit-buttons").removeClass("has-edit-buttons");
85
86	// responsive views from revize bar 
87	var urlParams = new URLSearchParams(window.location.search); //get all parameters
88	var hidebar = urlParams.get('hidebar'); //extract the hidebar parameter - this will return NULL if hidebar isn't a parameter
89	
90	if(hidebar) { //check if hidebar parameter is set to anything
91		$body.removeClass("user-logged-in").addClass("hide-edit-btns");
92	}
93
94	// prevent focused class changes on click - This way arrows wont pop when clicking nav links
95	$("#nav a,#flyout a").on('mousedown',function(){
96		isClick = true;
97	});
98
99
100	// Navigation Toggle
101	$("#nav-toggle").on("click", function(){
102		$("#nav").stop().slideToggle();
103		// $("#search").hide()
104		$(this).toggleClass("fa-bars fa-close");
105	});
106
107	// Search Toggle
108	$("#search-toggle").on("click", function(){
109		$(".header-right").stop().slideToggle();
110		$(this).toggleClass("active");
111		$("#nav").hide();
112		if ($(this).hasClass('active')) {
113			$(this).removeClass('fa-info').addClass('fa-times');
114			$('#nav-toggle').removeClass('active');
115		} else {
116			$(this).removeClass('fa-times').addClass('fa-info');
117		}
118		$('#nav-toggle').removeClass('fa-times').addClass('fa-bars');
119	});
120
121	
122	// Menu Arrows and Toggles
123	$("#nav >li>ul,#flyout >li>ul").addClass('first-level');
124    $("#nav  li ul ul").addClass('second-level');
125    $("#nav>li:has(ul)").each(function() {
126        $('<a href="#" class="fa fa-angle-down toggle d-lg-none" tabindex="0" aria-haspopup="true" aria-expanded="false" id="dropdown-toggle-' + $(this).index() + '" aria-label="Show Dropdown for ' + $(this).find('a:first').text() + '"></a>').insertAfter($(this).find('a:first'));
127        $(this).find('ul:first').attr('aria-labelledby', 'dropdown-toggle-' + $(this).index());
128    });
129    $('#nav li ul>li:has(ul)').each(function(index) {
130        $('<a href="#" class="fa fa-angle-down toggle2 d-lg-none" tabindex="0" aria-haspopup="true" aria-expanded="false" id="sub-dropdown-toggle-' + index + '" aria-label="Show Dropdown for ' + $(this).find('a:first').text() + '"></a>').insertAfter($(this).find('a:first'));
131        $(this).find('ul:first').attr('aria-labelledby', 'sub-dropdown-toggle-' + index);
132    });
133    $('#flyout >li:has(ul)').each(function() {
134        $('<a href="#" class="fa fa-angle-down toggle d-lg-none" tabindex="0" aria-haspopup="true" aria-expanded="false" id="flyout-dropdown-toggle-' + $(this).index() + '" aria-label="Show Flyout for ' + $(this).find('a:first').text() + '"></a>').insertAfter($(this).find('a:first'));
135        $(this).find('ul:first').attr('aria-labelledby', 'flyout-dropdown-toggle-' + $(this).index());
136    });
137
138	function addNavClass() {
139		if ($window.width() < 992) {
140			// Insert needed for mobile
141		} else{
142			// Insert needed for desktop
143			$('#nav ul, #flyout ul').css('display', '');
144		}
145	}
146	addNavClass();
147	$window.resize(addNavClass);
148
149	$('#search-toggle-desktop').on('click',function(e){
150		$('#search').stop().slideToggle(200);
151		$(this).toggleClass('fa-search fa-close');
152	});
153
154	$(".toggle").on("click keydown",function(e) {
155		if (e.keyCode === 13 || e.type === 'click') {
156			e.preventDefault();
157			var $parent = $(this).parent();
158			var $parentLi = $parent.parent();
159			$parent.toggleClass('opened');
160			if($parent.addClass('active') && $(this).next('.first-level').is(":visible")){
161				$(this).next('.first-level').slideUp();
162				$parent.removeClass('active');
163				$(this).attr({'aria-expanded': 'false'});
164			} else {
165				$(this).attr({'aria-expanded': 'true'});
166				$(".first-level").slideUp("slow");
167				$parent.addClass('active');
168				$(this).next('.first-level').slideToggle();
169			}
170		}
171	});
172	$(".toggle2").on("click keydown",function(e) {
173		if (e.keyCode === 13 || e.type === 'click') {
174			e.preventDefault();
175			var $parent = $(this).parent();
176			var $parentLi = $parent.parent();
177			$parent.toggleClass('opened2');
178			if($parent.addClass('active') && $(this).next('.second-level').is(":visible")){
179				$(this).next('.second-level').slideUp();
180				$parent.removeClass('active');
181				$(this).attr({'aria-expanded': 'false'});
182			} else {
183				$(this).attr({'aria-expanded': 'true'});
184				$(".second-level").slideUp("slow");
185				$parent.addClass('active');
186				$(this).next('.second-level').slideToggle();
187			}
188		}
189	});
190
191	// close nav if left
192	$(".desktop *").focus(function(e){
193		var $opened = $(".opened");
194		var $opened2 = $(".opened2");
195		if( $opened.length > 0 || $opened2.length > 0 ) {
196			if( $(".opened :focus").length < 1 ){
197				$opened.children("ul").slideUp();
198				$opened.removeClass("opened");
199				$(".opened2").removeClass("opened2");
200			}
201			if( $(".opened2 :focus").length < 1 ){
202				$opened2.children("ul").slideUp();
203				$opened2.removeClass("opened2");
204			}
205		}
206	});
207
208	// Flyout
209	var flyout = $('#flyout'),
210		flyoutwrap = $('#flyout-wrap');
211
212	if (flyout.text().length){
213		flyoutwrap.prepend('<div id="flyout-toggle" class="d-xl-none d-lg-none"><i class="fa fa-bars"></i> Sub Menu</div>');
214	}
215
216	$("#flyout-toggle").on("click", function(){
217		flyout.slideToggle();
218		$(this).toggleClass("active");
219	});
220
221
222	function fillSide(){
223		$('.fillRight').each(function(){
224			var cContainer = parseFloat($(this).closest('.container').css('margin-right')) + 15;
225			console.log('fillright', cContainer)
226			$('.fillRight').css('margin-right',-cContainer);
227			$('.fillRight.withPadding').css('padding-right',cContainer);
228		});
229		$('.fillLeft').each(function(){
230			var cContainer = parseFloat($(this).closest('.container').css('margin-left')) + 15;
231			console.log('fillleft', cContainer)
232			$('.fillLeft').css('margin-left',-cContainer);
233			$('.fillLeft.withPadding').css('padding-left',cContainer);
234		});
235	}
236	$('.aside-left-box').addClass('fillLeft withPadding');
237	$('').addClass('fillRight withPadding');
238	fillSide();
239	$window.resize(fillSide);
240
241
242	/*
243	* E-Notify Auto submit
244	*/
245	$.urlParam=function(n){var e=new RegExp("[?&]"+n+"=([^]*)").exec(window.location.href);return null==e?null:e[1]||0};
246	var $enotify = $('iframe[src*="/revize/plugins/notify/notify.jsp"]');
247	if( $enotify.length > 0 ){
248		var emailStr = $.urlParam("email");
249		if( emailStr != null ){
250			$enotify.attr("src", $enotify.attr("src") + "&email=" + emailStr);
251		}
252	}
253
254	// Make sure all calendars have unique ids
255	$('iframe[name="calendar"]').each(function (index, calendar) {
256		calendar.id = 'calendar-' + index;
257	});
258
259	// Start Frame Resizer
260	function resizeIframe(height, frameElement) {
261		if ( frameElement ) {
262			frameElement.height = "";
263			frameElement.height = height;
264		}
265	}
266
267	var eventMethod = window.addEventListener ? "addEventListener" : "attachEvent";
268	var eventHandler = window[eventMethod];
269	var messageEvent = eventMethod === "attachEvent" ? "onmessage" : "message";
270	eventHandler(messageEvent, function (e) {
271		if ( Array.isArray(e.data) ) {
272			if( e.data[0] === "setCalHeight" || e.data[0] === "setNotifyHeight") {
273				var frames = document.querySelectorAll('iframe');
274				for( var i = 0; i < frames.length; i++ ) {
275					if( frames[i].contentWindow === e.source ){
276						resizeIframe(e.data[1], frames[i]);
277					}
278				}
279			}
280		}
281	});
282	// End Frame Resizer
283
284	// Font resizer
285	function textResizer() {
286		var  $dec, $inc;
287		$inc = $('#increase-font');
288		$dec = $('#decrease-font');
289		$inc.on('click', function(e) {
290			return $('body p, body span,#nav a,#nav span,#flyout a,footer a,footer p,button,.btn,.rz-btn,#font-size .label,.social-links,div,h1,h2,h3,h4,h5,h6').css({
291				'font-size': '+=.5'
292			});
293		});
294		$dec.on('click', function(e) {
295			return $('body p, body span,#nav a,#nav span,#flyout a,footer a,footer p,button,.btn,.rz-btn,#font-size .label,.social-links,div,h1,h2,h3,h4,h5,h6').css({
296				'font-size': '-=.5'
297			});
298		});
299		return $('#font-resizer a').on('click', function(e) {
300			return e.preventDefault();
301		});
302	};
303	textResizer();
304
305	// Alert Close Caching
306	if ($("div.alert").length) {
307		var hide = window.sessionStorage && parseInt(window.sessionStorage.getItem("alertClosed")) > 1;
308		if (!hide || $(".user-logged-in").length != 0) {
309			$("div.alert").addClass('show');
310		}
311		$("div.alert .close-alert").on('click', function(e) {
312			if (window.sessionStorage) {
313				window.sessionStorage.setItem("alertClosed",parseInt(window.sessionStorage.getItem("alertClosed")||0)+1);
314			}
315		});
316	}
317
318
319	var $translateButton = $('#translate-button');
320	$translateButton.on('keydown click', function(e){
321		if (e.keyCode === 13 || e.type === 'click') {
322			$('#translation-links ul').stop().fadeToggle();
323			$translateButton.attr('aria-expanded', !('true' === $translateButton.attr('aria-expanded')));
324		}
325	});
326	
327	$('#translation-links ul').on('mouseleave',function(){
328		$(this).fadeOut();
329		$translateButton.attr('aria-expanded', false);
330	});
331	
332	function removeCookieString(value, domain) {
333		domain = domain ? 'domain='+domain+'; ' : '';
334		return value+'; expires=Thu, 01 Jan 1970 00:00:01 GMT; '+domain+'path=/';
335	}
336	
337	function unsetGoogtransCookie() {
338		for (var domains = window.location.hostname.split('.'); domains.length >= 2; domains.shift()) {
339			var cookieString = removeCookieString('googtrans=unset', domains.join('.'));
340			document.cookie=cookieString;
341			if  (domains.length === 2) {
342				cookieString = removeCookieString('googtrans=unset', '.'+domains.join('.'));
343				document.cookie=cookieString;
344			}
345		}
346		document.cookie=removeCookieString('googtrans=unset');
347	}
348	
349	if (document.cookie.split(';').some(function(item) { return item.trim().startsWith('googtrans=/auto/en'); })) {
350		unsetGoogtransCookie();
351	}
352
353	// revizeWeather
354	if (typeof $.fn.revizeWeather !== "undefined") {
355		$.fn.revizeWeather({
356			zip: '48371',
357			city_name: '',
358			unit: 'f',
359			success: function(weather) {
360				var date = new Date();
361				var daysOfWeek = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"];
362				var dayName = daysOfWeek[date.getDay()];
363				var month = date.getMonth() + 1;
364				var day = date.getDate();
365				var year = date.getFullYear();
366				var formattedDate = dayName + ", " + month + "/" + day + "/" + year;
367
368				// Adding a space after the temperature
369				var html = '<span class="weather-icon"><i class="' + weather.icon + '"></i></span>';
370				html += '<div class="weather-inner"><span class="weather-temp">' + weather.temp + ' &deg;F </span><span class="weather-forecast">' + weather.forecast + '</span></div>';
371				// html += '<span class="weather-temp">' + weather.temp + ' &deg;F </span>';
372
373				$(".weather-box").html(html);
374			},
375			error: function(error) {
376				// Better to just hide the section if there is an error
377				$('.weather').hide();
378				console.log(error);
379			}
380		});
381	}
382	
383	// Translate Script
384	var translateURL = "//translate.google.com/translate_a/element.js?cb=googleTranslateElementInit";
385	$.getScript(translateURL);
386	$('#translation-links a').click(function() {
387		var lang = $(this).data('lang');
388		var $frame = $('iframe.skiptranslate');
389		if (!$frame.length) {
390			return false;
391		}
392		var $el = $frame.contents().find('span.text:contains(' + lang + ')').parent().parent().get(0);
393	
394		if (!$el) {
395			$frame.contents().find('span.text:contains("English")').parent().parent().get(0);
396		}
397		$el.click();
398		return false;
399	});
400	
401	var $translateReset = $('#translate-reset');
402	$translateReset.on('keydown click', function(e){
403		
404		if (e.keyCode === 13 || e.type === 'click') {
405			$('iframe.skiptranslate').contents().find('span.text:contains("English")').parent().parent().get(0).click();
406		}
407	});
408
409	$(".search-btn .fa").on("click", function(){
410		$(".search-open").stop().slideToggle();
411		$(this).toggleClass("fa-search fa-close");
412	});
413
414	// tabs
415	$('#events-tabs .tab').click(function (e) {
416		var tabsIndex = $(this).index();
417		console.log(tabsIndex);
418		$('#events-tabs .tab').removeClass('active');
419		$(this).addClass('active');
420		$('.tab-calendar').removeClass('active');
421		$('.tab-calendar').hide();
422		$('.tab-calendar').eq(tabsIndex).addClass('active');
423		$('.tab-calendar').eq(tabsIndex).show();
424
425		$('.tab-event').removeClass('active');
426		$('.tab-event').hide();
427		$('.tab-event').eq(tabsIndex).addClass('active');
428		$('.tab-event').eq(tabsIndex).show();
429	});
430
431	// Tiny Slider
432	if (typeof tns !== "undefined") {
433		$('.tiny-slider').each(function(i, el) {
434			tns({
435				autoplay: true,
436				autoplayTimeout: 8000,
437				container: el,
438				items: 1,
439				lazyload: true,
440				loop: false,
441				nav: true,
442				lazyloadSelector: '.tns-lazy-img',
443				mode: "gallery",
444				preventScrollOnTouch: 'force',
445				autoplayButtonOutput: false,
446				controlsText: ['<i class="fa fa-chevron-left"></i>','<i class="fa fa-chevron-right"></i>'],
447			});
448		});
449		
450		// Welcome Slider
451		$('#welcome-carousel').each(function(i, el) {
452			var $el = $(el);
453			var welcomeCount = $el.children().length;
454			function welcomeItems(cnt) {return welcomeCount > cnt ? cnt : welcomeCount;}
455			var welcomeSlider = tns({
456				container: el,
457				preventScrollOnTouch: 'force',
458				loop: false,
459				nav: true,
460				controlsPosition: 'bottom',
461				controlsText: ['<i class="fa fa-chevron-left"></i>','<i class="fa fa-chevron-right"></i>'],
462				"gutter":0,
463				responsive: {
464					0: {
465						items: welcomeItems(1),
466					},
467				},
468			});
469		});
470		
471		// News Slider
472		$('#news-carousel').each(function(i, el) {
473			var $el = $(el);
474			var newsCount = $el.children().length;
475			function newsItems(cnt) {return newsCount > cnt ? cnt : newsCount;}
476			var newsSlider = tns({
477				container: el,
478				preventScrollOnTouch: 'force',
479				loop: false,
480				nav: false,
481				items: 6,
482				controlsPosition: 'bottom',
483				controlsText: ['<i class="fa fa-chevron-left"></i>','<i class="fa fa-chevron-right"></i>'],
484				"gutter":16,
485				responsive: {
486					0: {
487						items: newsItems(1),
488					},
489					768: {
490						items: newsItems(2),
491					},
492					992: {
493						items: newsItems(3),
494					},
495				},
496			});
497		});
498		
499		// Quick Links Slider
500		$('.quick-links-carousel').each(function(i, el) {
501			var $el = $(el);
502			var quickLinksCount = $el.children().length;
503			function quickLinksItems(cnt) {return quickLinksCount > cnt ? cnt : quickLinksCount;}
504			var quickLinksSlider = tns({
505				container: el,
506				preventScrollOnTouch: 'force',
507				loop: false,
508				nav: false,
509				controlsText: ['<i class="fa fa-chevron-left"></i>','<i class="fa fa-chevron-right"></i>'],
510				"gutter":16,
511				responsive: {
512					0: {
513						items: quickLinksItems(1),
514					},
515					475: {
516						items: quickLinksItems(2),
517					},
518					768: {
519						items: quickLinksItems(3),
520					},
521					992: {
522						items: quickLinksItems(5),
523					},
524					1199: {
525						items: quickLinksItems(6),
526					},
527				},
528			});
529		});
530	}
531
532	// Preloader
533	$window.on('load', function() {
534		setTimeout(function(){
535			$body.addClass('loaded');
536			 $('#loader-wrapper').fadeOut();
537		}, 600);
538	});
539
540	$window.ready(function(){
541
542		//#Smooth Scrolling
543		$('a[href*="#"]').not('[href="#"]').not('[href*="#collapse"]').not('.faq-header').click(function(event) {
544			if (location.pathname.replace(/^\//,'') === this.pathname.replace(/^\//,'') && location.hostname === this.hostname) {
545				var target = $(this.hash);
546				target = target.length ? target : $('[name=' + this.hash.slice(1) +']');
547				if (target.length) {
548					event.preventDefault();
549					$('html,body').animate({
550						scrollTop: target.offset().top
551					}, 1000, function() {
552						var $target = $(target);
553						$target.focus();
554						if ($target.is(":focus")) {
555							return false;
556						} else {
557							$target.attr('tabindex','-1');
558							$target.focus();
559							$target.removeAttr('tabindex');
560						};
561					});
562				}
563			}
564		});
565		
566		if(typeof $.fn.YTPlayer !== 'undefined' && $('body').attr('id') == 'homepage'){
567			$("#sliderVideo").YTPlayer();
568			$('#wrapper_sliderVideo').css('z-index','1')
569	
570			var interval = setInterval(hideControl,1000);
571			function hideControl(){
572				var videoId = document.getElementById('wrapper_sliderVideo');
573				if(videoId){
574					if(videoId.style.opacity == '1'){
575						clearInterval(interval);
576						$('#slider .tns-controls button').hide();
577					}else{
578						$('#slider .tns-controls button').show();
579					}
580				}
581			}
582			
583		}
584
585
586	}); // Ready
587
588	$(".number-counters").appear(function() {
589		$(".counter-box [data-to]").each(function() {
590			var e = $(this).attr("data-to");
591			$(this).delay(6e3).countTo({
592				from: 1,
593				to: e,
594				speed: 3000,
595				refreshInterval: 50
596			})
597		})
598	});
599
600
601	// calendar-colors
602	const observer = new MutationObserver(() => {
603	 $('.fc-event').each(function() {
604		const borderColor = $(this).css('border-color');
605			$(this).css('background-color', borderColor);
606			});
607		});
608
609		observer.observe(document.querySelector('#calendar'), {
610		childList: true,
611		subtree: true
612	});
613
614})(jQuery);

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.