var pmaWidgetInstance6155bf820067a2ef59f4f1d3 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=0c220143be0342fcd237d9a7021b7f23:2732746ec342ccb5330034192f62d405b0166d662bdf241419836fc19f1f33599c271a5c8b92f3a6820349e44194e0c84570a2a9db639ae114c46b55d0fb7084f54e2e76db73dc5bd2e2831eea170c0ad437ac047756b36d2e53dd4802723465f2345d5c9d04467ce5dfbbaa6939ebe6216b7ff09c5bdbb33862168472e11d33ef0822315f762c1c166e0f1c2a1d6ef8309d5687fbad6794b8d550a43957545e1b3760dcd7a675f57f40c26a8a7023b702957694bd34367b999cd92f75c795ce", shop_name: "MADER.sk", shop_logo: "https://y1.sk/t/s/130x50/9499.jpg", product_price: "189,96 €", product_shipping: "3,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(){ pmaWidgetInstance6155bf820067a2ef59f4f1d3.initWidget("6155bf820067a2ef59f4f1d3"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }