var pmaWidgetInstance63465d48ac365ae3748f2567 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=3ec249cef7531c3597865eb9f5e82655:ff2273058f776ff6c666a2d739f267770c3340890a507eacf6c2b5f1603bafb123f8a0357a9d68dcb09315767773402be590a18d0cf0132615352ba506c81e89eef0dde32cbc29b389cf43fe42c6da7ef14670756c5e9916292742682e717a57d105b36322db096b5322f570ee3a1544fb8414efa28ba1bc2aabac9eb1c3ce2d93ee73682cd52c4d734cad0a5288c29b0a4d21733d52ebbe3d7039554ac7c08e8bd61add055cc98f0e0677611553999463a829056571273a63d04c5cf61a3d1a0850eef9695b98a762b0f10f130fa7da", shop_name: "najlepsiemobily.sk", shop_logo: "https://y1.sk/t/s/130x50/60405.jpg", product_price: "238,00 €", product_shipping: "1,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(){ pmaWidgetInstance63465d48ac365ae3748f2567.initWidget("63465d48ac365ae3748f2567"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }