var pmaWidgetInstance654ccae142183289050f319c = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=c50ca7b7e87d0f1a23520f738cf96568:0914ba474d0df5639872748e9d0315a3a0c47009158192f3547c8c800dad0e7ff9a59fa8d60ed6e3262092b127abc726bbdfd64f438ed1a6b9055ff3fe5ae6d2d233d626d28300dc52234517767fdcae8246c8e8a4e9c7a33b54ed7e1392dcd71543cd7c331c5a70cc60f7f277b4505179e6079fd2b7b3a4e516090adcb2b846935e4ee2ed50007588b882012d7a29059193648d21a4e4da6aa2965aef18309acbbac5db3a3eef919c87d890357851611339a62b389d904fc8af2be3c4f378a76d62ca27dcbc7f830f7bec51c17b9d76", shop_name: "Arada.sk", shop_logo: "https://y1.sk/t/s/130x50/59720.jpg", product_price: "7,51 €", 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(){ pmaWidgetInstance654ccae142183289050f319c.initWidget("654ccae142183289050f319c"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }