var pmaWidgetInstance6373a0bdac365ae374bd7662 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=488490c77f2e73b3080642637009f2eb:006f61f04e56d01e40e1be241c35ffca2dd7c8f5f248054a8ff4d1b480822fd7cd99aafa84ac3de9484c574640a5b5efe815cafdcd233d29173aed5fe0b8b06bbd3837aea3e91e017749ea5c4b14c1c705153cc9ec06f94edb4300fbc3ea22fc5ac4399a4369e739885952f7fe30d643a6445a3cab0a7780369c57be86f913cafd4bf65400637ee32fd91f5fab8ec787e040b436e1ca6f3203104855ebcbdb79cd8817b80a5ec157545f84662e3c5ef3d2a25c747595d508238c5b378f43b2083605297e929efb813db6e1f3e8842bf6", 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); } }