var pmaWidgetInstance642e6d0e4218328905ee43ae = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=d116497ac16947520e3adbedda9ca037:ef619b70738e2822f2efc26ff60d382fb3111bb1cf429e1407b10aba433fff8c0c588ca1c0e406d23d8d751c09c4fb5b6ae5f2f7dc6f221a54e528897213695056598fea1d4e52684bf353ae6919c65bb31b86516fb4b3e3cf84eca3e8aa39b30a1156137956ecf628a218c8fdc881b9f929a064ae1f943e356d4a3dc468af437223f894bfd10d294bf6add6fdca8595542b59e7e89352f907353505244415ac229e6dcb16576f4301900ef87907a830e2ddde6858823d4d63002f6e863fa83b95f4b85b8fd5a9e2bdce472a1c4de0f6", shop_name: "megaknihy.sk", shop_logo: "https://y1.sk/t/s/130x50/8349.jpg", product_price: "201,62 €", product_shipping: "1,99 €", product_availability: "", 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(){ pmaWidgetInstance642e6d0e4218328905ee43ae.initWidget("642e6d0e4218328905ee43ae"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }