PageSourceSearch

https://eco.ca/wp-content/plugins/eco-career-profiles/includes/js/eco_career_profiles.js?ver=1711155308

js eco.ca collected 2026-09-24 18:20:55 UTC 2,328 bytes, 80 lines download raw bytes

1;(function ( $, window, document, undefined ) {
2	let profileComponents = $('#bodyText').find('.profile-component');
3
4	//Only execute on Career Profile pages.
5	if (profileComponents.length === 0) {
6		return;
7	}
8
9	let careerNav = $('#careerNav').find('ul').get(0);
10	
11	//clear all other profile sections.
12	profileComponents.css('display', 'none');
13
14	//make active profile section visible (initially it's always '#at-a-glance'.)
15    $('#bodyText').find('.profile-component#at-a-glance').css('display', 'block')
16
17	// we're building the nav items. Each will look like this:
18	//<li class="nav-item">
19	//	<a class="nav-link active" data-toggle="tab" href="#" targ="#at-a-glance" role="tab" aria-selected="true">En bref</a>
20	//</li>
21	profileComponents.each(function(index, element) {
22		let id = element.id;
23		let title = $(element).find('h2').text();
24		let content = $(element).find('.jet-listing-dynamic-field__content').text();
25
26		// console.log(element);
27		// console.log(id);
28		// console.log(title);
29		// console.log(content);
30
31		//skip generating nav items, if this profile content is empty.
32		if (content === "") {
33			return;
34		}
35	
36		let newLi = document.createElement("li");
37		newLi.classList.add('nav-item');
38		
39			let newA = document.createElement("a");
40			newA.setAttribute('class', 'nav-link');
41
42			//if fist element, make it active
43			if (index === 0) {
44				newA.classList.add('active');
45				newA.setAttribute('aria-selected', 'true');
46			}
47			else {
48				newA.setAttribute('aria-selected', 'false');
49			}
50		
51			newA.setAttribute('data-toggle', 'tab');
52			newA.setAttribute('href', '#');
53			newA.setAttribute('targ', '#' + id);
54			newA.setAttribute('role', 'tab');
55			newA.innerHTML = title;
56		
57		newLi.appendChild(newA);
58
59		careerNav.appendChild(newLi);
60	});
61
62	//add listener to show appropriate profile section when clicking on them.
63	$("#careerNav").find('.nav-link').on('click',function(e) {
64		e.preventDefault();
65
66		$("#careerNav").find('.nav-link').removeClass('active');
67
68		let target = $(this).attr('targ');
69		$(this).addClass('active');
70         
71        //console.log(target)
72
73        //clear all other profile sections
74		$('#bodyText').find('.profile-component').css('display', 'none');
75
76		//show only relevant one
77		$('#bodyText').find(target).show().css('display','block');
78	});
79
80})( jQuery, window, document );

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.