var pmaWidgetInstance60c3528f0067a2ef5990da3c = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=6ba6d4168ab7a0d093eb97076d74276e:a46d380b787c38aa863be12daf0f9e0d3629c4ff521d3526c82b3c5c2fb09eed7273b0c12e30474dc9fb9e990fbce1715eaf4756a194880205989702ca1dfeb1d6ecd7c0b563747c95b10a6e4e21be0846f1aef9fa890a693ff060fe558bbdb7f4d31e6187da15a416ca606a710ade835a0f40c61e28dc7dbcec1930efe0a5881e39e6ccb199425d54a537ff57cc91b7ceb376842347596b1bbdbbadc7bef35fee2470e4fef4995021467b3545263a11a2618522b963af0464bfbc1d29d52694", shop_name: "www.aldoshop.sk", shop_logo: "https://y1.sk/t/s/130x50/59034.jpg", product_price: "4,30 €", 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(){ pmaWidgetInstance60c3528f0067a2ef5990da3c.initWidget("60c3528f0067a2ef5990da3c"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }