diff --git a/documents/diapo/diapositive_ceremonie.pptx b/documents/diapo/diapositive_ceremonie.pptx new file mode 100644 index 0000000000000000000000000000000000000000..12a6ab22fd981efa161a7eb64411156723838e24 Binary files /dev/null and b/documents/diapo/diapositive_ceremonie.pptx differ diff --git a/documents/diapo/marcVachon_diapo_bachelor_2019.pdf b/documents/diapo/marcVachon_diapo_bachelor_2019.pdf new file mode 100644 index 0000000000000000000000000000000000000000..76463614228dcf74d7daae8bd2f8d4b929d4d352 Binary files /dev/null and b/documents/diapo/marcVachon_diapo_bachelor_2019.pdf differ diff --git a/documents/poster/PowerPoint.pptx b/documents/poster/PowerPoint.pptx index 1a354f9324a25eba657c8e05fd47d69c11983a2d..c77213329eaf55336a5321266a7d48cbf20cfb11 100644 Binary files a/documents/poster/PowerPoint.pptx and b/documents/poster/PowerPoint.pptx differ diff --git a/documents/poster/~$PowerPoint.pptx b/documents/poster/~$PowerPoint.pptx new file mode 100644 index 0000000000000000000000000000000000000000..743e3ed40e3ade22d08d0ad6dafcfeaa6b3c74ce Binary files /dev/null and b/documents/poster/~$PowerPoint.pptx differ diff --git a/documents/screenshot/Screenshot 2019-08-25 at 18.18.44.png b/documents/screenshot/Screenshot 2019-08-25 at 18.18.44.png new file mode 100644 index 0000000000000000000000000000000000000000..479c245a782417456c9689aedcad134968f4f3b9 Binary files /dev/null and b/documents/screenshot/Screenshot 2019-08-25 at 18.18.44.png differ diff --git a/webapp/class/hash/hash.js b/webapp/class/hash/hash.js index 0e75c2a377a1e4038cb9340e567b75c527eb08a5..42eb9c6405bc979c7fbb8448e4bb89bee0c8ad86 100644 --- a/webapp/class/hash/hash.js +++ b/webapp/class/hash/hash.js @@ -5,25 +5,112 @@ var db = require('../db/db_request') module.exports = { generate_id: (data, callback) => { + var end = false, key, jump = [] - var key = objectHash(data) + //while (!end) { + key = objectHash(data) + console.log("key: ", key); - console.log("Id generated:", key); + console.log("Id generated:", key); + /* + var collision = collision_handler(key) + + collision.then(function(resolve){ + end = true + },function(reject){ + data.push({jump: "jump"}) + + console.log("add jump", data); + })*/ + + /*Promise.resolve().then(function() { + console.group( "Recursion - inline function." ); + key = objectHash(data) + return(key); + } + ) + // In this link of the promise chain, the resolution function is explicitly + // named. This way, the function reference can be invoked from within its + // own function body. + .then(function recursiveFunction(key) { + console.log( "Entering recursive function for [", key, "]." ); + + // Internally to this promise link, we're going to start a NEW + // PROMISE CHAIN whose fulfillment will become the continuation of + // the parent promise chain. This fundamentally different from the + // reduce() example. + var promise = Promise.resolve().then(function(){ + + db.get_ids(function(ids){ + + var promises = [] + + for (var i = 0; i < ids.length; i++) { + + var prom = new Promise(function(resolve){ + if (key == ids[i].idMeeting) { + console.log("ids[i]:", ids[i]); + console.log("existe deja c'est la merde"); + resolve(false) + } + resolve(true) + }) + + promises.push(prom) + + prom.then(function(check){ + if (!check) { + jump.push["jump"] + } + }) + } + + + Promise.all(promises).then(function(){ + if(end == false){ + return recursiveFunction(key = objectHash([data, jump])) + }else { + return(key) + } + }) + + + + }) + }) + return(key); + // NOTE: To be ultra-concise, I could have written the following; + // but, I think that would have made the example harder to follow. + // -- + // return( Promise.resolve( recursiveFunction( n - 1 ) ) ); + }).then(function() { + console.groupEnd(); + })*/ + //} + + callback(key) - collision_handler(key, function(){ - callback(key) - }) } } -function collision_handler(key, callback){ - db.get_ids(function(ids){ +function collision_handler(key){ + + return new Promise(function(resolve, reject){ + + db.get_ids(function(ids){ + + ids.forEach(function(row){ + + if (key == row.idMeeting) { + console.log("existe deja c'est la merde"); + reject() + } + + }) + + resolve() + + }) - for (var id in ids) { - if (key == id) { - console.log("existe deja c'est la merde"); - } - } - callback() }) } diff --git a/webapp/views/include/user.ejs b/webapp/views/include/user.ejs index b4794f960e34e135387290329ed6c052d6781b4c..129db906269519beabea169c2f81135d05196e02 100644 --- a/webapp/views/include/user.ejs +++ b/webapp/views/include/user.ejs @@ -36,12 +36,12 @@ <input type="number" class="form-control" name="year" placeholder="year" min="2019" value="2019"> </td> <td class="duration px-1"> - <p>From</p> + <p class="mb-1 mt-3">From</p> <input type="number" class="form-control" name="from_hour" placeholder="hour" min="0" max="23" value="12"> <p class="d-inline">:</p> <input type="number" class="form-control" name="from_minutes" placeholder="minutes" min="0" max="59" value="37"> - <p>to</p> + <p class="mb-1 mt-3">to</p> <input type="number" class="form-control" name="to_hour" placeholder="hour" min="0" max="23" value="22"> <p class="d-inline">:</p> <input type="number" class="form-control" name="to_minutes" placeholder="minutes" min="0" max="59" value="0"> @@ -56,6 +56,7 @@ </form> <button type="button" name="button" class="btn btn-secondary" onclick="toggle_add_user()">Annuler</button> + <button type="button" name="button" class="btn btn-primary" onclick="add_user()">Ajouter</button> </div> diff --git a/webapp/views/index.ejs b/webapp/views/index.ejs index 5dd9e15d96253633798c6691e08a044af7ce5f0b..8206e6fd9f340ad823b88caf198d3dc643849d0b 100644 --- a/webapp/views/index.ejs +++ b/webapp/views/index.ejs @@ -30,12 +30,12 @@ <div class="card"> <div class="card-body"> - <h1 class="mb-5">Load meeting</h1> + <h1 class="mb-5">Charger un rendez-vous</h1> <form class="mb-4"> <input class="w-100" type="text" value="1352698ce0d3f78098da37219c7154a14f351484" placeholder="0" id="id_meeting"> </form> - <button class="btn btn-primary" type="button" name="button" onclick="check_id()">Search</button> + <button class="btn btn-primary" type="button" name="button" onclick="check_id()">Charger</button> <div class="mb-4" style="height: 50px"> <p class="alert alert-danger d-none" id="msg"></p> @@ -49,9 +49,9 @@ <div class="card"> <div class="card-body"> - <h1 class="mb-5">Create meeting</h1> + <h1 class="mb-5">Créer un rendez-vous</h1> - <a href="/create-meeting" class="btn btn-primary">Create</a> + <a href="/create-meeting" class="btn btn-primary">Créer</a> </div> </div> diff --git a/webapp/views/js/meeting.js b/webapp/views/js/meeting.js index 2caa64372ced8fe406363472f4266bbb92187f70..99783dd55b90c1b49a7ca0a3ce00b2548d5d5530 100644 --- a/webapp/views/js/meeting.js +++ b/webapp/views/js/meeting.js @@ -56,7 +56,7 @@ socket.on('get_meeting', function(data){ </div> <div class="col-md-9 text-md-right" style="word-wrap: break-word;"> - <h2 class="d-inline font-weight-bold"><small>${id_meeting}</small></h2> + <h4 class="d-inline font-weight-bold"><small>${id_meeting}</small></h4> </div> <p class="text-muted mx-3 mt-4 text-right">Ce code correspond à ce rendez-vous. Partagez-le avec les personnes concernées.</p> @@ -129,16 +129,20 @@ socket.on('get_meeting', function(data){ const markup = ` <div class="col-md-6 mb-3"> + <div class="card"> <div class="card-header"> + <h5 class="card-subtitle d-inline-block">${user.name}</h5> + <div class="d-inline-block"> <button class="btn btn-warning" type="button" name="button" onclick="toggle_modify_user(${i})">Modify</button> <button class="btn btn-danger" type="button" name="button" onclick="remove_user(${i})">delete</button> - <button type="button" class="btn btn-outline-primary" onclick="toggle_user_info(${i})" id="show_more">Afficher plus</button> + <button type="button" class="btn btn-outline-primary" onclick="toggle_user_info( ${i})" id="show_more">Afficher plus</button> </div> <h6 class="card-subtitle font-weight-normal">${user.email}</h6> + </div> <div class="card-body px-4 py-3 d-none" id="user-${i}"> @@ -164,7 +168,7 @@ socket.on('get_meeting', function(data){ <h5 class="card-subtitle">Journey</h5> <h6><small>Duration: ${user.journey.time.hour}h${user.journey.time.minutes}</small></h6> - <table class="table"> + <table class="table text-main"> <tr> <th>Time</th> <th>Journey</th> @@ -219,8 +223,10 @@ socket.on('get_meeting', function(data){ } function toggle_user_info(id){ + $(this).text('Afficher moins') $('#user-' + id).toggleClass('d-none d-block'); } + function add_user(){ var user = { name: $('#name').val(), diff --git a/webapp/views/meeting.ejs b/webapp/views/meeting.ejs index bfdfc01494c8e276706825bf976a3b138f27d5c7..acd6d8c731b1defbdfa8f45ba9463c9340b218d6 100644 --- a/webapp/views/meeting.ejs +++ b/webapp/views/meeting.ejs @@ -24,10 +24,15 @@ <div class="d-flex justify-content-end w-100"> <button type="button" name="add user" class="btn btn-primary" onclick="toggle_add_user()">Ajouter un membre</button> +<!-- <button type="button" name="button" class="btn btn-info mx-2" onclick="update_center()">Center</button> <button type="button" name="button" class="btn btn-secondary mx-2" onclick="update_appointement()">Appointement</button> <button type="button" name="button" class="btn btn-danger mx-2" onclick="update_journeys()">Journey</button> + + <button type="button" name="button" class="btn btn-success mx-2" onclick="socket.emit('test_class', id_meeting)">Test</button> + + --> </div> </div>