var pmaWidgetInstance63e4f3dc42183289055db4e4 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=e4638c79b523b41bdfcaa433f841e1fa:761857a46d5e492c8e0b3092074d3a0f91f1fdb917ba95a26b01638f67b49006459a07050eff21b4a3b83bdea146acaff8b654a62dd9c6c6a4e9e78154a565fe2c0c9b3251fb3ed22939833f4b9f8aeef0c60897d1931c46d25943936637b9b2e4e94c0e94be8c23cb78bcd807b06b7775a62f1a1be4a9782f5d97df939dbc5e910c8b66fa45d66784aeeefe811ba0cfffea1995e2f0d01d1010eb9fbe454ed014bb88c889a5ab6c1e7ef30836cee541889a8e3cfea4808349bcacd6a33c4fc6ea460f58f5e1b7b57135f7722f9af01f", shop_name: "electronic-star.sk", shop_logo: "https://y1.sk/t/s/130x50/44673.jpg", product_price: "259,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(){ pmaWidgetInstance63e4f3dc42183289055db4e4.initWidget("63e4f3dc42183289055db4e4"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }