var pmaWidgetInstance64142f4342183289059ceee6 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=57c0cc3e73cead3ac8d87badfb6dcdb9:f9c41688581b0646797d8f737aa934651880288172f1441a241106bd809128fbd7e1c55a605557798fe2cc73f5f3f3d3531fb4f51621fb7595576ac8f2cab24161598ad806b79f67b831ecbc16feef3839e67be2990fa1d854f1b12cedcdab874d86b2006bf5cba6961eeec5ac47966a9a1a76c007d57b96395dcb34e86a2854c21b2b4a29bb7fa76fde684161ada9255e2378b799094b7dd2f8936260f79ff70eb0ee9427058c3ce93cd165362241e25bfb11bb786d9fb55169d54b0af23a3e6106f4f3204a9137c8c20ac1be9eb073", 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); } }