var pmaWidgetInstance60dae2e00067a2ef59d9cb0f = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=6ba691a24e4d64957e6c58f9763d5017:a2cac34c884a681bd55368b516619b119666338b266b2379278969c41becda3d246ae52f534275e7a7608202f8dda87187353c6c061cef3fb5c9cbb7d03105bef9f7c49e3ce508c1eefef34a1f6173c702d00dc701aa1ddd46e129d373a3b73acbc62cf0fe7400800ae96e2d3745178ca6ea21c259b296500fb2b5cd6474b46bbdf790827e0ed67392e5b0ceaef84a455868d668c9eb2c9305a07308a1e24ad1a6b7bac6797e61380c822de56afc34aff1187cd489842cf5e22d4bbf8adf548207d21d3a9626856ecff7780c4ae910cd", shop_name: "alza.sk", shop_logo: "https://y1.sk/t/s/130x50/215.jpg", product_price: "1099 €", 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(){ pmaWidgetInstance60dae2e00067a2ef59d9cb0f.initWidget("60dae2e00067a2ef59d9cb0f"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }