1(function () { 2 var config = window.bzkshop || {}; 3 var cloakEvents = "mousemove mousedown touchstart keydown scroll"; 4 var lastClickTime = 0; 5 6 function getUrl(el) { 7 var data = el.getAttribute("data-bzkshop"); 8 return data ? atob(data) : null; 9 } 10 11 function trackClick(el) { 12 var url_dest = getUrl(el); 13 if (!url_dest) return; 14 var titreEl = el.querySelector(".bzkshop-title, .bzkshop-title-table"); 15 var titre = titreEl ? titreEl.textContent.trim() : ""; 16 var data = 17 "action=bzk_track_click" + 18 "&nonce=" + encodeURIComponent(bzkshopAjax.nonce) + 19 "&url_page=" + encodeURIComponent(window.location.href) + 20 "&url_dest=" + encodeURIComponent(url_dest) + 21 "&titre=" + encodeURIComponent(titre); 22 if (navigator.sendBeacon) { 23 navigator.sendBeacon(bzkshopAjax.ajaxurl, new Blob([data], { type: "application/x-www-form-urlencoded" })); 24 } else { 25 var xhr = new XMLHttpRequest(); 26 xhr.open("POST", bzkshopAjax.ajaxurl, true); 27 xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); 28 xhr.send(data); 29 } 30 } 31 32 function onItemClick(e) { 33 var now = Date.now(); 34 if (now - lastClickTime < 800) return; 35 lastClickTime = now; 36 var target = e.target.closest("[data-bzkshop]"); 37 if (!target) return; 38 e.stopPropagation(); 39 var url = getUrl(target); 40 if (!url) return; 41 window.open(url); 42 trackClick(target); 43 } 44 45 // Cloak : redirige vers le 1er produit à la première interaction utilisateur 46 function onCloakInteraction() { 47 cloakEvents.split(" ").forEach(function (evt) { 48 window.removeEventListener(evt, onCloakInteraction); 49 }); 50 var first = document.querySelector("[data-bzkshop]"); 51 if (first) window.location.replace(getUrl(first)); 52 } 53 54 function init() { 55 var items = document.querySelectorAll("[data-bzkshop]"); 56 for (var k = 0; k < items.length; k++) { 57 items[k].addEventListener("click", onItemClick); 58 } 59 if (config.c) { 60 cloakEvents.split(" ").forEach(function (evt) { 61 window.addEventListener(evt, onCloakInteraction); 62 }); 63 } 64 } 65 66 if (document.readyState === "loading") { 67 document.addEventListener("DOMContentLoaded", init); 68 } else { 69 init(); 70 } 71})();
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.