var pmaWidgetInstance5fca0ec0d9685ed2727de293 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=b7b778dba0d4e8cf1b107a9ed6eca2fe:436070e77d10824c3391207fb7cf702e05870a5c5d7d7ee9dc530d3f24bb5e9f33cbd7ef06e02a37692510ce05d4d8bf00fc04077f4e782369c02e64cdff57bea2c587d43e59e7ad1126d95bb2e6757de588e350e61f4b037bba35caede1e4aef11e903b44530aec257d6e9a5b0b58e79ec84de1b703f1578ca77f2000fe3d3844a78e0b9809902975e6512c9d064a2565164e3fd4dd50634c14a44a5d767fb0a568d1bae90bf0235e6ae17a1213f2c0ee84ebde15b2d57d7bcc968c79f299ec", shop_name: "drmax.sk", shop_logo: "https://y1.sk/t/s/130x50/52053.jpg", product_price: "18,19 €", product_shipping: "2,99 €", 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(){ pmaWidgetInstance5fca0ec0d9685ed2727de293.initWidget("5fca0ec0d9685ed2727de293"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }