var pmaWidgetInstance63f8ab3f42183289051869e5 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=7116912066bb82ccc4d52de7e325ce20:cc8c64ecc18e9c609ecfdab2b6a8c72ba57d5af0a633b09d85243969f167d7a222cd22e9c660a68430edf5a8e43920966e88d92214b8d36d478974f0a36794d7c681ce636c62d653933233b08ea5c68dae42d1a9dec350c31548a3c5572175a87dc8eea34b96bc237dbc23d63c85b44401f8c3d1f71505ebfdbab2bb4e1f8f4763394bb5a8374c61b45d5b8caad0e0170f7d7071d22fbff27f48091055ebe1ce3c4e9542675a60d6807abf96704a719b21aad7d6cdaf11455d603a371475c3f684a53dac9b6862c8553f1c7352356c41", shop_name: "alza.sk", shop_logo: "https://y1.sk/t/s/130x50/215.jpg", product_price: "29,90 €", product_shipping: "", 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(){ pmaWidgetInstance63f8ab3f42183289051869e5.initWidget("63f8ab3f42183289051869e5"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }