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