X-Git-Url: http://git.euphorik.ch/?p=euphorik.git;a=blobdiff_plain;f=js%2FpageMinichat.js;h=356956cf90787523d329da00dee7f9ca1bbc0f38;hp=07d5d8fd83f9b81b6264674cbdf2632d1f148c05;hb=c021866458e347a8c704217247ba207ad99c5cb7;hpb=cd316c6f623d315001c6f685f1f3355c0ea743d8 diff --git a/js/pageMinichat.js b/js/pageMinichat.js index 07d5d8f..356956c 100755 --- a/js/pageMinichat.js +++ b/js/pageMinichat.js @@ -63,6 +63,7 @@ PageMinichat.prototype.charger = function() this.util.outilsBan = $( '' + '

' + + '

' + 'Ban de 3 jours' + 'Ban de 15min' + 'Avertissement' + @@ -87,26 +88,11 @@ PageMinichat.prototype.charger = function() $(this).click( function(event) { - thisPage.util.replaceSelection($("form input.message")[0], thisPage.formateur.smiles[$(this).attr("class")][0].source.replace(/\\/g, "")) - } - ) - .hover( - function() - { - $(this).animate( - { - opacity: 1 - }, 200 - ) - }, - function() - { - $(this).animate( - { - opacity: opacityBase - }, 200 - ) + thisPage.util.replaceSelection($("form#posterMessage input.message")[0], thisPage.formateur.smiles[$(this).attr("class")][0].source.replace(/\\/g, "")) } + ).hover( + function() { $(this).animate({opacity: 1}, 200) }, + function() { $(this).animate({opacity: opacityBase}, 200) } ) } ) @@ -543,12 +529,6 @@ Conversation.prototype.flush = function(funClickOuvrirConv) messagePair = !messagePair } - - // enlève les messages exedentaires - var nbMessagesAffiche = $("#conversations #" + this.getId() + " .message").size() - - if (nbMessagesAffiche > this.nbMessageMax) - $("#conversations #" + this.getId() + " .message").slice(this.nbMessageMax, nbMessagesAffiche).empty() var DOM = $(XHTML) DOM.each( @@ -618,7 +598,7 @@ Conversation.prototype.flush = function(funClickOuvrirConv) $(this).click( function(event) { - if ($(event.target).is("a") || $(event.target).parents().is("#outilsBan")) return + if ($(event.target).is("a") || $(event.target).parents("#outilsBan").length > 0) return // l'id du message var idMess = $(this).attr("id").substr(4) @@ -654,6 +634,11 @@ Conversation.prototype.flush = function(funClickOuvrirConv) ) DOM.prependTo("#conversations #" + this.getId()) + // enlève les messages exedentaires + var nbMessagesAffiche = $("#conversations #" + this.getId() + " .message").size() + if (nbMessagesAffiche > this.nbMessageMax) + $("#conversations #" + this.getId() + " .message").slice(this.nbMessageMax, nbMessagesAffiche).remove() + if (this.messages.length > 0) this.idDernierMessageAffiche = this.messages[this.messages.length-1].id } @@ -807,7 +792,7 @@ Messages.prototype.ajouterMessage = function(element, numConversation) function(num) // insertion du lien vers la conversation { thisPage.util.replaceSelection( - $("form input.message")[0], + $("form#posterMessage input.message")[0], "{" + thisMessages.client.conversations[num-1].root.toString(36) + "}" ) } @@ -878,7 +863,7 @@ Messages.prototype.ajusterLargeurConversations = function() var largeurPourcent = (100 / this.conversations.length) // le "- 0.01" evite que IE se chie dessus lamentablement et affiche les conversations les unes au dessus des autres if($.browser["msie"]) - largeurPourcent -= 0.01 + largeurPourcent -= 0.05 $("#conversations .conversation").css("width", largeurPourcent + "%") }