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