var pmaWidgetInstance60924f8a0067a2ef59a2aa06 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=04c8ef9e23afad4440939d9d11aad2c5:74f6c035ca5ee9475f374fbeeda3e3bceb86897da4687a0fd15344a7174129cb398158a11f31bb8b6ecc0261ab489df5b4ba06e33b2ad88c5a886d0bfe2f07e15c170ce65851dea9d3c8adc6c19b04ae38c32e93ad37cc62914bd876d01881bb765d1760134e047c60f5d0470dd77a0b95ac9e04599d422e7da8e9d12da9ecdd072b88aa335caaf5a7cad25126911bcadb8b17b80574ade1b2a8b5cd7149ac406cf548f0006b39ce6316f1ef76f8ebf17b652277eb8c5e8531911b3273f9b79e2d895a7c0dc4140458e9c5ef9cf40d37", shop_name: "stavbaeu.sk", shop_logo: "https://y1.sk/t/s/130x50/45871.jpg", product_price: "500,92 €", product_shipping: "0,00 €", 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(){ pmaWidgetInstance60924f8a0067a2ef59a2aa06.initWidget("60924f8a0067a2ef59a2aa06"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }