X-Git-Url: http://git.euphorik.ch/?a=blobdiff_plain;ds=sidebyside;f=js%2FpageMinichat%2Fconversation.js;h=71a7b3d9af388007c3966f5b80c2ec7817b09371;hb=a57cb5dd4f773111f734c726f61f06434c39b94e;hp=20343f9f49bfc4a4ca6d18a58b7bac35b92e3548;hpb=f2eb4c4ec53b164804c0c7441830372358ce74e6;p=euphorik.git
diff --git a/js/pageMinichat/conversation.js b/js/pageMinichat/conversation.js
index 20343f9..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)
@@ -238,7 +240,6 @@ euphorik.Conversation.prototype.flush = function() {
var thisConversation = this;
var reverse = this.client.chatOrder === "reverse";
- // est-ce que le prochain message est pair ? (permet d'alterner le style des messages)
var messagePair = (this.idDernierMessageAffiche === 0 ? true :
($("#" + this.getId() + " .messages div:" + (reverse ? "first" : "last")).attr("class").search("messagePair") === -1)
);
@@ -251,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
@@ -288,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));
@@ -410,7 +415,7 @@ euphorik.Conversation.prototype.afficherConversation = function(id) {
function() {
var jq = $(this);
var statut = mess[thisConversation.idMessageFromString(jq.attr("id"))];
- if (!statut) {
+ if (statut === undefined) {
jq.addClass("cache");
} else {
jq.removeClass("cache");