doctype html html(lang='fr') head meta(charset='UTF-8') meta(name='viewport', content='width=device-width, initial-scale=1.0') meta(http-equiv='X-UA-Compatible', content='ie=edge') title Happy Dev App //- Prod/Dev setup if (['https://app.happy-dev.fr', 'https://staging-app.happy-dev.fr'].includes(dn)) include dependencies-prod.pug else include dependencies-dev.pug body include header.pug div#subContainer include menu.pug main#mainContainer.container-fluid include dashboard.pug include members.pug include member.pug include projects.pug include project.pug include client-creation.pug include channels.pug include channel.pug include search.pug sib-chat#chat-singleton(data-authentication='login', data-auto-login='true', data-bosh-service-url='https://jabber.happy-dev.fr/http-bind/', data-debug='false', data-locales-url='en', bind-resources='') script. // Move the chat singleton to the right view on "page load" window.onload = function() { if (window.location.pathname.indexOf("-chat") !== -1) { var chatSingleton = document.querySelector("#chat-singleton"); var pathnameParts = window.location.pathname.split("/"); var viewName = pathnameParts[pathnameParts.length - 1]; var view = document.getElementById(viewName); view.appendChild(chatSingleton); chatSingleton.dataset.src = view.dataset.src; } } // Move the chat singleton to the right view on "navigate" window.addEventListener('navigate', event => { var chatSingleton = document.querySelector("#chat-singleton"); var view = document.getElementById(event.detail.route); view.querySelector(".chat-view").appendChild(chatSingleton); chatSingleton.dataset.src = view.dataset.src; });