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