var pmaWidgetInstance60dee5fe0067a2ef59d398e4 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=fa3795b59cf2471caf6f77a0f06dd8a6:5c6a1be060edb74f4ebba6473f4546fdd886a188e20670f01140f1c7c362965f011ad2c5f6ee3c08e807b616e2a4de925144dcb19a7e6ed64397c0d7d466bed14178d6b7cf9a3f3baa7619d8fe1600cf7472ef98cf164b28be9cdf4f38aeff5e5403fd8cda42030b562b994f165a333001a784bff912b78c0cfa80a30aa3a87b58a97eeccf83adae6386a8018c3573873680112df77f7b66f3fcfb267044f7bbde46a559739bf8d8220ea62ae1a6508e9adeaf7df486c2f82efc34e7f529c54b1c01b832f5e4e5296f2d3fae9f5d66a9", 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(){ pmaWidgetInstance60dee5fe0067a2ef59d398e4.initWidget("60dee5fe0067a2ef59d398e4"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }