var pmaWidgetInstance6022c749d9685ed2720efcf6 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=6ca61ed9bc04be66b9c9ea2ee314075e:0b2a92a6a2a203c423e814c1f2a89d2aa94e7f47cb533b448e67ef2a37dd5a7403a22d791898d0e7d939a1f4a685d1eb411d09a2b11d1fece527166aae22dc9642d8077984e126fbacf4921cc10900ebc9433956841c375201d3b4821e274d9b97c7d873e60669a6071eb4fe53f254938a19eda596c6a367c858d7c4657798c920c713b83c12d1bf2ee5e3814f467edddf4329d7a3ea6d948eb2339e700e2976ae4b66f0bb97d830cad3727e4eea7147f7a362ea7ad292486b28733d0ccf241e5799ef136c66c3de57a61fe7c494818e", shop_name: "madmat.sk", shop_logo: "https://y1.sk/t/s/130x50/903.jpg", product_price: "157,95 €", product_shipping: "0,00 €", product_availability: "", 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(){ pmaWidgetInstance6022c749d9685ed2720efcf6.initWidget("6022c749d9685ed2720efcf6"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }