var pmaWidgetInstance605374fed9685ed272925037 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=92185478e1a7c2d6fce29e9688fbdb40:669b7f626652bb826646473554e7b57c2801e6f4ab6f8a71a26aebb08693bc970ab3ea6687dccc23d1e29c132ccfce9308718abdda20e983329e468bd33aec1136327e869979503a74ab1b95f1811d27515d4eb9637e9f7b9f9f317693541823391452b18b09536fe9d074a100602b25b1391fe47968e016fe73e854c6b34ca6ba881d2359f1d3e6ef7f5d566f773226e7590feea8274275ef441a9df429e9ce6ec34b369dfe079c38184353c8a5b576bc0f7710250d6fdc9029f93d41f51fb1cdbde0faf5969f4a4ddc20a0be61235c", shop_name: "alza.sk", shop_logo: "https://y1.sk/t/s/130x50/215.jpg", product_price: "329,00 €", 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(){ pmaWidgetInstance605374fed9685ed272925037.initWidget("605374fed9685ed272925037"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }