var pmaWidgetInstance63fc8ec94218328905f4cd0a = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=c971c3dd0ae6937ce70e21932d89c178:25fb588567c5a48b5a59c6eab8200b473e4bc253c8523828749581278840e0a931bc4ad70c1611bef2545c7d633c5334fb131fdb8ac1bf8df3163c12c64be2bc31f516fca2de463834cde7e647f5770aadfb2c4f331196c32a5be109c4ba4c3b90d4cf28ad0faee211075c053a1f5db1e8885436f9d164bde02efdfafbe6efb42c80ea3d553eb863efc6f29b6015d61bfced8655b084bf5090a1cc971492d3c116713db1a2d04e95175788cf3a8ca86772913ff35fa1739f56f9cf1ee2a3c32cd4a3f70da2ba24a51933edbf5c95caf4", shop_name: "alza.sk", shop_logo: "https://y1.sk/t/s/130x50/215.jpg", product_price: "601,90 €", product_shipping: "", product_availability: "Skladom", 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(){ pmaWidgetInstance63fc8ec94218328905f4cd0a.initWidget("63fc8ec94218328905f4cd0a"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }