var pmaWidgetInstance60b7836e0067a2ef5914a9cb = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=e6396eaeb467f0c075f89a795d1f2a62:251332b4ae89fdd381e30fa961777ffbcb1e723e5ec3ba8fdf037e976e9d1b106244d4aa479021308b5039e4ccdc8f5250a3093ebae999238777193ece83ea7ea53cde2b3ca05853eb3d8fefc3203c71348b03690b6471a58f0b5fe1043d5eb49eff949778a29564a1ac1f3d1d4dd05805300e0432165dcef4ff0d56c4aa446444a20da0aa690f0c51b9a6297a49ec0044ecc0b348443c029cd31eaee1528a897aa05d9e65850e9862826717a5ecbedfa796fe44256ccc1b651683cf680ecc8dc4a85e48a8223a76dfb8ee15ca44baf0", 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(){ pmaWidgetInstance60b7836e0067a2ef5914a9cb.initWidget("60b7836e0067a2ef5914a9cb"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }