var pmaWidgetInstance5fc90a75d9685ed2723a9ce6 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=008e40e6f9bac9139166eeff4ec08814:07b4b5e1165517f62d4c4bc7068a1acfa1bf02585baef801d64de0416dfa19ba9297f7899cec0454d016e9e3243f5bacb32ede77016b13bd9160cfcb6959eb5152284dfc2c3418bb8e92492d9518e1e0d9b0ae4248c7cc3ac84833b8072c7895cfd773b481edee7e31ed2c98155f6ccfa4cb2aa7bdbb586fd175da181a9db5216201c07951d53f511faefc46e955db23c0f7d0db7f99af53e761e54bb5a548d5453c261a7af06adbb0f284002f55d89c94506fd2d8a31641af2f5b22662e3bd2", shop_name: "alza.sk", shop_logo: "https://y1.sk/t/s/130x50/215.jpg", product_price: "134,99 €", 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(){ pmaWidgetInstance5fc90a75d9685ed2723a9ce6.initWidget("5fc90a75d9685ed2723a9ce6"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }