var pmaWidgetInstance62fa1e94524818ceae5b9932 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=ba3e02ccee7e024fa6c5b46466ddde69:d556ad84e010cbe5886bcc6313bb9257aedea0f3b3d6c1a03e218cdb626391d679fbc7d96de303997824d3e80863e12e4a84bb689d46def80b72885ae841933b306e8b7ce3cf4963e7215d63fcc4690d6f520e5610437564bc071c06417cd12a4caec9d236da9e5a6034a728cfc3b0c25380c07a1defd7e53ece8353561e0d30610c836b9523555f1ea6222d4ea4ef46867865027329e09f2666a28a2b6a6cf5944508488fe519bec15a7f6bae103cfac0ef4f5244c1a82dcf31f52c935944a2", shop_name: "svetnapojov.sk", shop_logo: "https://y1.sk/t/s/130x50/4380.jpg", product_price: "35,90 €", product_shipping: "4,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(){ pmaWidgetInstance62fa1e94524818ceae5b9932.initWidget("62fa1e94524818ceae5b9932"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }