var pmaWidgetInstance5fca565cd9685ed272d50b47 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=34938b1a5cbce67ca4fad1fafd86588a:2c35c6d4111ddea66c5662b6e0e520c1391f0821c7b4676adbc9bc6b762ff24516ccaa68d679752fd3552683b7fbae227d846d72280c777350c4370e0365bb81d26b2aaf9d58807838bb6d6633275fe205a339be438a346e62a69a240354d35c41e6d6947c87b2ee612d233101cf660fac2f81b1f3d13143671bf2a53a20aa1160f2aeee30b0e7f17c7e63760ca897cc93b220063e0e7500e7fada1c16ed0d2178cc2ebb437a33e1af04fcb0f3d7bbcd0d8a3dd708a657077be15b9723ac186a", shop_name: "Xzone.sk", shop_logo: "https://y1.sk/t/s/130x50/9583.jpg", product_price: "31,50 €", product_shipping: "2,99 €", 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(){ pmaWidgetInstance5fca565cd9685ed272d50b47.initWidget("5fca565cd9685ed272d50b47"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }