X-Git-Url: http://git.euphorik.ch/?p=euphorik.git;a=blobdiff_plain;f=js%2FpageMinichat.js;h=ec745f357f424e84b2a9617b68cf4a5a967bb1cd;hp=da53627f888ef508f9cecacb511bd56d681e9357;hb=994f68e1f8a7a43b55d6bd6214b2a0066671ba74;hpb=650c44a784cabc8a1f2bd1daa7e5e61ccf74ca6f diff --git a/js/pageMinichat.js b/js/pageMinichat.js index da53627..ec745f3 100755 --- a/js/pageMinichat.js +++ b/js/pageMinichat.js @@ -39,7 +39,7 @@ PageMinichat.prototype.contenu = function()
\

\ \ - \ + \ \ \ \ @@ -193,6 +193,12 @@ PageMinichat.prototype.envoyerMessage = function(pseudo, message) message = message.replace(this.regexMessageTagReplace, "") } + if (pseudo == conf.nickDefaut) + { + this.util.messageDialogue("Le pseudo ne peut pas être " + conf.nickDefaut) + return + } + message = message.trim() if (message == "") { @@ -574,7 +580,7 @@ Conversation.prototype.flush = function(funClickOuvrirConv) (this.messages[i].systeme ? " systeme" : "") + (this.messages[i].ekMaster ? " ekMaster" : "") + "\">" + - "

" + + "
" + "[" + message.date + "]" + "" + message.auteurId + "" + identifiant + "" + XHTMLrepondA + @@ -598,7 +604,8 @@ Conversation.prototype.flush = function(funClickOuvrirConv) } ) - thisConversation.util.infoBulle("Extraction de la conversation", $(".extraire", this)) + thisConversation.util.infoBulle("Extraction de la conversation à partir de ce message", $(".extraire", this)) + thisConversation.util.infoBulle("Extraction de la conversation complète", $(".extraireCompletement", this)) // l'id du message var idMess36 = $(this).attr("id").substr(4) @@ -726,16 +733,18 @@ Conversation.prototype.afficherConversation = function(id) { jq.removeClass("cache") switch (statut) - { + { + // "repondu" et "reponse" sont prioritaitres à "proprietaire" + // contrairement à la vue normale (sans mise en évidence d'une conversation) + case 3 : + jq.addClass("repondu") + break; + case 2 : + jq.addClass("reponse") + break; case 1 : jq.addClass("proprietaire") break; - case 2 : - jq.addClass("reponse") - break; - case 3 : - jq.addClass("repondu") - break; } } } @@ -764,6 +773,7 @@ function Messages(client, formateur, util) this.util = util this.conversations = new Array() // les conversations, la première représente la conversation principale + this.nouvelleConversation(0) this.trollIdCourant = 0 @@ -791,10 +801,17 @@ Messages.prototype.getJSONrafraichirMessages = function() Messages.prototype.getJSONConversations = function() { - var clientConv = this.client.getJSONConversations() - for (var i = 1; i < this.conversations.length; i++) + var clientConv = [] + + for (var i = 0; i < this.client.conversations.length; i++) { - clientConv[i-1]["last_message_id"] = this.conversations[i].idDernierMessageAffiche + clientConv.push( + { + root : this.client.conversations[i].root, + page : this.client.conversations[i].page, + last_message_id : this.conversations[i + 1] == undefined ? 0 : this.conversations[i + 1].idDernierMessageAffiche + } + ) } return clientConv } @@ -877,7 +894,8 @@ Messages.prototype.nouvelleConversation = function(num, funFermer, funLien) { var thisMessages = this - this.conversations[num] = new Conversation(num, this.util, this.formateur, this.client) + this.conversations[num] = new Conversation(num, this.util, this.formateur, this.client) + if (funFermer != undefined) this.conversations[num].eventFermer(funFermer) if (funLien != undefined)