PageSourceSearch

https://optimizerx.ai/wp-content/plugins/g5-core/assets/js/search-ajax.min.js?ver=1.8.9

js optimizerx.ai collected 2026-10-05 14:26:20 UTC 2,970 bytes, 1 lines download raw bytes

1(function($){"use strict";$.fn.searchAjax=function(options){const settings=$.extend(true,{inputSelector:'input[type="search"]',resultSelector:".result",iconSelector:"button > i",removeSelector:".remove",actionSelector:':input[name="action"]',nonceSelector:':input[name="_g5core_search_nonce"]',ajaxUrl:window.g5_search_ajax_variable?.ajax_url||"/wp-admin/admin-ajax.php",debounceTime:500,minKeywordLength:2,iconClasses:{search:"fa-search",loading:"fa-spinner fa-spin"},onSuccess:null,onClear:null},options);return this.each(function(){const $this=$(this);const $input=$this.find(settings.inputSelector);const $result=$this.find(settings.resultSelector);const $icon=$this.find(settings.iconSelector);const $remove=$this.find(settings.removeSelector);let timeoutId=null;let xhr=null;function handleClear(){$input.val("").focus();$result.html("");$remove.removeClass("in");$this.removeClass("in");if($.isFunction(settings.onClear)){settings.onClear($this,$input,$result,$remove)}}function handleSearch(){const keyword=$input.val();if(keyword.length<settings.minKeywordLength){return}$icon.addClass(settings.iconClasses.loading).removeClass(settings.iconClasses.search);if(xhr){xhr.abort()}const formData=new FormData($this[0]);xhr=$.ajax({type:"POST",url:settings.ajaxUrl,data:formData,processData:false,contentType:false,success:function(response){console.log(response);if(response.success){$icon.removeClass(settings.iconClasses.loading).addClass(settings.iconClasses.search);$result.html(response.data);$remove.addClass("in");$this.addClass("in");if($.isFunction(settings.onSuccess)){settings.onSuccess(response,$this,$result,$remove)}}},error:function(response){if(response.statusText==="abort")return;$icon.removeClass(settings.iconClasses.loading).addClass(settings.iconClasses.search);console.error("Search AJAX error:",response)}})}$remove.on("click.searchAjax",handleClear);$input.on("keyup.searchAjax",function(event){if(event.altKey||event.ctrlKey||event.shiftKey||event.metaKey)return;if(["Control","Alt","Shift"].includes(event.key))return;switch(event.key){case"Escape":handleClear();break;case"ArrowUp":case"ArrowDown":case"Enter":break;default:clearTimeout(timeoutId);timeoutId=setTimeout(handleSearch,settings.debounceTime);break}});$this.on("submit.searchAjax",function(event){event.preventDefault();const $actionInput=$this.find(settings.actionSelector);const $nonceInput=$this.find(settings.nonceSelector);if($actionInput.length)$actionInput.prop("disabled",true);if($nonceInput.length)$nonceInput.prop("disabled",true);$this.off("submit.searchAjax").submit()});$this.data("searchAjax",{destroy:function(){$remove.off(".searchAjax");$input.off(".searchAjax");$this.off(".searchAjax");if(xhr)xhr.abort();clearTimeout(timeoutId);$this.removeData("searchAjax")}})})};$.fn.searchAjax.destroy=function(){return this.each(function(){const instance=$(this).data("searchAjax");if(instance&&typeof instance.destroy==="function"){instance.destroy()}})}})(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.