var pmaWidgetInstance60c6f1ea0067a2ef59e5796e = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=8d3cc53e7ed3a7ed31af6c3cd6c4d72a:466b8f65225bba678e068fac683ca7a5940f19a5624deabb1f59fce05dcd8c931f3ee955ff6732672f3a5e2250b66ae4434706a924b11230ec0873f317ab826cdaf922b3c226a3ceb354a30f1240a747c5e1af55ced7210c2d2677b2e61ebf33e0e2fed5300e1f5951bc2ae63e3476cbab7b5a5a059359b257223092c69c47f17598450a0615c33ab14cc0eb0a33c712c1f9f61785a195e3b85a9321e4cbd59e6bbf75246f13c453fd28407383c7883a39023115d98e8732003ea291aba204e5", shop_name: "Best2Buy.eu", shop_logo: "https://y1.sk/t/s/130x50/60439.jpg", product_price: "22,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(){ pmaWidgetInstance60c6f1ea0067a2ef59e5796e.initWidget("60c6f1ea0067a2ef59e5796e"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }