var pmaWidgetInstance60a4d1930067a2ef59e48f18 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=726ac5baee1051e061e9db1ff7adf335:7870eef6d66d777c043be463537e8c13bbe158a164b32850d89f482d350a80a3f898f1c4ac1fa21a51756a87fae2c781b72c1e14a0809e998e04dedb867be8d26447bf0298fcd119bda68ed16c1f5875925145b490cc987881d671224557491f92f2cf18873ee8191458de3bff6ea842f762afd00aaa3848aaee8b62592650c1ad7b616ee654560c4dea5ca7344f243e2bae207f508d2d9a604e2b7b3210b6efd55fde68461f7886648b0609c33a8cf71407d2d9554681db0260c6d66293da6b626e5bf93ce2c35ad0dfc921c7b0fb70", shop_name: "elu.sk", shop_logo: "https://y1.sk/t/s/130x50/59355.jpg", product_price: "249,49 €", product_shipping: "0,00 €", 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(){ pmaWidgetInstance60a4d1930067a2ef59e48f18.initWidget("60a4d1930067a2ef59e48f18"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }