var pmaWidgetInstance60535eccd9685ed27249e623 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=c93a32f8d626f4d2b38cf9f6515729b8:055bf0424ed3061eae1c34cfc25005dd025aa13a4d8e9670167de94052b245b854c5bed7c69627ea69e7f31e60e153b77b8497ba546774fa3764a65baa98cad1fe56a6bac2025f918637a61b8ac0d01f7cf5b6b82de762cc5b16ef71b1e75cc7ab64321d5fc974771cbd6094aa19363a130ff2774df38084ccee83892b302c42d5bf906c62c582e468bece1213abd0c4ef23d9b053951313c7c64174477feab3a376ed1352a2e7cd614f56593a3bd26454cfd5afaeecbff1b6464540488ee89a204323f60a228cd1be363ed24908b884", 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); } }