PageSourceSearch

https://www.parkertrutec.com/wp-content/themes/parkerTruTech/assets/js/theme.js?ver=7.1.2

js parkertrutec.com collected 2026-10-08 10:39:06 UTC 5,110 bytes, 231 lines download raw bytes

1// Touch Device Detection
2
3if (Modernizr.touchevents) {
4	// Add class to body indicating touch support
5	jQuery(document).ready(function() {
6		jQuery('body').addClass('touch-support');
7
8		jQuery('.nav-cat-header > a').on("click", function(e) {
9			e.preventDefault();
10			e.stopPropagation();
11
12			if (jQuery(this).parent().hasClass('open'))
13				jQuery(this).parent().removeClass('open');
14			else {
15				jQuery(this).parent().addClass('open');
16			}
17
18    	});
19
20	});
21} else {
22	jQuery(document).ready(function() {
23		jQuery("body").addClass('no-touch-support');
24
25		// Swich to hover vs click for dropdowns
26		jQuery(function(){
27			jQuery('.dropdown').hover(function() {
28					jQuery(this).addClass('open');
29			},
30			function() {
31					jQuery(this).removeClass('open');
32			});
33		});
34
35	});
36}
37
38// Open/Close Side Nav
39jQuery(document).ready(function() {
40	var sideslider = jQuery('[data-toggle=collapse-side]');
41	var sel = sideslider.attr('data-target');
42
43	sideslider.click(function(event) {
44		jQuery(sel).toggleClass('in');
45	});
46});
47
48// Touch Controls
49jQuery(document).ready(function($) {
50
51	//Carousel
52	//Stops Menu swipe event
53	$('.carousel').swiperight(function(e) {
54		e.stopPropagation();
55		$(this).carousel('prev');
56	});
57
58	$('.carousel').swipeleft(function(e) {
59		e.stopPropagation();
60		$(this).carousel('next');
61	});
62
63	$('.pt-history').on("swipeleft", function(e){
64		e.stopImmediatePropagation();
65	});
66
67	// Side Collapse Menu
68	$('body').swipeleft(function(e) {
69		$('.side-collapse').removeClass('in');
70	});
71
72	$('.side-collapse').swiperight(function(e) {
73		$(this).addClass('in');
74	});
75});
76
77
78// MATCH HEIGHTS
79jQuery(document).ready(function($) {
80
81
82	$('.pt-document').matchHeight({
83		byRow: true,
84	});
85
86	$('#footer .location').matchHeight({
87		byRow: true,
88	});
89
90	$('.industry').matchHeight({
91		byRow: false,
92	});
93
94	$('.post').matchHeight({
95		byRow: true,
96	});
97
98	$('.pt-locations .pt-location').matchHeight({
99		byRow: true,
100	});
101
102});
103
104
105
106//Forms Logic
107jQuery(document).ready(function($){
108
109	if($('.gform_wrapper').length) {
110		// Floating Labels
111		$(function(){
112			var onClass = "on";
113			var showClass = "show";
114
115			jQuery(".ginput_container input, .ginput_container textarea").bind("checkval",function(){
116				var label = jQuery(this).parent().prev("label");
117
118				if(this.value !== ""){
119					label.addClass(showClass);
120				} else {
121					label.removeClass(showClass);
122				}
123
124			}).on("keyup",function(){
125
126				jQuery(this).trigger("checkval");
127
128			}).on("focus",function(){
129
130				jQuery(this).prev("label").addClass(onClass);
131
132			}).on("blur",function(){
133
134				jQuery(this).prev("label").removeClass(onClass);
135
136			}).trigger("checkval");
137		});
138
139		//Filtering Checkboxes on Contact Form
140		if($('.pt-form-locations').length && $('.pt-form-services').length) {
141
142			$('.pt-form-locations select').on("change", function() {
143				//Get the index of the selected option
144				var i = $(this)[0].selectedIndex;
145
146				//Grab the set Id from the select option
147				var set = $('option', $(this)).eq(i).data("set");
148
149				//If undefined, then show all
150				if(typeof set == 'undefined') {
151
152					$('.pt-set').show()
153					$('.pt-set input').prop( "disabled", false );
154
155				} else {
156					//If defined, hide everything but the set.
157					$('.pt-set').hide();
158					$('.pt-set input').prop( "disabled", true );
159
160					$('.set-' + set).show();
161					$('.set-' + set + ' input').prop( "disabled", false );
162				}
163			});
164		}
165
166		//Show filename when adding document
167		if($('.gf_file').length) {
168			$('.gf_file').on('change', function(e){
169				console.log(e);
170				var fileName = e.target.files[0].name;
171				$('.screen-reader-text', $(this)).html(fileName);
172			});
173		}
174
175	}
176
177
178});
179
180
181// Carousels
182jQuery(document).ready(function($){
183
184	// Front Page
185	$('.pt-carousel-carousel').slick({
186		infinite: true,
187		slidesToShow: 1,
188		slidesToScroll: 1,
189		mobileFirst: true,
190		prevArrow: $('.slick-prev'),
191		nextArrow: $('.slick-next'),
192		responsive: [
193		    {
194		      breakpoint: 600,
195		      settings: {
196		        slidesToShow: 2,
197		        slidesToScroll: 1
198		      }
199		    }
200		  ]
201	});
202
203	//Industry Slider Initiation
204	$('#industry-carousel').carousel({
205		interval: false
206	})
207
208	// Clicking on tab switches slide
209	// The reason I didn't use Boostrap's "carousel-inicators" is because the tabs need their own
210	// custom CSS for different breakpoints. Easier to not have to override Bootstrap default styling on top of that
211	$('.industry-tab').on('click', function(){
212		//Slide number
213		var slide = $(this).data("slide-to");
214
215		//Go to slide
216		$('#industry-carousel').carousel(slide);
217	});
218
219	//On Carousel slide, highlight the correct indicator
220	$('#industry-carousel').on('slide.bs.carousel', function (e) {
221		//Get new slide ID
222  		var slide = $(e.relatedTarget).data("id");
223
224		//Make current tab inactive
225		$('.industry-tab.active').toggleClass('active');
226
227		//Make target tab active
228		$('.industry-tab-' + slide).toggleClass('active');
229	})
230
231});

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.