FIX problème de gestion du profile, après ouverture d'une conversation puis enregistr...
[euphorik.git] / js / client.js
index 92009f5..73622a4 100644 (file)
@@ -105,12 +105,12 @@ euphorik.Client.prototype.pagePrecedente = function(numConv) {
 euphorik.Client.prototype.goPremierePage = function(numConv)\r
 {\r
    if (numConv < 0) {\r
-      if (this.pagePrincipale == 1) {\r
+      if (this.pagePrincipale === 1) {\r
          return false;\r
       }\r
       this.pagePrincipale = 1;\r
    } else {\r
-      if (this.conversations[numConv].page == 1) {\r
+      if (this.conversations[numConv].page === 1) {\r
          return false;\r
       }\r
       this.conversations[numConv].page = 1;\r
@@ -180,13 +180,17 @@ euphorik.Client.prototype.getJSONLoginCookie = function() {
   * de s'autentifier avec (login, password).\r
   */\r
 euphorik.Client.prototype.getJSONEnregistrement = function(login, password) {\r
-   var mess = { "header" : { "action" : "register", "version" : euphorik.conf.versionProtocole } };\r
+   var mess = {\r
+      "header" : { "action" : "register","version" : euphorik.conf.versionProtocole }\r
+   };\r
    \r
    if (login && password) {\r
       mess.login = login;\r
       mess.password = password;\r
    }\r
    \r
+   mess.profile_infos = this.getJSONProfileInfos();\r
+   \r
    return mess;\r
 };\r
 \r
@@ -204,6 +208,12 @@ euphorik.Client.prototype.getJSONProfile = function() {
       "cookie" : this.cookie,\r
       "login" : this.login,\r
       "password" : this.password,\r
+      "profile_infos" : this.getJSONProfileInfos()\r
+   };\r
+};\r
+\r
+euphorik.Client.prototype.getJSONProfileInfos = function() {\r
+   return {\r
       "nick" : this.pseudo,\r
       "email" : this.email,\r
       "css" : this.css,\r
@@ -302,7 +312,7 @@ euphorik.Client.prototype.enregistrement = function(login, password) {
 };\r
 \r
 /**\r
-  * Connexion. Réalisé de manière synchrone.\r
+  * Connexion. Réalisée de manière synchrone.\r
   */\r
 euphorik.Client.prototype.connexion = function(messageJson) {\r
    var thisClient = this;\r
@@ -409,11 +419,11 @@ euphorik.Client.prototype.majMenu = function() {
    $("#menu .admin").css("display", this.ekMaster ? displayType : "none");\r
   \r
    // met à jour le menu   \r
-   if (this.statut == euphorik.Client.statutType.auth_registered) {\r
+   if (this.statut === euphorik.Client.statutType.auth_registered) {\r
       $("#menu .profile").css("display", displayType).text("profile");\r
       $("#menu .logout").css("display", displayType);\r
       $("#menu .register").css("display", "none");\r
-   } else if (this.statut == euphorik.Client.statutType.auth_not_registered) {\r
+   } else if (this.statut === euphorik.Client.statutType.auth_not_registered) {\r
       $("#menu .profile").css("display", "none");\r
       $("#menu .logout").css("display", displayType);\r
       $("#menu .register").css("display", displayType);\r