var pmaWidgetInstance5fc0d5e8d9685ed27295d449 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=be7dc84d2aa6a04722c40c6a8b45da40:edb99a5fe323122b19e98e3ddfa9fa57c0c3f903a6dfe6149cde49dbdfb60e65e4c08895d68c3aac43a7c78a96888122f7d22c72d6045fe3113ee6e98c610b3b39609ecd679ed05e908836bd5c1a8d2a6a51aa825312e471d9eaffe716d87e9fb5cde2343cbafdebbf27ec8244bda4ba60e3ceb302e5e0a06e4b422d4367d202145a111d11652c283d71145dc84e1729debef000d9f1a362ea5e99d601ddce6e31f7f833e150ec9d71d67b5b75f2982d7e04d9fec12773ee8b5d1dcbf925a855", shop_name: "tpd.sk", shop_logo: "https://y1.sk/t/s/130x50/313.jpg", product_price: "40,78 €", product_shipping: "2,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(){ pmaWidgetInstance5fc0d5e8d9685ed27295d449.initWidget("5fc0d5e8d9685ed27295d449"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }