var pmaWidgetInstance642e6d0e4218328905ee43ae = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=cc3ec8bba6dd97d2e5368ede963855e9:ffda4cea19f7106551c951e963fa0cb24618a66ae7933674623f04225d377c82f376c44d8342e07a4b3243ec588e81faa015f892a1e37e8bc1cd51513b25131ee3832d68db900cd8c8a93a5a8d4a281de17ed14f1c43873a3d0b695f8c9aaad6801578f7c473ac8a7e79fc68afb20d29444a434e639c960196af284f5d86332e58fff3b1713c8cd02d7f7c56136e72b97a91ca963a4c92c0a5bfd67155c29c604ef2d4e1c1dc0523b69606f641b4b22238ca187eb2c051eef31b111d9b733ce2cab5196abed22984f8030bbe10e8dbae", shop_name: "megaknihy.sk", shop_logo: "https://y1.sk/t/s/130x50/8349.jpg", product_price: "201,62 €", product_shipping: "1,99 €", product_availability: "", 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(){ pmaWidgetInstance642e6d0e4218328905ee43ae.initWidget("642e6d0e4218328905ee43ae"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }