hubl/index.pug

49 lines
2.0 KiB
Plaintext

<!DOCTYPE html>
include config.pug
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 src/html/dependencies-prod.pug
else
include src/html/dependencies-dev.pug
body
include src/html/menu.pug
main#mainContainer.container-fluid
include src/html/dashboard.pug
include src/html/members.pug
include src/html/member.pug
include src/html/projects.pug
include src/html/project.pug
include src/html/client-creation.pug
include src/html/channels.pug
include src/html/channel.pug
include src/html/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;
});