var pmaWidgetInstance60e573ad0067a2ef59a399cf = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=8be350e799396ac6e465f9248d796541:178dd5beec5afc2ff1a25c78ca97c995c3f3e9bff1457c216662661a70bcfd77fc32ce2aa13d3c3bb4dd2818bf61551d38d6b49ab7ecab406d73375e90f66052a6ca23136be95a654609f00f3f7cbc61cf3f21618d5c523deff2df1621485a6639de29c1f851663f548740b503325636122c9ea0e5733b70b7ab4b4a3a4de2d8a5c6136f8d731bc52cdb3b74b90d74b1dbcebf448ea121f2dca36c6a4c204957d81bc3b4244502e23a7c611e737afb4b2ce7a51de833801b79ba04a93e6e4cf7", shop_name: "MADER.sk", shop_logo: "https://y1.sk/t/s/130x50/9499.jpg", product_price: "649,00 €", product_shipping: "3,99 €", 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(){ pmaWidgetInstance60e573ad0067a2ef59a399cf.initWidget("60e573ad0067a2ef59a399cf"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }