this.login = ""\r
this.password = ""\r
this.email = ""\r
- this.css = jQuery("link#cssPrincipale").attr("href")\r
+ this.css = jQuery("link#cssPrincipale").attr("href")
+
+ // les conversations, une conversation est un objet possédant les attributs suivants :
+ // - racine (entier)
+ // - page (entier)
+ this.conversations = new Array()\r
}
Client.prototype.setCss = function(css)
this.css = css
jQuery("link#cssPrincipale").attr("href", this.css)
this.majMenu()
-
- /* enregistement automatique..
- if (!this.identifie())
- if (!this.enregistrement())
- return
- */
+
if (this.identifie())
this.flush()
+}
+
+/**
+ * Ajoute une conversation à la vue de l'utilisateur.
+ * Le profile de l'utilisateur est directement sauvegardé sur le serveur.
+ * @param racines la racine de la conversation
+ */
+Client.prototype.ajouterConversation = function(racine)
+{
+ this.conversations.push({racine : racine, page : 1})
+ this.flush()
}\r
Client.prototype.getXMLlogin = function(login, password)
nodeCSS.appendChild(XMLDocument.createTextNode(this.css))
XMLDocument.documentElement.appendChild(nodeCSS)
+ // mémorise les conversations affichées
+ if (this.conversations.length > 0)
+ {
+ var nodeConversations = XMLDocument.createElement("conversations")
+ XMLDocument.documentElement.appendChild(nodeConversations)
+ for (var i = 0; i < this.conversations.length; i++)
+ {
+ var nodeConv = XMLDocument.createElement("conversation")
+ nodeConversations.appendChild(nodeConv)
+
+ var nodeRacine = XMLDocument.createElement("racine")
+ nodeRacine.appendChild(XMLDocument.createTextNode(this.conversations[i].racine))
+ nodeConv.appendChild(nodeRacine)
+
+ var nodePage = XMLDocument.createElement("page")
+ nodePage.appendChild(XMLDocument.createTextNode(this.conversations[i].page))
+ nodeConv.appendChild(nodePage)
+ }
+ }
+
return XMLDocument
}
Client.prototype.flush = function()
{
thisClient = this
- //thisClient.util.log(this.util.xmlVersAction(this.getXMLProfile()).action)
+ //thisClient.util.log(this.util.xmlVersAction(this.getXMLProfile()).action)
jQuery.ajax(
{
async: true,