ADD ajout du bannissement (pas fini)
[euphorik.git] / js / euphorik.js
index d7ef712..2d64fe2 100755 (executable)
@@ -21,19 +21,27 @@ var conf = {
       "bigsmile" : [/:D/g, /:-D/g],\r
       "clin" : [/;\)/g, /;-\)/g],\r
       "cool" : [/8\)/g, /8-\)/g],\r
-      "eheheh" : [/:P/g, /:-P/g],\r
-      "oh" : [/:o/g, /:O/g],\r
+      "eheheh" : [/:P/g, /:-P/g],
+      "lol" : [/\[-lol\]/g],
+      "spliff" : [/\[-spliff\]/g],\r
+      "oh" : [/:o/g, /:O/g],
+      "heink" : [/\[-heink\]/g],
+      "hum" : [/\[-hum\]/g],
+      "boh" : [/\[-boh\]/g],
+      "sniff" : [/:\(/g, /:-\(/g],
+      "triste" : [/\[-triste\]/g],\r
       "pascontent" : [/>\(/g, />\(/g],\r
-      "sniff" : [/:\(/g, /:-\(/g],\r
-      "argn" : [/\[:argn\]/g],\r
-      "bunny" : [/\[:lapin\]/g],\r
-      "chat" : [/\[:chat\]/g],\r
-      "renne" : [/\[:renne\]/g],\r
-      "lol" : [/\[:lol\]/g],\r
-      "spliff" : [/\[:spliff\]/g],\r
-      "star" : [/\[:star\]/g],\r
-      "triste" : [/\[:triste\]/g],\r
-      "kirby" : [/\[:kirby\]/g]\r
+      "argn" : [/\[-argn\]/g],
+      "redface" : [/\[-redface\]/g],\r
+      "bunny" : [/\[-lapin\]/g],\r
+      "chat" : [/\[-chat\]/g],\r
+      "renne" : [/\[-renne\]/g],\r
+      "star" : [/\[-star\]/g],\r
+      "kirby" : [/\[-kirby\]/g],
+      "slurp" : [/\[-slurp\]/g],
+      "agreed" : [/\[-agreed\]/g],
+      "dodo" : [/\[-dodo\]/g],
+      "bn" : [/\[-bn\]/g]\r
    }\r
 }\r
 
@@ -297,7 +305,8 @@ Formateur.prototype.traiterLiensConv = function(M)
 }
 \r
 /**\r
-  * FIXME : Cette méthode est attrocement lourde ! A optimiser.\r
+  * FIXME : Cette méthode est attrocement lourde ! A optimiser.
+  * moyenne su échantillon : 234ms\r
   */
 Formateur.prototype.traiterSmiles = function(M)
 {  
@@ -415,8 +424,10 @@ Client.prototype.resetDonneesPersonnelles = function()
    this.password = ""\r
    this.email = ""\r
    this.css = jQuery("link#cssPrincipale").attr("href")
+   this.nickFormat = "nick"
    
    this.pagePrincipale = 1
+   this.ekMaster = false
    
    // les conversations, une conversation est un objet possédant les attributs suivants :
    // - racine (entier)
@@ -550,6 +561,7 @@ Client.prototype.getJSONProfile = function()
       "nick" : this.pseudo,
       "email" : this.email,
       "css" : this.css,
+      "nick_format" : this.nickFormat,
       "main_page" : this.pagePrincipale < 1 ? 1 : this.pagePrincipale,
       "conversations" : this.getJSONConversations()
    }
@@ -660,7 +672,8 @@ Client.prototype.connexion = function(messageJson)
 }\r
 \r
 Client.prototype.deconnexion = function()\r
-{\r
+{
+   this.flush()\r
    this.setStatut(statutType.deconnected) // deconnexion\r
    this.resetDonneesPersonnelles()\r
    this.delCookie ()\r
@@ -681,6 +694,7 @@ Client.prototype.chargerDonnees = function(data)
       this.pseudo = data["nick"]\r
       this.email = data["email"]\r
       this.css = data["css"]
+      this.nickFormat = data["nick_format"]
       
       // la page de la conversation principale
       this.pagePrincipale = data["main_page"] == undefined ? 1 : data["main_page"]
@@ -694,6 +708,7 @@ Client.prototype.chargerDonnees = function(data)
       // les conversations
       thisClient.conversations = data["conversations"]
       
+      thisClient.ekMaster = data["ek_master"]
    }
    this.dernierMessageErreur = data["error_message"]
 }
@@ -777,12 +792,6 @@ jQuery.noConflict()
 jQuery(document).ready(
    function()
    {  
-      /* FIXME : ce code pose problème sur konqueror, voir : http://www.kde-forum.org/thread.php?threadid=17993
-      var p = new DOMParser();
-      var doc =  p.parseFromString("<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<action/>", "text/xml")
-      var s = new XMLSerializer()
-      alert(s.serializeToString(doc)) */
-   
       var util = new Util()
       var client = new Client(util)
       var pages = new Pages()
@@ -794,12 +803,7 @@ jQuery(document).ready(
       initialiserListeStyles(client)
 
       // TODO : pourquoi jQuery(document).unload ne fonctionne pas ?
-      jQuery(window).unload(
-         function()
-         {
-            client.flush(false)
-         }
-      )
+      jQuery(window).unload(function(){client.flush(false)})
       
       jQuery("#menu .minichat").click(function(){ pages.afficherPage("minichat") })
       jQuery("#menu .profile").click(function(){ pages.afficherPage("profile") })\r