var pmaWidgetInstance60535eccd9685ed27249e623 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=ab6bc8c6114470277c42759ef66a9109:24744fa85fc626b1281a8e33130b43ae5a85fef196cc75428260cea9343a1cf06b63c1b982675c6af44430699dee079f7c88650a6d575cc855a04edb4fae58a70454860f8a4082594e6c67c586cffe5f08c846e16ff890a46ca5a1cabca520c28b469b3f7c2ae16fc3390b8a08e770e95c227d1eb616b9707abd9bd7eefaefa34a530444ac2189cd919c82fe37395edd50ebd4c85cc2090cdd16f74fea10b2c08e73e5255cb45c52cdf5d04b4c7c3381b22a803758f6bda3787eb27c665b12ec7fb6d8cf9f81d825928fa53cb4d2bc1f", shop_name: "pelotony.sk", shop_logo: "https://y1.sk/t/s/130x50/59907.jpg", product_price: "297,70 €", 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(){ pmaWidgetInstance60535eccd9685ed27249e623.initWidget("60535eccd9685ed27249e623"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }