var pmaWidgetInstance60cc9b7f0067a2ef5913ad3d = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=3c5963e9bc0369347083d73032f60e3e:4efb9e59da25e980a9a2dbb2a18aeed3bb4f68ddc8f8b1d0d770fbfe1ab1f03585233ee099e8d263487c53a2fecdc0a0da42baf2dfac99764045b32872ff2f188d87c5630b8d343dfa9789ec8401dfdabf5c8842aa6cc5c34fab4d6aba15ca0c5b829632570c75e7f815fe993c106b64c62069222ccdef7972441ee7e318ba9cfc07be99155973070f0b23aac2a41381685bcdd1d2d31a67b4a688363ccb45e492c0946b006e709271e1923207b9b258ca03eec2e12088a11323a272f0575c3d657d1e670a2c32482977f524c838e80e", 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(){ pmaWidgetInstance60cc9b7f0067a2ef5913ad3d.initWidget("60cc9b7f0067a2ef5913ad3d"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }