MOD avancement dans la Grande Restructuration
[euphorik.git] / js / pageMinichat / pageMinichat.js
index 1213cab..333d22d 100755 (executable)
@@ -50,7 +50,7 @@ PageMinichat.prototype.contenu = function()
    //var messagesXHTML = '<tr id="messages"></tr>'
    var conversationXHTML = '<table id="conversations"><tr></tr></table>'
     
-   if (this.client.chatOrder == "reverse")
+   if (this.client.chatOrder === "reverse")
       return trollXHTML + formulaireXHTML + conversationXHTML
    else
       return trollXHTML + conversationXHTML + formulaireXHTML
@@ -58,7 +58,7 @@ PageMinichat.prototype.contenu = function()
 
 PageMinichat.prototype.classes = function()
 {
-   return this.client.chatOrder == "reverse" ? "orderReverse" : "orderChrono"
+   return this.client.chatOrder === "reverse" ? "orderReverse" : "orderChrono"
 }
 
 PageMinichat.prototype.charger = function()
@@ -159,7 +159,7 @@ PageMinichat.prototype.charger = function()
    $("form").keypress(
       function(e)
       {
-         if (e.which == 13) // return
+         if (e.which === 13) // return
             nouveauMessage()
       }
    )
@@ -173,7 +173,7 @@ PageMinichat.prototype.charger = function()
       function()
       {
          var input = $("input.pseudo")[0]
-         if (input.value == euphorik.conf.pseudoDefaut)
+         if (input.value === euphorik.conf.pseudoDefaut)
             input.value = ""
       }
    )
@@ -208,14 +208,14 @@ PageMinichat.prototype.envoyerMessage = function(pseudo, message)
    // (un pseudo vide est autorisé)
    pseudo = this.formateur.filtrerInputPseudo(pseudo)
    
-   if (pseudo == euphorik.conf.nickDefaut)
+   if (pseudo === euphorik.conf.nickDefaut)
    {
       this.util.messageDialogue("Le pseudo ne peut pas être " + euphorik.conf.nickDefaut)
       return
    }
    
    message = message.trim()
-   if (message == "")
+   if (!message)
    {
       this.util.messageDialogue("Le message est vide")
       return
@@ -251,7 +251,7 @@ PageMinichat.prototype.envoyerMessage = function(pseudo, message)
          },
          success : function(data, textStatus)
          {         
-            if(data["reply"] == "ok")
+            if(data["reply"] === "ok")
             {           
                // met à jour la classe des messages auquel repond celui ci (c'est un peu de la triche) TODO : ya mieux ?
                for (var messId in thisPageMinichat.conversations.messagesRepond)
@@ -269,7 +269,7 @@ PageMinichat.prototype.envoyerMessage = function(pseudo, message)
                $("form input.message").val("")
                thisPageMinichat.conversations.enleverMessagesRepond()
             }
-            else if (data["reply"] == "error")
+            else if (data["reply"] === "error")
             {
                thisPageMinichat.util.messageDialogue(data["error_message"])
             }