var pmaWidgetInstance60c1ae3f0067a2ef5963e43d = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=9643b43267bfd81386b1d190ae462d04:843464f53f719c5a0163d35f07176c7d708438468e4ecd3aae06d401317d8492422144472531871c0e8ca2d73019ced67318935e1c8220ff428a5a181df2a2afe6b577167931556617814a2049066ca45ec38e20dce89130ea58dfd6c2509df62733f885b19b71a02e19712474b85b0db13bfb59eab104d4f1a9d8044e4d0d5d7e11a208861d875e6cdec049e669793dab69c9a0b04255eedb21b5a4e6af02b1918cddb958f0443fad8c286540973e2f8e1073df9f9ca0cbb36dc6b32e77c810", shop_name: "exkalibr.sk", shop_logo: "https://y1.sk/t/s/130x50/49853.jpg", product_price: "137,74 €", product_shipping: "", 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(){ pmaWidgetInstance60c1ae3f0067a2ef5963e43d.initWidget("60c1ae3f0067a2ef5963e43d"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }