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