X-Git-Url: http://git.euphorik.ch/?a=blobdiff_plain;f=js%2Feuphorik.js;h=5a15c00e3fd1952af5833e6e35da8ef984a9eb07;hb=bfb430d094eb0021777302c1191642eab4077e78;hp=4b56fa3e01eb18a99bc7d0aa2eb18eeb8470f1b8;hpb=a2f6d159387e456847fb4e7607b4663ab8fa94fc;p=euphorik.git diff --git a/js/euphorik.js b/js/euphorik.js index 4b56fa3..5a15c00 100755 --- a/js/euphorik.js +++ b/js/euphorik.js @@ -13,7 +13,7 @@ * Normalement 'const' à la place de 'var' mais non supporté par IE7. */ var conf = { - nbMessageAffiche : 10, // (par page) + nbMessageAffiche : 40, // (par page) pseudoDefaut : "", tempsAffichageMessageDialogue : 4000, // en ms smiles : { @@ -384,7 +384,7 @@ Formateur.prototype.traiterPourFenetreLightBox = function(M, urlCourante) thisFormateur = this var traitementUrl = function(url) { - return "[" + thisFormateur.getShort(url)[0] + (urlCourante == url ? ": image courante" : "") + "]" + return "[" + thisFormateur.getShort(url)[0] + (urlCourante == url ? "*" : "") + "]" } return this.remplacerBalisesHTML(M).replace(this.regexUrl, traitementUrl) @@ -413,10 +413,7 @@ function Client(util) // données personnels this.resetDonneesPersonnelles() - this.setStatut(statutType.deconnected) - - // le dernier message d'erreur recut du serveur (par exemple une connexion foireuse : "login impossible") - this.dernierMessageErreur = "" + this.setStatut(statutType.deconnected) } Client.prototype.resetDonneesPersonnelles = function() @@ -428,6 +425,7 @@ Client.prototype.resetDonneesPersonnelles = function() this.email = "" this.css = $("link#cssPrincipale").attr("href") this.nickFormat = "nick" + this.cookie = undefined this.pagePrincipale = 1 this.ekMaster = false @@ -611,7 +609,7 @@ Client.prototype.setStatut = function(statut) (statut == "auth_not_registered" ? statutType.auth_not_registered : statutType.deconnected) } - if (statut == this.statut) return + if (statut == this.statut) return this.statut = statut this.majMenu() @@ -669,7 +667,10 @@ Client.prototype.connexion = function(messageJson) function(data) { ;;; dumpObj(data) - thisClient.chargerDonnees(data) + if (data["reply"] == "error") + thisClient.util.messageDialogue(data["error_message"]) + else + thisClient.chargerDonnees(data) } } ) @@ -679,9 +680,9 @@ Client.prototype.connexion = function(messageJson) Client.prototype.deconnexion = function() { this.flush(true) - this.delCookie() - this.setStatut(statutType.deconnected) // deconnexion + this.delCookie() this.resetDonneesPersonnelles() + this.setStatut(statutType.deconnected) // deconnexion } Client.prototype.chargerDonnees = function(data) @@ -710,7 +711,6 @@ Client.prototype.chargerDonnees = function(data) // les conversations this.conversations = data["conversations"] } - this.dernierMessageErreur = data["error_message"] } /** @@ -726,7 +726,7 @@ Client.prototype.flush = function(async) if (!this.authentifie()) return false - thisClient = this + var thisClient = this var ok = true ;;; dumpObj(this.getJSONProfile()) @@ -743,7 +743,7 @@ Client.prototype.flush = function(async) ;;; dumpObj(data) if (data["reply"] == "error") { - thisClient.dernierMessageErreur = data["error_message"] + thisClient.util.messageDialogue(data["error_message"]) ok = false } }