var pmaWidgetInstance5fc0c642d9685ed2727990a0 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=40c1654ff5e2f19d16a9d56aa47efa73:0dbec52369a03d95fa655aadb0d07fba72c331f7b8bc2a74cca275abf740b699cbf207358b799d52dc0da72bebc0bfc19d30891423ea8682fb5380eb631c3346b03496ed119aeae16199618b411ece5ed3405be97051cd3975723ba38cd954d5fbaafc6fd10c7a81b151349128cb50ccc18d148e51b78b6ddaa9396e1dd3b76e87fbf96a3308d899470691dd4360cd8025d4d1ef4dab42a4b4e0bc34bca8a558f1f3757a004e3368d4374eff504989e2d9f8526aa991baa3c25cb46550e55c2643c55de133ed27f23b4f31d2cda0ce64", shop_name: "megaknihy.sk", shop_logo: "https://y1.sk/t/s/130x50/8349.jpg", product_price: "75,58 €", 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(){ pmaWidgetInstance5fc0c642d9685ed2727990a0.initWidget("5fc0c642d9685ed2727990a0"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }