var pmaWidgetInstance63e4ec3a42183289054ef8c0 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=ff0ec0712564db7ea1a7d786c4fcfd4a:2ad2c92af771da330d5301dead3b1a987e6e61aeba049726b13b482f7e8d5a5ef97db52f8facc16acf014de4b5e1cd434f86f0ec00d6a20c34b6f5f8f602337b44c986a1fec8dae1f73dc4b6ddc20190432bd50c55807183e5506ccb75fda6bfd9bf4d7b72fcafe1359ad62eaa24c0ce13052938a0e1cc43ebac874cc59b1f3fb9c933f999277faa172b8175dd7d1c3b1510961703bba99c3a795d175e6c0ecef48773c346de0eb2c5341336bfea4219e84a70264a5a4a77832c425e7d397a71bd77bca581f54ebc650dbe102dfa9f9c", shop_name: "klarstein.sk", shop_logo: "https://y1.sk/t/s/130x50/52719.jpg", product_price: "149,90 €", product_shipping: "2,99 €", 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(){ pmaWidgetInstance63e4ec3a42183289054ef8c0.initWidget("63e4ec3a42183289054ef8c0"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }