X-Git-Url: http://git.euphorik.ch/?p=euphorik.git;a=blobdiff_plain;f=js%2FpageMinichat%2Fconversation.js;h=71a7b3d9af388007c3966f5b80c2ec7817b09371;hp=238976bcf434a6c9056409471aa35969d5e09641;hb=a57cb5dd4f773111f734c726f61f06434c39b94e;hpb=11fe8f6d268a9b1c0a773294cc7d70ffdb6afb30
diff --git a/js/pageMinichat/conversation.js b/js/pageMinichat/conversation.js
index 238976b..71a7b3d 100644
--- a/js/pageMinichat/conversation.js
+++ b/js/pageMinichat/conversation.js
@@ -62,10 +62,28 @@ euphorik.Conversation = function(conversations, num) {
(reverse ? "" : messageRacineXHTML) +
'' +
(reverse ? "" : messagesXHTML) +
+ '
' +
'';
$("#conversations tr").append(XHTML);
+ // les différents événements liés à la conversation
+ var thisConversation = this;
+ $("#" + this.getId() + " .titre .lien").click(function() {
+ thisConversation.util.replaceSelection(
+ $("form#posterMessage input.message")[0],
+ "{" + thisConversation.client.conversations[thisConversation.num - 1].root.toString(36) + "}"
+ );
+ });
+ $("#" + this.getId() + " .titre .fermer").click(function() {
+ thisConversation.conversations.supprimerConversation(num);
+ });
+ $("#" + this.getId() + " .titre .reduire").click(function() {
+ $("#" + thisConversation.getId() + " .titre, #" + thisConversation.getId() + " .messages").hide()
+ var e = $("#" + thisConversation.getId() + " .messageReduit");
+ e.get()[0].innerHTML = thisConversation.getMessageReduit()
+ });
+
this.util.infoBulle("Aller à la première page", $("#" + this.getId() + " .numPage"), euphorik.Util.positionBulleType.haut);
if (num !== 0) {
this.util.infoBulle("Créer un lien vers la conversation", $("#" + this.getId() + " .lien"));
@@ -73,6 +91,16 @@ euphorik.Conversation = function(conversations, num) {
}
};
+euphorik.Conversation.prototype.getMessageReduit = function() {
+ return '' +
+ '' +
+ '' +
+ '' +
+ 'Blabla blablablabla bla blabla ..' +
+ '' +
+ '';
+}
+
/**
* @racine un message représentant la racine de la conversation, vaut undefined pour la conversation générale
*/
@@ -139,32 +167,6 @@ euphorik.Conversation.prototype.setPage = function(pageCourante, dernierePage) {
$("#" + this.getId() + " .prev").css("display", dernierePage ? "none" : "inline");
};
-/**
- * Evenement déclanché lors de l'insertion du lien de la conversation dans le message courant.
- */
-euphorik.Conversation.prototype.eventLien = function(fun) {
- var thisConversation = this;
-
- $("#" + this.getId() + " .titre .lien").click(
- function() {
- fun(thisConversation.num);
- }
- );
-};
-
-/**
- * Evenement déclanché lors de la fermeture de la conversation.
- */
-euphorik.Conversation.prototype.eventFermer = function(fun) {
- var thisConversation = this;
-
- $("#" + this.getId() + " .titre .fermer").click(
- function() {
- fun(thisConversation.num);
- }
- );
-};
-
/**
* @funNext appelé lorsque l'on passe à la page suivante (de 2 à 1 par exemple)
* @funPrev appelé lorsque l'on passe à la page précédente (de 1 à 2 par exemple)
@@ -250,7 +252,7 @@ euphorik.Conversation.prototype.flush = function() {
messagePair = !messagePair;
}
});
-
+
var DOM = $(XHTML);
// pour chaque nouveau message au niveau du document on lui assigne ses événements
@@ -287,6 +289,10 @@ euphorik.Conversation.prototype.flush = function() {
euphorik.Conversation.prototype.attacherEventsSurMessage = function(element) {
// l'id du message
var idMess = this.idMessageFromString($(element).attr("id"));
+
+ if (idMess in this.conversations.messagesRepond) {
+ $(element).addClass("repondEnEvidence");
+ }
this.util.infoBulle("Extraction de la conversation à partir de ce message", $(".extraire", element));
this.util.infoBulle("Extraction de la conversation complète", $(".extraireCompletement", element));