hubl/index.php

75 lines
2.5 KiB
PHP

<?php
// Some useful variables
$v = rand();// Used to avoid abusive caching by the browser
require_once("config.php");// Use "config-sample.php" to create your own
?>
<!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</title>
<?php
// Prod/Dev setup
if (in_array($dn, array('https://app.happy-dev.fr', 'https://staging-app.happy-dev.fr'))) {
require_once("src/html/dependencies-prod.php");
} else {
require_once("src/html/dependencies-dev.php");
}
?>
</head>
<body>
<?php require_once('src/html/menu.html'); ?>
<main id="mainContainer" class="container-fluid">
<?php require_once('src/html/dashboard.html'); ?>
<?php require_once('src/html/members.html'); ?>
<?php require_once('src/html/member.php'); ?>
<?php require_once('src/html/projects.html'); ?>
<?php require_once('src/html/project.php'); ?>
<?php require_once('src/html/client-creation.html'); ?>
<?php require_once('src/html/channels.html'); ?>
<?php require_once('src/html/channel.php'); ?>
<?php require_once('src/html/search.html'); ?>
</main>
<sib-chat
id="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
></sib-chat>
<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;
});
</script>
</body>
</html>