var pmaWidgetInstance60ab2eb00067a2ef59dc7853 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=e980953fb92255b0b0c12040c34e35d4:0f97dcf0c95878fc73db6e852df96a9410edf81ba478ff8cd9c010e7e064f7a701371bc9454fe1359073dad2a9b4621883d79e1001f92bf9a94b170ab19902fb0c86c34294ad23c7e0fbe2eefcbdf529478882c72dbe9670b69955aa757ffa98bded1453578ddbdaa0ac10dc5bad2ca2559a252777eff5a2f06ffb69dbcb0bcafb303d4e39369abafc02cf824a02b5bee96e275b9a54f650a65610ddca27c6c492daefaade4cb21eed52a2fa897d7a3aad9a9d76bc27160d065da412e193c4b5", shop_name: "Odpudzovače.sk", shop_logo: "https://y1.sk/t/s/130x50/59075.jpg", product_price: "49,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(){ pmaWidgetInstance60ab2eb00067a2ef59dc7853.initWidget("60ab2eb00067a2ef59dc7853"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }