var pmaWidgetInstance60119ad0d9685ed272c9f6fd = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=d47e465cf3fdaa6eb8ea410cc0c132f2:5fc2fbe234428e17d20a92413e29ce8577f114cf630d423b1844bacb7e07deefa3b70de0c808b3d26724fbab80f5376bb63089bce18e840d0b1d530eb08681c896b5d0bad124b3d1c079bacf456865e832a4c9778a00b1e75965963284981e3899dc65999f8910ab8716d0743129e95185b34707e4f3e3e0cb49ba61c375110cbbc23507c4fa7501d56a06eba5cf105e1227169503a9ca669f8e7ad26f9f2eafc73fdfd4c8d2c88f5d3d5cd35bf2bcf8b534e196266b57bb34bbd8a9c284093d", shop_name: "alza.sk", shop_logo: "https://y1.sk/t/s/130x50/215.jpg", product_price: "26,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(){ pmaWidgetInstance60119ad0d9685ed272c9f6fd.initWidget("60119ad0d9685ed272c9f6fd"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }