var pmaWidgetInstance604757a0d9685ed2724de938 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=5ffc694e25400ab3e003778484e87bda:3f43b598a95e07d767dbb89f40e01c73514f4ab144ac8fe49560f3dec9e90b0016bbb90ebd3049187b4c07683dc2829ad1907d9a49e5e58a9c9e6d83f239101de10eae7d6493cc8c1a52f3fe0f0f9888994eca3fcdc5c278e16ee48e98c90be87c8b9c014927d58e675663e145e8aa6daa35a74f7784429ac26f92f70fc2164a3daa6deb6303819bdbb5f2faffe16520185a7a2b5c11fb18b12d39871906a8c9774ed025f1c7d965023261e9d518a728812a814693cbfb4d4b9ac9fd9aeeaad9efbb8bb893c6001bc303c144f2d48d45", shop_name: "drmax.sk", shop_logo: "https://y1.sk/t/s/130x50/52053.jpg", product_price: "415,69 €", 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(){ pmaWidgetInstance604757a0d9685ed2724de938.initWidget("604757a0d9685ed2724de938"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }