var pmaWidgetInstance614646550067a2ef59747caf = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=60d227cda0118e46165f886dc40f4916:09ad299935de32d19114dfc1e7bf1efe54804316457496ccd1dcc3cf499515064f8c5bf39e4549b81d4b8535466e517fc63bba043983d35ad456a6b985f7bd84b534f0c3a11f8751e3cdddad5309aeaae758b6c3edfbc87b30b8ea310b05ee536d070b35e2e4c82cf8e3e435e49e9e1e7bdc8b67be40f2f9626e172d7a2079b4addb1b76f75e9c8e17d920f4288ca7a0d15dc7de635eca2dc5e5837b1614e26fed44b3e5b4a93f80e5a90248ca1a424c7ec421f972047dcd4b7c2a8c3fa134a8", shop_name: "MADER.sk", shop_logo: "https://y1.sk/t/s/130x50/9499.jpg", product_price: "649,00 €", product_shipping: "3,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(){ pmaWidgetInstance614646550067a2ef59747caf.initWidget("614646550067a2ef59747caf"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }