var pmaWidgetInstance611bb3da0067a2ef5944bd64 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=fff2591b73480ee0d7ead8f5e73c448c:dfd8371771460c9ed8e7cbe9510aade00fd60238cd861fa0502f24f2c056d880f1abc5408f06bb823780e7b328ace9e68db1f9c17316e776058e1f189d047420fd2d41e1618c9adbae32855bdf5645944fd569e20fb51452d478d0d08906912b6d1eb56174088ac5e9536264b228b638e419fa3d31a10744bc7574287f7b98a9d831f2b4abfdb6c35e68687dd84e4b4baf58e3f5838d90611c5aeefdfa2a7913e32a99564cc0a203de66ddb2bb50e72f3dcebf2d73f67b99adae792868058020e30b3959606244a2714f40cf415ca605", shop_name: "elu.sk", shop_logo: "https://y1.sk/t/s/130x50/59355.jpg", product_price: "249,49 €", 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(){ pmaWidgetInstance611bb3da0067a2ef5944bd64.initWidget("611bb3da0067a2ef5944bd64"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }