var pmaWidgetInstance612e3cae0067a2ef59a7c3e9 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=678c345baf18bbf49eb9902cdd63f5f2:3a400e39fe8228696aa5ca732451f158d262f01e4ff9cf537dd394a0088149150351c2851c45a9602d79f45a2bd80c98a936f98fbdd4cf4c5a427b4171f2c3c14bf7e56be1294207b1385be1e1f84267c63347d76c91b9f7d327be35b336915f0a3ff3236ce4297253d276b94dc02dea3015fd3d371bf5681bcf03a8bdeaaac5499b72309cf21fe79fb052c726dbecbcec31e8f407d98e7ac47d256f82704ad1d73ed1378ba3e78d5d2d4a10c2d478e567700194bdc42486914abb67384a7f7d", shop_name: "GalaxyMarket", shop_logo: "https://y1.sk/t/s/130x50/59525.jpg", product_price: "117,52 €", product_shipping: "3,25 €", 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(){ pmaWidgetInstance612e3cae0067a2ef59a7c3e9.initWidget("612e3cae0067a2ef59a7c3e9"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }