var pmaWidgetInstance60ec22fe0067a2ef598995d4 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=b2dbeba7afddf364a3645ce5364ce067:d871dc8ee15acd91e210392d035561713c0f1baf21debd1e653918717ce748d8c96516770dba5ad523b470ae12d96a0a4b54d6ab21632ecbb7112bd532438f11b964aa4d2265558bf2524693c7a4767a70e8223fc7c846c721405006108766f7e35d6dab46bf1f9068bda29752d6450276a2b9138d942bac7cc92aa707fbf021145d50a8f99885a2091ba4b2eea176b9682743b4c1d809e5d617d084997fbea74f9e1db9ae246fa67ae146ccfaef38b2edf54fda07393f20179563eb70071ed1", shop_name: "MobilPC.sk", shop_logo: "https://y1.sk/t/s/130x50/46049.jpg", product_price: "103,00 €", product_shipping: "3,90 €", product_availability: "", 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(){ pmaWidgetInstance60ec22fe0067a2ef598995d4.initWidget("60ec22fe0067a2ef598995d4"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }