2018-04-19 16:24:42 +00:00
|
|
|
<?php
|
|
|
|
// Some useful variables
|
|
|
|
$v = rand();// Used to avoid abusive caching by the browser
|
2018-05-01 04:18:20 +00:00
|
|
|
require_once("config.php");// Use "config-sample.php" to create your own
|
2018-04-19 16:24:42 +00:00
|
|
|
?>
|
2018-03-11 23:42:46 +00:00
|
|
|
<!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>
|
|
|
|
|
2018-05-01 04:18:20 +00:00
|
|
|
<?php
|
|
|
|
// Prod/Dev setup
|
2018-05-16 06:08:38 +00:00
|
|
|
if (in_array($dn, array('https://app.happy-dev.fr', 'https://staging-app.happy-dev.fr'))) {
|
2018-05-01 04:18:20 +00:00
|
|
|
require_once("src/html/dependencies-prod.php");
|
|
|
|
} else {
|
|
|
|
require_once("src/html/dependencies-dev.php");
|
|
|
|
}
|
|
|
|
?>
|
2018-03-11 23:42:46 +00:00
|
|
|
</head>
|
|
|
|
|
|
|
|
<body>
|
2018-03-18 14:18:29 +00:00
|
|
|
<?php require_once('src/html/menu.html'); ?>
|
|
|
|
|
2018-03-18 15:29:31 +00:00
|
|
|
<main id="mainContainer" class="container-fluid">
|
2018-04-22 06:47:18 +00:00
|
|
|
<?php require_once('src/html/dashboard.html'); ?>
|
2018-03-18 15:29:31 +00:00
|
|
|
<?php require_once('src/html/members.html'); ?>
|
2018-04-05 12:09:42 +00:00
|
|
|
<?php require_once('src/html/member.html'); ?>
|
2018-05-14 19:16:04 +00:00
|
|
|
<?php require_once('src/html/edit-profile.html'); ?>
|
2018-04-05 12:09:42 +00:00
|
|
|
<?php require_once('src/html/projects.html'); ?>
|
|
|
|
<?php require_once('src/html/project.html'); ?>
|
2018-05-15 06:08:31 +00:00
|
|
|
<?php require_once('src/html/project-edition.html'); ?>
|
2018-04-26 16:48:53 +00:00
|
|
|
<?php require_once('src/html/channels.html'); ?>
|
|
|
|
<?php require_once('src/html/channel.html'); ?>
|
2018-05-15 06:08:31 +00:00
|
|
|
<?php require_once('src/html/channel-edition.html'); ?>
|
2018-05-13 03:06:10 +00:00
|
|
|
<?php require_once('src/html/search.html'); ?>
|
2018-03-18 15:29:31 +00:00
|
|
|
</main>
|
2018-05-03 19:02:37 +00:00
|
|
|
|
|
|
|
<!-- This is a hack : https://git.happy-dev.fr/happy-dev/xmpp-chat-component/issues/24 -->
|
|
|
|
<hd-chat-window
|
|
|
|
id="chat-singleton"
|
|
|
|
data-authentication="anonymous"
|
|
|
|
data-auto-login="true"
|
|
|
|
data-bosh-service-url="https://conversejs.org/http-bind/"
|
2018-05-13 03:06:10 +00:00
|
|
|
data-debug="false"
|
2018-05-03 19:02:37 +00:00
|
|
|
data-jid="nomnom.im"
|
2018-05-06 06:17:07 +00:00
|
|
|
data-locales-url="<?php echo $cdn; ?>/node_modules/converse.js/locale/{{{locale}}}/LC_MESSAGES/converse.json",
|
2018-05-03 19:02:37 +00:00
|
|
|
data-room-jid="anonymous@conference.nomnom.im">
|
|
|
|
</hd-chat-window>
|
|
|
|
<script>
|
|
|
|
// Store url on load
|
|
|
|
var currentRoute = getCurrentRoute();
|
|
|
|
var chatSingleton = document.querySelector("#chat-singleton");
|
|
|
|
var body = document.querySelector("body");
|
|
|
|
|
|
|
|
function getCurrentRoute() {
|
|
|
|
var pathnameSegments = window.location.pathname.split("/");
|
|
|
|
|
|
|
|
return pathnameSegments[1];
|
|
|
|
}
|
|
|
|
|
|
|
|
// Listen for changes
|
2018-05-14 19:16:04 +00:00
|
|
|
//setInterval(function() {
|
|
|
|
//if (currentRoute != window.location.href) {
|
|
|
|
//currentRoute = getCurrentRoute();
|
2018-05-03 19:02:37 +00:00
|
|
|
|
2018-05-14 19:16:04 +00:00
|
|
|
//insertChatIfNeeded();
|
|
|
|
//}
|
|
|
|
//}, 250);
|
2018-05-03 19:02:37 +00:00
|
|
|
|
|
|
|
// Inserts a chat in the current view if needed
|
|
|
|
function insertChatIfNeeded() {
|
|
|
|
if (["project", "project-chat", "channel", "channel-chat", "member", "member-chat"].indexOf(currentRoute) > -1) {
|
|
|
|
if (currentRoute.indexOf("chat") == -1) {
|
|
|
|
currentRoute += "-chat";
|
|
|
|
}
|
|
|
|
var currentView = document.querySelector("#" + currentRoute);
|
|
|
|
if (currentView.querySelector("hd-chat-window") == null) {
|
|
|
|
currentView.appendChild(chatSingleton);
|
|
|
|
currentView.style.display = 'block';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
body.appendChild(chatSingleton);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|
2018-03-17 17:34:32 +00:00
|
|
|
</body>
|
|
|
|
</html>
|