var pmaWidgetInstance633bef51ac365ae374c17828 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=fb89863211d8c070ff50f82b5a634075:ba059355500efc3104bbd8270f34ca977b8e45923f92cfb497040c5721bccb38156d5dd1e5dafbcd8d7934152e42e73660fb8499269a520176a5d8288ec105cba3488de45cb189b7b478e5491a7b50e526cb5093e51e5a808bb588002a13e26804b8a6b55651a9d8f57642a44d6e1cded8da1dd5d3e142e44988d8524758fcd359503db4b501b026152be19ccd9c04b8273c9cc1f379dca9fa0562d6ce17cbc374d24fe1459e6e2d9a4879d1d06b82d2bcdc8a22f1ac482de679c4f74d68a96fb05eb5461899e5deda750328491f1da3", shop_name: "alza.sk", shop_logo: "https://y1.sk/t/s/130x50/215.jpg", product_price: "15,10 €", product_shipping: "", 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(){ pmaWidgetInstance633bef51ac365ae374c17828.initWidget("633bef51ac365ae374c17828"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }