var pmaWidgetInstance60378428d9685ed2721b679f = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=2b388b028ae8f7d2002a7526a22f6d37:6e1e224653ea79dac7f8b099acb56c13d834023ed3b8ac1430f76b408803e5e9704f9bf5a28ae10eb330a46c1e839c15f31baa833d736316bb6c45080dd4147e2a42f293e4f787dfee831cbb37c4074e68781700479ca98393814aa27c23eab938da65f3a2a202201aa313ff8026d1a4ff811bd2b150568e9887071f6a6f614093b99c1e1bc2edf6a96eebee85d0999bc1e031d48cb1948b6db9618fd63f625126217d8317f59547801cd79ad956588bf8cbb874a47bffad81eeb13fd9c717c08b9ed53f5d4ab33baac86791efcecb32", shop_name: "alza.sk", shop_logo: "https://y1.sk/t/s/130x50/215.jpg", product_price: "689,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(){ pmaWidgetInstance60378428d9685ed2721b679f.initWidget("60378428d9685ed2721b679f"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }