var pmaWidgetInstance634667afac365ae3749a8dc1 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=65883d442aed7be75b351ae0632cd8a6:6c482842f5b08fc86bf6b8297a434fab16a1277756731c654995b7ad4d40e7677bac38cf3669f4c3039c892b1025f2e187978212b43668096a1a7b4b573f19d2cf93793417b5b0e45499f1bac167bffd6964ec116112373d25655341f7167d900bdb160ac22c335994bbea3e1f00acecf22181f62adf8b4ed42e3bcb147796415db9c93e4ec4829f03a82b910697f2d19eb6ca188dce3648a352b473086107e5a63d7e33607215922a736ad4e8ca1c2dd6915fcebdf8692baa5c9f577966fe3a9dab4f264d3a5274b0805b8a399c9032", shop_name: "MALL.SK", shop_logo: "https://y1.sk/t/s/130x50/135.jpg", product_price: "541,30 €", product_shipping: "15,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(){ pmaWidgetInstance634667afac365ae3749a8dc1.initWidget("634667afac365ae3749a8dc1"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }