var pmaWidgetInstance64142f4342183289059ceee6 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=d77941c4d684c0f37d53411c1c27933d:c3bb09a9a6cfc6cc0c1b5f3644fe57de0b5951759e80f86e32fad13e24f9108c6c8cb6aaee2721bca31c948b81518b9b6d9c6d0fed7a6dff0e826b15a1e609b1a66b1599bf24ff7838eff59a2198752b9f8f26d2bb77e847a668f19d944a9b6bc4e429b51d8c42d7a24dbac28f23aed0eceb3c7d122c9d96f27df457d1230d9b7e870472bb341e23bf47cccdc7b76b7ebb82a4ef23cbc068430de739caa4c5efb7f8fa1b9e6e430a54b5c9a92d3bb9d548839e798fcc5eaef415b378487a5452fc35dc1b19744dd96b63e8a5c3f4754c", shop_name: "Best2Buy.eu", shop_logo: "https://y1.sk/t/s/130x50/60439.jpg", product_price: "21,99 €", product_shipping: "3,90 €", product_availability: "Skladom", initWidget: function(widgetId){ this.insertLinkToButton(widgetId); }, insertLinkToButton: function(widgetId){ const instance = this; const btns = this.findButtonWidgets(widgetId); for(var btn of btns){ instance.insertButtonVariables(btn); if(btn.tagName == "A"){ btn.href = this.exitLink; btn.target = "_blank"; btn.rel = "nofollow"; } else { btn.onclick = function(event){ event.stopPropagation(); window.open(instance.exitLink); } } } }, findButtonWidgets: function(widgetId){ var currentModalButtons = []; var modalButtons = document.getElementsByClassName(`pma-widget`); for(var modalButton of modalButtons){ if(modalButton.getAttribute('data-id') == widgetId){ currentModalButtons.push(modalButton); } } return currentModalButtons; }, insertButtonVariables: function(element){ element.innerHTML = element.innerHTML.replaceAll("{{shop_name}}",this.shop_name?this.shop_name:""); element.innerHTML = element.innerHTML.replaceAll("{{shop_logo}}",this.shop_logo?this.shop_logo:""); element.innerHTML = element.innerHTML.replaceAll("{{product_price}}",this.product_price?this.product_price:""); element.innerHTML = element.innerHTML.replaceAll("{{product_shipping}}",this.product_shipping?this.product_shipping:""); element.innerHTML = element.innerHTML.replaceAll("{{product_availability}}",this.product_availability?this.product_availability:""); } } docReady(function(){ pmaWidgetInstance64142f4342183289059ceee6.initWidget("64142f4342183289059ceee6"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }