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