File "woocompare.min.js"
Full Path: /home/siazco/grocery.siazco.se/wp-content/plugins/yith-woocommerce-compare/assets/js/woocompare.min.js
File size: 4.64 KB
MIME-type: text/plain
Charset: utf-8
jQuery(document).ready(function(n){if(n(document.body).hasClass("elementor-editor-active"))return!1;n(document).on("click",".product a.compare:not(.added)",function(o){o.preventDefault();var e=n(this),o={action:yith_woocompare.actionadd,id:e.data("product_id"),context:"frontend",security:yith_woocompare.add_nonce},t=n(".yith-woocompare-widget ul.products-list");"undefined"!=typeof n.fn.block&&(e.block({message:null,overlayCSS:{background:"#fff url("+yith_woocompare.loader+") no-repeat center",backgroundSize:"16px 16px",opacity:.6}}),t.block({message:null,overlayCSS:{background:"#fff url("+yith_woocompare.loader+") no-repeat center",backgroundSize:"16px 16px",opacity:.6}})),n.ajax({type:"post",url:yith_woocompare.ajaxurl.toString().replace("%%endpoint%%",yith_woocompare.actionadd),data:o,dataType:"json",success:function(o){"undefined"!=typeof n.fn.block&&(e.unblock(),t.unblock()),e.addClass("added").attr("href",o.table_url).text(yith_woocompare.added_label),t.html(o.widget_table),"yes"==yith_woocompare.auto_open&&n("body").trigger("yith_woocompare_open_popup",{response:o.table_url,button:e})}})}),n(document).on("click",".product a.compare.added",function(o){o.preventDefault();o=this.href;void 0!==o&&n("body").trigger("yith_woocompare_open_popup",{response:o,button:n(this)})}),n("body").on("yith_woocompare_open_popup",function(o,e){e=e.response;if(768<=n(window).width())n.colorbox({href:e,iframe:!0,width:"90%",height:"90%",className:"yith_woocompare_colorbox",close:yith_woocompare.close_label,onClosed:function(){var e=n(".yith-woocompare-widget ul.products-list"),o={action:yith_woocompare.actionreload,context:"frontend",security:yith_woocompare.reload_nonce};"undefined"!=typeof n.fn.block&&e.block({message:null,overlayCSS:{background:"#fff url("+yith_woocompare.loader+") no-repeat center",backgroundSize:"16px 16px",opacity:.6}}),n.ajax({type:"post",url:yith_woocompare.ajaxurl.toString().replace("%%endpoint%%",yith_woocompare.actionreload),data:o,success:function(o){"undefined"!=typeof n.fn.block&&e.unblock().html(o),e.html(o)}})}}),n(window).resize(function(){n.colorbox.resize({width:"90%",height:"90%"})});else{var t=e.split("?");if(2<=t.length){for(var a=encodeURIComponent("iframe")+"=",r=t[1].split(/[&;]/g),c=r.length;0<c--;)-1!==r[c].lastIndexOf(a,0)&&r.splice(c,1);e=t[0]+"?"+r.join("&")}window.open(e,yith_woocompare.table_title)}}),n(document).on("click",".remove a",function(o){o.preventDefault();var e=n(this),o={action:yith_woocompare.actionremove,id:e.data("product_id"),context:"frontend",security:yith_woocompare.remove_nonce};n("td.product_"+o.id+", th.product_"+o.id);"undefined"!=typeof n.fn.block&&e.block({message:null,overlayCSS:{background:"#fff url("+yith_woocompare.loader+") no-repeat center",backgroundSize:"16px 16px",opacity:.6}}),n.ajax({type:"post",url:yith_woocompare.ajaxurl.toString().replace("%%endpoint%%",yith_woocompare.actionremove),data:o,dataType:"html",success:function(o){o=n(o).filter("#yith-woocompare");n("#yith-woocompare").replaceWith(o),n('.compare[data-product_id="'+e.data("product_id")+'"]',window.parent.document).removeClass("added").html(yith_woocompare.button_text),n(document).trigger("yith_woocompare_product_removed")}})}),n(".yith-woocompare-open a, a.yith-woocompare-open").on("click",function(o){o.preventDefault(),n("body").trigger("yith_woocompare_open_popup",{response:function(o,e){o=escape(o),e=escape(e);var t=document.location.search,e=o+"="+e,o=new RegExp("(&|\\?)"+o+"=[^&]*");t=t.replace(o,"$1"+e),RegExp.$1||(t+=(0<t.length?"&":"?")+e);return t}("action",yith_woocompare.actionview)+"&iframe=true"})}),n(".yith-woocompare-widget").on("click","a.compare",function(o){o.preventDefault(),n("body").trigger("yith_woocompare_open_popup",{response:n(this).attr("href")})}).on("click","li a.remove, a.clear-all",function(o){o.preventDefault();var o=n(".yith-woocompare-widget .products-list").data("lang"),e=n(this),t=e.data("product_id"),o={action:yith_woocompare.actionremove,id:t,context:"frontend",responseType:"product_list",lang:o,security:yith_woocompare.remove_nonce},a=e.parents(".yith-woocompare-widget").find("ul.products-list");"undefined"!=typeof n.fn.block&&a.block({message:null,overlayCSS:{background:"#fff url("+yith_woocompare.loader+") no-repeat center",backgroundSize:"16px 16px",opacity:.6}}),n.ajax({type:"post",url:yith_woocompare.ajaxurl.toString().replace("%%endpoint%%",yith_woocompare.actionremove),data:o,dataType:"html",success:function(o){n("all"==t?".compare.added":'.compare[data-product_id="'+t+'"]').removeClass("added").html(yith_woocompare.button_text),a.html(o),"undefined"!=typeof n.fn.block&&a.unblock()}})}),n("body").on("added_to_cart",function(o,e,t,a){n(a).closest("table.compare-list").length&&a.hide()})});