var pmaWidgetInstance60f0893a0067a2ef5943632d = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=95da24bacda83ce8f28e3b4cec73a325:c4b95fe39dbbf716b033a1bec95b433070f82858b5c6dec899ebce59383e390db69683d92fa73a8dc1894b7db82fd04e41146a29bb10a9b0d72da48369a28a2ddb8ec7950063a2fb60d93ea7d19bcbab25cd3880c4dfb18dd931fbcb48040d04feadcb7a4983cf5d8d068170a9ed16bfd5b00b0d572b7c4d18057f52c00cf4caed6edb289cb171928e70a6914b87f599f609e9b88b1dbb10989ef22fbe97f5ab4561c238dec92be303f4f56310d34d2063f83ae3da75bd6ddb5af4f20b62ab9c16800327ef4eef420430a4bcc1969e15", shop_name: "alza.sk", shop_logo: "https://y1.sk/t/s/130x50/215.jpg", product_price: "193,90 €", 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(){ pmaWidgetInstance60f0893a0067a2ef5943632d.initWidget("60f0893a0067a2ef5943632d"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }