var pmaWidgetInstance63eca6714218328905a6625c = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=b28f2599ffdeff14938a82a3321edc02:1160fa4b75aebd0a42ecd57d7389c953f28a0a121a4187fbf145de453a9f828933c8b1a94930c063f0ab822dccb2ab5580d95c7393631289daf03d1477d8c4489b3afe74369c6b7001de6ebfd075698b6075c95c8a95eae0ca243ce5fbea4b0efeb218c6877d48b2e98d56e220e5ea1e8d0ecb0d4eaca35838dd18f8650d32b5f5bd77bda803c1c68ab21861a234937cfe090f01b93f441b8d2068f8a5e3ba4be2099cfe63d2ac52d31df267c33a12737d0d91c6eed860a126dcf656a8f254da", shop_name: "MADER.sk", shop_logo: "https://y1.sk/t/s/130x50/9499.jpg", product_price: "258,69 €", product_shipping: "34,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(){ pmaWidgetInstance63eca6714218328905a6625c.initWidget("63eca6714218328905a6625c"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }