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