var pmaWidgetInstance60bf7e810067a2ef59f6a3e8 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=2e674ce1d00df5222180dacec91beb53:36e5b2f0b6e1bc12846b6f2752e0ff352883796aed9e94ca2cadee8623abbf1015aca870cda66d9cb45a83090a1557b25a1a4f29e0264e485cccf8c847269d85bd99af627307cd560c821eb15db72e2e7ac806b945f74d3fe883ce40e1f11ae1a3c7716ef9293fb250c5b2f90c8c37c21322901bf1bc6392569aec4b22d2e48602438d5364301f19ef0476fe90fec2e233832776b45aa091bb22936a105dcf66d1b47ce082e9431a85c07fd6795a39c6c16333e59c7caa9e50e797ad719c1ff7abdf4c5a2fa36bba7488d9e024a68ca3", shop_name: "drmax.sk", shop_logo: "https://y1.sk/t/s/130x50/52053.jpg", product_price: "512,39 €", product_shipping: "0,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(){ pmaWidgetInstance60bf7e810067a2ef59f6a3e8.initWidget("60bf7e810067a2ef59f6a3e8"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }