var pmaWidgetInstance60924f8a0067a2ef59a2aa06 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=01b112a9b8894683d3fa298dd96dd89e:4c14e75ee43b13f597c41834280fc0f5fcc1abb3c8b60a5aee9dcad2ec41f4a68a183c9e3ea8b20f259124e5324e3998d8606ad5e41453db65f080628712f2ca545c6f16ee2e1f92e2507547c3389a3e3dd7431250e07ca5310d1ed69067e9f826b7f380652bc3c5fa093fde75e5b770f02efbcc1e9e3e5fd90547df99c8da367d0b10f97f82b69bfedd78d600fa5176bf469129a5efa5fe0f1e3ee3fa98c66fc263771f14c2dc2aae4a7e07b0cae1e98a6f42174dd769e115078c05f48c6c7abcdf4ae1cb029bbede9587b25c7284b4", 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); } }