var pmaWidgetInstance60e43a100067a2ef59ac3237 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=9e860373a67aa3cc0862fc999834c953:1f8d14bb7336cb61eb99295179cfec8941dc8deb0f8daaf8d1e4af4ccbba994f8e99976f2ea1579b33cfcc315b0372fc961c7b20fbd05f8d9b4a51ff3afe856e7bbe4c906e16107971a94c914cbab08df8be6d0d2144b18f641e07c8af227e2d4b03cb7be86bdb9034339908687b1e9f9a637faa8853f1654d7917e222d1807ee66a9e7547fee2cc53bc6ea52a3aa410d30f0bfd9f648ef2be062393e41cec9230f7d2bf139c554b1505e4f4ff2e79f7b1e350628de65c5841df4f46096a02bd", shop_name: "MADER.sk", shop_logo: "https://y1.sk/t/s/130x50/9499.jpg", product_price: "649,00 €", 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(){ pmaWidgetInstance60e43a100067a2ef59ac3237.initWidget("60e43a100067a2ef59ac3237"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }