var pmaWidgetInstance5fcde97ed9685ed272162750 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=b4345f81b2edc6cbd2c1bab2a4402a44:576ae34a7d98b4fb8fe0eb9ffde726716f4c28c95c7b6a6c01129842056eb49459c8192595c3e91bbd85e7847cb6d511a12483b826229af7d2ffb83b0698906b628811f8b0dae0e11b5b5fbdd14b493f6035ea60ceebd77bef927e27a53e4e4d1bfa6474c22043a5ced07e3df9b41c51063d04cab5c15f810c02dbd05acf9e73587e71adc745872b671d9036a573ed87a7db6fac765a21550cec6b15ffe9b7ccb5517f2836b80496447ed93a1389db75326b224ea90ed0bf7d64e900e5e24d9c", shop_name: "Xzone.sk", shop_logo: "https://y1.sk/t/s/130x50/9583.jpg", product_price: "273,99 €", product_shipping: "1,99 €", 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(){ pmaWidgetInstance5fcde97ed9685ed272162750.initWidget("5fcde97ed9685ed272162750"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }