X-Git-Url: http://git.euphorik.ch/?p=euphorik.git;a=blobdiff_plain;f=js%2Fclient.js;h=92009f521e6f7cf26055d40c3a9f169234b020e7;hp=ea96902c2fa56d305ab1ac4c1aaef4dcfd1bf6e7;hb=1146f3264ff7535ff3408230140414789c3c25da;hpb=48fe12fba37afba9f9d490cf78ce439c21fe6b70 diff --git a/js/client.js b/js/client.js index ea96902..92009f5 100644 --- a/js/client.js +++ b/js/client.js @@ -18,16 +18,6 @@ /*jslint laxbreak:true */ -// les statuts possibes du client -euphorik.Client.statutType = { - // mode enregistré, peut poster des messages et modifier son profile - auth_registered : 0, - // mode identifié, peut poster des messages mais n'a pas accès au profile - auth_not_registered : 1, - // mode déconnecté, ne peut pas poster de message - deconnected : 2 -}; - /** * Représente l'utilisateur du site. */ @@ -46,6 +36,16 @@ euphorik.Client = function(util) { this.autoflush = $.browser.opera; }; +// les statuts possibes du client +euphorik.Client.statutType = { + // mode enregistré, peut poster des messages et modifier son profile + auth_registered : 0, + // mode identifié, peut poster des messages mais n'a pas accès au profile + auth_not_registered : 1, + // mode déconnecté, ne peut pas poster de message + deconnected : 2 +}; + euphorik.Client.prototype.resetDonneesPersonnelles = function() { this.id = 0; this.pseudo = euphorik.conf.pseudoDefaut; @@ -126,11 +126,15 @@ euphorik.Client.prototype.goPremierePage = function(numConv) */ euphorik.Client.prototype.ajouterConversation = function(racine) { // vérification s'il elle n'existe pas déjà + var existe = false this.conversations.each(function(i, conv) { if (conv.root === racine) { - return false; + existe = true; } }); + if (existe) { + return false; + } this.conversations.push({root : racine, page : 1, reduit : false}); if (this.autoflush) { @@ -260,6 +264,7 @@ euphorik.Client.prototype.setStatut = function(statut) } this.statut = statut; + this.majMenu(); this.majLogo(); }; @@ -402,7 +407,7 @@ euphorik.Client.prototype.majMenu = function() { var displayType = "block"; $("#menu .admin").css("display", this.ekMaster ? displayType : "none"); - + // met à jour le menu if (this.statut == euphorik.Client.statutType.auth_registered) { $("#menu .profile").css("display", displayType).text("profile");