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