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