X-Git-Url: http://git.euphorik.ch/index.cgi?a=blobdiff_plain;ds=sidebyside;f=js%2FpageMinichat%2Fconversation.js;h=2810b1b3e730d755ffa6fc928ef95672516e4d50;hb=76bcba66b341128f518ed77a40f640048cd006fd;hp=70be515e80ce2f90f44ca4e449357fe1c0c78466;hpb=de42c1d3c8cd320a8481e93976316a920b9ad6a8;p=euphorik.git
diff --git a/js/pageMinichat/conversation.js b/js/pageMinichat/conversation.js
index 70be515..2810b1b 100644
--- a/js/pageMinichat/conversation.js
+++ b/js/pageMinichat/conversation.js
@@ -56,7 +56,7 @@ euphorik.Conversation = function(conversations, num) {
'
' +
(reverse ? messageRacineXHTML : "") +
'
' +
- (this.num === 0 ? '' : '
') + //
+ (this.num === 0 ? '' : '
') + //
'<1>' +
'
' +
(reverse ? "" : messageRacineXHTML) +
@@ -70,13 +70,13 @@ euphorik.Conversation = function(conversations, num) {
// 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("Créer un lien vers la conversation", $("#" + this.getId() + " .titre .creerLien"));
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() {
+ $("#" + this.getId() + " .titre .creerLien").click(function() {
thisConversation.util.replaceSelection(
$("form#posterMessage input.message")[0],
"{" + thisConversation.client.conversations[thisConversation.num - 1].root.toString(36) + "}"
@@ -286,6 +286,7 @@ euphorik.Conversation.prototype.flush = function() {
/**
* Attache des événements à un message donné.
+ * Utilisé lorsqu'un message est ajouté au document HTML.
* @element le message du DOM
*/
euphorik.Conversation.prototype.attacherEventsSurMessage = function(element) {
@@ -298,7 +299,7 @@ euphorik.Conversation.prototype.attacherEventsSurMessage = function(element) {
var thisConversation = this;
$(".lienConv", element).click(
- function(event) {
+ function(event) {
// FIXME : ya pas mieux ?
var racine = $(event.target).text();
thisConversation.conversations.ouvrirConversation(parseInt(racine.substring(1, racine.length - 1), 36));
@@ -326,8 +327,14 @@ euphorik.Conversation.prototype.attacherEventsSurMessage = function(element) {
$("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();
+ var left = $(this).offset().left + $(this).outerWidth() - thisConversation.util.outilsMessage.outerWidth();
+ $(".extraire", thisConversation.util.outilsMessage).unbind();
+ $(".extraireCompletement", thisConversation.util.outilsMessage).unbind();
+ // TODO : ces deux appels devraient se trouver dans "PageMinichat" lors de la création de thisConversation.util
+ // malheureusement lors de la modification du DOM (suppression des conversations) les événements liés sont supprimés
+ thisConversation.util.infoBulle("Extraction de la conversation à partir de ce message", $(".extraire", thisConversation.util.outilsMessage));
+ thisConversation.util.infoBulle("Extraction de la conversation complète", $(".extraireCompletement", thisConversation.util.outilsMessage));
+ thisConversation.util.outilsMessage.css("top", top).css("left", left).prependTo(this).show();
}, function() {
thisConversation.util.outilsMessage.hide()
});