var pmaWidgetInstance604379f5d9685ed272b70ee4 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=6dde82bec604ae6ef42a8c5c34e5d5c6:bba76d91c6174856f829a864e775d272b931f6959dfef4fdca132fe0df0daf19252b28c619709c2b4b6d60d1c4bc4b5d58619656eee1273fef692badada69f931345358289d7ba8bdb4ce747cfdbc92e2feee64498b6845704ac3270de06d895ba5cd269bf02995dbb50663ed75e05b2595d6b094393375bd9b0da76b5db26c47645186837008db45b89d5081dd97fcc641e19f6866466cd619fc1a94dda10fa8f3ff216f7cd3b7be72a8f021984b21e63d641c6a6885d2180208c37af731ebd", shop_name: "MALL.SK", shop_logo: "https://y1.sk/t/s/130x50/135.jpg", product_price: "6,10 €", product_shipping: "3,90 €", 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(){ pmaWidgetInstance604379f5d9685ed272b70ee4.initWidget("604379f5d9685ed272b70ee4"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }