X-Git-Url: http://git.euphorik.ch/?p=euphorik.git;a=blobdiff_plain;f=js%2Fclient.js;h=73622a4bdfc6b292c19901d389afd7ab22bd986f;hp=92009f521e6f7cf26055d40c3a9f169234b020e7;hb=11fe8f6d268a9b1c0a773294cc7d70ffdb6afb30;hpb=1146f3264ff7535ff3408230140414789c3c25da diff --git a/js/client.js b/js/client.js index 92009f5..73622a4 100644 --- a/js/client.js +++ b/js/client.js @@ -105,12 +105,12 @@ euphorik.Client.prototype.pagePrecedente = function(numConv) { euphorik.Client.prototype.goPremierePage = function(numConv) { if (numConv < 0) { - if (this.pagePrincipale == 1) { + if (this.pagePrincipale === 1) { return false; } this.pagePrincipale = 1; } else { - if (this.conversations[numConv].page == 1) { + if (this.conversations[numConv].page === 1) { return false; } this.conversations[numConv].page = 1; @@ -180,13 +180,17 @@ euphorik.Client.prototype.getJSONLoginCookie = function() { * de s'autentifier avec (login, password). */ euphorik.Client.prototype.getJSONEnregistrement = function(login, password) { - var mess = { "header" : { "action" : "register", "version" : euphorik.conf.versionProtocole } }; + var mess = { + "header" : { "action" : "register","version" : euphorik.conf.versionProtocole } + }; if (login && password) { mess.login = login; mess.password = password; } + mess.profile_infos = this.getJSONProfileInfos(); + return mess; }; @@ -204,6 +208,12 @@ euphorik.Client.prototype.getJSONProfile = function() { "cookie" : this.cookie, "login" : this.login, "password" : this.password, + "profile_infos" : this.getJSONProfileInfos() + }; +}; + +euphorik.Client.prototype.getJSONProfileInfos = function() { + return { "nick" : this.pseudo, "email" : this.email, "css" : this.css, @@ -302,7 +312,7 @@ euphorik.Client.prototype.enregistrement = function(login, password) { }; /** - * Connexion. Réalisé de manière synchrone. + * Connexion. Réalisée de manière synchrone. */ euphorik.Client.prototype.connexion = function(messageJson) { var thisClient = this; @@ -409,11 +419,11 @@ euphorik.Client.prototype.majMenu = function() { $("#menu .admin").css("display", this.ekMaster ? displayType : "none"); // met à jour le menu - if (this.statut == euphorik.Client.statutType.auth_registered) { + if (this.statut === euphorik.Client.statutType.auth_registered) { $("#menu .profile").css("display", displayType).text("profile"); $("#menu .logout").css("display", displayType); $("#menu .register").css("display", "none"); - } else if (this.statut == euphorik.Client.statutType.auth_not_registered) { + } else if (this.statut === euphorik.Client.statutType.auth_not_registered) { $("#menu .profile").css("display", "none"); $("#menu .logout").css("display", displayType); $("#menu .register").css("display", displayType);