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