X-Git-Url: http://git.euphorik.ch/index.cgi?a=blobdiff_plain;f=js%2FpageMinichat.js;h=0aa2142271c341e19441ef30d4098e6638f65829;hb=fa5ea78cb2bd127b797f161d9bc922469a55375d;hp=53f4ab2d5e7d12b3374d8b3080e4352ebba4d15f;hpb=5db18ca51ea988501309b589aa1b3c342451050a;p=euphorik.git diff --git a/js/pageMinichat.js b/js/pageMinichat.js index 53f4ab2..0aa2142 100755 --- a/js/pageMinichat.js +++ b/js/pageMinichat.js @@ -345,7 +345,6 @@ function Conversation(num, util, formateur, client) this.num = num // peut changer au cours de la vie de la conversation this.id = Math.floor(Math.random() * 1000000).toString(36) - this.messageOver = null // le message sur lequel se trouve le curseur this.util = util this.formateur = formateur this.client = client @@ -371,15 +370,6 @@ function Conversation(num, util, formateur, client) this.util.infoBulle("Créer un lien vers la conversation", $("#conversations #" + this.getId() + " .lien")) this.util.infoBulle("Fermer la conversation", $("#conversations #" + this.getId() + " .fermer")) } - - // enlève la mise en évidence pour la conversation - $("#conversations #" + this.getId()).hover( - function(){}, - function(event) - { - thisConversation.enleverMiseEnEvidence() - } - ) } /** @@ -388,7 +378,16 @@ function Conversation(num, util, formateur, client) Conversation.prototype.enleverMiseEnEvidence = function() { $("#conversations .message").removeClass("cache") - this.messageOver = null +} + +Conversation.prototype.colorerEntetes = function() +{ + +} + +Conversation.prototype.decolorerEntetes = function() +{ + } /** @@ -625,21 +624,14 @@ Conversation.prototype.flush = function(funClickOuvrirConv) $("input.message").val(tag + " " + valCourant) thisConversation.util.setCaretToEnd($("form input.message")[0]) } - ) - - // Q : pourquoi pas un .hover ? - // R : simplement pour éviter que lorsqu'un message arrive cela n'affecte la conversation actuellement mise en évidence (uniquement pour Firefox) - $(".entete", this).mousemove( - function(e) - { - if (this !== thisConversation.messageOver) - { - thisConversation.afficherConversation(idMess) - thisConversation.messageOver = this - } - } - ).hover( - function(){}, + ) + + // mise en évidence de la conversation + $(".entete", this).hover( + function() + { + thisConversation.afficherConversation(idMess) + }, // quand on sort de l'entête du message la mise en évidence est enlevée function() { @@ -936,18 +928,10 @@ Messages.prototype.rafraichirMessages = function(vider) this.pageEvent.waitEvent( function() { return thisMessages.getJSONrafraichirMessages() }, - function(data) - { - if (vider) - { - thisMessages.viderMessages() - vider = false - } - - // en fonction du message - switch(data["reply"]) - { - case "new_troll" : + { + "new_troll" : + function(data) + { thisMessages.trollIdCourant = data["troll_id"] $("#trollCourant .troll").html(thisMessages.formateur.traitementComplet(data["content"])).unbind("click").click( function() @@ -957,9 +941,15 @@ Messages.prototype.rafraichirMessages = function(vider) ) $("#trollCourant .troll a[@rel*=lightbox]").lightBox() - break - - case "new_messages" : + }, + "new_messages" : + function(data) + { + if (vider) + { + thisMessages.viderMessages() + vider = false + } // ajoute les messages reçus à leur conversation respective for (var numConv = 0; numConv < data["conversations"].length; numConv++) { @@ -969,8 +959,7 @@ Messages.prototype.rafraichirMessages = function(vider) thisMessages.client.supprimerConversation(numConv - 1) } } - break - } + } } ) }