/**\r
* Représente l'ensemble des conversations affichés.\r
*/\r
-euphorik.Conversations = function(client, formateur, util, fragment) {\r
+euphorik.Conversations = function(client, formater, util, fragment) {\r
this.client = client;\r
- this.formateur = formateur;\r
+ this.formater = formater;\r
this.util = util;\r
this.fragment = fragment;\r
\r
euphorik.Conversations.prototype.mettreAJourFragment = function() {\r
conv = [];\r
for(var i = 1; i < this.conversations.length; i++) {\r
- conv.push(this.conversations[i].racine.id)\r
+ conv.push(this.conversations[i].racine.id);\r
}\r
this.fragment.setVal("conv", conv);\r
this.fragment.write();\r
-}\r
+};\r
\r
/**\r
* Enlève tous les messages auquel l'utilisateur souhaite répondre.\r
}\r
\r
if (mess2 && mess2.racineId !== mess.racineId) {\r
- this.util.messageDialogue("Impossible de répondre à deux messages ne faisant pas partie de la même conversation");\r
+ this.util.messageDialog("Impossible de répondre à deux messages ne faisant pas partie de la même conversation");\r
return;\r
}\r
\r
};\r
\r
euphorik.Conversations.prototype.getJSONConversations = function() {\r
- var thisConversations = this\r
+ var thisConversations = this;\r
var clientConv = [];\r
\r
this.client.conversations.each(function(i, conv) {\r
var message = \r
new euphorik.Message(\r
this.client,\r
- this.formateur,\r
+ this.formater,\r
element\r
);\r
\r
}\r
this.conversations[num].supprimer();\r
\r
- // décalage TODO : supprimer le dernier élément \r
+ // les numéros sont réassigné\r
for (var i = num; i < this.conversations.length - 1; i++) {\r
this.conversations[i] = this.conversations[i+1];\r
this.conversations[i].num -= 1;\r
if (this.client.ajouterConversation(racine)) {\r
this.rafraichirMessages(true);\r
} else {\r
- this.util.messageDialogue("Cette conversation est déjà ouverte");\r
+ this.util.messageDialog("Cette conversation est déjà ouverte");\r
}\r
};\r
\r
conv.idDernierMessageAffiche = 0;\r
});\r
}\r
+
+ thisConversations.util.showWaitBar(); // pour faire patienter le user :)
\r
this.comet.waitEvent(\r
function() { return thisConversations.getJSONrafraichirMessages(); },\r
"new_troll" :\r
function(data) {\r
thisConversations.trollIdCourant = data.troll_id;\r
- $("#trollCourant .troll").html(thisConversations.formateur.traitementComplet(data.content)).unbind("click").click(\r
+ $("#trollCourant .troll").html(thisConversations.formater.traitementComplet(data.content)).unbind("click").click(\r
function() {\r
thisConversations.ouvrirConversation(data.message_id);\r
}\r
$("#trollCourant .troll a[@rel*=lightbox]").lightBox();\r
},\r
"new_messages" :\r
- function(data) {\r
+ function(data) {
+ \r
if (vider) {\r
thisConversations.viderMessages();\r
}\r
// ajoute les messages reçus à leur conversation respective\r
data.conversations.each(function(numConv, conv) {\r
if (!thisConversations.ajouterMessages(conv, numConv)) {\r
- thisConversations.util.messageDialogue("La conversation {" + thisConversations.client.conversations[numConv - 1].root.toString(36) + "} n'existe pas");\r
+ thisConversations.util.messageDialog("La conversation {" + thisConversations.client.conversations[numConv - 1].root.toString(36) + "} n'existe pas");\r
thisConversations.client.supprimerConversation(numConv - 1);\r
}\r
});\r
thisConversations.afficherMessagesRepondConversations();\r
}\r
\r
- vider = false;\r
+ vider = false;
+
+ thisConversations.util.hideWaitBar();\r
}\r
}\r
);\r