PageSourceSearch

https://durhammastergardeners.com/_static/??-eJyNy8EOgjAMgOEXck5Il…CPwgdEyVcck2UXFxVykz089y6Mbuns/3K6X/gtSYk6M

js durhammastergardeners.com collected 2026-10-01 14:45:47 UTC 8,259 bytes, 279 lines download raw bytes

1(()=>{const e=document.querySelectorAll(".coblocks-animate");if("IntersectionObserver"in window){const t=new IntersectionObserver((e=>{e.forEach((e=>{e.isIntersecting&&(e.target.classList.add(e.target.dataset.coblocksAnimation),t.unobserve(e.target))}))}),{threshold:[.15]});e.forEach((e=>{t.observe(e)}))}else e.forEach((e=>{e.classList.remove("coblocks-animate"),delete e.dataset.coblocksAnimation}))})();;
2/**
3 * navigation.js
4 *
5 * Handles toggling the navigation menu for small screens and enables tab
6 * support for dropdown menus.
7 */
8( function() {
9	var container, button, menu, links, subMenus;
10
11	container = document.getElementById( 'site-navigation' );
12	if ( ! container ) {
13		return;
14	}
15
16	button = document.getElementsByClassName( 'menu-toggle' )[0];
17	if ( 'undefined' === typeof button ) {
18		return;
19	}
20
21	menu = container.getElementsByTagName( 'ul' )[0];
22
23	// Hide menu toggle button if menu is empty and return early.
24	if ( 'undefined' === typeof menu ) {
25		button.style.display = 'none';
26		return;
27	}
28
29	menu.setAttribute( 'aria-expanded', 'false' );
30	if ( -1 === menu.className.indexOf( 'nav-menu' ) ) {
31		menu.className += ' nav-menu';
32	}
33
34	button.onclick = function() {
35		if ( -1 !== container.className.indexOf( 'toggled' ) ) {
36			container.className = container.className.replace( ' toggled', '' );
37			button.setAttribute( 'aria-expanded', 'false' );
38			menu.setAttribute( 'aria-expanded', 'false' );
39		} else {
40			container.className += ' toggled';
41			button.setAttribute( 'aria-expanded', 'true' );
42			menu.setAttribute( 'aria-expanded', 'true' );
43		}
44	};
45
46	// Get all the link elements within the menu.
47	links    = menu.getElementsByTagName( 'a' );
48	subMenus = menu.getElementsByTagName( 'ul' );
49
50	// Set menu items with submenus to aria-haspopup="true".
51	for ( var i = 0, len = subMenus.length; i < len; i++ ) {
52		subMenus[i].parentNode.setAttribute( 'aria-haspopup', 'true' );
53	}
54
55	// Each time a menu link is focused or blurred, toggle focus.
56	for ( i = 0, len = links.length; i < len; i++ ) {
57		links[i].addEventListener( 'focus', toggleFocus, true );
58		links[i].addEventListener( 'blur', toggleFocus, true );
59	}
60
61	/**
62	 * Sets or removes .focus class on an element.
63	 */
64	function toggleFocus() {
65		var self = this;
66
67		// Move up through the ancestors of the current link until we hit .nav-menu.
68		while ( -1 === self.className.indexOf( 'nav-menu' ) ) {
69
70			// On li elements toggle the class .focus.
71			if ( 'li' === self.tagName.toLowerCase() ) {
72				if ( -1 !== self.className.indexOf( 'focus' ) ) {
73					self.className = self.className.replace( ' focus', '' );
74				} else {
75					self.className += ' focus';
76				}
77			}
78
79			self = self.parentElement;
80		}
81	}
82
83	/**
84	 * Fix child menus for touch devices
85	 */
86	function fixMenuTouchTaps( container ) {
87
88		var touchStartFn,
89			parentLink = container.querySelectorAll( '.menu-item-has-children > a, .page_item_has_children > a' );
90
91		if ( 'ontouchstart' in window ) {
92			if( window.innerWidth > 1000 ) {
93				touchStartFn = function( e ) {
94					var menuItem = this.parentNode;
95
96					if ( ! menuItem.classList.contains( 'focus' ) ) {
97						e.preventDefault();
98						for( var i = 0; i < menuItem.parentNode.children.length; ++i ) {
99							if ( menuItem === menuItem.parentNode.children[i] ) {
100								continue;
101							}
102							menuItem.parentNode.children[i].classList.remove( 'focus' );
103						}
104						menuItem.classList.add( 'focus' );
105					} else {
106						menuItem.classList.remove( 'focus' );
107					}
108				};
109
110				for ( var i = 0; i < parentLink.length; ++i ) {
111					parentLink[i].addEventListener( 'touchstart', touchStartFn, false )
112				}
113			}
114		}
115	}
116
117	fixMenuTouchTaps( container );
118
119} )();;
120( function () {
121	'use strict';
122
123	var menuToggle;
124	var searchToggle;
125	var search;
126	var menu;
127
128	var pendingTransition;
129
130	function cleanUp( el ) {
131		el.style.removeProperty( 'display' );
132		el.style.removeProperty( 'height' );
133		el.style.removeProperty( 'margin-top' );
134		el.style.removeProperty( 'overflow' );
135		el.style.removeProperty( 'transition' );
136	}
137
138	function slideDown( el ) {
139		// Start by cancelling any ongoing transitions and displaying the element.
140		// Note that this won't actually render on screen, as we won't give the
141		// browser a chance to do that.
142		cleanUp( el );
143		pendingTransition = null;
144		el.style.display = 'block';
145
146		// Take measurements.
147		var styles = getComputedStyle( el );
148		var height = styles.height;
149		var marginTop = styles.marginTop;
150
151		// Re-hide the element by setting the height to 0, before the browser has a
152		// chance to render. Also, set up animation parameters for the next step.
153		el.style.height = 0;
154		el.style.overflow = 'hidden';
155		el.style.transition = 'height 400ms, margin-top 400ms';
156
157		// Now that we have our end numbers and the stage is set, trigger animation.
158		// Sadly, we must use a non-performant height/margin animation, as we need
159		// to push all the other page content down while resizing the element.
160		// We use a double rAF to ensure browser compatibility.
161		requestAnimationFrame( function () {
162			requestAnimationFrame( function () {
163				el.style.height = height;
164				el.style.marginTop = marginTop;
165			} );
166		} );
167	}
168
169	function slideUp( el ) {
170		// Trigger animation.
171		el.style.height = 0;
172		el.style.marginTop = 0;
173
174		var whenFinished = function ( e ) {
175			if ( e.target === el && e.propertyName === 'height' ) {
176				if ( pendingTransition === whenFinished ) {
177					cleanUp( el );
178					pendingTransition = null;
179				}
180				el.removeEventListener( 'transitionend', whenFinished );
181				el.removeEventListener( 'transitioncancel', whenFinished );
182			}
183		};
184
185		// Listen for animation end, so that we can clean up.
186		el.addEventListener( 'transitionend', whenFinished );
187		el.addEventListener( 'transitioncancel', whenFinished );
188		pendingTransition = whenFinished;
189	}
190
191	function toggleSlider( button, slider ) {
192		if ( button.classList.contains( 'active' ) ) {
193			button.classList.remove( 'active' );
194			document.body.classList.remove( 'toggle-active' );
195			slideUp( slider );
196		} else {
197			button.classList.add( 'active' );
198			document.body.classList.add( 'toggle-active' );
199			slideDown( slider );
200		}
201	}
202
203	function init() {
204		menuToggle = document.querySelector( '.menu-toggle' );
205		searchToggle = document.querySelector( '.search-toggle' );
206		search = document.querySelector( '.mobile-search' );
207		menu = document.querySelector( '.main-navigation' );
208
209		if ( ! menuToggle || ! searchToggle || ! search || ! menu ) {
210			return;
211		}
212
213		// Toggle mobile-menu.
214		menuToggle.addEventListener( 'click', function ( e ) {
215			e.preventDefault();
216			toggleSlider( menuToggle, menu );
217
218			if ( searchToggle.classList.contains( 'active' ) ) {
219				toggleSlider( searchToggle, search );
220			}
221		} );
222
223		// Toggle mobile-search.
224		searchToggle.addEventListener( 'click', function ( e ) {
225			e.preventDefault();
226			toggleSlider( searchToggle, search );
227
228			if ( menuToggle.classList.contains( 'active' ) ) {
229				toggleSlider( menuToggle, menu );
230			}
231		} );
232
233		// Hide/show mobile menu/search block > 1000.
234		window.addEventListener( 'resize', function () {
235			if ( window.innerWidth > 1000 ) {
236				document.body.classList.remove( 'toggle-active' );
237				menuToggle.classList.remove( 'active' );
238				searchToggle.classList.remove( 'active' );
239				search.style.removeProperty( 'display' );
240				cleanUp( search );
241				cleanUp( menu );
242			}
243		} );
244	}
245
246	if ( document.readyState !== 'loading' ) {
247		init();
248	} else {
249		document.addEventListener( 'DOMContentLoaded', init );
250	}
251} )();
252;
253( function() {
254	var is_webkit = navigator.userAgent.toLowerCase().indexOf( 'webkit' ) > -1,
255	    is_opera  = navigator.userAgent.toLowerCase().indexOf( 'opera' )  > -1,
256	    is_ie     = navigator.userAgent.toLowerCase().indexOf( 'msie' )   > -1;
257
258	if ( ( is_webkit || is_opera || is_ie ) && document.getElementById && window.addEventListener ) {
259		window.addEventListener( 'hashchange', function() {
260			var id = location.hash.substring( 1 ),
261				element;
262
263			if ( ! ( /^[A-z0-9_-]+$/.test( id ) ) ) {
264				return;
265			}
266
267			element = document.getElementById( id );
268
269			if ( element ) {
270				if ( ! ( /^(?:a|select|input|button|textarea)$/i.test( element.tagName ) ) ) {
271					element.tabIndex = -1;
272				}
273
274				element.focus();
275			}
276		}, false );
277	}
278})();
279;

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.