var pmaWidgetInstance65788212ae16db34669aa833 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=a55e79a32d8a0baaf22ab41a9664f45e:407cff130a4e8c963e9d28c4fd77bf341688265de63c6e7c13a9ac0f50ec76a41bfa9cac7862acaf65a932ad7f1050f7336110ed844e53b57338f1c9fd092193210b831cf47b716eb643d655df4e80cb1c3489a802d6ff92e226ee8aa499b45700d28dc5b09ed545023e6960f413c01afd0798a63a552db604bdd259ec9aaaa0a86a9ee417c88e14bc2dffd472e7678a43fc59ae1239da852de36a5fb82acf6a9037009f3de553736266602135b15cdf2ef9885673545447c23bdfb8596d0f780afb7c465c6183998ca1cd464ed76dd3", shop_name: "tonerpartner.sk", shop_logo: "https://y1.sk/t/s/130x50/53619.jpg", product_price: "448,19 €", product_shipping: "0,00 €", 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(){ pmaWidgetInstance65788212ae16db34669aa833.initWidget("65788212ae16db34669aa833"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }