var pmaWidgetInstance6373a0bdac365ae374bd7662 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=6f24e96e9318c927abe4fedc61d9e1e1:0c00ff16243abe0df988aabe328a7a4e3ff72f4cfd7466cd1807e3b4b1acb0391dcf51db2cce7e3fd92ccb5821f3522cc6c75c8d731fc16d574e66ada5b5c1b9a8c1d227ae259e15073258f14b7445eb2fd3aa79804867ebd8ea4f0246a55d32a8d5e5f78faa420a1ad6b5f5d8261d7f0407f9f518c19bd9d92071c1b208f1062e9f166edfbf53ab8f1db040d2be3d0a2912508dc860cb4bed210f1fb2b0e455f912848d69c04fc7d7193859446b7884c75312bc05133de0b7f508856be96c0a5c6b221857387418dbe743d324e2dd92", shop_name: "tonerpartner.sk", shop_logo: "https://y1.sk/t/s/130x50/53619.jpg", product_price: "279,57 €", 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(){ pmaWidgetInstance6373a0bdac365ae374bd7662.initWidget("6373a0bdac365ae374bd7662"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }