var pmaWidgetInstance5fca0ec0d9685ed2727de293 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=492eced1d7b14d429fb362f1979cd489:1dba209d9413d2e2ed4517cd98baedcb3e9fb6462d8911aa2b3c449e78a1a33ce39edf1e767a81090ba19f2d5406c13538166facb9e8a654ac2603b94e530ea37893ffff46fa22c73ac29b6ffa8566f6885c9ccbdd84e9c710b7ed2d45f172bdbf898049636647168993f3398e1f3784e4505288f7141a073eb1f79b954058c30a8bcd1f426206c7a5d8c4918f0e20f1ace9856e7ae1a0f02d5380215c2bbf08c6e2942c32d43d0e5257724ac64e810f61da06b8eea4b4b711c82de098ac5866", shop_name: "Gigamat.sk", shop_logo: "https://y1.sk/t/s/130x50/59591.jpg", product_price: "28,87 €", product_shipping: "4,00 €", 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(){ pmaWidgetInstance5fca0ec0d9685ed2727de293.initWidget("5fca0ec0d9685ed2727de293"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }