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