FIX linefeed
[euphorik.git] / js / pageMinichat.js
index e660b1a..2a0e81f 100755 (executable)
@@ -1,19 +1,19 @@
-// coding: utf-8\r
-// Copyright 2008 Grégory Burri\r
-//\r
-// This file is part of Euphorik.\r
-//\r
-// Euphorik is free software: you can redistribute it and/or modify\r
-// it under the terms of the GNU General Public License as published by\r
-// the Free Software Foundation, either version 3 of the License, or\r
-// (at your option) any later version.\r
-//\r
-// Euphorik is distributed in the hope that it will be useful,\r
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
-// but WITHOUT ANY WARRANTY; without even the implied warranty of\r
-// GNU General Public License for more details.\r
-//\r
-// You should have received a copy of the GNU General Public License\r
+// coding: utf-8
+// Copyright 2008 Grégory Burri
+//
+// This file is part of Euphorik.
+//
+// Euphorik is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// Euphorik is distributed in the hope that it will be useful,
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
 // along with Euphorik.  If not, see <http://www.gnu.org/licenses/>.
  
 function PageMinichat(client, formateur, util)
@@ -58,7 +58,7 @@ PageMinichat.prototype.charger = function()
    this.messages = new Messages(this.client, this.formateur, this.util)
    
    this.messages.rafraichirMessages(true)
-   \r
+   
    this.util.setCaretToEnd($("form input.message")[0])
 
    // les outils de bannissement (uniquement pour les ekMaster)
@@ -179,7 +179,7 @@ PageMinichat.prototype.getJSONMessage = function(pseudo, message, repondA)
 PageMinichat.prototype.envoyerMessage = function(pseudo, message)
 {   
    var thisPageMinichat = this
-\r
+
    // (un pseudo vide est autorisé)
    pseudo = this.formateur.filtrerInputPseudo(pseudo)
 
@@ -191,23 +191,23 @@ PageMinichat.prototype.envoyerMessage = function(pseudo, message)
       for(var i = 0; i < tags.length; i++)
          repondA.push(parseInt(/\{(.*?)\}>/.exec(tags[i])[1], 36))
       message = message.replace(this.regexMessageTagReplace, "")
-   }\r
-   \r
-   message = message.trim()\r
-   if (message == "")\r
+   }
+   
+   message = message.trim()
+   if (message == "")
    {
-      this.util.messageDialogue("Le message est vide")\r
-      return\r
-   }\r
-\r
-   if (!this.client.authentifie())\r
-      if (!this.client.enregistrement())\r
-      {\r
-         this.util.messageDialogue("login impossible")\r
-         return\r
+      this.util.messageDialogue("Le message est vide")
+      return
+   }
+
+   if (!this.client.authentifie())
+      if (!this.client.enregistrement())
+      {
+         this.util.messageDialogue("login impossible")
+         return
       }
       
-   this.client.pseudo = pseudo\r
+   this.client.pseudo = pseudo
    
    // évite le double post
    if (this.envoieMessageEnCours)
@@ -217,24 +217,24 @@ PageMinichat.prototype.envoyerMessage = function(pseudo, message)
    }
    this.envoieMessageEnCours = true
    
-   ;; dumpObj(this.getJSONMessage(pseudo, message, repondA))\r
-   jQuery.ajax(\r
-      {\r
-         url : "request", \r
-         type: "POST",\r
-         data : this.util.jsonVersAction(this.getJSONMessage(pseudo, message, repondA)),\r
+   ;; dumpObj(this.getJSONMessage(pseudo, message, repondA))
+   jQuery.ajax(
+      {
+         url : "request", 
+         type: "POST",
+         data : this.util.jsonVersAction(this.getJSONMessage(pseudo, message, repondA)),
          dataType : "json",
          beforeSend : function(xmlHttpRequest)
          {
             // TODO : ça marche ça ??
             xmlHttpRequest.setRequestHeader("X-Requested-With", "")
-         },\r
-         success : function(data, textStatus)\r
+         },
+         success : function(data, textStatus)
          {
             ;; dumpObj(data)
          
             if(data["reply"] == "ok")
-            {  \r
+            {  
                $("form input.message").val("")
                         
                // met à jour la classe des messages auquel repond celui ci (c'est un peu de la triche) TODO : ya mieux ?
@@ -253,13 +253,13 @@ PageMinichat.prototype.envoyerMessage = function(pseudo, message)
             {
                thisPageMinichat.util.messageDialogue(data["error_message"])
             }
-            thisPageMinichat.envoieMessageEnCours = false\r
+            thisPageMinichat.envoieMessageEnCours = false
          },
          error : function()
          {
             thisPageMinichat.envoieMessageEnCours = false         
-         }\r
-      }\r
+         }
+      }
    )
 }
 
@@ -843,7 +843,7 @@ Messages.prototype.ajouterMessage = function(element, numConversation)
       element["nick"],
       element["login"],
       element["content"]
-   )   \r
+   )   
    
    message.appartientAuClient = element["owner"]
    message.clientARepondu = element["answered"]
@@ -930,10 +930,10 @@ Messages.prototype.supprimerConversation = function(num)
   * Ajuste la largeur des conversations en fonction de leur nombre. modifie l'attribut CSS 'width'.
   */
 Messages.prototype.ajusterLargeurConversations = function()
-{\r
-   var largeurPourcent = (100 / this.conversations.length)   \r
-   // le "- 0.01" evite que IE se chie dessus lamentablement et affiche les conversations les unes au dessus des autres\r
-   if($.browser["msie"])\r
+{
+   var largeurPourcent = (100 / this.conversations.length)   
+   // le "- 0.01" evite que IE se chie dessus lamentablement et affiche les conversations les unes au dessus des autres
+   if($.browser["msie"])
       largeurPourcent -= 0.05
    $("#conversations .conversation").css("width", largeurPourcent + "%")
 }