var pmaWidgetInstance642e6d0e4218328905ee43ae = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=2de4610e90cebaa9990ad68ef4c20d4c:7971bab9fcef5b6d3836c79d2dbce49a3800c9e6410fec05b2bb7b78390f4b02dd25a18a14e9659d9fe4747ca6c59c68faead25cc51f3c60224247b7a4ac0fdfe1902c2c51619ee6eefa8ac61fb4c6e42000d3b5aac4d63a4a0c95ce0763b1f6e4bbceb210360589dc5cc2ddd404fb10345202df866403f2b4f46d1c7792c93a114f7cb2b8cd9525f2f4e10681fe0591d9567243371106fec364a9071a7ad4604753d4ba9cf9ef69b3ab5b4b2a0ff47897b87e211e58d82afeaa8edbfc5d2384e139bc40cc55efa79f8a5df22c96225d", 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); } }