var pmaWidgetInstance5ff3fca4d9685ed272aed087 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=6bf7e3711f795876f4801635a581d3a1:630e9e93e949770c0c2800db31b1bc6d7d7ddd3ae6227dad83292a80c7298d3f4258a568a46b60a7e9c9f7f0c08ddd1bebc59ed85a4f53ef172e68d3ab7480a06308ec4756f35788c75c01dffae42c3c09c5590c81173ac4c3fe3a0b55b30a42393922723b2ce9bc9077cec979c07e40e5eaeb9d76f4f920e7d342de7049bc8fb80a40acd96df7ccd3596ced50b4ba57efa08f8b45eedba9f604f9b9bca11aa9a526e4700f6b592204adad1bfd4f798673f56b571b190b53b494881921bfb4cb", shop_name: "alza.sk", shop_logo: "https://y1.sk/t/s/130x50/215.jpg", product_price: "296,90 €", 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(){ pmaWidgetInstance5ff3fca4d9685ed272aed087.initWidget("5ff3fca4d9685ed272aed087"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }