var pmaWidgetInstance5fce4a54d9685ed272c04eea = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=d3a83d69c99f7731b98e600da1fb25f1:3289bb65db8e252bfb0a7ec2690189aaf037d5426a8f0b67c228c8f2dcfe09cbb5c1be0e1c070d6201f603e64accc89c13ed301351e47aed083806e8e827373b03d851c989a11c99f98ea5ae776f5ac367a9bca5e9ce868e0ca6d7031a733d1594d95b1a807e11d9f1ed79448416c7eed6a4ce876c3740f7d837fdbd1ce53f2b76e26420bd8de064a854abe9164062c1d8b56a933be36afc993af73b388a5c4b55e2719da4d0bf4a9aa5dd83c3434ed9ff71cc55138179c7239d1ab1c8627598", shop_name: "Gigamat.sk", shop_logo: "https://y1.sk/t/s/130x50/59591.jpg", product_price: "37,52 €", product_shipping: "4,00 €", 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(){ pmaWidgetInstance5fce4a54d9685ed272c04eea.initWidget("5fce4a54d9685ed272c04eea"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }