var pmaWidgetInstance5fcf708ed9685ed2723bd230 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=6a32b2672238565765f334bcd7c4ee6a:1df2a5c7d145bd1e306eefa208b79892877db327e79f5f6816c6a23477805e62d5d4584abe3e926537c52bf2449b1675fc8446187c34b9cdfabf459cc2aa7ad8d34e466e27cd10c4df1d6ca6a02b659e4def0de4fe223066de14daf819bb41cf2cfc03424ac69110c1fa4142d7a9b32e022d8a36ce0c1fdfb4f9094db6444d83fc86bbfb5abfaefd481e5d346b932de094c047acd9b3b80a797d07eac44b4b36992f0fa3304f59851d4676facd56c4f7bf0c38a5e0a51f8a8d765b069c21898a", shop_name: "SADAJ.sk", shop_logo: "https://y1.sk/t/s/130x50/59800.jpg", product_price: "174,04 €", 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(){ pmaWidgetInstance5fcf708ed9685ed2723bd230.initWidget("5fcf708ed9685ed2723bd230"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }