var pmaWidgetInstance64142f4342183289059ceee6 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=51cadffa350b0ebe1d1d83563180d9ed:b2e261d694fce69303211ab81a94003abfb8cb6a1730f9bbd3100345e099d1bb66adfda1a06fc978dcacc3a1da30d9294ac07f5408375c47305b3380cc782dae5b8df220cef7524ada9241ea1bfd7d4ad74e2ec072f245e0fe65f4b4e884324cf33cbfed79ef767a8d513d54684c92234f423b4f14140ac17027a782691bc8caf6e1ae233a845c637a1f03911894f10fdf6ba49341c2c8ce8af69614364ff81df4d745b7fbad42a6783c0be36eafd5fc32e6f1213d41454579f512a0cd25fac75ef7a725b519d40968fd72f7ec69d4c5", shop_name: "Best2Buy.eu", shop_logo: "https://y1.sk/t/s/130x50/60439.jpg", product_price: "21,99 €", product_shipping: "3,90 €", 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(){ pmaWidgetInstance64142f4342183289059ceee6.initWidget("64142f4342183289059ceee6"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }