var pmaWidgetInstance6373a0bdac365ae374bd7662 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=d806ff517a26e2e7c6fd4f25fdd09415:69d146570b5abed82361ceed4884f5365f2d7f118e91ee98ec660d9a177f4cbf7856ca4ed47cd089e437e02ca037536061ccaaceb980c6e0ec9dbdf323b92569841a8e348056473670561b45d56b0bf344ead3ed282649a1a5aa2f5a4c9667110a6ab9174eebd6b3dee8f8320dea57ab6dfa041cc7787cd7e0aac51bc51ae1f5f7cb4f6015b8cedd74ffc2e283104d11f11cd0863ca1417f0a9ace45c7f7bb29628763d3c30ff8195c8bbffd6c06ef81c7c35f1f239831c29469fcddb84e77559191575b0216fba6dae02cd6d7ee7ede", shop_name: "Delivero", shop_logo: "https://y1.sk/t/s/130x50/61183.jpg", product_price: "199,90 €", 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(){ pmaWidgetInstance6373a0bdac365ae374bd7662.initWidget("6373a0bdac365ae374bd7662"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }