10b1c529afa4c84c146e562ee68b878bcdb35825
3 * Quelques bouts de JS pour le site de la corcelles-lan 7.
4 * Necessite la lib jQuery.
9 cl7
.verification_formulaire_inscription = function(util
) {
10 if ($('#formulaireInscription input[name="pseudo"]').val() === "") {
11 util
.messageDialogue("Le pseudo ne peut pas être vide");
14 if ($('#formulaireInscription input[name="pass1"]').val() === "" &&
15 $('#formulaireInscription input[name="pass2"]').val() === "") {
16 util
.messageDialogue("Le password ne peut pas être vide");
19 if ($('#formulaireInscription input[name="pass1"]').val() !== $('#formulaireInscription input[name="pass2"]').val()) {
20 util
.messageDialogue("Les passwords ne correspondent pas");
23 if ($('#formulaireInscription input[name="pass1"]').val().length
< 3) {
24 util
.messageDialogue("La taille de password doit être d'au moins 3 caractères");
27 if ($('#formulaireInscription input[name="nom"]').val() === "") {
28 util
.messageDialogue("Le nom ne peut pas être vide");
31 if ($('#formulaireInscription input[name="prenom"]').val() === "") {
32 util
.messageDialogue("Le prénom ne peut pas être vide");
35 if ($('#formulaireInscription input[name="e_mail"]').val() === "") {
36 util
.messageDialogue("L'email ne peut pas être vide");
39 if ($('#formulaireInscription input[name="accord"]').length
=== 1 && !$('#formulaireInscription input[name="accord"]').attr("checked")) {
40 util
.messageDialogue("Vous devez être d'accord avec le préambule");
48 var util
= new cl7
.Util();
49 $('form#formulaireInscription').submit(function() {
50 return cl7
.verification_formulaire_inscription(util
);
53 $('form#formulaireInscription select[name="clanChoix"]').change(function() {
54 if ($(this).val() === '0') {
57 $clan
= $(this).val().split(';');
58 $('form#formulaireInscription input[name="clan_nom"]').val($clan
[0]);
59 $('form#formulaireInscription input[name="clan_tag"]').val($clan
[1]);
62 // inscrit les emails codés (page contact)
63 $('a#contactPifou').attr('href', util
.rot13('znvygb:tert.oheev@tznvy.pbz'))
64 $('a#contactLePiaf').attr('href', util
.rot13('znvygb:tyrcvns695@zfa.pbz'))
66 // permet d'éviter de faire plus de choix qu'il n'en faut sur la page des jeux joués
69 $('#formulaireJeuxJoues input:checked').each(function() {
70 coches
.unshift(parseInt($(this).attr("value")));
72 $('#formulaireJeuxJoues input[name="votes[]"]').change(function() {
73 if($(this).attr("checked")) {
74 if (coches
.length
>= nbVotesMax
) {
75 $('#formulaireJeuxJoues input[value="' + coches
.pop() + '"]').attr("checked", false);
77 coches
.unshift(parseInt($(this).attr("value")));
79 for (var i
= 0; i
< coches
.length
; i
++) {
80 if (coches
[i
] == parseInt($(this).attr("value"))) {