PageSourceSearch

https://www.bizwrks.us/wp-content/themes/twentyfourteen/js/functions_ver-20150315.js

js bizwrks.us collected 2026-10-08 17:42:12 UTC 6,764 bytes, 220 lines download raw bytes

1var _____WB$wombat$assign$function_____=function(name){return (self._wb_wombat && self._wb_wombat.local_init && self._wb_wombat.local_init(name))||self[name];};if(!self.__WB_pmw){self.__WB_pmw=function(obj){this.__WB_source=obj;return this;}}{
2let window = _____WB$wombat$assign$function_____("window");
3let self = _____WB$wombat$assign$function_____("self");
4let document = _____WB$wombat$assign$function_____("document");
5let location = _____WB$wombat$assign$function_____("location");
6let top = _____WB$wombat$assign$function_____("top");
7let parent = _____WB$wombat$assign$function_____("parent");
8let frames = _____WB$wombat$assign$function_____("frames");
9let opens = _____WB$wombat$assign$function_____("opens");
10/**
11 * Theme functions file
12 *
13 * Contains handlers for navigation, accessibility, header sizing
14 * footer widgets and Featured Content slider
15 *
16 */
17( function( $ ) {
18	var body    = $( 'body' ),
19		_window = $( window ),
20		nav, button, menu;
21
22	nav = $( '#primary-navigation' );
23	button = nav.find( '.menu-toggle' );
24	menu = nav.find( '.nav-menu' );
25
26	// Enable menu toggle for small screens.
27	( function() {
28		if ( ! nav.length || ! button.length ) {
29			return;
30		}
31
32		// Hide button if menu is missing or empty.
33		if ( ! menu.length || ! menu.children().length ) {
34			button.hide();
35			return;
36		}
37
38		button.on( 'click.twentyfourteen', function() {
39			nav.toggleClass( 'toggled-on' );
40			if ( nav.hasClass( 'toggled-on' ) ) {
41				$( this ).attr( 'aria-expanded', 'true' );
42				menu.attr( 'aria-expanded', 'true' );
43			} else {
44				$( this ).attr( 'aria-expanded', 'false' );
45				menu.attr( 'aria-expanded', 'false' );
46			}
47		} );
48	} )();
49
50	/*
51	 * Makes "skip to content" link work correctly in IE9 and Chrome for better
52	 * accessibility.
53	 *
54	 * @link http://www.nczonline.net/blog/2013/01/15/fixing-skip-to-content-links/
55	 */
56	_window.on( 'hashchange.twentyfourteen', function() {
57		var hash = location.hash.substring( 1 ), element;
58
59		if ( ! hash ) {
60			return;
61		}
62
63		element = document.getElementById( hash );
64
65		if ( element ) {
66			if ( ! /^(?:a|select|input|button|textarea)$/i.test( element.tagName ) ) {
67				element.tabIndex = -1;
68			}
69
70			element.focus();
71
72			// Repositions the window on jump-to-anchor to account for header height.
73			window.scrollBy( 0, -80 );
74		}
75	} );
76
77	$( function() {
78		// Search toggle.
79		$( '.search-toggle' ).on( 'click.twentyfourteen', function( event ) {
80			var that    = $( this ),
81				wrapper = $( '#search-container' ),
82				container = that.find( 'a' );
83
84			that.toggleClass( 'active' );
85			wrapper.toggleClass( 'hide' );
86
87			if ( that.hasClass( 'active' ) ) {
88				container.attr( 'aria-expanded', 'true' );
89			} else {
90				container.attr( 'aria-expanded', 'false' );
91			}
92
93			if ( that.is( '.active' ) || $( '.search-toggle .screen-reader-text' )[0] === event.target ) {
94				wrapper.find( '.search-field' ).focus();
95			}
96		} );
97
98		/*
99		 * Fixed header for large screen.
100		 * If the header becomes more than 48px tall, unfix the header.
101		 *
102		 * The callback on the scroll event is only added if there is a header
103		 * image and we are not on mobile.
104		 */
105		if ( _window.width() > 781 ) {
106			var mastheadHeight = $( '#masthead' ).height(),
107				toolbarOffset, mastheadOffset;
108
109			if ( mastheadHeight > 48 ) {
110				body.removeClass( 'masthead-fixed' );
111			}
112
113			if ( body.is( '.header-image' ) ) {
114				toolbarOffset  = body.is( '.admin-bar' ) ? $( '#wpadminbar' ).height() : 0;
115				mastheadOffset = $( '#masthead' ).offset().top - toolbarOffset;
116
117				_window.on( 'scroll.twentyfourteen', function() {
118					if ( _window.scrollTop() > mastheadOffset && mastheadHeight < 49 ) {
119						body.addClass( 'masthead-fixed' );
120					} else {
121						body.removeClass( 'masthead-fixed' );
122					}
123				} );
124			}
125		}
126
127		// Focus styles for menus.
128		$( '.primary-navigation, .secondary-navigation' ).find( 'a' ).on( 'focus.twentyfourteen blur.twentyfourteen', function() {
129			$( this ).parents().toggleClass( 'focus' );
130		} );
131	} );
132
133	/**
134	 * @summary Add or remove ARIA attributes.
135	 * Uses jQuery's width() function to determine the size of the window and add
136	 * the default ARIA attributes for the menu toggle if it's visible.
137	 * @since Twenty Fourteen 1.4
138	 */
139	function onResizeARIA() {
140		if ( 781 > _window.width() ) {
141			button.attr( 'aria-expanded', 'false' );
142			menu.attr( 'aria-expanded', 'false' );
143			button.attr( 'aria-controls', 'primary-menu' );
144		} else {
145			button.removeAttr( 'aria-expanded' );
146			menu.removeAttr( 'aria-expanded' );
147			button.removeAttr( 'aria-controls' );
148		}
149	}
150
151	_window
152		.on( 'load.twentyfourteen', onResizeARIA )
153		.on( 'resize.twentyfourteen', function() {
154			onResizeARIA();
155	} );
156
157	_window.load( function() {
158		var footerSidebar,
159			isCustomizeSelectiveRefresh = ( 'undefined' !== typeof wp && wp.customize && wp.customize.selectiveRefresh );
160
161		// Arrange footer widgets vertically.
162		if ( $.isFunction( $.fn.masonry ) ) {
163			footerSidebar = $( '#footer-sidebar' );
164			footerSidebar.masonry( {
165				itemSelector: '.widget',
166				columnWidth: function( containerWidth ) {
167					return containerWidth / 4;
168				},
169				gutterWidth: 0,
170				isResizable: true,
171				isRTL: $( 'body' ).is( '.rtl' )
172			} );
173
174			if ( isCustomizeSelectiveRefresh ) {
175
176				// Retain previous masonry-brick initial position.
177				wp.customize.selectiveRefresh.bind( 'partial-content-rendered', function( placement ) {
178					var copyPosition = (
179						placement.partial.extended( wp.customize.widgetsPreview.WidgetPartial ) &&
180						placement.removedNodes instanceof jQuery &&
181						placement.removedNodes.is( '.masonry-brick' ) &&
182						placement.container instanceof jQuery
183					);
184					if ( copyPosition ) {
185						placement.container.css( {
186							position: placement.removedNodes.css( 'position' ),
187							top: placement.removedNodes.css( 'top' ),
188							left: placement.removedNodes.css( 'left' )
189						} );
190					}
191				} );
192
193				// Re-arrange footer widgets after selective refresh event.
194				wp.customize.selectiveRefresh.bind( 'sidebar-updated', function( sidebarPartial ) {
195					if ( 'sidebar-3' === sidebarPartial.sidebarId ) {
196						footerSidebar.masonry( 'reloadItems' );
197						footerSidebar.masonry( 'layout' );
198					}
199				} );
200			}
201		}
202
203		// Initialize audio and video players in Twenty_Fourteen_Ephemera_Widget widget when selectively refreshed in Customizer.
204		if ( isCustomizeSelectiveRefresh && wp.mediaelement ) {
205			wp.customize.selectiveRefresh.bind( 'partial-content-rendered', function() {
206				wp.mediaelement.initialize();
207			} );
208		}
209
210		// Initialize Featured Content slider.
211		if ( body.is( '.slider' ) ) {
212			$( '.featured-content' ).featuredslider( {
213				selector: '.featured-content-inner > article',
214				controlsContainer: '.featured-content'
215			} );
216		}
217	} );
218} )( jQuery );
219
220}

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.