var pmaWidgetInstance654cb70c4218328905a8f3bc = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=1cfa4644fc942926ad89dd9dcff045dd:9e9d460f28e0b1af0cc75008a1fb78ef75a40de62b0f539b1748cd571b5e04ac47c06cc8be0ca8e0f2e0ad4af15a101939c62f79f1bc98b001e16b84e0e27573841be7e5c55300331c366c3d8aba5180a2f2c440633941f6cbd17db2de8129b0d0bcd5610b236867d9a1c7eddf08c1b6cfe89e904350183819b67b3abadf50b011574d5b1b9f62b2ef4cc0897f5850c23146d3a2334a3ab5569753240b52e9bac38533359bfd9decda4ca587d594ff17bdfa56d559582c473c1f296f1bbc22724df5573c9576000781a0aa7c8f6b773f", shop_name: "bux.sk", shop_logo: "https://y1.sk/t/s/130x50/528.jpg", product_price: "6,00 €", 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(){ pmaWidgetInstance654cb70c4218328905a8f3bc.initWidget("654cb70c4218328905a8f3bc"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }