var pmaWidgetInstance654cd41142183289053cdd38 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=8498f19c69ef7564bedc33c569f8e9cc:e448effa16b4ae6b83f91511285b7dab89f9a7a49cdaa090a519aa0b362e81de283ba9d0f0a5470a1e3627c012cf386b9b6b9d58fc2798ea8858c6ff8f849c49258aa6b768054ba83447b9c00e1911790e22430abbaf0f3b458e10ecfdd7ed7a4b9bd4089b7cd6d7c67786be8e3b7c46d92f215b0dd6456737c9cc33213853f4a0a9f4b2f89e955c939763fd137d12520789189ad27151998bfa8533ee2b8460ddeadb5cb202bbb7336d50520035bcd9e7b445ae5cd17cc184acfc7fb7e6428604634614b044a679b07f08f193980c84", shop_name: "Arada.sk", shop_logo: "https://y1.sk/t/s/130x50/59720.jpg", product_price: "10,46 €", product_shipping: "2,29 €", 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(){ pmaWidgetInstance654cd41142183289053cdd38.initWidget("654cd41142183289053cdd38"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }