PageSourceSearch

https://mafondue.ch/wp-content/plugins/woocommerce-product-search/js/product-search.min.js?ver=7.7.0

js mafondue.ch collected 2026-10-04 23:54:50 UTC 7,118 bytes, 20 lines download raw bytes

1/*!
2 * product-search.js
3 *
4 * Copyright (c) "kento" Karim Rahimpur www.itthinx.com
5 *
6 * This code is provided subject to the license granted.
7 * Unauthorized use and distribution is prohibited.
8 * See COPYRIGHT.txt and LICENSE.txt
9 *
10 * This code is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13 *
14 * This header and all notices must be kept intact.
15 *
16 * @author itthinx
17 * @package woocommerce-product-search
18 * @since 1.0.0
19 */
20;var ixwps={doPost:true,blinkerTimeouts:[],blinkerTimeout:5000,xhr:null,dragging:false};(function(a){ixwps.inhibitEnter=function(b){a("#"+b).on("keydown",function(c){if(c.keyCode==13){c.preventDefault();return false}})};ixwps.dynamicFocus=function(d,c){var e=a("#"+d),b=a("#"+c);e.on("focusout",function(g){var f=a(this);setTimeout(function(){var h=(f.find(":focus").length>0);if(!h&&!ixwps.dragging){b.hide()}},100)});e.on("focusin",function(h){var g=a(this),f=g.find("input.product-search-field");if(f.length>0){if(a(f[0]).val().length==0){b.html("")}}b.show()});a(document).on("mouseup touchend",function(f){var g=e.is(":focus");if(!g){g=(e.find(":focus").length>0);if(!g){b.hide()}}})};ixwps.navigate=function(c,b){a("#"+c).on("keydown",function(l){var j=0,g=false,n=false;switch(l.keyCode){case 37:break;case 39:break;case 38:j=-1;break;case 40:j=1;break;case 13:g=true;break;case 27:n=true;break}if(j!=0){var k=a("#"+b).find(".entry"),f=a("#"+b+" .entry.active").index();if(k.length>0){if(f>=0){a(k[f]).removeClass("active")}f+=j;if(f<0){f=k.length-1}else{if(f>=k.length){f=0}}a(k[f]).addClass("active");var h=k[f].offsetTop;a("#"+b).find(".product-search-results-content").first().prop("scrollTop",h)}l.preventDefault();return false}if(g){var k=a("#"+b).find(".entry"),f=a("#"+b+" .entry.active").index();if((f>=0)&&(f<k.length)){var m=a(k[f]).find("a").get(0);if(typeof m!=="undefined"){var d=a(m).attr("href");if(typeof d!=="undefined"){l.preventDefault();ixwps.doPost=false;document.location=d;return false}}}}if(n){var k=a("#"+b).find(".entry"),f=a("#"+b+" .entry.active").index();if(k.length>0){if(f>=0){a(k[f]).removeClass("active");a("#"+b).find(".product-search-results-content").first().prop("scrollTop",0)}}l.preventDefault();return false}})};ixwps.autoAdjust=function(d,c){var e=a("#"+d),b=a("#"+c);b.on("adjustWidth",function(g){g.stopPropagation();var f=e.outerWidth()-(b.outerWidth()-b.innerWidth());b.width(f)})};ixwps.productSearch=function(h,g,c,b,j,i){if(!ixwps.doPost){return}if(typeof i==="undefined"){i={}}var k=a("#"+c),e=a("#"+h),d=ixwps.blinkerTimeout;if(typeof i.blinkerTimeout!=="undefined"){d=i.blinkerTimeout}j=j.trim();if(j!=""){if(d!==0){e.addClass("blinker")}if(d>0){ixwps.blinkerTimeouts["#"+h]=setTimeout(function(){e.removeClass("blinker")},d)}var f={action:"product_search","product-search":1,"product-query":j};if(typeof i.lang!=="undefined"){f.lang=i.lang}a("#"+h).parent().find(".product-search-field-clear").hide();if(ixwps.xhr!==null){ixwps.xhr.abort()}ixwps.xhr=a.post(b,f,function(p){ixwps.xhr=null;var q="";if((p!==null)&&(p.length>0)){var v=null,n=true,u=true,t=true,m=true,o=true;if(typeof i.product_thumbnails!=="undefined"){n=i.product_thumbnails}if(typeof i.show_description!=="undefined"){u=i.show_description}if(typeof i.show_price!=="undefined"){t=i.show_price}if(typeof i.show_add_to_cart!=="undefined"){m=i.show_add_to_cart}if(typeof i.show_more!=="undefined"){o=i.show_more}q+='<table class="search-results">';for(var w in p){if(!("type" in p[w])){continue}var s="";if(v!=p[w].type){v=p[w].type;s="first"}q+='<tr class="entry '+p[w].type+" "+s+'">';if(n&&v!="s_product_cat"&&v!="s_more"){q+='<td class="product-image">';q+='<a href="'+p[w].url+'" title="'+p[w].title+'">';if(typeof p[w].thumbnail!=="undefined"){var l="",x="",r="";if(typeof p[w].thumbnail_alt!=="undefined"){r=' alt="'+p[w].thumbnail_alt+'" '}if(typeof p[w].thumbnail_width!=="undefined"){l=' width="'+p[w].thumbnail_width+'" '}if(typeof p[w].thumbnail_height!=="undefined"){x=' height="'+p[w].thumbnail_height+'" '}q+='<img class="thumbnail" src="'+p[w].thumbnail+'" '+r+l+x+"/>"}q+="</a>";q+="</td>"}switch(v){case"s_more":if(o){if(typeof p[w].url!=="undefined"&&typeof p[w].title!=="undefined"){q+='<td class="more-info" colspan="2">';q+='<a href="'+p[w].url+'" title="'+(typeof p[w].a_title!=="undefined"?p[w].a_title:p[w].title)+'">';q+='<span class="title">'+p[w].title+"</span>";q+="</a>";q+="</td>"}else{console.log("WooCommerce Product Search Field, missing data for show more entry.")}}break;case"s_product_cat":if(typeof p[w].url!=="undefined"&&typeof p[w].title!=="undefined"){q+='<td class="category-info" colspan="2">';q+='<a href="'+p[w].url+'" title="'+p[w].title+'">';q+='<span class="title">'+p[w].title+"</span>";q+="</a>";q+="</td>"}else{console.log("WooCommerce Product Search Field, missing data for category entry.")}break;case"product":if(typeof p[w].url!=="undefined"&&typeof p[w].title!=="undefined"){q+='<td class="product-info">';q+='<a href="'+p[w].url+'" title="'+p[w].title+'">';q+='<span class="title">'+p[w].title+"</span>";
20if(u){if(typeof p[w].description!=="undefined"){q+='<span class="description">'+p[w].description+"</span>"}}if(t){if(typeof p[w].price!=="undefined"){q+='<span class="price">'+p[w].price+"</span>"}}q+="</a>";if(m){if(typeof p[w].add_to_cart!=="undefined"){q+='<div class="wps_add_to_cart">'+p[w].add_to_cart+"</div>"}}q+="</td>"}else{console.log("WooCommerce Product Search Field, missing data for product entry.")}break}q+="</tr>"}q+="</table>"}else{if(typeof i.no_results!=="undefined"){if(i.no_results.length>0){q+='<div class="no-results">';q+=i.no_results;q+="</div>"}}}k.show().html(q);ixwps.clickable(c);k.trigger("adjustWidth");e.removeClass("blinker");if(d>0){clearTimeout(ixwps.blinkerTimeouts["#"+h])}a("#"+h).parent().find(".product-search-field-clear").show()},"json")}else{k.hide().html("");a("#"+h).parent().find(".product-search-field-clear").hide()}};ixwps.clickable=function(b){a("#"+b+" table.search-results tr").click(function(d){if(!a(d.target).hasClass("add_to_cart_button")){var c=a(this).find("a").attr("href");if(c){window.location=c}}});a("#"+b+" table.search-results tr").css("cursor","pointer")};a(document).ready(function(){a(document).on("mousedown touchstart",function(b){ixwps.dragging=true});a(document).on("mouseup touchend",function(b){ixwps.dragging=false});a(document).on("mousemove touchmove",function(b){if(ixwps.dragging){if(!b.buttons){ixwps.dragging=false}}});a(document).on("click",function(b){ixwps.dragging=false});a(".product-search-form input.product-search-field").prop("disabled",false);a(document).on("click",".product-search-form .product-search-field-clear",function(){var b=a(this).parent().find("input.product-search-field");if(b.length>0){b.trigger("clear");b.closest(".product-search").find(".product-search-results-content").html("");if(b.closest(".product-search").find(".product-search-results-content").length===0){b.closest(".product-search").find(".product-search-results").html("")}a(this).hide()}})})})(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.