var pmaWidgetInstance654ccc3d421832890515b1f0 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=a27d183d8a871c65fcdade729ab3d7e7:6b463ec8d34ec312fe3c9b0e81e07ed264c7db8171bff523593487dd3a15e97d651b18888b45a1c23a7b4bc566222b1fe021a0fa30f5d72e5dec00382a48c960e30385302ec4a3bb676667734d77e59f5fb0aa3db8d77bead843c529440cc0f74421e75de2019f97e8286ef013e9d6b80f363ae5b1378b13a461f059cd765a1d4771ce90d47022c524805a6b632686a91cce3187e4453868c6864d8c9aa9ba6c5a8ad6713815d1fe77cd21c0f7a5e1168d1ae535714d22faf5ad9fe4433cd276126a267e7deed50dd1a30b27b7e86479", shop_name: "bux.sk", shop_logo: "https://y1.sk/t/s/130x50/528.jpg", product_price: "8,56 €", product_shipping: "", 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(){ pmaWidgetInstance654ccc3d421832890515b1f0.initWidget("654ccc3d421832890515b1f0"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }