1'use strict'; 2 3function woof_init_text(){ 4 (function ($) { 5 let sparams = (new URL( window.location.href )).searchParams; 6 7 let data = { 8 // s: typeof sparams.get('woof_text') !== 'undefined' ? sparams.get('woof_text') : '' 9 }; 10 11 data = {...data, ...woof_husky_txt.default_data}; 12 delete data.page;// fix to avoid pagination breaking 13 14 [].forEach.call( 15 $.querySelectorAll( 'input.woof_husky_txt-input' ), 16 function (input) { 17 let txt = jQuery( input ).val(); 18 data.s = txt; 19 new HuskyText( input, data ); 20 } 21 ); 22 23 // init default wp search as HuskyText - to options - TODO 24 if (false) { 25 if ($.querySelectorAll( 'form[role=search] input[type=search]' ).length) { 26 27 [].forEach.call( 28 $.querySelectorAll( 'form[role=search] input[type=search]' ), 29 function (input) { 30 31 if (input.classList.contains( 'husky-input' )) { 32 return;// already defined 33 } 34 35 if (input.closest( 'form[role=search]' ).querySelector( 'input[type=submit]' )) { 36 input.closest( 'form[role=search]' ).querySelector( 'input[type=submit]' ).remove(); 37 } 38 39 let clone = input.cloneNode( true );// trick - reset theme actions 40 input.insertAdjacentElement( 'afterend', clone ); 41 input.remove(); 42 43 new HuskyText( clone, data ); 44 } 45 ); 46 47 } 48 } 49 })( document ); 50}
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.