var pmaWidgetInstance615ef6cc0067a2ef59cb1670 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=f11e001537ef3c0db5e7bee502728096:5cdcc1c077d6ffa08db42a5c53f2f2c7d8b18c84dce087bb119d13b5bbf0141b377cd4ca201ad93e7090779e860c3331a93dde013c3c3af2f60a7b27c3a76b5cee334e5051a1945ea22978e2fb5da50b9adbfd8da6b18cd4952d61a17a1fc86afa15ecc126de54ebde3a3bcc2c923bd9fbc766ce041af3f0cb1b81e9345b7e281ba0bcbac8b8e8b7d5c3ae7af8fa77296673725dbfd17473dc79bab88a65aa28a8ad8692ef7262f36f5297caa7fe80e389a9bc5ec4fb63e0f99dee7fe2f653a9", shop_name: "MADER.sk", shop_logo: "https://y1.sk/t/s/130x50/9499.jpg", product_price: "102,71 €", product_shipping: "3,99 €", 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(){ pmaWidgetInstance615ef6cc0067a2ef59cb1670.initWidget("615ef6cc0067a2ef59cb1670"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }