X-Git-Url: http://git.euphorik.ch/?p=euphorik.git;a=blobdiff_plain;f=js%2FpageMinichat%2FpageMinichat.js;fp=js%2FpageMinichat%2FpageMinichat.js;h=792f64a7b85b7a1182c6afbea61704dfa5c782fa;hp=2f53eb0c14d7988cae975cd319982f5d84fc3cc0;hb=217c4d7a0d5f9fee3a8ef0a05ab8506c7f39d5e5;hpb=bd9caeefe3cfc9b4194c31052b0ddd4da26f604c diff --git a/js/pageMinichat/pageMinichat.js b/js/pageMinichat/pageMinichat.js index 2f53eb0..792f64a 100755 --- a/js/pageMinichat/pageMinichat.js +++ b/js/pageMinichat/pageMinichat.js @@ -68,9 +68,11 @@ euphorik.PageMinichat.prototype.charger = function() { $("#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 = new euphorik.Conversations(this.client, this.formateur, this.util, this.fragment); - this.conversations.rafraichirMessages(true); + this.chargerConversationsFragment(); + + this.conversations.rafraichirMessages(true); this.util.setCaretToEnd($("form#posterMessage input.message")[0]); @@ -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) {