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