X-Git-Url: http://git.euphorik.ch/?p=euphorik.git;a=blobdiff_plain;f=js%2FpageMinichat%2FpageMinichat.js;h=da6ba74fc617b3be57ab66ae79f6d76a562bcf8b;hp=2f53eb0c14d7988cae975cd319982f5d84fc3cc0;hb=7203835bce6f94b6afcc7403694145c829a4f833;hpb=4f15129b495827b1894f8a234cc8f32262233fb1 diff --git a/js/pageMinichat/pageMinichat.js b/js/pageMinichat/pageMinichat.js index 2f53eb0..da6ba74 100755 --- a/js/pageMinichat/pageMinichat.js +++ b/js/pageMinichat/pageMinichat.js @@ -64,14 +64,16 @@ euphorik.PageMinichat.prototype.classes = function() { euphorik.PageMinichat.prototype.charger = function() { thisPage = this; - + $("#posterMessage input.pseudo").val(this.client.pseudo); // cet appel ne doit pas être fait avant l'appel à 'charger' - this.conversations = new euphorik.Conversations(this.client, this.formateur, this.util); - - this.conversations.rafraichirMessages(true); + this.conversations = new euphorik.Conversations(this.client, this.formateur, this.util, this.fragment); + this.chargerConversationsFragment(); + + this.conversations.rafraichirMessages(true); + this.util.setCaretToEnd($("form#posterMessage input.message")[0]); // les outils de bannissement (uniquement pour les ekMaster) @@ -194,12 +196,31 @@ euphorik.PageMinichat.prototype.charger = function() { ); }; +euphorik.PageMinichat.prototype.chargerConversationsFragment = function() { + var thisPageMinichat = this; + + // attention : "conv" doit être un tableau d'entier + try { + var conv = this.fragment.getVal("conv"); + if (conv) { + conv.each(function(i, racine) { + thisPageMinichat.client.ajouterConversation(racine) + }); + } + } catch(e) { + ;; console.log(e) + } +} + euphorik.PageMinichat.prototype.decharger = function() { this.conversations.comet.stopAttenteCourante(); $("body #smiles").remove(); + + this.fragment.delVal("conv") }; + euphorik.PageMinichat.prototype.getJSONMessage = function(pseudo, message) { var repondA = []; objectEach(this.conversations.messagesRepond, function(id) {