PageSourceSearch

https://beirutmarathon.org/js/shortcode-frontend.js

js beirutmarathon.org collected 2026-10-02 11:22:34 UTC 5,377 bytes, 149 lines download raw bytes

1(function($) {
2  "use strict";
3$(document).ready(function(){
4	// Tabs
5	$('body:not(.bt-other-shortcodes-loaded) .our-team-nav span').on('click',  function (e) {
6		var $tab = $(this),
7			index = $tab.index(),
8			is_disabled = $tab.hasClass('bt-tabs-disabled'),
9			$tabs = $tab.parent('.our-team-nav').children('span'),
10			$panes = $tab.parents('.our-team-tabs').find('.our-team-pane'),
11			$gmaps = $panes.eq(index).find('.bt-gmap:not(.bt-gmap-reloaded)');
12		// Check tab is not disabled
13		if (is_disabled) return false;
14		// Hide all panes, show selected pane
15		$panes.hide().removeClass('active').eq(index).show().addClass('active');
16		// Disable all tabs, enable selected tab
17		$tabs.removeClass('our-team-current').eq(index).addClass('our-team-current');
18		// Reload gmaps
19		if ($gmaps.length > 0) $gmaps.each(function () {
20			var $iframe = $(this).find('iframe:first');
21			$(this).addClass('bt-gmap-reloaded');
22			$iframe.attr('src', $iframe.attr('src'));
23		});
24		// Set height for vertical tabs
25		tabs_height();
26		e.preventDefault();
27	});
28	$('.tab-history .our-team-nav span').unbind('click');
29	$('.tab-history .our-team-nav span').on('click',  function (e) {
30		var $tab = $(this),
31			index = $tab.index(),
32			is_disabled = $tab.hasClass('bt-tabs-disabled'),
33			$tabs = $tab.parent('.our-team-nav').children('span'),
34			$panes = $tab.parents('.our-team-tabs').find('.our-team-pane'),
35			$gmaps = $panes.eq(index).find('.bt-gmap:not(.bt-gmap-reloaded)');
36		// Check tab is not disabled
37		if (is_disabled) return false;
38		// Hide all panes, show selected pane
39		//$panes.hide().removeClass('active').eq(index).show().addClass('active');
40		$panes.each(function(){
41			var self = $(this);
42			if($(this).hasClass('active')){
43				$(this).removeClass('active').addClass('out');
44			}
45			setTimeout(function(){
46				self.removeClass('out');
47			}, 700);
48		});
49		
50		$panes.eq(index).show().addClass('active');
51		var height = $panes.eq(index).outerHeight();
52		$tab.parents('.our-team-tabs').find('.our-team-panes').animate({height: height}, 700);
53		// Disable all tabs, enable selected tab
54		$tabs.removeClass('our-team-current').eq(index).addClass('our-team-current');
55		// Reload gmaps
56		if ($gmaps.length > 0) $gmaps.each(function () {
57			var $iframe = $(this).find('iframe:first');
58			$(this).addClass('bt-gmap-reloaded');
59			$iframe.attr('src', $iframe.attr('src'));
60		});
61		// Set height for vertical tabs
62		tabs_height();
63		e.preventDefault(); 
64	});
65	$(window).resize(function(){
66		var height = $('.tab-history .our-team-panes .active').height();
67		$('.tab-history .our-team-panes').height(height);
68	});
69	// Activate tabs
70	$('.our-team-tabs').each(function () {
71		var active = parseInt($(this).data('active')) - 1;
72		$(this).children('.our-team-nav').children('span').eq(active).trigger('click');
73		tabs_height();
74	});
75
76	// Activate anchor nav for tabs and spoilers
77	anchor_nav();
78	
79	function tabs_height() {
80		$('.bt-tabs-vertical, .bt-tabs-vertical-right').each(function () {
81			var $tabs = $(this),
82				$nav = $tabs.children('.our-team-nav'),
83				$panes = $tabs.find('.our-team-pane'),
84				height = 0;
85			$panes.css('min-height', $nav.outerHeight(true));
86		});
87	}
88	function anchor_nav() {
89		// Check hash
90		if (document.location.hash === '') return;
91		// Go through tabs
92		$('.our-team-nav span[data-anchor]').each(function () {
93			if ('#' + $(this).data('anchor') === document.location.hash) {
94				var $tabs = $(this).parents('.our-team-tabs');
95					 
96				// Activate tab
97				$(this).trigger('click');
98				// Scroll-in tabs container
99				window.setTimeout(function () {
100					$(window).scrollTop($tabs.offset().top - 10);
101				}, 100);
102			}
103		});
104		
105		// Go through spoilers
106		$('.experience-spoiler[data-anchor]').each(function () {
107			if ('#' + $(this).data('anchor') === document.location.hash) {
108				var $spoiler = $(this);
109				// Activate tab
110				if ($spoiler.hasClass('experience-spoiler-closed')) $spoiler.find('.experience-details-title:first').trigger('click');
111				// Scroll-in tabs container
112				window.setTimeout(function () {
113					$(window).scrollTop($spoiler.offset().top  - 10);
114				}, 100);
115			}
116		});
117	}
118
119	if ('onhashchange' in window) $(window).on('hashchange', anchor_nav);
120	
121	/**
122	 * Accordion
123	 */
124	$('.experience-main .experience-details-content').hide();
125	$('.experience-main').each(function(){
126		if($(this).data('active-first') == 'yes'){
127			$(this).find('.experience-spoiler').eq(0).addClass('experience-spoiler-opened').children('.experience-details-content').show();
128		}
129	});
130	$('.experience-details-title').click(function(e){
131		var $spoiler = $(this).parent();
132		var $accordion = $spoiler.parent();
133		$accordion.find('.experience-spoiler-opened .experience-details-content').stop();
134		if($spoiler.hasClass('experience-spoiler-opened')){
135		
136			$spoiler.removeClass('experience-spoiler-opened');
137			$(this).next('.experience-details-content').slideUp(300);
138			
139		}else{
140			$('.experience-spoiler').removeClass('experience-spoiler-opened');
141			$('.experience-spoiler .experience-details-content').slideUp(300);
142			$spoiler.addClass('experience-spoiler-opened');
143			$(this).next('.experience-details-content').slideDown(300);
144		}
145		
146	});
147});
148	//$('body').addClass('bt-other-shortcodes-loaded');
149})(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.