var pmaWidgetInstance638b44bfac365ae374f5daf9 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=59adab203c2c47f54fd24f87e990a3c6:a28f9106a3f2674b4b8fc8737e4a7d4fb3b68c2fb4b45222f591eedb2382acac1e78163380237f84a4d27edcf617068d32cbfd369cbc6a8d7bb0e1f3889bc8cb368461e088c094f6a4fe38c6618089ba56b22fbf8c5d21cea8c3655428171dbf01fd67dc45f44a1c3ad8eb20b7cfff36da7baf000e0c40f405f88c56d7ae2b081368fb85bf849b54379ef72424b4d6124f41cd0b335fde985e25aaa4aabc0d32c965db7b99e7867b33dd32bafb40def415ce8390e6d836854a9c013d8cf20344d7eba8d49281f135765521d8d823c187", shop_name: "arco.sk", shop_logo: "https://y1.sk/t/s/130x50/45797.jpg", product_price: "455,00 €", product_shipping: "2,00 €", 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(){ pmaWidgetInstance638b44bfac365ae374f5daf9.initWidget("638b44bfac365ae374f5daf9"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }