var pmaWidgetInstance635799bfac365ae374f61201 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=d500ad5b2ecb6166c6cab0c4f15dee47:93c4bb5aa9d472a7bcec685309a7e641ca86d019376cb6140f80b575ad4e19f8b7790239459e6c7b8f70862851f80826a51630a9ef30a3696072c6b76c30a5de55bac7c65985adc341b578d70bbceaf3636be21590ce8338f3073f58fcf228f971b6a834ef2f1ad0069ba99ef691b0c51f86bdb860b68c9acb30277088def7b25d0dca67db8e9780d510aa8ef75fb717de36aadf82be0b384d11ac902ccd76871c1be625689f80bf57f8a52e35da3675324eb9102c989b1b363bd50083b57df463944c10e2a4947d5db829b22fde052e", shop_name: "bux.sk", shop_logo: "https://y1.sk/t/s/130x50/528.jpg", product_price: "11,09 €", 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(){ pmaWidgetInstance635799bfac365ae374f61201.initWidget("635799bfac365ae374f61201"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }