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