var pmaWidgetInstance5fcf6637d9685ed27233a851 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=caa9e9e727f9b701cdb21eb64fbb7c4d:a21dd4d53b528be25308f0b828cf78544fd97ade9bc9b1829c417d762fc4bbc48da27032541c7cdad60f9fdac92448944aa775a43750c53fda22d11c5679a6ca9e65ce1d428fa89cbdb73cba8973cea3caa69021028d4e440b69439391707e1c09723c0f78783e0a5762e8534b2b2ddd40adf74c0521f75dc9c45c05ebc5960c73cdb2dcda7c7bada11f536e7b6edf47b4d9d3958d50052d38ac116b9e21073e9cc5603f3f0f86c2b8f672fd798907cd3ed3f6b10740077431f51b36fcc128c20dddb53fb9670d24e401d2ebd59a0aa3", shop_name: "KupTeraz.sk", shop_logo: "https://y1.sk/t/s/130x50/9469.jpg", product_price: "89,00 €", product_shipping: "4,50 €", 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(){ pmaWidgetInstance5fcf6637d9685ed27233a851.initWidget("5fcf6637d9685ed27233a851"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }