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