var pmaWidgetInstance60c1ad5e0067a2ef595d6f30 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=9d3658bbb24a99edf614c558a1c20bf7:c9a800dc59a9d80c6879443aa798ba162a4876461bbc57aa5b951ce694b9de6db8584cde4e826ef9d175cbccf11b46ef199519da57035bf5ed5696cfd1d2f5b9b636fac7e2aa974c583e67e2a1c30371f8d5b529f2d7cd0f747deaddad6edc190e55df65dc1ff198356429f75282e8cf8852237ac099ffcc0939995228239fd8f363f423066093e2b7123c40acdb6655ffd7a17963be989b69066b26a5895af7a3efa1a833b84d69ff1a68fdccd6cf74c957d6fdb6bb4ec6e2cc3b835a1defd1d7e7201719d0801d555631ec4f07fcd0", shop_name: "megaknihy.sk", shop_logo: "https://y1.sk/t/s/130x50/8349.jpg", product_price: "134,46 €", 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(){ pmaWidgetInstance60c1ad5e0067a2ef595d6f30.initWidget("60c1ad5e0067a2ef595d6f30"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }