var pmaWidgetInstance6052278ed9685ed272095451 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=d5b50bb08b133d6dc1135c0c9a5337b3:766ff9f839d88be265ccd29223a98176aef8796a4a067c09a34f3e8e5b85f9498abc8345067492508786fe3c3a3723b7c01ff722c6e209dc1f93a61f2792f8307a01917bfa08756bbaf766deb65288e7aae8240f1c1df517ef2ecc930af8beadc00c4ea82d05ff359e9f501133490f98dfbd8b13909fb77bba568be300f5f1627497acc400ad7a95eced658d0ea4b46e41be1edcb729db75225ec4c10b5c1263ab4be27cb812fb49d92898178d86556f8b917f887426c520283c50967db75cdab0bdd2c58fe88ffab38eb881ca4ede29", shop_name: "alza.sk", shop_logo: "https://y1.sk/t/s/130x50/215.jpg", product_price: "23,90 €", product_shipping: "", 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(){ pmaWidgetInstance6052278ed9685ed272095451.initWidget("6052278ed9685ed272095451"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }