var pmaWidgetInstance63e2201d4218328905dee820 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=989f2db325832992ba99876ba31dbe20:622f00fe489bfe0377d293346d3b2fd2bd11d8fc951b32a49f7884d9f80142597965848c0558cd70f8517a560d1454a6269c0e9d7d4872e68daade89745a0baf8ce04b343b0aa91055083e07914efc97d9f5c3327424deed195e6435ad83a0f8a6e67ca5d6d0df8e841914e9dd0fa518e5e1c0c9c691d95cafcf31ab6639491d518b9539f22117821c96dd3af331a71a562262ea5513def3a4ef994a593232b97c08b03c12c375fc6f5e2ba9373ff2382761a83701ef582a9265737fa79c6484f5dc75024cd72b5f69a268f4e15aebbd", shop_name: "alza.sk", shop_logo: "https://y1.sk/t/s/130x50/215.jpg", product_price: "314,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(){ pmaWidgetInstance63e2201d4218328905dee820.initWidget("63e2201d4218328905dee820"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }