X-Git-Url: http://git.euphorik.ch/?p=euphorik.git;a=blobdiff_plain;f=js%2FpageMinichat%2Fconversation.js;h=70be515e80ce2f90f44ca4e449357fe1c0c78466;hp=71a7b3d9af388007c3966f5b80c2ec7817b09371;hb=de42c1d3c8cd320a8481e93976316a920b9ad6a8;hpb=a57cb5dd4f773111f734c726f61f06434c39b94e
diff --git a/js/pageMinichat/conversation.js b/js/pageMinichat/conversation.js
index 71a7b3d..70be515 100644
--- a/js/pageMinichat/conversation.js
+++ b/js/pageMinichat/conversation.js
@@ -56,17 +56,24 @@ euphorik.Conversation = function(conversations, num) {
'
' +
(reverse ? messageRacineXHTML : "") +
'
' +
- (num === 0 ? '' : '
') +
+ (this.num === 0 ? '' : '
') + //
'<1>' +
'
' +
(reverse ? "" : messageRacineXHTML) +
'
' +
(reverse ? "" : messagesXHTML) +
- '' +
+ //'' +
'';
$("#conversations tr").append(XHTML);
+ // les infos bulles
+ this.util.infoBulle("Aller à la première page", $("#" + this.getId() + " .titre .numPage"), euphorik.Util.positionBulleType.haut);
+ if (this.num !== 0) {
+ this.util.infoBulle("Créer un lien vers la conversation", $("#" + this.getId() + " .titre .lien"));
+ this.util.infoBulle("Fermer la conversation", $("#" + this.getId() + " .titre .fermer"));
+ }
+
// les différents événements liés à la conversation
var thisConversation = this;
$("#" + this.getId() + " .titre .lien").click(function() {
@@ -76,21 +83,16 @@ euphorik.Conversation = function(conversations, num) {
);
});
$("#" + this.getId() + " .titre .fermer").click(function() {
- thisConversation.conversations.supprimerConversation(num);
+ thisConversation.conversations.supprimerConversation(thisConversation.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"));
- this.util.infoBulle("Fermer la conversation", $("#" + this.getId() + " .fermer"));
- }
+ });*/
};
-
+/*
euphorik.Conversation.prototype.getMessageReduit = function() {
return '' +
'' +
@@ -99,7 +101,7 @@ euphorik.Conversation.prototype.getMessageReduit = function() {
'Blabla blablablabla bla blabla ..' +
'' +
'';
-}
+}*/
/**
* @racine un message représentant la racine de la conversation, vaut undefined pour la conversation générale
@@ -253,7 +255,7 @@ euphorik.Conversation.prototype.flush = function() {
}
});
- var DOM = $(XHTML);
+ var DOM = $(XHTML);
// pour chaque nouveau message au niveau du document on lui assigne ses événements
DOM.each(function() { thisConversation.attacherEventsSurMessage(this); });
@@ -293,9 +295,6 @@ euphorik.Conversation.prototype.attacherEventsSurMessage = function(element) {
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));
var thisConversation = this;
$(".lienConv", element).click(
@@ -307,30 +306,31 @@ euphorik.Conversation.prototype.attacherEventsSurMessage = function(element) {
}
);
- $(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;
- }
+ $(element).click(function(event) {
+ if ($(event.target).is("a") || $(event.target).parents("#outilsBan").length > 0) {
+ return;
+ } else if ($(event.target).is(".extraire")) {
+ thisConversation.util.outilsMessage.hide();
+ thisConversation.conversations.ouvrirConversation(idMess);
+ return;
+ } else if ($(event.target).is(".extraireCompletement")) {
+ thisConversation.util.outilsMessage.hide();
+ thisConversation.conversations.ouvrirConversation(thisConversation.messagesParId[idMess].racineId);
+ 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]);
- // 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();
- }
- );
+ // donne le focus à la ligne de saisie
+ $("form input.message").focus();
+ }).hover(function() { // affiche les outils liées au message
+ var top = $(this).offset().top
+ var left = $(this).offset().left + $(this).width() - thisConversation.util.outilsMessage.largeur
+ thisConversation.util.outilsMessage.css("top", top + 1).css("left", left).prependTo(this).show();
+ }, function() {
+ thisConversation.util.outilsMessage.hide()
+ });
// mise en évidence de la conversation
$(".entete", element).hover(
@@ -389,7 +389,7 @@ euphorik.Conversation.prototype.attacherEventsSurMessage = function(element) {
);
},
function() {
- $("#outilsBan", this).hide();
+ thisConversation.util.outilsBan.hide();
}
);
}
@@ -438,8 +438,7 @@ euphorik.Conversation.prototype.afficherConversation = function(id) {
};
/**
- * Supprime une conversation.
- * Ne l'enlève pas du DOM.
+ * Supprime la conversation du DOM.
*/
euphorik.Conversation.prototype.supprimer = function() {
$("#" + this.getId()).remove();