var pmaWidgetInstance63738d3dac365ae3746971a6 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=d7a4bad9b3f64cbd21091fd49128fa8f:0c7d15f0c237ba5a3ca8a52fa63d5f3f22eca5eb07b802a31b10d876f66f5ddcaac44b51a477be5b452a2edfd796d0615ba9fb2f9c09b9fd5d871d10b245d2019f1443f4d91f99985afbb1b348ad11986f9406647135b18b71c2a7c9047fcd29b15a75b22069e43c8595356f23f3772f6266240069f274deb08e0b9325e04b0d2491e2717f24df95a53fa9f05e4a1ee4adae7deea965714477b31fd2b651a51ae222b0af423c5afe02c0e7825b0b491033b0d0bfb3fdbb8e9b8725a3221f5f372fc8c92af005bb7a642e19d5456356ba", shop_name: "Aromaniac", shop_logo: "https://y1.sk/t/s/130x50/10227.jpg", product_price: "15,87 €", product_shipping: "5,13 €", 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(){ pmaWidgetInstance63738d3dac365ae3746971a6.initWidget("63738d3dac365ae3746971a6"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }