var pmaWidgetInstance60535eccd9685ed27249e623 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=a52c00057cd54c3e31a561cd64740e79:13dd7fb2b8b31cec1ccb462bcdf6922590189313907b758b9eb3536d1e7aada7d6e39335799107fadad888df578f3a662dd97332bb9ff1d1b17bc75b0d8ec9f120717e2875ce3d3eafe9da71e55c9eba82562f2595ea1a0ddcc531986dc2e9d0a504f0868df466ddeef5016ad8d41c5b32eedd10dc0b6c694597abe651379dc26915b32f18cd1dc77f9ddac5d2024e33a93a016714741d94b7d26c3c7e720402873ebc4030741dba613b6ba56b4f19d0139cce8dea026701266821bf881c12902bb5f7f3c9a5fb9404590fe4e08dbb7d", shop_name: "pelotony.sk", shop_logo: "https://y1.sk/t/s/130x50/59907.jpg", product_price: "297,70 €", product_shipping: "", 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(){ pmaWidgetInstance60535eccd9685ed27249e623.initWidget("60535eccd9685ed27249e623"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }