4 * Contient la base javascript pour le site euphorik.ch.
5 * Chaque page possède son propre fichier js nommé "page<nom de la page>.js".
13 * Normalement 'const' à la place de 'var' mais non supporté par IE7.
16 nbMessageAffiche : 10, // (par page)
17 pseudoDefaut : "<nick>",
18 tempsAffichageMessageDialogue : 4000, // en ms
20 "smile" : [/:\)/g, /:-\)/g],
21 "bigsmile" : [/:D/g, /:-D/g],
22 "clin" : [/;\)/g, /;-\)/g],
23 "cool" : [/8\)/g, /8-\)/g],
24 "eheheh" : [/:P/g, /:-P/g],
25 "lol" : [/\[-lol\]/g],
26 "spliff" : [/\[-spliff\]/g],
27 "oh" : [/:o/g, /:O/g],
28 "heink" : [/\[-heink\]/g],
29 "hum" : [/\[-hum\]/g],
30 "boh" : [/\[-boh\]/g],
31 "sniff" : [/:\(/g, /:-\(/g],
32 "triste" : [/\[-triste\]/g],
33 "pascontent" : [/>\(/g, />\(/g],
34 "argn" : [/\[-argn\]/g],
35 "redface" : [/\[-redface\]/g],
36 "bunny" : [/\[-lapin\]/g],
37 "chat" : [/\[-chat\]/g],
38 "renne" : [/\[-renne\]/g],
39 "star" : [/\[-star\]/g],
40 "kirby" : [/\[-kirby\]/g],
41 "slurp" : [/\[-slurp\]/g],
42 "agreed" : [/\[-agreed\]/g],
43 "dodo" : [/\[-dodo\]/g],
48 ///////////////////////////////////////////////////////////////////////////////////////////////////
50 String
.prototype.trim = function()
52 return jQuery
.trim(this) // anciennement : this.replace(/^\s+|\s+$/g, "");
55 String
.prototype.ltrim = function()
57 return this.replace(/^\s+/, "");
60 String
.prototype.rtrim = function()
62 return this.replace(/\s+$/, "");
65 ///////////////////////////////////////////////////////////////////////////////////////////////////
68 * Cette classe regroupe des fonctions utilitaires (helpers).
72 $("#info .fermer").click(function(){
73 $("#info").slideUp(50)
77 var messageType
= {informatif: 0, question: 1, erreur: 2}
80 * Affiche une boite de dialogue avec un message à l'intérieur.
81 * @param message le message (string)
82 * @param type voir 'messageType'. par défaut messageType.informatif
83 * @param les boutons sous la forme d'un objet ou les clefs sont les labels des boutons
84 * et les valeurs les fonctions executées lorsqu'un bouton est activé.
86 Util
.prototype.messageDialogue = function(message
, type
, boutons
)
88 if (type
== undefined)
89 type
= messageType
.informatif
91 if (this.timeoutMessageDialogue
!= undefined)
92 clearTimeout(this.timeoutMessageDialogue
)
94 var fermer = function(){$("#info").slideUp(100)}
97 $("#info .message").html(message
)
100 case messageType
.informatif : $("#info #icone").attr("class", "information"); break
101 case messageType
.question : $("#info #icone").attr("class", "interrogation"); break
102 case messageType
.erreur : $("#info #icone").attr("class", "exclamation"); break
104 $("#info .boutons").html("")
105 for (var b
in boutons
)
106 $("#info .boutons").append("<div>" + b
+ "</div>").find("div:last").click(boutons
[b
]).click(fermer
)
108 $("#info").slideDown(200)
109 this.timeoutMessageDialogue
= setTimeout(fermer
, conf
.tempsAffichageMessageDialogue
)
113 * Utilisé pour l'envoie de donnée avec la méthode ajax de jQuery.
115 Util
.prototype.jsonVersAction = function(json
)
117 return {action : JSON
.stringify(json
) }
120 Util
.prototype.md5 = function(chaine
)
122 return hex_md5(chaine
)
125 // pompé de http://www.faqts.com/knowledge_base/view.phtml/aid/13562/fid/130
126 Util
.prototype.setSelectionRange = function(input
, selectionStart
, selectionEnd
)
128 if (input
.setSelectionRange
)
131 input
.setSelectionRange(selectionStart
, selectionEnd
)
133 else if (input
.createTextRange
)
135 var range
= input
.createTextRange()
137 range
.moveEnd('character', selectionEnd
)
138 range
.moveStart('character', selectionStart
)
143 Util
.prototype.setCaretToEnd = function(input
)
145 this.setSelectionRange(input
, input
.value
.length
, input
.value
.length
)
147 Util
.prototype.setCaretToBegin = function(input
)
149 this.setSelectionRange(input
, 0, 0)
151 Util
.prototype.setCaretToPos = function(input
, pos
)
153 this.setSelectionRange(input
, pos
, pos
)
155 Util
.prototype.selectString = function(input
, string
)
157 var match
= new RegExp(string
, "i").exec(input
.value
)
160 this.setSelectionRange (input
, match
.index
, match
.index
+ match
[0].length
)
163 Util
.prototype.replaceSelection = function(input
, replaceString
) {
164 if (input
.setSelectionRange
)
166 var selectionStart
= input
.selectionStart
167 var selectionEnd
= input
.selectionEnd
168 input
.value
= input
.value
.substring(0, selectionStart
) + replaceString
+ input
.value
.substring(selectionEnd
)
170 if (selectionStart
!= selectionEnd
) // has there been a selection
171 this.setSelectionRange(input
, selectionStart
, selectionStart
+ replaceString
.length
)
173 this.setCaretToPos(input
, selectionStart
+ replaceString
.length
)
175 else if (document
.selection
)
177 var range
= document
.selection
.createRange();
178 if (range
.parentElement() == input
)
180 var isCollapsed
= range
.text
== ''
181 range
.text
= replaceString
184 // there has been a selection
185 // it appears range.select() should select the newly
186 // inserted text but that fails with IE
187 range
.moveStart('character', -replaceString
.length
);
194 Util
.prototype.rot13 = function(chaine
)
196 var ACode
= 'A'.charCodeAt(0)
197 var aCode
= 'a'.charCodeAt(0)
198 var MCode
= 'M'.charCodeAt(0)
199 var mCode
= 'm'.charCodeAt(0)
200 var ZCode
= 'Z'.charCodeAt(0)
201 var zCode
= 'z'.charCodeAt(0)
203 var f = function(ch
, pos
) {
204 if (pos
== ch
.length
)
207 var c
= ch
.charCodeAt(pos
);
208 return String
.fromCharCode(
210 (c
>= ACode
&& c
<= MCode
|| c
>= aCode
&& c
<= mCode
? 13 :
211 (c
> MCode
&& c
<= ZCode
|| c
> mCode
&& c
<= zCode
? -13 : 0))
217 ///////////////////////////////////////////////////////////////////////////////////////////////////
221 this.pageCourante
= null
225 Pages
.prototype.ajouterPage = function(page
)
227 page
.pages
= this // la magie des langages dynamiques : le foutoire
228 this.pages
[page
.nom
] = page
231 Pages
.prototype.afficherPage = function(nomPage
, forcerChargement
)
233 if (forcerChargement
== undefined) forcerChargement
= false
235 var page
= this.pages
[nomPage
]
236 if (page
== undefined || (!forcerChargement
&& page
== this.pageCourante
)) return
238 if (this.pageCourante
!= null && this.pageCourante
.decharger
)
239 this.pageCourante
.decharger()
241 $("#menu div").removeClass("courante")
242 $("#menu div." + nomPage
).addClass("courante")
244 this.pageCourante
= page
245 $("#page").html(this.pageCourante
.contenu()).removeClass().addClass(this.pageCourante
.nom
)
247 if (this.pageCourante
.charger
)
248 this.pageCourante
.charger()
251 ///////////////////////////////////////////////////////////////////////////////////////////////////
255 this.smiles
= conf
.smiles
256 this.protocoles
= "http|https|ed2k"
258 this.regexUrl
= new RegExp("(?:(?:" + this.protocoles
+ ")://|www\\.)[^ ]*", "gi")
259 this.regexImg
= new RegExp("^.*?\\.(gif|jpg|png|jpeg|bmp|tiff)$", "i")
260 this.regexDomaine
= new RegExp("^(?:(?:" + this.protocoles
+ ")://|www\\.).*?([^/.]+\\.[^/.]+)(?:$|/).*$", "i")
261 this.regexTestProtocoleExiste
= new RegExp("^(?:" + this.protocoles
+ ")://.*$", "i")
262 this.regexNomProtocole
= new RegExp("^(.*?)://")
266 * Formate un pseudo saise par l'utilisateur.
267 * @param pseudo le pseudo brut
268 * @return le pseudo filtré
270 Formateur
.prototype.filtrerInputPseudo = function(pseudo
)
272 return pseudo
.replace(/{|}/g, "").trim()
275 Formateur
.prototype.getSmilesHTML = function()
278 for (var sNom
in this.smiles
)
280 XHTML
+= "<img class=\"" + sNom
+ "\" src=\"img/smileys/" + sNom
+ ".gif\" />"
286 * Formatage complet d'un texte.
288 * @pseudo facultatif, permet de contruire le label des images sous la forme : "<Pseudo> : <Message>"
290 Formateur
.prototype.traitementComplet = function(M
, pseudo
)
292 return this.traiterLiensConv(this.traiterSmiles(this.traiterURL(this.remplacerBalisesHTML(M
), pseudo
)))
296 * Transforme les liens en entités clickables.
297 * Un lien vers une conversation permet d'ouvrire celle ci, elle se marque comme ceci dans un message :
298 * "{5F}" ou 5F est la racine de la conversation.
299 * Ce lien sera transformer en <span class="lienConv">{5F}</span> pouvant être clické pour créer la conv 5F.
301 Formateur
.prototype.traiterLiensConv = function(M
)
307 return "<span class=\"lienConv\">" + lien
+ "</span>"
313 * FIXME : Cette méthode est attrocement lourde ! A optimiser.
314 * moyenne su échantillon : 234ms
316 Formateur
.prototype.traiterSmiles = function(M
)
318 for (var sNom
in this.smiles
)
320 ss
= this.smiles
[sNom
]
321 for (var i
= 0; i
< ss
.length
; i
++)
322 M
= M
.replace(ss
[i
], "<img src=\"img/smileys/" + sNom
+ ".gif\" />")
327 Formateur
.prototype.remplacerBalisesHTML = function(M
)
329 return M
.replace(/</g
, "<").replace(/>/g
, ">")
332 Formateur
.prototype.traiterURL = function(M
, pseudo
)
336 var traitementUrl = function(url
)
338 // si ya pas de protocole on rajoute "http://"
339 if (!thisFormateur
.regexTestProtocoleExiste
.test(url
))
340 url
= "http://" + url
341 var extension
= thisFormateur
.getShort(url
)
342 return "<a " + (extension
[1] ? "title=\"" + (pseudo
== undefined ? "" : thisFormateur
.traiterPourFenetreLightBox(pseudo
, url
) + ": ") + thisFormateur
.traiterPourFenetreLightBox(M
, url
) + "\"" + " rel=\"lightbox\"" : "") + " href=\"" + url
+ "\" >[" + extension
[0] + "]</a>"
344 return M
.replace(this.regexUrl
, traitementUrl
)
348 * Renvoie une version courte de l'url.
349 * par exemple : http://en.wikipedia.org/wiki/Yakov_Smirnoff devient wikipedia.org
351 Formateur
.prototype.getShort = function(url
)
353 var estUneImage
= false
354 var versionShort
= null
355 var rechercheImg
= this.regexImg
.exec(url
)
357 if (rechercheImg
!= null)
359 versionShort
= rechercheImg
[1].toLowerCase()
360 if (versionShort
== "jpeg") versionShort
= "jpg" // jpeg -> jpg
365 var rechercheDomaine
= this.regexDomaine
.exec(url
)
366 if (rechercheDomaine
!= null && rechercheDomaine
.length
>= 2)
367 versionShort
= rechercheDomaine
[1]
370 var nomProtocole
= this.regexNomProtocole
.exec(url
)
371 if (nomProtocole
!= null && nomProtocole
.length
>= 2)
372 versionShort
= nomProtocole
[1]
376 return [versionShort
== null ? "url" : versionShort
, estUneImage
]
380 * Traite les pseudo et messages à être affiché dans le titre d'une image visualisé avec lightbox.
382 Formateur
.prototype.traiterPourFenetreLightBox = function(M
, urlCourante
)
385 var traitementUrl = function(url
)
387 return "[" + thisFormateur
.getShort(url
)[0] + (urlCourante
== url
? "*" : "") + "]"
390 return this.remplacerBalisesHTML(M
).replace(this.regexUrl
, traitementUrl
)
394 ///////////////////////////////////////////////////////////////////////////////////////////////////
396 // les statuts possibes du client
398 // mode enregistré, peut poster des messages et modifier son profile
400 // mode identifié, peut poster des messages mais n'a pas accès au profile
401 auth_not_registered : 1,
402 // mode déconnecté, ne peut pas poster de message
406 function Client(util
)
411 this.regexCookie
= new RegExp("^cookie=([^;]*)")
413 // données personnels
414 this.resetDonneesPersonnelles()
416 this.setStatut(statutType
.deconnected
)
419 Client
.prototype.resetDonneesPersonnelles = function()
422 this.pseudo
= conf
.pseudoDefaut
426 this.css
= $("link#cssPrincipale").attr("href")
427 this.nickFormat
= "nick"
428 this.cookie
= undefined
430 this.pagePrincipale
= 1
431 this.ekMaster
= false
433 // les conversations, une conversation est un objet possédant les attributs suivants :
436 this.conversations
= new Array()
439 Client
.prototype.setCss = function(css
)
441 if (this.css
== css
|| css
== "")
445 $("link#cssPrincipale").attr("href", this.css
)
449 Client
.prototype.pageSuivante = function(numConv
)
451 if (numConv
< 0 && this.pagePrincipale
> 1)
452 this.pagePrincipale
-= 1
453 else if (this.conversations
[numConv
].page
> 1)
454 this.conversations
[numConv
].page
-= 1
457 Client
.prototype.pagePrecedente = function(numConv
)
460 this.pagePrincipale
+= 1
462 this.conversations
[numConv
].page
+= 1
466 * Définit la première page pour la conversation donnée.
467 * @return true si la page a changé sinon false
469 Client
.prototype.goPremierePage = function(numConv
)
473 if (this.pagePrincipale
== 1)
475 this.pagePrincipale
= 1
479 if (this.conversations
[numConv
].page
== 1)
481 this.conversations
[numConv
].page
= 1
487 * Ajoute une conversation à la vue de l'utilisateur.
488 * Le profile de l'utilisateur est directement sauvegardé sur le serveur.
489 * @param racines la racine de la conversation (integer)
490 * @return true si la conversation a été créée sinon false (par exemple si la conv existe déjà)
492 Client
.prototype.ajouterConversation = function(racine
)
494 // vérification s'il elle n'existe pas déjà
495 for (var i
= 0; i
< this.conversations
.length
; i
++)
496 if (this.conversations
[i
].root
== racine
)
499 this.conversations
.push({root : racine
, page : 1})
503 Client
.prototype.supprimerConversation = function(num
)
505 if (num
< 0 || num
>= this.conversations
.length
) return
507 // décalage TODO : supprimer le dernier élément
508 for (var i
= num
; i
< this.conversations
.length
- 1; i
++)
509 this.conversations
[i
] = this.conversations
[i
+1]
510 this.conversations
.pop()
513 Client
.prototype.getJSONLogin = function(login
, password
)
516 "action" : "authentification",
518 "password" : password
522 Client
.prototype.getJSONLoginCookie = function()
525 "action" : "authentification",
526 "cookie" : this.cookie
531 * le couple (login, password) est facultatif. S'il n'est pas fournit alors il ne sera pas possible
532 * de s'autentifier avec (login, password).
534 Client
.prototype.getJSONEnregistrement = function(login
, password
)
536 var mess
= { "action" : "register" }
538 if (login
!= undefined && password
!= undefined)
540 mess
["login"] = login
541 mess
["password"] = password
547 Client
.prototype.getJSONConversations = function()
549 var conversations
= new Array()
550 for (var i
= 0; i
< this.conversations
.length
; i
++)
551 conversations
.push({ "root" : this.conversations
[i
].root
, "page" : this.conversations
[i
].page
})
555 Client
.prototype.getJSONProfile = function()
558 "action" : "set_profile",
559 "cookie" : this.cookie
,
560 "login" : this.login
,
561 "password" : this.password
,
562 "nick" : this.pseudo
,
563 "email" : this.email
,
565 "nick_format" : this.nickFormat
,
566 "main_page" : this.pagePrincipale
< 1 ? 1 : this.pagePrincipale
,
567 "conversations" : this.getJSONConversations()
572 * Renvoie null si pas définit.
574 Client
.prototype.getCookie = function()
576 var cookie
= this.regexCookie
.exec(document
.cookie
)
577 if (cookie
== null) this.cookie
= null
578 else this.cookie
= cookie
[1]
581 Client
.prototype.delCookie = function()
583 document
.cookie
= "cookie=; max-age=0"
586 Client
.prototype.setCookie = function(cookie
)
588 if (this.cookie
== null)
592 "cookie="+this.cookie
+
593 "; max-age=" + (60 * 60 * 24 * 365)
596 Client
.prototype.authentifie = function()
598 return this.statut
== statutType
.auth_registered
|| this.statut
== statutType
.auth_not_registered
601 Client
.prototype.setStatut = function(statut
)
603 // conversation en "enum" si en "string"
604 if (typeof(statut
) == "string")
607 statut
== "auth_registered" ?
608 statutType
.auth_registered :
609 (statut
== "auth_not_registered" ? statutType
.auth_not_registered : statutType
.deconnected
)
612 if (statut
== this.statut
) return
619 * Effectue la connexion vers le serveur.
620 * Cette fonction est bloquante tant que la connexion n'a pas été établie.
621 * S'il existe un cookie en local on s'authentifie directement avec lui.
622 * Si il n'est pas possible de s'authentifier alors on affiche un captcha anti-bot.
624 Client
.prototype.connexionCookie = function()
627 if (this.cookie
== null) return false;
628 return this.connexion(this.getJSONLoginCookie())
631 Client
.prototype.connexionLogin = function(login
, password
)
633 return this.connexion(this.getJSONLogin(login
, password
))
636 Client
.prototype.enregistrement = function(login
, password
)
638 if (this.authentifie())
641 this.password
= password
644 this.setStatut(statutType
.auth_registered
)
651 return this.connexion(this.getJSONEnregistrement(login
, password
))
655 Client
.prototype.connexion = function(messageJson
)
657 ;;; dumpObj(messageJson
)
665 data: this.util
.jsonVersAction(messageJson
),
670 if (data
["reply"] == "error")
671 thisClient
.util
.messageDialogue(data
["error_message"])
673 thisClient
.chargerDonnees(data
)
677 return this.authentifie()
680 Client
.prototype.deconnexion = function()
684 this.resetDonneesPersonnelles()
685 this.setStatut(statutType
.deconnected
) // deconnexion
688 Client
.prototype.chargerDonnees = function(data
)
690 // la modification du statut qui suit met à jour le menu, le menu dépend (page admin)
691 // de l'état ekMaster
692 this.ekMaster
= data
["ek_master"] != undefined ? data
["ek_master"] : false
694 this.setStatut(data
["status"])
696 if (this.authentifie())
698 this.cookie
= data
["cookie"]
702 this.login
= data
["login"]
703 this.pseudo
= data
["nick"]
704 this.email
= data
["email"]
705 this.setCss(data
["css"])
706 this.nickFormat
= data
["nick_format"]
708 // la page de la conversation principale
709 this.pagePrincipale
= data
["main_page"] == undefined ? 1 : data
["main_page"]
712 this.conversations
= data
["conversations"]
717 * Met à jour les données personne sur serveur.
718 * @param async de manière asynchrone ? défaut = true
719 * @return false si le flush n'a pas pû se faire sinon true
721 Client
.prototype.flush = function(async
)
723 if (async
== undefined)
726 if (!this.authentifie())
729 var thisClient
= this
732 ;;; dumpObj(this.getJSONProfile())
739 data: this.util
.jsonVersAction(this.getJSONProfile()),
744 if (data
["reply"] == "error")
746 thisClient
.util
.messageDialogue(data
["error_message"])
756 Client
.prototype.majMenu = function()
758 // TODO : à virer : ne plus changer de style de display ... spa beau .. ou trouver une autre méthode
759 var displayType
= this.css
== "css/3/euphorik.css" ? "block" : "inline" //this.client
761 $("#menu .admin").css("display", this.ekMaster
? "inline" : "none")
763 // met à jour le menu
764 if (this.statut
== statutType
.auth_registered
)
766 $("#menu .profile").css("display", displayType
).text("profile")
767 $("#menu .logout").css("display", displayType
)
768 $("#menu .register").css("display", "none")
770 else if (this.statut
== statutType
.auth_not_registered
)
772 $("#menu .profile").css("display", "none")
773 $("#menu .logout").css("display", displayType
)
774 $("#menu .register").css("display", displayType
)
778 $("#menu .profile").css("display", displayType
).text("login")
779 $("#menu .logout").css("display", "none")
780 $("#menu .register").css("display", displayType
)
784 Client
.prototype.slap = function(userId
, raison
)
786 var thisClient
= this
792 data: this.util
.jsonVersAction(
795 "cookie" : thisClient
.cookie
,
802 if (data
["reply"] == "error")
803 thisClient
.util
.messageDialogue(data
["error_message"])
808 Client
.prototype.ban = function(userId
, raison
, minutes
)
810 var thisClient
= this
812 // par défaut un ban correspond à 3 jours
813 if (typeof(minutes
) == "undefined")
814 minutes
= 60 * 24 * 3
820 data: this.util
.jsonVersAction(
823 "cookie" : thisClient
.cookie
,
824 "duration" : minutes
,
831 if (data
["reply"] == "error")
832 thisClient
.util
.messageDialogue(data
["error_message"])
837 Client
.prototype.kick = function(userId
, raison
)
839 this.ban(userId
, raison
, 15)
842 ///////////////////////////////////////////////////////////////////////////////////////////////////
845 * classe permettant de gérer les événements (push serveur).
848 function PageEvent(page
, util
)
853 // l'objet JSONHttpRequest représentant la connexion d'attente
854 this.attenteCourante
= null
858 * Arrête l'attente courante s'il y en a une.
860 PageEvent
.prototype.stopAttenteCourante = function()
862 if (this.attenteCourante
!= null)
863 this.attenteCourante
.abort()
867 * Attend un événement lié à la page.
868 * @funSend une fonction renvoyant les données json à envoyer
869 * @funReceive une fonction qui accepte un paramètre correspondant au données reçues
871 PageEvent
.prototype.waitEvent = function(funSend
, funReceive
)
873 var thisPageEvent
= this
875 this.stopAttenteCourante()
877 // on doit conserver l'ordre des valeurs de l'objet JSON (le serveur les veux dans l'ordre définit dans le protocole)
878 // TODO : ya pas mieux ?
881 "action" : "wait_event",
884 var poulpe
= funSend()
886 dataToSend
[v
] = poulpe
[v
]
888 ;;; dumpObj(dataToSend
)
889 this.attenteCourante
= jQuery
.ajax({
893 data: this.util
.jsonVersAction(dataToSend
),
901 // rappel de la fonction dans 100 ms
902 setTimeout(function(){ thisPageEvent
.waitEvent(funSend
, funReceive
) }, 100);
905 function(XMLHttpRequest
, textStatus
, errorThrown
)
907 setTimeout(function(){ thisPageEvent
.rafraichirMessages(funSend
, funReceive
) }, 1000);
913 ///////////////////////////////////////////////////////////////////////////////////////////////////
915 function initialiserListeStyles(client
)
917 $("#menuCss").change(
920 client
.setCss("css/" + $("option:selected", this).attr("value") + "/euphorik.css")
925 // charge dynamiquement le script de debug
926 ;;; jQuery
.ajax({async : false, url : "js/debug.js", dataType : "script"})
932 var util
= new Util()
933 var client
= new Client(util
)
934 var pages
= new Pages()
935 var formateur
= new Formateur()
937 // connexion vers le serveur (utilise un cookie qui traine)
938 client
.connexionCookie()
940 initialiserListeStyles(client
)
942 // TODO : pourquoi $(document).unload ne fonctionne pas ?
943 $(window
).unload(function(){client
.flush()})
945 $("#menu .minichat").click(function(){ pages
.afficherPage("minichat") })
946 $("#menu .admin").click(function(){ pages
.afficherPage("admin") })
947 $("#menu .profile").click(function(){ pages
.afficherPage("profile") })
948 $("#menu .logout").click(function(){
949 util
.messageDialogue("Êtes-vous sur de vouloir vous délogger ?", messageType
.question
,
952 client
.deconnexion();
953 pages
.afficherPage("minichat", true)
959 $("#menu .register").click(function(){ pages
.afficherPage("register") })
960 $("#menu .about").click(function(){ pages
.afficherPage("about") })
962 pages
.ajouterPage(new PageMinichat(client
, formateur
, util
))
963 pages
.ajouterPage(new PageAdmin(client
, formateur
, util
))
964 pages
.ajouterPage(new PageProfile(client
, formateur
, util
))
965 pages
.ajouterPage(new PageRegister(client
, formateur
, util
))
966 pages
.ajouterPage(new PageAbout(client
, formateur
, util
))
967 pages
.afficherPage("minichat")