var pmaWidgetInstance60d98b1e0067a2ef5954d7be = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=8ee8e798e630f393b7b95ac1236d82df:dbdc8bc9e21d67be8c9f9c321fd5f580904bc9416d711c393372e86a9c5f004373dda60155a56302776f17429110719a7c4144902212aeb267b6529cf6c6aa5e23d8cb829b751fb7db424ceac77f480c105abfcd373607afcd5c449c784b71151fcc0de145e605a97280c573d09f99b03e7653fdeb23e920100fb712ccdea4014d3690a3cd46b11b21e26d9a9cc67ee276178f59163b275e6816a405419ee2be00a407a686d8e28654b804ab5a9d1adb2c1d77f3b3fc2b6027b7272e588166f54b557c9ede1875a56ad90f3754799f1b", shop_name: "drmax.sk", shop_logo: "https://y1.sk/t/s/130x50/52053.jpg", product_price: "474,99 €", 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(){ pmaWidgetInstance60d98b1e0067a2ef5954d7be.initWidget("60d98b1e0067a2ef5954d7be"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }