X-Git-Url: http://git.euphorik.ch/?a=blobdiff_plain;f=js%2FpageProfile.js;h=0641e7c36928cb9bd327e33b90b4f663209d25aa;hb=145974d77e365d720a83778626f7855eaa8e9b3f;hp=7270c23f0132a8f28ba58c04fe114abdee7e84cd;hpb=6feaef2a51f7226c41d69f9e86f605718b78aa02;p=euphorik.git diff --git a/js/pageProfile.js b/js/pageProfile.js index 7270c23..0641e7c 100755 --- a/js/pageProfile.js +++ b/js/pageProfile.js @@ -11,38 +11,44 @@ function PageProfile(client, formateur, util) PageProfile.prototype.contenu = function() { + // pourquoi ? return "" } PageProfile.prototype.charger = function() { - jQuery("#page").html(this.getHTML()) + $("#page").html(this.getHTML()) // en fonction du statut - if (this.client.identifie()) + if (this.client.authentifie()) this.chargerProfile() else this.chargerLogin() - jQuery("#page form#profile").submit(function(){return false}) + $("#page form#profile").submit(function(){return false}) } PageProfile.prototype.chargerProfile = function() { var thisPage = this - jQuery("form#profile input.login").val(this.client.login) - jQuery("form#profile input.pseudo").val(this.client.pseudo) - jQuery("form#profile input.email").val(this.client.email) + $("form#profile input.login").val(this.client.login) + $("form#profile input.pseudo").val(this.client.pseudo) + $("form#profile input.email").val(this.client.email) + + $("form#profile select#affichagePseudo option").removeAttr("selected") + $("form#profile select#affichagePseudo option[value=" + this.client.nickFormat + "]").attr("selected", "selected") + - jQuery("#page form#profile button").click( + $("form#profile button").click( function() { - thisPage.client.pseudo = thisPage.formateur.filtrerInputPseudo(jQuery("form#profile input.pseudo").val()) - thisPage.client.email = jQuery("form#profile input.email").val() + thisPage.client.pseudo = thisPage.formateur.filtrerInputPseudo($("form#profile input.pseudo").val()) + thisPage.client.email = $("form#profile input.email").val() + thisPage.client.nickFormat = $("form#profile select#affichagePseudo option:selected").attr("value") - var password = jQuery("form#profile input.password").val() - var passwordRe = jQuery("form#profile input.passwordRe").val() + var password = $("form#profile input.password").val() + var passwordRe = $("form#profile input.passwordRe").val() if (password != "" || passwordRe != "") { if (password != passwordRe) @@ -68,10 +74,10 @@ PageProfile.prototype.chargerLogin = function() { var thisPage = this - jQuery("#page form#profile button").click( + $("#page form#profile button").click( function() { - if(!thisPage.client.connexionLogin(jQuery("form#profile input.login").val(), thisPage.util.md5(jQuery("form#profile input.password").val()))) + if(!thisPage.client.connexionLogin($("form#profile input.login").val(), thisPage.util.md5($("form#profile input.password").val()))) thisPage.util.messageDialogue("Couple login/pass introuvable") else { @@ -89,13 +95,13 @@ return '\ \ \ \ - \ + \ \ \ \ \ ' + - (this.client.identifie() ? '\ + (this.client.authentifie() ? '\ \ \ \ @@ -108,6 +114,16 @@ return '\ \ \ \ + \ + \ + \ + \ ' : '') + '\ \ \ @@ -115,4 +131,5 @@ return '\ \
login
password
password ree-mail
Affichage des identifiants\ + \ +
\ ' -} \ No newline at end of file +} +