PageSourceSearch

https://powersportsbusiness.com/wp-content/themes/jannah/assets/js/viewport-scripts.js?ver=7.6.5

js powersportsbusiness.com collected 2026-09-24 09:44:30 UTC 7,259 bytes, 200 lines download raw bytes

1/*! jQuery-viewport-checker v1.8.8 (c) 2015 Dirk Groenen https://github.com/dirkgroenen/jQuery-viewport-checker MIT @license: en.wikipedia.org/wiki/MIT_License */
2!function(o){o.fn.viewportChecker=function(t){var e={classToAdd:"visible",classToRemove:"invisible",classToAddForFullView:"full-visible",removeClassAfterAnimation:!1,offset:100,repeat:!1,invertBottomOffset:!0,callbackFunction:function(o,t){},scrollHorizontal:!1,scrollBox:window};o.extend(e,t);var a=this,s={height:o(e.scrollBox).height(),width:o(e.scrollBox).width()};return this.checkElements=function(){var t,l;e.scrollHorizontal?(t=Math.max(o("html").scrollLeft(),o("body").scrollLeft(),o(window).scrollLeft()),l=t+s.width):(t=Math.max(o("html").scrollTop(),o("body").scrollTop(),o(window).scrollTop()),l=t+s.height),a.each(function(){var a=o(this),i={},n={};if(a.data("vp-add-class")&&(n.classToAdd=a.data("vp-add-class")),a.data("vp-remove-class")&&(n.classToRemove=a.data("vp-remove-class")),a.data("vp-add-class-full-view")&&(n.classToAddForFullView=a.data("vp-add-class-full-view")),a.data("vp-keep-add-class")&&(n.removeClassAfterAnimation=a.data("vp-remove-after-animation")),a.data("vp-offset")&&(n.offset=a.data("vp-offset")),a.data("vp-repeat")&&(n.repeat=a.data("vp-repeat")),a.data("vp-scrollHorizontal")&&(n.scrollHorizontal=a.data("vp-scrollHorizontal")),a.data("vp-invertBottomOffset")&&(n.scrollHorizontal=a.data("vp-invertBottomOffset")),o.extend(i,e),o.extend(i,n),!a.data("vp-animated")||i.repeat){String(i.offset).indexOf("%")>0&&(i.offset=parseInt(i.offset)/100*s.height);var d=i.scrollHorizontal?a.offset().left:a.offset().top,r=i.scrollHorizontal?d+a.width():d+a.height(),c=Math.round(d)+i.offset,f=i.scrollHorizontal?c+a.width():c+a.height();if(i.invertBottomOffset&&(f-=2*i.offset),c<l&&f>t){if(e.isInTop&&d-t>300)return;a.removeClass(i.classToRemove),a.addClass(i.classToAdd),i.callbackFunction(a,"add"),r<=l&&d>=t?a.addClass(i.classToAddForFullView):a.removeClass(i.classToAddForFullView),a.data("vp-animated",!0),i.removeClassAfterAnimation&&a.one("webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend",function(){a.removeClass(i.classToAdd)})}else a.hasClass(i.classToAdd)&&i.repeat&&(a.removeClass(i.classToAdd+" "+i.classToAddForFullView),i.callbackFunction(a,"remove"),a.data("vp-animated",!1))}})},("ontouchstart"in window||"onmsgesturechange"in window)&&o(document).bind("touchmove MSPointerMove pointermove",this.checkElements),o(e.scrollBox).bind("load scroll",this.checkElements),o(window).resize(function(t){s={height:o(e.scrollBox).height(),width:o(e.scrollBox).width()},a.checkElements()}),this.checkElements(),this}}(jQuery);
3
4
5$doc.ready(function(){
6
7	'use strict';
8
9	/**
10	 * Load More Button for archives
11	 **/
12	$doc.on( 'click', '#load-more-archives', function(){
13		if( isDuringAjax === false ){
14			isDuringAjax = true;
15			tie_ajax_archives();
16		}
17	});
18
19
20	/**
21	 * Infinite Scroll for archives
22	 **/
23	var $infiniteScrollArchives = jQuery('.infinite-scroll-archives');
24	if( $infiniteScrollArchives.length ){
25		$infiniteScrollArchives.viewportChecker({
26			repeat: true,
27			offset: 60,
28			callbackFunction: function(){
29				if( isDuringAjax === false ){
30					isDuringAjax = true;
31					tie_ajax_archives();
32				}
33			}
34		});
35	}
36
37
38	/**
39	 * Story Index
40	 */
41	var $StoryIndex = jQuery('#story-index');
42	if( $StoryIndex.length && window.innerWidth ){
43
44		var $content = jQuery('#content');
45
46		jQuery('.index-title').viewportChecker({
47			repeat: true,
48			offset: 10,
49			isInTop: true, // By TieLabs - Used to heighlight the element when it reach the top of the page
50			callbackFunction: function( elem, action ){
51				var ID = elem.attr('id');
52				$StoryIndex.find('a').removeClass('is-current');
53				jQuery('#trigger-' + ID).addClass('is-current');
54			}
55		});
56
57		if( jQuery.fn.theiaStickySidebar ){
58			$StoryIndex.theiaStickySidebar({
59				'containerSelector'   : '#the-post .entry-content',
60				'additionalMarginTop' : 150
61			});
62		}
63
64		jQuery( '#story-index-icon, #story-index a' ).on('click', function(){
65			$StoryIndex.find( '.story-index-content' ).toggle();
66		});
67
68		storyIndexStatus();
69
70		jQuery(window).resize(function() {
71			storyIndexStatus();
72		});
73	}
74
75	function storyIndexStatus(){
76
77		if( jQuery(window).width() < $content.outerWidth() + 370 ){
78			$StoryIndex.addClass( 'is-compact' );
79			$StoryIndex.find( '.theiaStickySidebar' ).removeAttr('style');
80		}else{
81			$StoryIndex.removeClass( 'is-compact' );
82			$StoryIndex.find( '.theiaStickySidebar' ).removeAttr('style');
83		}
84	}
85
86	// End Of Text :)
87});
88
89
90/**
91 * Archives Ajax Pagination
92 */
93function tie_ajax_archives(){
94
95	var pagiButton = jQuery('#load-more-archives');
96
97	if( ! pagiButton.length ){
98		return false;
99	}
100
101	var theQuery    = pagiButton.attr('data-query'),
102			theURL      = pagiButton.attr('data-url'),
103			maxPages    = pagiButton.attr('data-max'),
104			buttonText  = pagiButton.attr('data-text'),
105			latest_post = pagiButton.attr('data-latest'),
106			currentPage = parseInt( pagiButton.attr('data-page') ) +1,
107			is_masonry  = false;
108
109	// Check if the Button Disabled
110	if( pagiButton.hasClass( 'pagination-disabled' ) || currentPage > maxPages ){
111		return false;
112	}
113
114	// Page Layout
115	if( jQuery('#masonry-grid').length ){
116		var theBlock = jQuery('#masonry-grid');
117		is_masonry = true;
118	}
119	else{
120		var theBlock = jQuery('#posts-container');
121	}
122
123	var theLayout   = theBlock.attr('data-layout'),
124			theSettings = theBlock.attr('data-settings');
125
126	// Ajax Call
127	jQuery.ajax({
128		url : tie.ajaxurl,
129		type: 'post',
130		data: {
131			action      : 'tie_archives_load_more',
132			query       : theQuery,
133			max         : maxPages,
134			page        : currentPage,
135			latest_post : latest_post,
136			layout      : theLayout,
137			settings    : theSettings
138		},
139		beforeSend: function(){
140			pagiButton.html( tie.ajax_loader );
141		},
142		success: function( data ){
143
144			data = jQuery.parseJSON(data);
145
146			// Change the latest post number
147			pagiButton.attr( 'data-latest', data['latest_post'] );
148
149			// Hide next posts button
150			if( data['hide_next'] ){
151				pagiButton.addClass( 'pagination-disabled' );
152				pagiButton.html( data['button'] );
153			}
154			else{
155				pagiButton.html( buttonText );
156			}
157
158			data = data['code'];
159			data = data.replace( /<li class="/g, '<li class="posts-items-'+ currentPage +' ' );
160
161			var content = jQuery( data );
162
163			if( is_masonry ){
164				theBlock.append( content ).masonry( 'appended', content );
165				var theBlockList_li = theBlock.find('.post-element');
166				tie_animate_element( theBlockList_li );
167				isDuringAjax = false;
168
169				// Load images and re fire masonry
170				theBlock.imagesLoaded().progress( function(){
171					theBlock.masonry('layout');
172				});
173
174			}
175			else{
176
177				theBlock.append( content );
178				var theBlockList_li = theBlock.find( '.posts-items-'+currentPage ).hide();
179
180				// Animate the loaded items
181				//theBlockList_li.addClass( 'tie-animate-slideInUp tie-animate-delay' ).show();
182
183				var $i = 0;
184				theBlockList_li.each(function(){
185					$i++;
186					jQuery(this).addClass( 'tie-animate-slideInUp' ).attr('style', 'animation-delay: 0.'+ $i +'s' ).show();
187				});
188
189				tie_animate_element( theBlockList_li );
190				isDuringAjax = false;
191			}
192
193		}
194	});
195
196	// Change the next page number
197	pagiButton.attr( 'data-page', currentPage );
198
199	return false;
200}

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.