var pmaWidgetInstance5fca6192d9685ed272e729db = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=e5b04b78a2a5e9e08598486957f60e2f:9c58695695646caafa87fa6f89dcd4f2008507ce5f5b6a5c2ce5da78365054c5df9f7c46e68d67ffa2f54389ff2f128648d122a029ebc4a0bab41771b48ff9487c86206f54e0f5b8541a3b62573e4eb5d972d9873194c63d75cd31fdfe3c9478ff01e19a75158945ea491a59d25b1a23960320ec54e1547fdfdcc68c29c4015e9399227b5b232389ea86781b45a9d9467d008217d7eceae56c31aade1d99208981358332bcd32b17019f55245d0d3269641c8f246b6a9e923276cde7209e1b17", shop_name: "efarby.sk", shop_logo: "https://y1.sk/t/s/130x50/47665.jpg", product_price: "6,35 €", product_shipping: "", 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(){ pmaWidgetInstance5fca6192d9685ed272e729db.initWidget("5fca6192d9685ed272e729db"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }