PageSourceSearch

https://www.myutensilcrock.com/wp-content/themes/lbd-pro-v/js/general.js?ver=2.2.1

js myutensilcrock.com collected 2026-10-03 20:28:23 UTC 8,124 bytes, 266 lines download raw bytes

1/*!
2* FitVids 1.1
3*
4* Copyright 2013, Chris Coyier - http://css-tricks.com + Dave Rupert - http://daverupert.com
5* Credit to Thierry Koblentz - http://www.alistapart.com/articles/creating-intrinsic-ratios-for-video/
6* Released under the WTFPL license - http://sam.zoy.org/wtfpl/
7*
8*/
9;(function( $ ) {
10
11	'use strict';
12
13	$.fn.fitVids = function( options ) {
14		var settings = {
15			customSelector: null,
16			ignore: null
17		};
18
19		if ( ! document.getElementById( 'fit-vids-style' ) ) {
20			// appendStyles: https://github.com/toddmotto/fluidvids/blob/master/dist/fluidvids.js
21			var head = document.head || document.getElementsByTagName( 'head' )[0];
22			var css = '.fluid-width-video-wrapper{width:100%;position:relative;padding:0;}.fluid-width-video-wrapper iframe,.fluid-width-video-wrapper object,.fluid-width-video-wrapper embed {position:absolute;top:0;left:0;width:100%;height:100%;}';
23			var div = document.createElement( 'div' );
24			div.innerHTML = '<p>x</p><style id="fit-vids-style">' + css + '</style>';
25			head.appendChild( div.childNodes[1] );
26		}
27
28		if ( options ) {
29			$.extend( settings, options );
30		}
31
32		return this.each(function() {
33			var selectors = [
34				'iframe[src*="player.vimeo.com"]',
35				'iframe[src*="youtube.com"]',
36				'iframe[src*="youtube-nocookie.com"]',
37				'iframe[src*="kickstarter.com"][src*="video.html"]',
38				'object',
39				'embed'
40			];
41
42			if ( settings.customSelector ) {
43				selectors.push( settings.customSelector );
44			}
45
46			var ignoreList = '.fitvidsignore';
47
48			if ( settings.ignore ) {
49				ignoreList = ignoreList + ', ' + settings.ignore;
50			}
51
52			var $allVideos = $( this ).find( selectors.join( ',' ) );
53			$allVideos = $allVideos.not( 'object object' ); // SwfObj conflict patch
54			$allVideos = $allVideos.not( ignoreList ); // Disable FitVids on this video.
55
56			$allVideos.each(function( count ) {
57				var $this = $( this );
58				if ( $this.parents( ignoreList ).length > 0 ) {
59					return; // Disable FitVids on this video.
60				}
61				if ( this.tagName.toLowerCase() === 'embed' && $this.parent( 'object' ).length || $this.parent( '.fluid-width-video-wrapper' ).length ) {
62					return;
63				}
64				if ( ( ! $this.css( 'height' ) && ! $this.css( 'width' ) ) && ( isNaN( $this.attr( 'height' ) ) || isNaN( $this.attr( 'width' ) ) ) ) {
65					$this.attr( 'height', 9 );
66					$this.attr( 'width', 16 );
67				}
68				var height = ( this.tagName.toLowerCase() === 'object' || ( $this.attr( 'height' ) && ! isNaN( parseInt( $this.attr( 'height' ), 10 ) ) ) ) ? parseInt( $this.attr( 'height' ), 10 ) : $this.height(),
69					width = ! isNaN( parseInt( $this.attr( 'width' ), 10 ) ) ? parseInt( $this.attr( 'width' ), 10 ) : $this.width(),
70					aspectRatio = height / width;
71				if ( ! $this.attr( 'id' ) ) {
72					var videoID = 'fitvid' + count;
73					$this.attr( 'id', videoID );
74				}
75				$this.wrap( '<div class="fluid-width-video-wrapper"></div>' ).parent( '.fluid-width-video-wrapper' ).css( 'padding-top', ( aspectRatio * 100 ) + '%' );
76				$this.removeAttr( 'height' ).removeAttr( 'width' );
77			});
78		});
79	};
80})( window.jQuery || window.Zepto );
81
82/*! Gamajo Accessible Menu - v1.0.0 - 2014-09-08
83* https://github.com/GaryJones/accessible-menu
84* Copyright (c) 2014 Gary Jones; Licensed MIT */
85;(function( $, window, document, undefined ) {
86	'use strict';
87
88	var pluginName = 'gamajoAccessibleMenu',
89		hoverTimeout = [];
90
91	// The actual plugin constructor
92	function Plugin( element, options ) {
93		this.element = element;
94		// jQuery has an extend method which merges the contents of two or
95		// more objects, storing the result in the first object. The first object
96		// is generally empty as we don't want to alter the default options for
97		// future instances of the plugin
98		this.opts = $.extend({}, $.fn[ pluginName ].options, options );
99		this.init();
100	}
101
102	// Avoid Plugin.prototype conflicts
103	$.extend( Plugin.prototype, {
104		init: function() {
105			$( this.element )
106				.on( 'mouseenter.' + pluginName, this.opts.menuItemSelector, this.opts, this.menuItemEnter )
107				.on( 'mouseleave.' + pluginName, this.opts.menuItemSelector, this.opts, this.menuItemLeave )
108				.find( 'a' )
109				.on( 'focus.' + pluginName + ', blur.' + pluginName, this.opts, this.menuItemToggleClass );
110		},
111
112		/**
113		 * Add class to menu item on hover so it can be delayed on mouseout.
114		 *
115		 * @since 1.0.0
116		 */
117		menuItemEnter: function( event ) {
118			// Clear all existing hover delays
119			$.each( hoverTimeout, function( index ) {
120				$( '#' + index ).removeClass( event.data.hoverClass );
121				clearTimeout( hoverTimeout[ index ] );
122			});
123			// Reset list of hover delays
124			hoverTimeout = [];
125
126			$( this ).addClass( event.data.hoverClass );
127		},
128
129		/**
130		 * After a short delay, remove a class when mouse leaves menu item.
131		 *
132		 * @since 1.0.0
133		 */
134		menuItemLeave: function( event ) {
135			var $self = $( this );
136			// Delay removal of class
137			hoverTimeout[ this.id ] = setTimeout(function() {
138				$self.removeClass( event.data.hoverClass );
139			}, event.data.hoverDelay );
140		},
141
142		/**
143		 * Toggle menu item class when a link fires a focus or blur event.
144		 *
145		 * @since 1.0.0
146		 */
147		menuItemToggleClass: function( event ) {
148			$( this ).parents( event.data.menuItemSelector ).toggleClass( event.data.hoverClass );
149		}
150	});
151
152	// A really lightweight plugin wrapper around the constructor,
153	// preventing against multiple instantiations
154	$.fn[ pluginName ] = function( options ) {
155		this.each(function() {
156			if ( ! $.data( this, 'plugin_' + pluginName ) ) {
157				$.data( this, 'plugin_' + pluginName, new Plugin( this, options ) );
158			}
159		});
160
161		// chain jQuery functions
162		return this;
163	};
164
165	$.fn[ pluginName ].options = {
166		// The CSS class to add to indicate item is hovered or focused
167		hoverClass: 'menu-item-hover',
168
169		// The delay to keep submenus showing after mouse leaves
170		hoverDelay: 250,
171
172		// Selector for general menu items. If you remove the default menu item
173		// classes, then you may want to call this plugin with this value
174		// set to something like 'nav li' or '.menu li'.
175		menuItemSelector: '.menu-item'
176	};
177})( jQuery, window, document );
178
179/**
180 * Brunch Pro General Scripts
181 *
182 * @copyright Copyright (c) 2017, Feast Design Co.
183 * @license   MIT
184 */
185(function( $, undefined ) {
186	'use strict';
187
188	var $document = $( document ),
189		$navs     = $( '.nav-secondary' );
190
191	/**
192	 * Returns a function, that, as long as it continues to be invoked, will not
193	 * be triggered. The function will be called after it stops being called for
194	 * N milliseconds.
195	 *
196	 * @source underscore.js
197	 * @see http://unscriptable.com/2009/03/20/debouncing-javascript-methods/
198	 * @param {Function} func to wrap
199	 * @param {Number} wait in ms (`100`)
200	 */
201	function debounce( func, wait ) {
202		var timeout;
203
204		return function() {
205			var that = this;
206			var args = arguments;
207
208			clearTimeout( timeout );
209
210			timeout = setTimeout( function() {
211				timeout = null;
212				func.apply( that, args );
213			}, wait );
214		};
215	}
216
217	/**
218	 * Check whether or not a given element is visible.
219	 *
220	 * @param  {object} $object a jQuery object to check
221	 * @return {bool} true if the current element is hidden
222	 */
223	function isHidden( $object ) {
224		var element = $object[0];
225
226		if ( 'undefined' === typeof element ) {
227			return false;
228		}
229
230		return ( null === element.offsetParent );
231	}
232
233	function addNavToggles() {
234		$navs.before( '<div class="menu-toggle"><span></span></div>' );
235		$navs.find( '.sub-menu' ).before( '<div class="sub-menu-toggle"></div>' );
236	}
237
238	function showHideNav() {
239		$( '.menu-toggle, .sub-menu-toggle' ).on( 'click', function() {
240			var $that = $( this );
241			$that.toggleClass( 'active' );
242			$that.next( 'nav, .sub-menu' ).slideToggle( 'slow' );
243		});
244	}
245
246	function reflowNavs() {
247		if ( isHidden( $navs ) ) {
248			$navs.removeAttr( 'style' );
249			$( '.sub-menu-toggle, .menu-toggle' ).removeClass( 'active' );
250		}
251	}
252
253	function navInit() {
254		if ( 0 !== $navs.length ) {
255			addNavToggles();
256			showHideNav();
257			$( window ).resize( debounce( reflowNavs, 200 ) );
258		}
259	}
260
261	$document.ready(function() {
262		$( '#genesis-content' ).fitVids();
263		$document.gamajoAccessibleMenu();
264		navInit();
265	});
266}( 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.