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