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