2015-10-22 12:06:49 +00:00
|
|
|
var subSections = document.querySelectorAll('hgroup');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// si aucune sous-partie n'est active, on active la première
|
|
|
|
if( document.querySelector('#CONTAINER hgroup.active') == null )
|
|
|
|
selectSubSection( document.querySelector('#CONTAINER hgroup') );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*************************************************/
|
|
|
|
/****************** EXEMPLE API ******************/
|
|
|
|
/*************************************************/
|
|
|
|
|
2015-10-22 21:06:25 +00:00
|
|
|
// on récupère la liste des élèves du groupe E
|
|
|
|
|
2015-10-22 12:06:49 +00:00
|
|
|
/* objet envoyé à API.php */
|
|
|
|
var request = {
|
|
|
|
level_0: 'groups',
|
2015-10-23 08:04:26 +00:00
|
|
|
level_1: 'grouplist',
|
2015-10-28 17:08:12 +00:00
|
|
|
semestre: '3',
|
|
|
|
annee: '2015',
|
2015-10-22 12:06:49 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
// console.log( request );
|
|
|
|
|
|
|
|
// envoi de la requête
|
|
|
|
// @ on envoie l'objet
|
|
|
|
// @ quand réception: affichage de l'objet reçu
|
|
|
|
//
|
2015-10-24 17:01:22 +00:00
|
|
|
API.send(request, function(r){} );
|
|
|
|
|
|
|
|
|
2015-10-25 16:55:18 +00:00
|
|
|
/* Gestion du déroulement des tableaux des groupes */
|
|
|
|
function afficherCacherGroupes(e){
|
2015-10-24 17:01:22 +00:00
|
|
|
// s'il s'agit de la case "Voir plus"
|
|
|
|
if( e.target.className == 'more' ){
|
|
|
|
var thead = e.target.parentNode.parentNode.parentNode.children[0];
|
|
|
|
thead.className = (thead.className=='active') ? '' : 'active';
|
|
|
|
}
|
2015-10-25 16:55:18 +00:00
|
|
|
}
|
|
|
|
|
2015-10-24 17:01:22 +00:00
|
|
|
|
2015-10-28 17:08:12 +00:00
|
|
|
DOM.CONTAINER.addEventListener('click', afficherCacherGroupes, false);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* GESTION DU DRAG N DROP */
|
|
|
|
if( document.querySelector('#CONTAINER section[name=movestudents]') != null ){ // si c'set l'admin
|
|
|
|
var dnd = new DragnDrop();
|
|
|
|
|
|
|
|
var members = document.querySelectorAll('#CONTAINER section[name=movestudents] table tr td:not(.more)');
|
|
|
|
for( var i = 0 ; i < members.length ; i++ )
|
|
|
|
dnd.setDraggable(members[i]);
|
|
|
|
|
|
|
|
var groups = document.querySelectorAll('#CONTAINER section[name=movestudents] table thead th:first-child');
|
|
|
|
for( var i = 0 ; i < groups.length ; i++ )
|
|
|
|
dnd.setDroppable(groups[i]);
|
|
|
|
|
|
|
|
dnd.init();
|
|
|
|
}
|