var pmaWidgetInstance615d9a820067a2ef5996c3ff = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=61b46d4f384ab9e3f586623da9b699c8:2adc278195124f0eced844c1089e2dd3e5778aa6b91a869c29e72f91e54e78b8f54d3fd49663d8a178d59b816dd3d8db0ff1f84db482466843a76090f0a3d6e0e6abaed4a1db4cba1e1d57a4d912b5dea0c81150acc786c2f4d2d2330553b1d5f38171d6b29524451f24e1106cf76296ee072941a18a0bb91ba08fff5c44e601f980cad5e80fcbe8447305a7d6408ad580058aa90be3c14c190971cfe70d1e8b78dbabe23fbe99afa592f5f373aa0b41ce4e1329fb6ef2fc908d7eed2b1cf966", shop_name: "MALL.SK", shop_logo: "https://y1.sk/t/s/130x50/135.jpg", product_price: "517,00 €", product_shipping: "3,90 €", 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(){ pmaWidgetInstance615d9a820067a2ef5996c3ff.initWidget("615d9a820067a2ef5996c3ff"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }