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