var pmaWidgetInstance5fc8ece0d9685ed2720dc14d = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=5753e065c7a207fe015574c1e71f8923:1f770ce5cb522a40edb0fda914cf5d31158a5ab1b268770cd49c1f59d2e91d2651c2bef0ec7ec0b3f65296ea0e37c082529b15ed37cc6f735a2c9dea7dde3ab3f757a4c52bdadc9d15562c2e481a95c138f172ca6ae8fdc08eb17a98dcb009f8c8cf92cf41fcb62f3d88f666a314ece5b912d611aeb287921f81692d6fca86f414a777bc7ea9d265c23b1e26a557b97206aadefe1e52be2bcc15da60fce6715b9f612e9e7e3290505aa3b2c5872eb00fe4751c92c6789e18d102a87530f6366e", shop_name: "alza.sk", shop_logo: "https://y1.sk/t/s/130x50/215.jpg", product_price: "29,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(){ pmaWidgetInstance5fc8ece0d9685ed2720dc14d.initWidget("5fc8ece0d9685ed2720dc14d"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }