var pmaWidgetInstance63579ff7ac365ae3742f53ed = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=71fc111303fbf1d7d04fdc3bb27731e9:82f5f4c706c062a07fced4bfc790065a4f169c30c64a795d21a0bcd2a6fe8e7de10bb898d41dc3fcade303f292f0556a08fd37cec45dbe8cc4f08cbbeccd71e4180a6e25cefb0f288fd631a508f4c574c675e2b649518b82ed1aa3243205c56884c78c0147814e213c9988df641e01c3e5d525476b065db86d487eacd2a43d008d0eaa125c91c1f8ec3c21417f294e2e22c16eaac16d4422787a73013e2d734e4d9cf80e7fb9a77562471ab90ea5b43e35126f13ddf842ed2ba276d39849217a3cab1fd92e5ff06494262a07f113847d", shop_name: "Arada.sk", shop_logo: "https://y1.sk/t/s/130x50/59720.jpg", product_price: "7,14 €", product_shipping: "2,29 €", 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(){ pmaWidgetInstance63579ff7ac365ae3742f53ed.initWidget("63579ff7ac365ae3742f53ed"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }