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