var pmaWidgetInstance5fcdf3c6d9685ed2721bd318 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=80daa478315a112f4fc48acf3751dba6:e831df1631556b99181f3a444c7b92acfa2fbb9a9ce3fb286d7033ea3201d19d64e475e7c6e516f56627e57f54cdb4bebc224031f831329d5ea15291987225e06b7ebd33ae5817a364e91b18f00b7c54a34832bea523a0d5ca1fd9417ec0024b41d9be68171f2565bb310468057f5ce06f2abef1ef58e00e341e546b95f3e6797c9e757733a42a5023bdf2dc50fa772c0865b38de16309f38b72c3ccd7dd06ef0e899495b7fe09f366f2aa0441b52e53a681d44f8979fa818c9c9fc6a1d7cdb2", shop_name: "MADER.sk", shop_logo: "https://y1.sk/t/s/130x50/9499.jpg", product_price: "28,80 €", product_shipping: "3,99 €", product_availability: "", 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(){ pmaWidgetInstance5fcdf3c6d9685ed2721bd318.initWidget("5fcdf3c6d9685ed2721bd318"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }