var pmaWidgetInstance6022cac9d9685ed2721175fc = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=19ce71042da3357a792b72825d0bc428:ecf323425f7c857d39e875f92c8749cb1a59790b8d44ea47c8447ed5fb5c4516261685551035229a95e8568b18cf116067a5b15aaf77119e73052682d7de8b92bc95643386d3ee0c27bf0c817b8a907b690c3b1d6ef676833a313ec2757edeaa43403b3d139199851bced91bbf12027ac72a436eeeea87d560eee4157a79b8ee461d58c5d946538dcbda271a63209f5a710d07a536e7c6e9dafb17a4475cac3906aafcc94e5353aa8d57111cb81fac76c6ea1bcf0bc5c7926e9ba44d61126c46ab27b03fc66fe0b1801790e4997e6083", shop_name: "madmat.sk", shop_logo: "https://y1.sk/t/s/130x50/903.jpg", product_price: "265,95 €", 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(){ pmaWidgetInstance6022cac9d9685ed2721175fc.initWidget("6022cac9d9685ed2721175fc"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }