var pmaWidgetInstance605374fed9685ed272925037 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=dd663b8a539d47f8f59e5488acaf6220:d62fd75424740d1ca4c560688926c76427109f13d0a2d804213b7e06a58165badcba599ef0d629d4e8e8331e870543fce576d4620bc6cc0e8f17dfc75a879f2818c69bef02873436b2357a5a0ad253f040456a24a8012fdb6e49369c8481af24f9d095a47ec217da8ead51ae8daf802f2ddcec0031cebcf17dfc522eec693f358117ba58aa764caf1d82634688f1b68c156de6020c703f1f4422ef855326ee16c654fdd652e0d2e971c7f296eebee6ada93f5acfe9f4764397f7158c06ceaa6da8d5427033a352e69aa59fbd98c73404", shop_name: "pelotony.sk", shop_logo: "https://y1.sk/t/s/130x50/59907.jpg", product_price: "315,25 €", product_shipping: "0,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(){ pmaWidgetInstance605374fed9685ed272925037.initWidget("605374fed9685ed272925037"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }