var pmaWidgetInstance5fbfca1dd9685ed27203b9e5 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=6f5bd9b78d882539cb9854d2d87774a9:2d050fd9a76f6377abf1832df84798ed49f56584bf13cc3eecd4e29db672969588d03469c16414d31a456ee87a568735ec50b84cfe19ea13bfc1bcf0be06f4d9431ec7e78ccbfd61db659db2cdc15945da8c68cedbe7189bf045ab0e5fb343b421a920da4da941be67e53f9743e525b41e6dc3757009f195bca8ef6590f889528e60180402a904effa7cf70dda9e7f43cc113a017e6915295c36560ef0271c27bd5c0abeeeb820425e553c99ddedef2a75b08eb301d72e2fa14604785b7acc2d", shop_name: "Best2Buy.eu", shop_logo: "https://y1.sk/t/s/130x50/60439.jpg", product_price: "47,99 €", product_shipping: "3,50 €", 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(){ pmaWidgetInstance5fbfca1dd9685ed27203b9e5.initWidget("5fbfca1dd9685ed27203b9e5"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }