PageSourceSearch

https://uscpr.org/wp-content/themes/uscpr/main.js

js uscpr.org collected 2026-10-01 10:25:00 UTC 933 bytes, 45 lines download raw bytes

1/* ---------------------------------------------------------------------
2 Global Js
3 Target Browsers: All
4 ------------------------------------------------------------------------ */
5
6var USCPR = ( function ( USCPR, $ ) {
7
8	/**
9	 * Toggle site search form
10	 * @type {Object}
11	 */
12	USCPR.siteSearch = {
13		init() {
14			this.bind();
15		},
16
17		bind() {
18			$( '.js-site-search a' ).on( 'click', this.toggleSearch );
19		},
20
21		toggleSearch() {
22			event.preventDefault();
23			var parentLi = $( event.target ).closest( 'header' );
24			parentLi.toggleClass( 'open' );
25			if ( parentLi.hasClass( 'open' ) ) {
26				parentLi.find( 'input' ).focus();
27			}
28		}
29	}
30
31	const onDocReady = [
32		() => {
33			USCPR.siteSearch.init();
34		},
35	];
36
37	// Iterate through callbacks and move each callback separately to event queue
38	$( function () {
39		onDocReady.forEach( callback => {
40			setTimeout( callback, 0 );
41		} );
42	} );
43
44	return USCPR;
45}( USCPR || { }, 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.