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