MOD légère modif du protocole
[euphorik.git] / js / pageMinichat.js
index 62f07f8..cedcf92 100755 (executable)
@@ -79,6 +79,7 @@ PageMinichat.prototype.charger = function()
    {    
       this.util.outilsBan = $(
          '<span id="outilsBan">' +
+         '<span class="spacer"></span>' +
          '<form action=""><p><input id="raison" name="raison" type="text" size="10" maxlength="200"></input></p></form>' +
          '<img id="ban" src="img/ban.gif" alt="Ban de 3 jours" />' +
          '<img id="kick" src="img/kick.gif" alt="Ban de 15min" />' +
@@ -519,8 +520,6 @@ Conversation.prototype.majRacine = function()
       this.attacherEventsSurMessage(element)
       $("#" + this.getId() + " .titre .messageRacine").html(element)
    }
-   else // si le message fait déjà parti de la conversation on n'affiche pas la racine
-      $("#" + this.getId() + " .titre .messageRacine").empty()
 }
 
 Conversation.prototype.enleverMiseEnEvidence = function()
@@ -642,6 +641,9 @@ Conversation.prototype.viderMessages = function()
    this.messagesParId = {}
    this.idDernierMessageAffiche = 0
    $("#" + this.getId() + " .messages .message").remove()
+   
+   // enlève également la racine
+   $("#" + this.getId() + " .titre .messageRacine").empty()
 }
 
 Conversation.prototype.idMessageFromString = function(idString)
@@ -716,7 +718,7 @@ Conversation.prototype.attacherEventsSurMessage = function(element)
          thisConversation.conversations.ouvrirConversation(parseInt(idString.substring(1, racine.length - 1), 36))
          return false
       }
-   )  
+   )
        
    $(element).click(
       function(event)
@@ -749,7 +751,7 @@ Conversation.prototype.attacherEventsSurMessage = function(element)
       function()
       {
          thisConversation.decolorerEntetes()
-         thisConversation.afficherConversation(element)
+         thisConversation.afficherConversation(idMess)
       },
       // quand on sort de l'entête du message la mise en évidence est enlevée
       function()
@@ -774,9 +776,10 @@ Conversation.prototype.attacherEventsSurMessage = function(element)
        {     
           var userId = parseInt($(".id", this).text())
           var pseudo = $(this)
-          var h = pseudo.height()
+          var h = pseudo.outerHeight()
           var offset = pseudo.offset()
-          thisConversation.util.outilsBan.css("top", offset.top - 2).css("left", offset.left - 2).height(h < 16 ? 16 : h).width(pseudo.width() + 16 * 3 + 4 + 64).prependTo(this).show()
+          // TODO : calculer automatiquement la largeur plutôt que d'inscrire des valeurs en brut'
+          thisConversation.util.outilsBan.css("top", offset.top - 2).css("left", offset.left - 2).height(h < 16 ? 16 : h).width(pseudo.outerWidth() + 16 * 3 + 12 + 64).prependTo(this).show()
           $("img", thisConversation.util.outilsBan).unbind("click")
           $("#slap", thisConversation.util.outilsBan).click(
              function()