var pmaWidgetInstance61025ad00067a2ef5902bff6 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=0614c80e02a633db3e5032495992cd65:decebc7d7463d0ea1ca137200a044cb6e67894957fdb81b7fe32a0289947f9d35f79347f40b8d92e0481f726cfc5aeba106cfc3f1715b03a0da00998a512bbc643e6f0fdf61956c9bcd0a53b0f9550bec67847bf978a6f947c9f8f047e942984abc789e82f6380e59fba23c5426296f6f9e78dd59ab3c0b4156e891325363f6a32c50ceb47965a74d094efd8fff4002b7ec0ae28b9a9d97aacb3d9586188bf61297fdd80223d64686da80656e21f275436e0976f4f461b4a8c9c837f0107a43d54d99b9fff2ff54a5fe3ad46d6d63127", 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(){ pmaWidgetInstance61025ad00067a2ef5902bff6.initWidget("61025ad00067a2ef5902bff6"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }