var pmaWidgetInstance5fcdf8c1d9685ed2721ee8c6 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=a9ed61e80bbc7631d98478f753804a98:854d211019595197f995f71a6a0a03e382c19c258362f46869019407d198e15dc70196a4128966fa3c753b142510b1c471c3f6dd9c7c5d0dd34ac7c39dee4ddae64137dca77060feb3597028fa3a2abd880506cc582ad319e7f0da43d10213ec27b220c049ca6eea136e25b73f2492f52be1d99d9659e2852c4bf03c3cf8382f0983afb427c148d589006f1bad2bc6308836a5f14a5dbea463ea2eb7b1ecfa74040c61b12400b3e560ae99c070e3d672fdef0725aa8f3de18ebb46bdaf08d92bf5aa215ed603c00dac604f1c227c1da8", shop_name: "megaknihy.sk", shop_logo: "https://y1.sk/t/s/130x50/8349.jpg", product_price: "68,96 €", 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(){ pmaWidgetInstance5fcdf8c1d9685ed2721ee8c6.initWidget("5fcdf8c1d9685ed2721ee8c6"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }