var pmaWidgetInstance63e4eb9b42183289054d8933 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=78539c01ba1df8cea4a37f74a3c3823c:801798566ed6c456447b903f6d1bd3ff7f599222e29cbaf414f7ce17bf74ef930f0987c49c444c96ff8375c1710832994efcc8ab8edf22c4bf902e880d9dc8a1c840399c78ec194c21bc6e04cd2ca5d436fe69d49bf072530588684c0975b81a8367a0b0f8d26bd15addcd25bff8e085ba5fb2d6a5a636f85f003286fe73cd45544b65756cae01457b385277fde022cd1c333b2f8eb885632c980209171f4c7ecc8f2306df6bc0c7d59d11e03a73ecbc6dd75e287454638558fb4ccc80f5b362ce0ec7e804b5c44492819b9295613c3b", shop_name: "klarstein.sk", shop_logo: "https://y1.sk/t/s/130x50/52719.jpg", product_price: "722,90 €", product_shipping: "0,00 €", 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(){ pmaWidgetInstance63e4eb9b42183289054d8933.initWidget("63e4eb9b42183289054d8933"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }