var pmaWidgetInstance6357b61dac365ae3740bdb9b = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=85cf868f7acb4a9a8ec00af195251039:99c9225cc7e08ea61cbe1a912ff4bc451c22acfe4be74d83cf777e31cdd25e540fd64bbbe0ab765ba8b6ee4133f082b24e7e50632149185844f2e81f430251dc2f4a541bb5d0f52cba922b3cc45967b69ed134cede4f5acace8b379515bd6c3e4ed449983331c26f7e625abbb4cff90e884d188228aa744fdcf4050b500c62646d2f8c5ade7e90419c220eab66e772413b86a87d42fd92f0953dc31a2e6ddcb018832e56d6cdc10cd05018b960ae3f168952db4a412ac2d5d1c408da060038f677551ccdce9d0908a98ed1ed59f5a00a", shop_name: "Arada.sk", shop_logo: "https://y1.sk/t/s/130x50/59720.jpg", product_price: "7,74 €", 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(){ pmaWidgetInstance6357b61dac365ae3740bdb9b.initWidget("6357b61dac365ae3740bdb9b"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }