var pmaWidgetInstance614b64eb0067a2ef59dd390e = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=2ce02770678d1d7e0cf98dac0ca8fb28:b165eb3f70b855c62845ae67b6a876b65281ba3e2d6a2bf3d94558e40ae1ad2b70dbe639a4b90393fd5f0c4d179e51fa9b5feaa6ee177709d8c7f544bb86dc25396c4c5885b577714a43f7b081a0d9876e2afdb0f2303586b5e3115a42b8558f52539cc6fb96ba34929a75850d3671c6e7ea99a3749cbd85b51d1c45734ddfedfe04e7bbeae162b08762297a645acf8382bd664be967981d8034d914ce983246e0d3e7e0d4ffef2a3caa72aa833598f1f6dc691a32d9d240a5049ce2034bf41b7ed87d9e3f6050bca585ffe564439b6d", shop_name: "alza.sk", shop_logo: "https://y1.sk/t/s/130x50/215.jpg", product_price: "350,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(){ pmaWidgetInstance614b64eb0067a2ef59dd390e.initWidget("614b64eb0067a2ef59dd390e"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }