var pmaWidgetInstance6054a0bfd9685ed2720621a7 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=8fb5a66e3b97dbda6505ac4fa41229da:c2e8bfee1e4a117402885660cc78d8c1d8c738d0ff1e277ec02c63e9dc10631e609103fafa55fee183d43f1d8a8aac4c36966e99e55b7e644d14a5bf0cfa3c3f41a4d25c39aaef4e5810d1dfe8d56c68f5861a26821efd70ab6f84d0746ce5a0b79ed475ffd5a4db7ee6e016a75215e9e1d662615343339969a366253de9f2e7eca5ea9aaf784ce8102379f3d029f8e7a88ff7166bbf1ec79733952df7e22fa3027a8cb2042cf36d969cf840cd9db9eb931b042bd079d02e8422f8db8709c598", shop_name: "MADER.sk", shop_logo: "https://y1.sk/t/s/130x50/9499.jpg", product_price: "621,37 €", 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(){ pmaWidgetInstance6054a0bfd9685ed2720621a7.initWidget("6054a0bfd9685ed2720621a7"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }