var pmaWidgetInstance5fcdf8c1d9685ed2721ee8c6 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=15961a88f2a508ff6856c9abfca80225:6072057ae250c2b58385e52d17e4d9b10f827add42a5222e29f289e490b43cd2156f40e2f9a63aacf86847ae9ab58ef431f38fa187162c50e4d0329f81781dec81def3d8da1d11db2f675682366d7f44480955f16d9d87500e33f8821e372df0da1c73da4ba46dbf9754b0a9605b306d56f549281bab5f051c193fbd2ba7e0f90fdbc8667887f0bd6883eb7e475fc9b1e13292255768f9d7c1c1bf09350bd6de7d1c8255fa8aae8fb7ff55db48c27b00157df1bd2c0e618a8e6c14ef192ba75fcaa97a21970b57a1559f7114bd4cacd9", shop_name: "megaknihy.sk", shop_logo: "https://y1.sk/t/s/130x50/8349.jpg", product_price: "68,96 €", product_shipping: "1,99 €", product_availability: "", 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(){ pmaWidgetInstance5fcdf8c1d9685ed2721ee8c6.initWidget("5fcdf8c1d9685ed2721ee8c6"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }