var pmaWidgetInstance5fce1bc9d9685ed27263b87a = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=83cf7f6d8f2ce3f096704547ae3d2348:1674624fcc6c3d78c169fa195042c005948816522aacfcb25103a00fb84d805b37cddf2cf4681d699d2607049bda1184a7c63e2c9c27880885401facf63bb39659f56b6c7ac6d0f1839aba7c535673cb40f87c7dc2b90dbe38a9df9052158de0251f4a74a632ee1af8ea8003d8c2553b2076833b0632b8f29692bb0c9b9cb3bf9ff5a60835c923c69d338ae32851701c2ca46313d7091763b8358263d1fca59cf8ed9f3ba449832b33f6f775872ba3d30a510099d9756ec59684c98c9f9cd69f", shop_name: "alza.sk", shop_logo: "https://y1.sk/t/s/130x50/215.jpg", product_price: "5,89 €", product_shipping: "", 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(){ pmaWidgetInstance5fce1bc9d9685ed27263b87a.initWidget("5fce1bc9d9685ed27263b87a"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }