[x] Gestion explicite du chargement de tout traitement (bounce pamp puis retour default)
+ career.js + groups.js + modules.js + settings.js
This commit is contained in:
parent
e18a4d1a10
commit
3bd1f1dc29
|
@ -372,9 +372,54 @@ select.active + .confirm,
|
|||
.confirm.pamp{
|
||||
border-color: #f55b55;
|
||||
color: #f55b55;
|
||||
background-image: url(../src/validate@pamp.svg);
|
||||
background-image: url(../src/validate@pamp.svg) !important;
|
||||
}
|
||||
|
||||
@keyframes bounce_err{
|
||||
0%{
|
||||
transform: translateX(5px);
|
||||
-moz-transform: translateX(5px);
|
||||
-webkit-transform: translateX(5px);
|
||||
-ms-transform: translateX(5px);
|
||||
-o-transform: translateX(5px);
|
||||
}
|
||||
|
||||
|
||||
25%{
|
||||
transform: translateX(-5px);
|
||||
-moz-transform: translateX(-5px);
|
||||
-webkit-transform: translateX(-5px);
|
||||
-ms-transform: translateX(-5px);
|
||||
-o-transform: translateX(-5px);
|
||||
}
|
||||
|
||||
50%{
|
||||
transform: translateX(5px);
|
||||
-moz-transform: translateX(5px);
|
||||
-webkit-transform: translateX(5px);
|
||||
-ms-transform: translateX(5px);
|
||||
-o-transform: translateX(5px);
|
||||
}
|
||||
|
||||
100%{
|
||||
transform: translateX(0);
|
||||
-moz-transform: translateX(0);
|
||||
-webkit-transform: translateX(0);
|
||||
-ms-transform: translateX(0);
|
||||
-o-transform: translateX(0);
|
||||
}
|
||||
}
|
||||
|
||||
/* bounce animation */
|
||||
.confirm.bounce_error{
|
||||
animation: bounce_err .8s ease-in;
|
||||
-moz-animation: bounce_err .8s ease-in;
|
||||
-webkit-animation: bounce_err .8s ease-in;
|
||||
-ms-animation: bounce_err .8s ease-in;
|
||||
-o-animation: bounce_err .8s ease-in;
|
||||
}
|
||||
|
||||
|
||||
/* tr@hover */
|
||||
body.trHoverActivated tr:hover td select.active + .confirm,
|
||||
body.trHoverActivated tr:hover td input.active + .confirm,
|
||||
|
|
|
@ -87,15 +87,15 @@ var connected = !( DOM.AUTH.children[0].innerHTML == 'Connexion' );
|
|||
|
||||
/* [c] gestion des classes
|
||||
================================================*/
|
||||
function addClass(el, pClass){
|
||||
if( el.className.length > 0 && el.className != pClass ) el.className = el.className + ' ' + pClass;
|
||||
else el.className = pClass;
|
||||
}
|
||||
// function addClass(el, pClass){
|
||||
// if( el.className.length > 0 && el.className != pClass ) el.className = el.className + ' ' + pClass;
|
||||
// else el.className = pClass;
|
||||
// }
|
||||
|
||||
function remClass(el, pClass){
|
||||
if( el.className.indexOf(pClass) > -1 ) // si la class de l'élement contient la classe à enlever
|
||||
el.className = el.className.substr(0, el.className.indexOf(pClass)) + '' + el.className.substr(el.className.indexOf(pClass)+pClass.length);
|
||||
}
|
||||
// function remClass(el, pClass){
|
||||
// if( el.className.indexOf(pClass) > -1 ) // si la class de l'élement contient la classe à enlever
|
||||
// el.className = el.className.substr(0, el.className.indexOf(pClass)) + '' + el.className.substr(el.className.indexOf(pClass)+pClass.length);
|
||||
// }
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -6,4 +6,32 @@ NodeList.prototype.indexOf = HTMLCollection.prototype.indexOf = function(searche
|
|||
|
||||
// si on a rien trouvé, on retourne -1
|
||||
return -1;
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
/* GESTION DE L'AJOUT/SUPPRESSION D'UNE CLASSE */
|
||||
function addClass(el, pClass){
|
||||
if( el.className.length > 0 && el.className != pClass ) el.className = el.className + ' ' + pClass;
|
||||
else el.className = pClass;
|
||||
}
|
||||
|
||||
function remClass(el, pClass){
|
||||
if( el.className.indexOf(pClass) > -1 ) // si la class de l'élement contient la classe à enlever
|
||||
el.className = el.className.substr(0, el.className.indexOf(pClass)) + '' + el.className.substr(el.className.indexOf(pClass)+pClass.length);
|
||||
}
|
||||
|
||||
|
||||
/* ANIMATION DE BOUNCE PENDANT 1 SEC */
|
||||
function makeBounce(buttonElement){
|
||||
// ajout de la classe
|
||||
remClass(buttonElement, 'loading');
|
||||
addClass(buttonElement, 'bounce_error');
|
||||
addClass(buttonElement, 'pamp');
|
||||
|
||||
// suppression de la classe après 1 sec
|
||||
setTimeout(function(){
|
||||
remClass(buttonElement, 'bounce_error');
|
||||
remClass(buttonElement, 'pamp');
|
||||
}, 1000);
|
||||
|
||||
}
|
|
@ -226,6 +226,8 @@ if( document.querySelector('#CONTAINER section[name=controlesenseignants]') != n
|
|||
|
||||
API.send(request, function(response){ // on gère la réponse de API, si déplacement effectué, on recharge la page
|
||||
if( response.request == 'success' ) reload();
|
||||
// si réponse erreur, on le signale physiquement
|
||||
else makeBounce(obj.button);
|
||||
});
|
||||
|
||||
}
|
||||
|
@ -270,6 +272,7 @@ if( document.querySelector('#CONTAINER section[name=controlesenseignants]') != n
|
|||
API.send(request, function(response){ // on gère la réponse de API
|
||||
if( response.request == 'success' ) // si on a une réponse positive, on incrémente le nombre de succès
|
||||
reload();
|
||||
else makeBounce(e.target);
|
||||
});
|
||||
|
||||
}, false);
|
||||
|
@ -369,6 +372,8 @@ if( document.querySelector('#CONTAINER section[name=allcontroles]') != null ){ /
|
|||
|
||||
API.send(request, function(response){ // on gère la réponse de API, si déplacement effectué, on recharge la page
|
||||
if( response.request == 'success' ) reload();
|
||||
// si réponse erreur, on le signale physiquement
|
||||
else makeBounce(obj.button);
|
||||
});
|
||||
|
||||
}
|
||||
|
@ -413,6 +418,8 @@ if( document.querySelector('#CONTAINER section[name=allcontroles]') != null ){ /
|
|||
API.send(request, function(response){ // on gère la réponse de API
|
||||
if( response.request == 'success' ) // si on a une réponse positive, on incrémente le nombre de succès
|
||||
reload();
|
||||
// si réponse erreur, on le signale physiquement
|
||||
else makeBounce(e.target);
|
||||
});
|
||||
|
||||
}, false);
|
||||
|
@ -479,9 +486,9 @@ if( exportJury != null ){
|
|||
if( answer2.request == 'success' ){ // le fichier a bien été généré, on lance le téléchargement
|
||||
document.location = answer2.pathfile;
|
||||
reload();
|
||||
}
|
||||
}else makeBounce(e.target);
|
||||
});
|
||||
}
|
||||
}else makeBounce(e.target);
|
||||
});
|
||||
|
||||
|
||||
|
@ -543,13 +550,19 @@ if( importJury != null ){
|
|||
if( f.request == 'success' ){
|
||||
console.log('liste intégrée');
|
||||
reload();
|
||||
}else console.log('integration error');
|
||||
}else{
|
||||
console.log('integration error');
|
||||
makeBounce(e.target);
|
||||
}
|
||||
});
|
||||
|
||||
}else console.log('import error');
|
||||
}else{
|
||||
console.log('import error');
|
||||
makeBounce(e.target);
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
}else makeBounce(e.target);
|
||||
|
||||
}
|
||||
|
||||
|
@ -591,6 +604,7 @@ if( publicationControles.length > 0 ){
|
|||
// on envoie la requête vers l'API
|
||||
API.send(request, function(answer){
|
||||
if( answer.request == 'success' ) reload();
|
||||
else makeBounce(e.target);
|
||||
});
|
||||
}
|
||||
}, false);
|
||||
|
@ -708,13 +722,19 @@ if( importNotes.length > 0 ){
|
|||
if( f.request == 'success' ){
|
||||
console.log('liste intégrée');
|
||||
reload();
|
||||
}else console.log('integration error');
|
||||
}else{
|
||||
console.log('integration error');
|
||||
makeBounce(boutonImport);
|
||||
}
|
||||
});
|
||||
|
||||
}else console.log('import error');
|
||||
}else{
|
||||
console.log('import error');
|
||||
makeBounce(boutonImport);
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
}else makeBounce(boutonImport);
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -85,6 +85,7 @@ if( canMoveStudents ){ // si c'set l'admin
|
|||
// on envoie la requête
|
||||
API.send(request, function(answer){
|
||||
if( answer.request == 'success' ) reload();
|
||||
else makeBounce(e.target);
|
||||
});
|
||||
|
||||
}, false);
|
||||
|
@ -231,9 +232,9 @@ if( exportInscrits != null ){
|
|||
if( answer2.request == 'success' ){ // le fichier a bien été généré, on lance le téléchargement
|
||||
document.location = answer2.pathfile;
|
||||
reload();
|
||||
}
|
||||
}else makeBounce(e.target);
|
||||
});
|
||||
}
|
||||
}else makeBounce(e.target);
|
||||
});
|
||||
|
||||
|
||||
|
@ -282,24 +283,31 @@ if( importInscrits != null ){
|
|||
/* [2] LECTURE DU FICHIER
|
||||
=======================================*/
|
||||
var request = { level_0: 'excel', level_1: 'import_inscrits' };
|
||||
API.send(request, function(e){
|
||||
console.log('[2] PARSE=>'+e.request);
|
||||
if( e.request == 'success' ){
|
||||
API.send(request, function(ex){
|
||||
console.log('[2] PARSE=>'+ex.request);
|
||||
if( ex.request == 'success' ){
|
||||
|
||||
/* [3] INTÉGRATION À LA BDD
|
||||
=======================================*/
|
||||
requestIntegration = { level_0: 'groups', level_1: 'addUserlist', rang: rang, annee: annee, formationList: e.formationList };
|
||||
requestIntegration = { level_0: 'groups', level_1: 'addUserlist', rang: rang, annee: annee, formationList: ex.formationList };
|
||||
API.send( requestIntegration, function(f){
|
||||
console.log('[3] INTEGRATION=>'+f.request);
|
||||
if( f.request == 'success' ){
|
||||
console.log('liste intégrée');
|
||||
reload();
|
||||
}else console.log('integration error');
|
||||
}else{
|
||||
console.log('integration error');
|
||||
makeBounce(e.target.parentNode);
|
||||
}
|
||||
});
|
||||
|
||||
}else console.log('import error');
|
||||
}else{
|
||||
console.log('import error');
|
||||
makeBounce(e.target.parentNode);
|
||||
console.log( e.target );
|
||||
}
|
||||
});
|
||||
}
|
||||
}else makeBounce(e.target.parentNode);
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -158,13 +158,13 @@ if( importMcc != null ){
|
|||
if( f.request == 'success' ){
|
||||
console.log('mcc intégré');
|
||||
reload();
|
||||
}
|
||||
}else makeBounce(e.target);
|
||||
});
|
||||
|
||||
}
|
||||
}else makeBounce(e.target);
|
||||
});
|
||||
|
||||
}
|
||||
}else makeBounce(e.target);
|
||||
|
||||
}
|
||||
|
||||
|
@ -217,6 +217,7 @@ if( creerSemestre != null ){ // si la page est présente
|
|||
API.send(request, function(e){
|
||||
if( e.request == 'success' )
|
||||
reload();
|
||||
else makeBounce(e.target);
|
||||
});
|
||||
|
||||
|
||||
|
@ -251,6 +252,7 @@ if( cloneMCC != null ){ // si la page est présente
|
|||
API.send(request, function(e){
|
||||
if( e.request == 'success' )
|
||||
reload();
|
||||
else makeBounce(e.target);
|
||||
});
|
||||
|
||||
|
||||
|
|
|
@ -138,8 +138,11 @@ if( roleSection != null ){
|
|||
};
|
||||
|
||||
API.send(request, function(answer){
|
||||
if( answer.request != 'success' ) console.log('erreur de changement de rôle (admin)');
|
||||
reload();
|
||||
if( answer.request != 'success' ){
|
||||
console.log('erreur de changement de rôle (admin)');
|
||||
makeBounce(e.target);
|
||||
}else
|
||||
reload();
|
||||
});
|
||||
|
||||
}
|
||||
|
@ -169,8 +172,11 @@ if( roleSection != null ){
|
|||
};
|
||||
|
||||
API.send(request, function(answer){
|
||||
if( answer.request != 'success' ) console.log('erreur de changement de rôle (référent)');
|
||||
reload();
|
||||
if( answer.request != 'success' ){
|
||||
console.log('erreur de changement de rôle (référent)');
|
||||
makeBounce(e.target);
|
||||
}else
|
||||
reload();
|
||||
});
|
||||
|
||||
}
|
||||
|
@ -206,8 +212,11 @@ if( roleSection != null ){
|
|||
};
|
||||
|
||||
API.send(request, function(answer){
|
||||
if( answer.request != 'success' ) console.log('erreur de changement de rôle');
|
||||
reload();
|
||||
if( answer.request != 'success' ){
|
||||
console.log('erreur de changement de rôle');
|
||||
makeBounce(e.target);
|
||||
}else
|
||||
reload();
|
||||
});
|
||||
|
||||
}
|
||||
|
@ -241,8 +250,11 @@ if( roleSection != null ){
|
|||
};
|
||||
|
||||
API.send(request, function(answer){
|
||||
if( answer.request != 'success' ) console.log('erreur de changement de rôle');
|
||||
reload();
|
||||
if( answer.request != 'success' ){
|
||||
console.log('erreur de changement de rôle');
|
||||
makeBounce(e.target);
|
||||
}else
|
||||
reload();
|
||||
});
|
||||
|
||||
}
|
||||
|
@ -273,8 +285,11 @@ if( roleSection != null ){
|
|||
};
|
||||
|
||||
API.send(request, function(answer){
|
||||
if( answer.request != 'success' ) console.log('erreur de changement de rôle');
|
||||
reload();
|
||||
if( answer.request != 'success' ){
|
||||
console.log('erreur de changement de rôle');
|
||||
makeBounce(e.target);
|
||||
}else
|
||||
reload();
|
||||
});
|
||||
|
||||
}
|
||||
|
@ -320,7 +335,7 @@ if( changeYear.select != null && changeYear.button != null ){
|
|||
if( answer.request == 'success' ){
|
||||
reload(); // on recharge la page
|
||||
updateCurrentYear(request.year);
|
||||
}
|
||||
}else makeBounce(e.target);
|
||||
});
|
||||
|
||||
}, false);
|
||||
|
|
|
@ -440,9 +440,9 @@ elseif( permission('teacher') ){ // si enseignant et qu'un contrôle est spécif
|
|||
|
||||
echo "<td>";
|
||||
if( $user['note'] != null ) // s'il a déjà une note, on la met par défaut
|
||||
echo "<input class='saisie_note' data-ctrl='".$answer->controle['id']."' type='text' step='.25' min='0' max='".$answer->controle['base']."' placeholder='Note' value='".$user['note']."'>";
|
||||
echo "<input class='saisie_note' data-ctrl='".$answer->controle['id']."' type='text' min='0' max='".$answer->controle['base']."' placeholder='Note' value='".$user['note']."'>";
|
||||
else // sinon on laisse le champ vide
|
||||
echo "<input class='saisie_note' data-ctrl='".$answer->controle['id']."' type='text' step='.25' min='0' max='".$answer->controle['base']."' placeholder='Note'>";
|
||||
echo "<input class='saisie_note' data-ctrl='".$answer->controle['id']."' type='text' min='0' max='".$answer->controle['base']."' placeholder='Note'>";
|
||||
|
||||
echo "<div class='confirm'>enregistrer</div>";
|
||||
echo "</td>";
|
||||
|
|
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue