var pmaWidgetInstance60cb044b0067a2ef590b64c8 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=01742f3e43694668040bf32132eaf923:718b1d43af0814184fe73a58d91f194cc7935253cc222d15a0297e4dcf6fbf94c0e12ffc2ce0c417330ed0ecc0cc321980e4b81b874581c02203a8e78a5a14ed3d8c89ff42d5aa1accf9195d3d14c331e483ba87af730ecc5cd8860e1902ec07ad07dce5d527c2e91fa86b79a0e7e221d904ac36b78dfb69b4cb6e76e440823f2ee2cceb6fea3b3a411fd0ee2227c554d7cf6ce897f4153aebdbf5c3c910f807ae4f1cbbf16578d615a649deb4d98a829cc87b453baea3de53e7b46ed2a1b45f", shop_name: "MobilPC.sk", shop_logo: "https://y1.sk/t/s/130x50/46049.jpg", product_price: "211,30 €", product_shipping: "3,90 €", 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(){ pmaWidgetInstance60cb044b0067a2ef590b64c8.initWidget("60cb044b0067a2ef590b64c8"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }