var pmaWidgetInstance6177f832069a975de5cff434 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=571c3c3657f44dd4f4e5139159f93518:ad4773f173b0824d02f021aa51eacef6b926c22eb9401d3aacad062479620e845e9ac5eb9b927c1399c6701c5cd69d0891680d64e4b1d9cee14a5b15e10ea8b59bd6828fafa97310c4c3874c17c839e55dc2338b1a944100650058ddff6752ac62ca9962447501c36272c382a4e21c2608886717182720fb68985f470eb276845f571e755feb4bfb57e2e7ee225798e28df770b0241dc284aaf1661f5b0e7129cf5a760557a556ff4d8da0fe21b82e774ca5f37af6d5721093bbab2d103681ba9b8d23e8d2ea757bc8e61ca55243cf09", shop_name: "tescoma.sk", shop_logo: "https://y1.sk/t/s/130x50/41149.jpg", product_price: "20,20 €", product_shipping: "2,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(){ pmaWidgetInstance6177f832069a975de5cff434.initWidget("6177f832069a975de5cff434"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }