var pmaWidgetInstance6357d7eeac365ae374a8eb74 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=e0a728ec5bb28b7eab518a1f46b427d9:047cc29dd304ceb59e714fb9b07b680fee1789d85f0d4f2966ade736adf7f394adeede8d62b5c79b935a1cf9370fae70ec5eeb1367c82a1a715fc1aeefc1f5c9319379c87e39ae95882375959abb61ab8f752fbe29d027e0885722f8f5202faa3ae064988179c127f6e9977f9ee593614bedff6336646563c4426a7acc019ca4703f00e1d906304dda7d913a9c7a05100791d33fac858ff615582f15567fe3253fb1fe294850c81dfa0ed54907a23f6eceaa90136d28016b3f783577f5b80293e638c2b1fe4d15af9d124c53e2db3a3c", shop_name: "bux.sk", shop_logo: "https://y1.sk/t/s/130x50/528.jpg", product_price: "5,90 €", 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(){ pmaWidgetInstance6357d7eeac365ae374a8eb74.initWidget("6357d7eeac365ae374a8eb74"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }