window['bravo.config']={"baseUrl":"https://bravoapp.nl","id":"pcfgs"};(function () { function getUrl(baseUrl, id) { return baseUrl + "/e/" + id; } function getEmbedUrl(baseUrl, id) { return baseUrl + "/embed/" + id; } function insertScript() { addScript(getEmbedUrl(config.baseUrl, config.id)); } function addScript(src, callback) { // avoid duplicates for (var i = 0; i < document.scripts.length; i++) { if (document.scripts[i].src == src) { return; } } var head = document.getElementsByTagName('head')[0]; var link = document.createElement('script'); link.src = src; if (callback) { link.onload = function () { callback() } } head.appendChild(link); } var config = window['bravo.config']; function attachEvents() { if (config.id && document.body) { document.body.querySelectorAll('a[href*="' + getUrl(config.baseUrl, config.id) + '"]').forEach(function (node) { if (node.bravoeventsadded) return; node.addEventListener("mouseenter", insertScript, false); node.addEventListener("focus", insertScript, false); node.bravoeventsadded = true; }); } } attachEvents(); const observer = new MutationObserver(list => { attachEvents(); }); observer.observe(document, { childList: true, subtree: true }); })();