+Conversation.prototype.attacherEventsSurMessage = function(element)
+{
+ // l'id du message
+ var idMess = this.idMessageFromString($(element).attr("id"))
+
+ this.util.infoBulle("Extraction de la conversation à partir de ce message", $(".extraire", element))
+ this.util.infoBulle("Extraction de la conversation complète", $(".extraireCompletement", element))
+
+ var thisConversation = this
+ $(".lienConv", element).click(
+ function(event)
+ {
+ // FIXME : ya pas mieux ?
+ var racine = $(event.target).text()
+ thisConversation.conversations.ouvrirConversation(parseInt(idString.substring(1, racine.length - 1), 36))
+ return false
+ }
+ )
+
+ $(element).click(
+ function(event)
+ {
+ if ($(event.target).is("a") || $(event.target).parents("#outilsBan").length > 0) return
+
+ // extraction d'une conversation
+ if ($(event.target).is(".extraire"))
+ {
+ thisConversation.conversations.ouvrirConversation(idMess)
+ return
+ }
+
+ if ($(event.target).is(".extraireCompletement"))
+ {
+ thisConversation.conversations.ouvrirConversation(thisConversation.messagesParId[idMess].racineId)
+ return
+ }
+
+ // met ou enlève la mise en evidence du message
+ thisConversation.conversations.toggleMessageRepond(thisConversation.messagesParId[idMess])
+
+ // donne le focus à la ligne de saisie
+ $("form input.message").focus()
+ }
+ )
+
+ // mise en évidence de la conversation
+ $(".entete", element).hover(
+ function()
+ {
+ thisConversation.decolorerEntetes()
+ thisConversation.afficherConversation(idMess)
+ },
+ // quand on sort de l'entête du message la mise en évidence est enlevée
+ function()
+ {
+ thisConversation.enleverMiseEnEvidence()
+ thisConversation.decolorerEntetes()
+ thisConversation.colorerEntetes()
+ }
+ )
+
+ if (thisConversation.client.viewTimes)
+ $(".dateComplete", element).show()
+ else
+ $(".dateComplete", idMess).hide()
+
+ $("a[@rel*=lightbox]", idMess).lightBox()
+
+ // les outils de bannissement (uniquement pour les ekMaster)
+ if (thisConversation.client.ekMaster)
+ $(".pseudo", idMess).hover(
+ function(e)
+ {
+ var userId = parseInt($(".id", this).text())
+ var element = $(this)
+ var h = element.height()
+ var offset = element.offset()
+ thisConversation.util.outilsBan.css("top", offset.top - 2).css("left", offset.left - 2).height(h < 16 ? 16 : h).width(element.width() + 16 * 3 + 4 + 64).prependTo(this).show()
+ $("img", thisConversation.util.outilsBan).unbind("click")
+ $("#slap", thisConversation.util.outilsBan).click(
+ function()
+ {
+ thisConversation.client.slap(userId, $("#outilsBan input").val())
+ $("#outilsBan input").val("")
+ $("#outilsBan").hide()
+ }
+ )
+ $("#kick", thisConversation.util.outilsBan).click(
+ function()
+ {
+ thisConversation.client.kick(userId, $("#outilsBan input").val())
+ $("#outilsBan input").val("")
+ $("#outilsBan").hide()
+ }
+ )
+ $("#ban", thisConversation.util.outilsBan).click(
+ function()
+ {
+ thisConversation.client.ban(userId, $("#outilsBan input").val())
+ $("#outilsBan input").val("")
+ $("#outilsBan").hide()
+ }
+ )
+ },
+ function()
+ {
+ $("#outilsBan", this).hide()
+ }
+ )
+}
+