var pmaWidgetInstance5ff4017ad9685ed272b4a0ec = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=d9bca80f2e5c3d24e3d6d084ff33cd8c:4d3eab31cce4bfbfcd19c730b45b72135ae7ffc388303ad2e599a7464e2e4782388b0de2c416df74c1342ad8a9787d49d71cf6afaeac5a7b84350740862e71a3ba40321e8134f81375590130c283f1dc102ca1d4ff321affb1ed356abab7240aa1b5f3ff85c5c008ff136561ad9b43a429a2841c94b3fef7007097a53dcc8c6ee3ca20ae7ba9169ef44527dead681bf924a463282126594f9264826c4837d8937be467a00198a2f8c319fd35bae207b86564d6f2e2377acd930b4abd80fdda17", shop_name: "alza.sk", shop_logo: "https://y1.sk/t/s/130x50/215.jpg", product_price: "74,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(){ pmaWidgetInstance5ff4017ad9685ed272b4a0ec.initWidget("5ff4017ad9685ed272b4a0ec"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }