var pmaWidgetInstance63f9de6c4218328905b51868 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=a5a34d0bab00f6447d53e9d349e66a2c:1a241aa7296e4a69c747e9b83faa153e8e4ef2d18feba7e07996551a566e74f4d4eb5c442ef80a830753f68124880bba30e625612b83ffaeb83925306c31228f87fbe4c1909d19d18b40764aaa3a5a0e3ca5da20025575edb8c26a6784d4c6195972cf89cdc5fab41dd75f6821de4b3b087a3f0996d28865280f5d9600919bb11fbbfca78fa9ceda60ded4c8f57b919425bb693819368627fc638daafc2078228c5ce9a047d9cd37fb00ac6a49a3db0a9ce6307c033c0f09c874e3577cc3bc3253ba3c0b0149c521c8e8af8faab5e4f5", shop_name: "electronic-star.sk", shop_logo: "https://y1.sk/t/s/130x50/44673.jpg", product_price: "212,90 €", product_shipping: "2,99 €", 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(){ pmaWidgetInstance63f9de6c4218328905b51868.initWidget("63f9de6c4218328905b51868"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }