var pmaWidgetInstance60c06a940067a2ef594b65c8 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=6cd877741e3db4ff3508d9ad2fccee9d:8fb8b1f1f6afa451aa5f4f70314d74abe06521143aac19016cf5af1d9e56802d6489ccf294b080847f58bbcca27f4999d0c0452326c3ed3c1d6e2c8e0d151169eaef714799c721c9700f4a4fcc0efb154f5833357fd5aeb6d404ed76fc555c786e568a4990e4ad147f09088dfed586434d8b800c2fd6361e061fc1f4cb58ca65e74d422e8e60fdbc80feba8f9462268502a89fbbe038bbdd46a20e423f82cca4b28fdad5925c674639609d3e1ebe9212c37dfa7904751dc0477d19ce02d42cb4", shop_name: "GalaxyMarket", shop_logo: "https://y1.sk/t/s/130x50/59525.jpg", product_price: "117,52 €", product_shipping: "3,25 €", 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(){ pmaWidgetInstance60c06a940067a2ef594b65c8.initWidget("60c06a940067a2ef594b65c8"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }