var pmaWidgetInstance60b9f7800067a2ef59efc63c = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=17f7f42d0a71f2aab6efd5f2ecabaf55:c1ed5399801360508ed5715edc30bf1855c430a40196ba71d80fbb51014e48ac784076f03668dec052d0d4c69a3ea611825f034bba1950f7194ef369f242a3d6fff97e23c98115508e7a82daa854f79f060c8f3829e23deb58bf7a89ef4f8556d2b195eb5e93bc0669b170295d42629e5bc856acc91f5790a2e43c094d4b795121ca2b4e0e9dbe9c7e914123ebfb01c4210e324c93a8e4fc5ae23db07e801d16939970977f5c0ce15ad659b158c1d0b88b112a87744e4f31ca40601f65eda8cdb0a4ae76f865063a8c55f00929ea819c", shop_name: "alza.sk", shop_logo: "https://y1.sk/t/s/130x50/215.jpg", product_price: "718,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(){ pmaWidgetInstance60b9f7800067a2ef59efc63c.initWidget("60b9f7800067a2ef59efc63c"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }