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