ADD licence au début des fichiers js
[euphorik.git] / js / pageMinichat.js
index 541c980..5ce2793 100755 (executable)
@@ -1,4 +1,20 @@
-// coding: utf-8
+// coding: utf-8\r
+// Copyright 2008 Grégory Burri\r
+//\r
+// This file is part of Euphorik.\r
+//\r
+// Euphorik is free software: you can redistribute it and/or modify\r
+// it under the terms of the GNU General Public License as published by\r
+// the Free Software Foundation, either version 3 of the License, or\r
+// (at your option) any later version.\r
+//\r
+// Euphorik is distributed in the hope that it will be useful,\r
+// but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+// GNU General Public License for more details.\r
+//\r
+// You should have received a copy of the GNU General Public License\r
+// along with Euphorik.  If not, see <http://www.gnu.org/licenses/>.
  
 function PageMinichat(client, formateur, util)
 {
@@ -514,9 +530,9 @@ Conversation.prototype.flush = function(funClickOuvrirConv)
             "\">" +
                "<div class=\"extraire\">&gt;</div>" +
                "[<span class=\"date\">" + message.date + "</span>]" +
-               "<span class=\"pseudo\"><span class=\"id\" style=\"display: none\">" + message.auteurId + "</span>" + identifiant + "</span>:" +
+               "<span class=\"pseudo\"><span class=\"id\" style=\"display: none\">" + message.auteurId + "</span class=\"ident\">" + identifiant + "</span>:" +
                XHTMLrepondA +
-               "<span class=\"contenu\">" + (message.systeme ? this.formateur.remplacerBalisesHTML(message.contenu) : this.formateur.traitementComplet(message.contenu, message.pseudo)) + "</span>" +
+               "<span class=\"contenu\">" + this.formateur.traitementComplet(message.contenu, message.pseudo) + "</span>" +
             "</div>"
             
          messagePair = !messagePair
@@ -531,7 +547,7 @@ Conversation.prototype.flush = function(funClickOuvrirConv)
       $("#conversations #" + this.getId() + " .message").slice(this.nbMessageMax, nbMessagesAffiche).empty()
 
    // ajoute les événements liés à chaque nouveau message
-   $("#conversations #" + this.getId() + " .message").filter(function(){return parseInt($(this).attr("id").substr(4), 36) > thisConversation.idDernierMessageAffiche}).each(
+   $("#conversations #" + this.getId() + " .message").filter(function(){ return parseInt($(this).attr("id").substr(4), 36) > thisConversation.idDernierMessageAffiche }).each(
       function()
       {
          $(".lienConv", this).click(
@@ -599,7 +615,7 @@ Conversation.prototype.flush = function(funClickOuvrirConv)
             
                var valCourant = $("input.message").val()
                if (valCourant == undefined) valCourant = ""
-               var tag = $(".pseudo", this).text()  + "{" + idMess + "}" + ">"
+               var tag = $(".pseudo span.ident", this).text()  + "{" + idMess + "}" + ">"
                if (valCourant.indexOf(tag, 0) == -1)
                   $("input.message").val(tag + " " + valCourant)
                thisConversation.util.setCaretToEnd($("form input.message")[0])
@@ -840,8 +856,9 @@ Messages.prototype.supprimerConversation = function(num)
   * Ajuste la largeur des conversations en fonction de leur nombre. modifie l'attribut CSS 'width'.
   */
 Messages.prototype.ajusterLargeurConversations = function()
-{
-      $("#conversations .conversation").css("width", 100 / this.conversations.length + "%")
+{\r
+   // le "- 0.01" evite que IE se chie dessus lamentablement et affiche les conversations les unes au dessus des autres
+   $("#conversations .conversation").css("width", (100 / this.conversations.length) - 0.01 + "%")
 }
 
 /**