PageSourceSearch

https://warrenfarrell.com/wp-content/themes/ci-warrenfarrell/js/init.js?ver=6.8.9

js warrenfarrell.com collected 2026-10-02 09:57:14 UTC 5,329 bytes, 232 lines download raw bytes

1function setScrolled() {
2	if ($(window).scrollTop() > 100) {
3		$("body").addClass("scrolled");	
4	} else {
5		$("body").removeClass("scrolled");	
6	}
7}
8
9$(window).load(function() {
10	$('.home .container').stickem({
11		offset: $('.navbar').height(),
12		onStick: function() {
13			$('.home .container .related-children').css("width", function() {
14				return $('.home .container .related-children').parent().width();	
15			});
16		}
17	});
18	
19	$('.main-container').stickem({
20		offset: $('.navbar').height(),
21		onStick: function() {
22			$('.main-container .related-children').css("width", function() {
23				return $('.main-container .related-children').parent().width();	
24			});
25		}
26	});
27	
28	// masonry
29	try {
30		$('body').addClass('masonry');
31		$('.masonry-container').masonry({
32		  itemSelector: '.post-container'
33		});
34		//console.log("masonry initialized");
35	} catch (e) {}
36	
37	// masonry
38	try {
39		$('body').addClass('masonry');
40		$('.masonry-container').masonry({
41		  itemSelector: '.blockquote'
42		});
43		//console.log("masonry initialized");
44	} catch (e) {}
45
46});
47
48$(document).ready(function() {
49	"use strict";
50
51	$.waitForImages.hasImgProperties = ['backgroundImage'];
52	
53 	$('#carousel-container').waitForImages(function() {	
54		$(this).removeClass('hidden');
55		
56		var wow = new WOW({
57			boxClass:     'wow',      // animated element css class (default is wow)
58			animateClass: 'animated', // animation css class (default is animated)
59			offset:       0,          // distance to the element when triggering the animation (default is 0)
60			mobile:       false        // trigger animations on mobile devices (true is default)
61		});
62		
63		try {
64			wow.init();
65		} catch (e) {
66			$('.wow').css({"visibility":"visible"});
67		}
68		
69 	}, function(loaded, count, success) {}, true);
70
71	$("#books-carousel").owlCarousel({
72		loop: true,
73		center: false,
74		nav: false,
75		dots: true,
76		margin: 40,
77		responsive : {
78			0: {
79				items: 1
80			},
81			544: {
82				items: 2,
83			},
84			768: {
85				items: 3
86			},
87			992: {
88				items: 4
89			},
90			1200: {
91				items: 6
92			}
93		}
94	});
95
96	function whichTransitionEvent(){
97	  var t,
98		  el = document.createElement("fakeelement");
99	
100	  var transitions = {
101		'WebkitTransition' :'webkitTransitionEnd',
102		'MozTransition'    :'transitionend',
103		'MSTransition'     :'msTransitionEnd',
104		'OTransition'      :'oTransitionEnd',
105		'transition'       :'transitionEnd'
106	  };
107	
108	  for (t in transitions){
109		if (el.style[t] !== undefined){
110		  return transitions[t];
111		}
112	  }
113	}
114	
115	var transitionEvent = whichTransitionEvent();
116	var stickyOffset = 0;
117	
118	$(".navbar-toggler").on("click", function() {
119		var transitionlocker = 0;
120		
121		if ($("html").hasClass("scroll-lock")) {
122			$("html").removeClass("scroll-lock");
123			$("#primary-slide-menu > div.the-aside").on(transitionEvent, function() {
124				if (transitionlocker == 0) {
125					$("#primary-slide-menu").removeClass("active");
126					transitionlocker = 1;
127				}
128			});
129		} else {
130			$("html").addClass("scroll-lock");
131			$("#primary-slide-menu").addClass("active");			
132		}
133				
134		return false;
135	});
136
137	function instantSearch(){
138		keyword = $('#header-search-input').val();
139
140		if (keyword.length >= 3) {
141			$.post(ajaxurl, {s: keyword, action: 'get_search_results'}, function(data, success) {
142				if (success === 'success') {
143					$('#header-search-results').html(data);
144					$('#header-search-results').slideDown("fast");
145				}
146			});
147		}
148		
149		// Verhindert das richtige abschicken des Formulars
150		return false;
151	}
152	 
153	$('#header-search-input').on('change',		function(){instantSearch();});
154	$('#header-search-input').on('keyup',		function(){instantSearch();});
155	$('#header-search').on('submit',			function(){instantSearch();return false;});
156	$('#header-search-input').on('blur',		function() { $('#header-search-results').slideUp("fast"); });
157		
158	$("a.grouped_items").fancybox({
159	    openEffect: 'fade',
160		prevEffect	: 'fade',
161		nextEffect	: 'fade',
162		type: 'image',
163		helpers	: {
164			title	: {
165				type: 'outside'
166			},
167			thumbs	: {
168				width	: 50,
169				height	: 50
170			}
171		}
172	});
173	
174	setScrolled();
175});
176
177$(window).resize(function() {	
178});
179
180$(window).scroll(function() {
181	setScrolled();
182});
183
184$('#menu-container').menuAim({
185	activate: function(e) {
186	  if ($(e).not('.open')) {
187	    if ($(e).find('.dropdown-menu').length > 0) {
188			
189			$element = $(e).find('.dropdown-menu').first();
190			$off = $(e).offset();
191			$l = $off.left;
192			$w = $element.width();
193			$docW = $("body").width();
194			
195			var isEntirelyVisible = ($l + $w <= $docW);
196			
197			if (!isEntirelyVisible) {
198		  		$(e).find('.dropdown-menu').first().fadeIn();
199		  		$(e).addClass('flip-dropdown open');
200			} else {
201				$(e).find('.dropdown-menu').first().fadeIn();
202		  		$(e).addClass('open');
203			}
204			
205		}
206	  }
207	},
208	deactivate: function(e) {
209	  if ($(e).hasClass('open')) {
210		$(e).find('.dropdown-menu').first().fadeOut();
211		$(e).removeClass('open');
212	  }
213	},
214	exitMenu: function(e) {
215	  return true;
216	},
217    submenuDirection: "below",
218	rowSelector: ".navbar-nav > li"
219});
220
221$('#primary-slide-menu .dropdown-toggle').off('click').on('click', function() {
222		$submenu = $(this).parent().children('.dropdown-menu');
223		$(this).add($submenu).toggleClass('dropdown-menu-active'); // Toggle active class.
224			
225		if ($submenu.hasClass('dropdown-menu-active')) {
226			$submenu.slideDown(200);
227		} else {
228			$submenu.slideUp(200);
229		}
230		
231		return false;
vendor: 3 bytes, line 232
232});

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.