var pmaWidgetInstance60924f8a0067a2ef59a2aa06 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=8eb358ec701c91679919561d6bb24075:2c72a12cea9be9443e057ac2ef5fd90cf2dc1c43b4c16bbab31dd1126b7231923935c472e6444d48ea4194c28315c1d8b2029efaab7288e97c4328a7be9a2a48a1d6350ed0436bf0803e778c61ae74d4a59cb85862e8f138f4ec854ef42665eb609a7dffb05fdbf132cb720701d1d481bcac77ec24617c6e9e86bac0d47bb736f599a3513391772be15a65a4f7205ff88f99cff1ea541f26d8bd20402cd8841a19498beb9a9007a466a4a99161e9126117a90c4f186c971aa50d612734bc5f43ba7bbad68f6f89aa37ba97e7625f3a21", shop_name: "stavbaeu.sk", shop_logo: "https://y1.sk/t/s/130x50/45871.jpg", product_price: "500,92 €", product_shipping: "0,00 €", 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(){ pmaWidgetInstance60924f8a0067a2ef59a2aa06.initWidget("60924f8a0067a2ef59a2aa06"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }