From 7f8025543a7a5d614ec47d18026dc0feb3338fdb Mon Sep 17 00:00:00 2001 From: Greg Burri Date: Thu, 1 May 2008 09:37:05 +0000 Subject: [PATCH] MOD correction de bugs (youpi) --- css/common.css | 9 --------- doc/TODO.txt | 2 +- doc/protocole3.txt | 2 +- index.html | 3 +-- js/euphorik.js | 6 +++--- js/pageMinichat.js | 17 ++++++++++++++--- modules/erl/euphorik_protocole.erl | 12 +++++++----- sessions/js.session | 14 ++++---------- 8 files changed, 31 insertions(+), 34 deletions(-) diff --git a/css/common.css b/css/common.css index 1157650..e69de29 100755 --- a/css/common.css +++ b/css/common.css @@ -1,9 +0,0 @@ -#underDevelopment { - position: fixed; - top: 0px; - z-index: 15; - padding: 2px 10px 2px 10px; - background-color: #FF6666; - color: #FFFFFF; - opacity: 0.8; -} \ No newline at end of file diff --git a/doc/TODO.txt b/doc/TODO.txt index 0b32e09..0a26333 100755 --- a/doc/TODO.txt +++ b/doc/TODO.txt @@ -1,7 +1,6 @@ == TODO == === v1.0 === -* Problème de rafraichissement des couleurs des messages auquels on répond * Problème dans l'alternance des couleurs des messages * Rendre compatible IE 7 * Tester avec des caractères accentués sur Firefox, Safari, Opera et IE7. Les messages doivent être envoyés en UTF8. @@ -145,6 +144,7 @@ [ok] Les id ne sont plus passés en base 36 [ok] Flusher le profil lors du déchargement de la page ? -> oui [ok] Envoyer les infos des conversations avec l'attente d'events ? -> oui +[ok] Problème de rafraichissement des couleurs des messages auquels on répond === Bugs === 1 : Critique diff --git a/doc/protocole3.txt b/doc/protocole3.txt index 8b16d6e..3f154a3 100644 --- a/doc/protocole3.txt +++ b/doc/protocole3.txt @@ -113,7 +113,7 @@ c -> s "main_page" : 1, "conversations" : [ { - "racine" : 123, + "root" : 123, "page" : 1 } ] diff --git a/index.html b/index.html index b8a06b2..6ece2b3 100755 --- a/index.html +++ b/index.html @@ -17,8 +17,7 @@ - -
! Under heavy development !
+
diff --git a/js/euphorik.js b/js/euphorik.js index c37ee4c..56c78fd 100755 --- a/js/euphorik.js +++ b/js/euphorik.js @@ -459,10 +459,10 @@ Client.prototype.ajouterConversation = function(racine) { // vérification s'il elle n'existe pas déjà for (var i = 0; i < this.conversations.length; i++) - if (this.conversations[i].racine == racine) + if (this.conversations[i].root == racine) return false - this.conversations.push({racine : racine, page : 1}) + this.conversations.push({root : racine, page : 1}) return true } @@ -514,7 +514,7 @@ Client.prototype.getJSONConversations = function() { var conversations = new Array() for (var i = 0; i < this.conversations.length; i++) - conversations.push({ "racine" : this.conversations[i].racine, "page" : this.conversations[i].page}) + conversations.push({ "root" : this.conversations[i].root, "page" : this.conversations[i].page}) return conversations } diff --git a/js/pageMinichat.js b/js/pageMinichat.js index ec00d7b..d7f343f 100755 --- a/js/pageMinichat.js +++ b/js/pageMinichat.js @@ -409,20 +409,29 @@ Conversation.prototype.flush = function(funClickExtract, funClickLienConv) var idDernierMessageAffiche = jQuery("#conversations #" + this.getId() + " div:first").attr("id") idDernierMessageAffiche = (idDernierMessageAffiche == undefined ? 0 : parseInt(idDernierMessageAffiche, 36)) + // est-ce que le prochain message est pair ? (permet d'alterner le style des messages) + var messagePair = (idDernierMessageAffiche == undefined ? true : + (jQuery("#conversations #" + this.getId() + " div:first").attr("class").search("messagePair") == -1) + ) + // construction de l'XHTML des messages var XHTML = "" for (var i = this.messages.length - 1; i >= 0; i--) if (this.messages[i].id > idDernierMessageAffiche) { var message = this.messages[i] + var XHTMLrepondA = "" for (var id in message.repondA) XHTMLrepondA += this.formateur.traitementComplet(message.repondA[id].pseudo) + "> " XHTMLrepondA = "" + XHTMLrepondA + "" XHTML += - "
" + "
>
" + "[" + message.date + "]" + @@ -430,6 +439,8 @@ Conversation.prototype.flush = function(funClickExtract, funClickLienConv) XHTMLrepondA + "" + (message.systeme ? this.formateur.remplacerBalisesHTML(message.contenu) : this.formateur.traitementComplet(message.contenu, message.pseudo)) + "" + "
" + + messagePair = !messagePair } jQuery("#conversations #" + this.getId()).prepend(XHTML) @@ -626,7 +637,7 @@ Messages.prototype.ajouterMessage = function(element, numConversation) { thisPage.util.replaceSelection( jQuery("form input.message")[0], - "{" + thisMessages.client.conversations[num-1].racine + "}" + "{" + thisMessages.client.conversations[num-1].root + "}" ) } ) diff --git a/modules/erl/euphorik_protocole.erl b/modules/erl/euphorik_protocole.erl index 548f4af..154c7d4 100755 --- a/modules/erl/euphorik_protocole.erl +++ b/modules/erl/euphorik_protocole.erl @@ -70,12 +70,12 @@ profile( {email, Email}, {css, Css}, {main_page, Main_page}, - {conversations, Conversations_json} + {conversations, {array, Conversations_json}} ] ) -> % est-ce que les messages auquel on répond existent ? Conversations = lists:foldr( - fun([struct, {root, Root}, {page, Page}], Acc) -> + fun({struct, [{root, Root}, {page, Page}]}, Acc) -> Message_existe = euphorik_minichat:message_existe(Root), if Message_existe -> [{Root, Page} | Acc]; @@ -105,7 +105,7 @@ wait_event(Data) -> {value, {_, Message_count}} = lists:keysearch(message_count, 1, Data), Main_page = case lists:keysearch(main_page, 1, Data) of {value, {_, P}} -> P; _ -> 1 end, {value, {_, {array, Conversations_json}}} = lists:keysearch(conversations, 1, Data), - Conversations = lists:map(fun({struct, [{racine, Racine}, {page, Page}]}) -> {Racine, Page} end, Conversations_json), + Conversations = lists:map(fun({struct, [{root, Racine}, {page, Page}]}) -> {Racine, Page} end, Conversations_json), User = case euphorik_minichat:user_by_cookie(Cookie) of {ok, U} -> U; _ -> inconnu @@ -251,8 +251,10 @@ json_reponse_login_ok(User) -> lists:map( fun(C) -> {struct, - {root, element(1, C)}, - {page, element(2, C)} + [ + {root, element(1, C)}, + {page, element(2, C)} + ] } end, User#user.conversations diff --git a/sessions/js.session b/sessions/js.session index 9c69bdc..4b4bf8a 100755 --- a/sessions/js.session +++ b/sessions/js.session @@ -1,11 +1,10 @@ # SciTE session file buffer.1.path=/home/gburri/projets/euphorik/js/euphorik.js -buffer.1.position=7787 +buffer.1.position=22818 buffer.2.path=/home/gburri/projets/euphorik/js/pageMinichat.js -buffer.2.position=1044 -buffer.2.current=1 +buffer.2.position=7496 buffer.3.path=/home/gburri/projets/euphorik/js/pageProfile.js buffer.3.position=1 @@ -13,11 +12,6 @@ buffer.3.position=1 buffer.4.path=/home/gburri/projets/euphorik/js/pageRegister.js buffer.4.position=1 -buffer.5.path=/home/gburri/projets/euphorik/css/1/euphorik.css +buffer.5.path=/home/gburri/projets/euphorik/js/debug.js buffer.5.position=1 - -buffer.6.path=/home/gburri/projets/euphorik/css/1/pageMinichat.css -buffer.6.position=1 - -buffer.7.path=/home/gburri/projets/euphorik/css/1/pageProfileRegister.css -buffer.7.position=1 +buffer.5.current=1 -- 2.43.0