var pmaWidgetInstance60c1e25a0067a2ef59b46b74 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=98e160a9c7b49dceede2482b7107884a:90b1d9811f811ccd5cc494e0d7b92e1ec8a02763b5e26eb1dfd33a6a2f06666969ecc1894396afcb9f0ca2e0455d1ceb2ec7d11039447914334d48ac80f9ca30f07f27f8aa4fc0e0a0dfc10e94d07e9cb1e300d8a2e903bb8b454092d584dd57c0dd07d4ac5896237c27931f63ad2a4232ad36d2d3ea350e7e9a93d0cba9a66120dc058e9521e11022c441f8ec906ff4f7eddb3c6c7eef5c2edb1ebee79579910b29933f1097d82956fc81d2ab345efae79413fb686d74958abaf9c88ad28170", shop_name: "MADER.sk", shop_logo: "https://y1.sk/t/s/130x50/9499.jpg", product_price: "606,35 €", product_shipping: "3,99 €", product_availability: "", 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(){ pmaWidgetInstance60c1e25a0067a2ef59b46b74.initWidget("60c1e25a0067a2ef59b46b74"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }