var pmaWidgetInstance610a6cdb0067a2ef59750d0d = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=31636dadb61ffffbe22502921d4075e0:85a5927d0607904887125617a7cd236fbe9f54b2243f8cf9a398e8f7ca68fd018a46eb88cba8fbe696059f98432145da043dafea69b8354eedcf442f7de348a781df6963a1c4f55e2fbe75bdd080ebc6a70c0dcbd782d0f227e04d80cfedf022cb94ee97e676f7eeea5148fa538410a5b56b2574148a421b4448fc563f4e2dc05ac8b1b46c49c58b884678a89873ca0cc5310d3a069ca82560bd57308f051b5b05949a4a575bd7523c0572cd8a36709a5afb83c011fccdf35b1d65cf2d3ccb10", shop_name: "MADER.sk", shop_logo: "https://y1.sk/t/s/130x50/9499.jpg", product_price: "606,35 €", product_shipping: "3,99 €", product_availability: "", 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(){ pmaWidgetInstance610a6cdb0067a2ef59750d0d.initWidget("610a6cdb0067a2ef59750d0d"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }