var pmaWidgetInstance6357a541ac365ae37466f572 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=30c903bb79e6dd6787fc8bc36ba06cc8:fea38004de8e20cf4abd47b855d0b79113b95710c879db6ac7d7c35aee0db808d5c4bf96bc200d433078f6ecdd999b38619de8f102a091747cc9a87d9952c4847948e33f5e1febb1c127f9264ad3622150f046cfe8984d9e2640ed25bc9391738807e77537bb9dcdd66fd53877a946bcdb27b5b2f44fe820c3c31134d706ae374662daa48152a49c2881f2b9cbd6f31254d2e1dd7e39c1ceb474ca81602c9db27ec83ed564aac9fd4d05fa81f2df0d3997a3682455d64616207cee70ed182030986097d2f332bbd03a8f11af87acb773", shop_name: "KNIHCENTRUM.sk", shop_logo: "https://y1.sk/t/s/130x50/6810.jpg", product_price: "12,47 €", 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(){ pmaWidgetInstance6357a541ac365ae37466f572.initWidget("6357a541ac365ae37466f572"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }