var pmaWidgetInstance612346f20067a2ef59fa8733 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=6ab3a141bee2c7b4da8285ccf6e170ef:675cf6bd55407eb80e5a50d1eef0ddcf1fdf8cfa312db0ec551ddafce3ab3ed91705cf496e91bb12e0b98ce014d3ec41af4e345c330abc39528c92f47d558777ca3d873025441cb6361b41c38de46fb89d3d414b9b389c3bbac3f3acc5995db1231b714b28d5f07aa272dc582747b999d3e8c24380d9363a7f5f1878cb17934170f5ddd4969b2ebae61e63e60f7a60a4586b474dcbb8eb98a5230b71cbdcbd612729c42b9ba3bbe20bbfb433a46fea6c4ea1aaf8c4ae4c660140ce93432f7df12880c09ab766770f6e608104eac8f037", shop_name: "andreashop.sk", shop_logo: "https://y1.sk/t/s/130x50/530.jpg", product_price: "498,00 €", product_shipping: "1,29 €", 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(){ pmaWidgetInstance612346f20067a2ef59fa8733.initWidget("612346f20067a2ef59fa8733"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }