MOD présentation des css sous la forme d'une liste box.
[euphorik.git] / js / euphorik.js
1 // coding: utf-8
2
3 /**
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".
6 * Auteur : GBurri
7 * Date : 6.11.2007
8 */
9
10
11 /**
12 * La configuration.
13 * Normalement 'const' à la place de 'var' mais non supporté par IE7.
14 */
15 var conf = {
16 nbMessageAffiche : 10, // (par page)
17 pseudoDefaut : "<nick>",
18 tempsAffichageMessageDialogue : 4000, // en ms
19 smiles : {
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 "oh" : [/:o/g, /:O/g],
26 "pascontent" : [/>\(/g, /&gt;\(/g],
27 "sniff" : [/:\(/g, /:-\(/g],
28 "argn" : [/\[:argn\]/g],
29 "bunny" : [/\[:lapin\]/g],
30 "chat" : [/\[:chat\]/g],
31 "renne" : [/\[:renne\]/g],
32 "lol" : [/\[:lol\]/g],
33 "spliff" : [/\[:spliff\]/g],
34 "star" : [/\[:star\]/g],
35 "triste" : [/\[:triste\]/g],
36 "kirby" : [/\[:kirby\]/g]
37 }
38 }
39
40 ///////////////////////////////////////////////////////////////////////////////////////////////////
41
42 String.prototype.trim = function()
43 {
44 return jQuery.trim(this) // anciennement : this.replace(/^\s+|\s+$/g, "");
45 }
46
47 String.prototype.ltrim = function()
48 {
49 return this.replace(/^\s+/, "");
50 }
51
52 String.prototype.rtrim = function()
53 {
54 return this.replace(/\s+$/, "");
55 }
56
57 ///////////////////////////////////////////////////////////////////////////////////////////////////
58
59 /**
60 * Cette classe regroupe des fonctions utilitaires (helpers).
61 */
62 function Util()
63 {
64 jQuery("#info .fermer").click(function(){
65 jQuery("#info").slideUp(50)
66 })
67 }
68
69 /**
70 * Affiche une boite de dialogue avec un message à l'intérieur.
71 * @param message le message (string)
72 * @param type voir 'messageType'. par défaut messageType.informatif
73 * @param les boutons sous la forme d'un objet ou les clefs sont les labels des boutons
74 * et les valeurs les fonctions executées lorsqu'un bouton est activé.
75 */
76 Util.prototype.messageDialogue = function(message, type, boutons)
77 {
78 if (type == undefined)
79 type = messageType.informatif
80
81 if (this.timeoutMessageDialogue != undefined)
82 clearTimeout(this.timeoutMessageDialogue)
83
84 var fermer = function(){jQuery("#info").slideUp(100)}
85 fermer()
86
87 jQuery("#info .message").html(message)
88 switch(type)
89 {
90 case messageType.informatif : jQuery("#info #icone").attr("class", "information"); break
91 case messageType.question : jQuery("#info #icone").attr("class", "interrogation"); break
92 case messageType.erreur : jQuery("#info #icone").attr("class", "exclamation"); break
93 }
94 jQuery("#info .boutons").html("")
95 for (var b in boutons)
96 jQuery("#info .boutons").append("<div>" + b + "</div>").find("div:last").click(boutons[b]).click(fermer)
97
98 jQuery("#info").slideDown(200)
99 this.timeoutMessageDialogue = setTimeout(fermer, conf.tempsAffichageMessageDialogue)
100 }
101
102 var messageType = {informatif: 0, question: 1, erreur: 2}
103
104 /**
105 * Utilisé pour l'envoie de donnée avec la méthode ajax de jQuery.
106 */
107 Util.prototype.jsonVersAction = function(json)
108 {
109 return {action : JSON.stringify(json) }
110 }
111
112 Util.prototype.md5 = function(chaine)
113 {
114 return hex_md5(chaine)
115 }
116
117 // pompé de http://www.faqts.com/knowledge_base/view.phtml/aid/13562/fid/130
118 Util.prototype.setSelectionRange = function(input, selectionStart, selectionEnd)
119 {
120 if (input.setSelectionRange)
121 {
122 input.focus()
123 input.setSelectionRange(selectionStart, selectionEnd)
124 }
125 else if (input.createTextRange)
126 {
127 var range = input.createTextRange()
128 range.collapse(true)
129 range.moveEnd('character', selectionEnd)
130 range.moveStart('character', selectionStart)
131 range.select()
132 }
133 }
134
135 Util.prototype.setCaretToEnd = function(input)
136 {
137 this.setSelectionRange(input, input.value.length, input.value.length)
138 }
139 Util.prototype.setCaretToBegin = function(input)
140 {
141 this.setSelectionRange(input, 0, 0)
142 }
143 Util.prototype.setCaretToPos = function(input, pos)
144 {
145 this.setSelectionRange(input, pos, pos)
146 }
147 Util.prototype.selectString = function(input, string)
148 {
149 var match = new RegExp(string, "i").exec(input.value)
150 if (match)
151 {
152 this.setSelectionRange (input, match.index, match.index + match[0].length)
153 }
154 }
155 Util.prototype.replaceSelection = function(input, replaceString) {
156 if (input.setSelectionRange)
157 {
158 var selectionStart = input.selectionStart
159 var selectionEnd = input.selectionEnd
160 input.value = input.value.substring(0, selectionStart) + replaceString + input.value.substring(selectionEnd)
161
162 if (selectionStart != selectionEnd) // has there been a selection
163 this.setSelectionRange(input, selectionStart, selectionStart + replaceString.length)
164 else // set caret
165 this.setCaretToPos(input, selectionStart + replaceString.length)
166 }
167 else if (document.selection)
168 {
169 var range = document.selection.createRange();
170 if (range.parentElement() == input)
171 {
172 var isCollapsed = range.text == ''
173 range.text = replaceString
174 if (!isCollapsed)
175 {
176 // there has been a selection
177 // it appears range.select() should select the newly
178 // inserted text but that fails with IE
179 range.moveStart('character', -replaceString.length);
180 range.select();
181 }
182 }
183 }
184 }
185
186 ///////////////////////////////////////////////////////////////////////////////////////////////////
187
188 function Pages()
189 {
190 this.pageCourante = null
191 this.pages = {}
192 }
193
194 Pages.prototype.ajouterPage = function(page)
195 {
196 page.pages = this // la magie des langages dynamiques : le foutoire
197 this.pages[page.nom] = page
198 }
199
200 Pages.prototype.afficherPage = function(nomPage, forcerChargement)
201 {
202 if (forcerChargement == undefined) forcerChargement = false
203
204 var page = this.pages[nomPage]
205 if (page == undefined || (!forcerChargement && page == this.pageCourante)) return
206
207 if (this.pageCourante != null && this.pageCourante.decharger)
208 this.pageCourante.decharger()
209
210 jQuery("#menu div").removeClass("courante")
211 jQuery("#menu div." + nomPage).addClass("courante")
212
213 this.pageCourante = page
214 jQuery("#page").html(this.pageCourante.contenu()).removeClass().addClass(this.pageCourante.nom)
215
216 if (this.pageCourante.charger)
217 this.pageCourante.charger()
218 }
219
220 ///////////////////////////////////////////////////////////////////////////////////////////////////
221
222 function Formateur()
223 {
224 this.smiles = conf.smiles
225 this.protocoles = "http|https|ed2k"
226
227 this.regexUrl = new RegExp("(?:(?:" + this.protocoles + ")://|www\\.)[^ ]*", "gi")
228 this.regexImg = new RegExp("^.*?\\.(gif|jpg|png|jpeg|bmp|tiff)$", "i")
229 this.regexDomaine = new RegExp("^(?:(?:" + this.protocoles + ")://|www\\.).*?([^/.]+\\.[^/.]+)(?:$|/).*$", "i")
230 this.regexTestProtocoleExiste = new RegExp("^(?:" + this.protocoles + ")://.*$", "i")
231 this.regexNomProtocole = new RegExp("^(.*?)://")
232 }
233
234 /**
235 * Formate un pseudo saise par l'utilisateur.
236 * @param pseudo le pseudo brut
237 * @return le pseudo filtré
238 */
239 Formateur.prototype.filtrerInputPseudo = function(pseudo)
240 {
241 return pseudo.replace(/{|}/g, "").trim()
242 }
243
244 Formateur.prototype.getSmilesHTML = function()
245 {
246 var XHTML = ""
247 for (var sNom in this.smiles)
248 {
249 XHTML += "<img class=\"" + sNom + "\" src=\"img/smileys/" + sNom + ".gif\" />"
250 }
251 return XHTML
252 }
253
254 Formateur.prototype.traitementComplet = function(M, pseudo)
255 {
256 return this.traiterLiensConv(this.traiterSmiles(this.traiterURL(this.remplacerBalisesHTML(M), pseudo)))
257 }
258
259 /**
260 * Transforme les liens en entités clickables.
261 * Un lien vers une conversation permet d'ouvrire celle ci, elle se marque comme ceci dans un message :
262 * "{5F}" ou 5F est la racine de la conversation.
263 * Ce lien sera transformer en <span class="lienConv">{5F}</span> pouvant être clické pour créer la conv 5F.
264 */
265 Formateur.prototype.traiterLiensConv = function(M)
266 {
267 return M.replace(
268 /\{\w+\}/g,
269 function(lien)
270 {
271 return "<span class=\"lienConv\">" + lien + "</span>"
272 }
273 )
274 }
275
276 /**
277 * FIXME : Cette méthode est attrocement lourde ! A optimiser.
278 */
279 Formateur.prototype.traiterSmiles = function(M)
280 {
281 for (var sNom in this.smiles)
282 {
283 ss = this.smiles[sNom]
284 for (var i = 0; i < ss.length; i++)
285 M = M.replace(ss[i], "<img src=\"img/smileys/" + sNom + ".gif\" />")
286 }
287 return M
288 }
289
290 Formateur.prototype.remplacerBalisesHTML = function(M)
291 {
292 return M.replace(/</g, "&lt;").replace(/>/g, "&gt;")
293 }
294
295 Formateur.prototype.traiterURL = function(M, pseudo)
296 {
297 thisFormateur = this
298
299 if (pseudo == undefined)
300 pseudo = ""
301
302 var traitementUrl = function(url)
303 {
304 // si ya pas de protocole on rajoute "http://"
305 if (!thisFormateur.regexTestProtocoleExiste.test(url))
306 url = "http://" + url
307 var extension = thisFormateur.getShort(url)
308 return "<a " + (extension[1] ? "title=\"" + thisFormateur.traiterPourFenetreLightBox(pseudo, url) + ": " + thisFormateur.traiterPourFenetreLightBox(M, url) + "\"" + " rel=\"lightbox[groupe]\"" : "") + " href=\"" + url + "\" >[" + extension[0] + "]</a>"
309 }
310 return M.replace(this.regexUrl, traitementUrl)
311 }
312
313 /**
314 * Renvoie une version courte de l'url.
315 * par exemple : http://en.wikipedia.org/wiki/Yakov_Smirnoff devient wikipedia.org
316 */
317 Formateur.prototype.getShort = function(url)
318 {
319 var estUneImage = false
320 var versionShort = null
321 var rechercheImg = this.regexImg.exec(url)
322 //alert(url)
323 if (rechercheImg != null)
324 {
325 versionShort = rechercheImg[1].toLowerCase()
326 if (versionShort == "jpeg") versionShort = "jpg" // jpeg -> jpg
327 estUneImage = true
328 }
329 else
330 {
331 var rechercheDomaine = this.regexDomaine.exec(url)
332 if (rechercheDomaine != null && rechercheDomaine.length >= 2)
333 versionShort = rechercheDomaine[1]
334 else
335 {
336 var nomProtocole = this.regexNomProtocole.exec(url)
337 if (nomProtocole != null && nomProtocole.length >= 2)
338 versionShort = nomProtocole[1]
339 }
340 }
341
342 return [versionShort == null ? "url" : versionShort, estUneImage]
343 }
344
345 /**
346 * Traite les pseudo et messages à être affiché dans le titre d'une image visualisé avec lightbox.
347 */
348 Formateur.prototype.traiterPourFenetreLightBox = function(M, urlCourante)
349 {
350 thisFormateur = this
351 var traitementUrl = function(url)
352 {
353 return "[" + thisFormateur.getShort(url)[0] + (urlCourante == url ? ": image courante" : "") + "]"
354 }
355
356 return this.remplacerBalisesHTML(M).replace(this.regexUrl, traitementUrl)
357 }
358
359
360 ///////////////////////////////////////////////////////////////////////////////////////////////////
361
362 // les statuts possibes du client
363 var statutType = {
364 // mode enregistré, peut poster des messages et modifier son profile
365 auth_registered : 0,
366 // mode identifié, peut poster des messages mais n'a pas accès au profile
367 auth_not_registered : 1,
368 // mode déconnecté, ne peut pas poster de message
369 deconnected : 2
370 }
371
372 function Client(util)
373 {
374 this.util = util
375
376 this.cookie = null
377 this.regexCookie = new RegExp("^cookie=([^;]*)")
378
379 // données personnels
380 this.resetDonneesPersonnelles()
381
382 this.setStatut(statutType.deconnected)
383
384 // le dernier message d'erreur recut du serveur (par exemple une connexion foireuse : "login impossible")
385 this.dernierMessageErreur = ""
386 }
387
388 Client.prototype.resetDonneesPersonnelles = function()
389 {
390 this.pseudo = conf.pseudoDefaut
391 this.login = ""
392 this.password = ""
393 this.email = ""
394 this.css = jQuery("link#cssPrincipale").attr("href")
395
396 this.pagePrincipale = 1
397
398 // les conversations, une conversation est un objet possédant les attributs suivants :
399 // - racine (entier)
400 // - page (entier)
401 this.conversations = new Array()
402 }
403
404 Client.prototype.setCss = function(css)
405 {
406 if (this.css == css)
407 return
408
409 this.css = css
410 jQuery("link#cssPrincipale").attr("href", this.css)
411 this.majMenu()
412 }
413
414 Client.prototype.pageSuivante = function(numConv)
415 {
416 if (numConv < 0 && this.pagePrincipale > 1)
417 this.pagePrincipale -= 1
418 else if (this.conversations[numConv].page > 1)
419 this.conversations[numConv].page -= 1
420 }
421
422 Client.prototype.pagePrecedente = function(numConv)
423 {
424 if (numConv < 0)
425 this.pagePrincipale += 1
426 else
427 this.conversations[numConv].page += 1
428 }
429
430 /**
431 * Définit la première page pour la conversation donnée.
432 * @return true si la page a changé sinon false
433 */
434 Client.prototype.goPremierePage = function(numConv)
435 {
436 if (numConv < 0)
437 {
438 if (this.pagePrincipale == 1)
439 return false
440 this.pagePrincipale = 1
441 }
442 else
443 {
444 if (this.conversations[numConv].page == 1)
445 return false
446 this.conversations[numConv].page = 1
447 }
448 return true
449 }
450
451 /**
452 * Ajoute une conversation à la vue de l'utilisateur.
453 * Le profile de l'utilisateur est directement sauvegardé sur le serveur.
454 * @param racines la racine de la conversation (integer)
455 * @return true si la conversation a été créée sinon false (par exemple si la conv existe déjà)
456 */
457 Client.prototype.ajouterConversation = function(racine)
458 {
459 // vérification s'il elle n'existe pas déjà
460 for (var i = 0; i < this.conversations.length; i++)
461 if (this.conversations[i].root == racine)
462 return false
463
464 this.conversations.push({root : racine, page : 1})
465 return true
466 }
467
468 Client.prototype.supprimerConversation = function(num)
469 {
470 if (num < 0 || num >= this.conversations.length) return
471
472 // décalage TODO : supprimer le dernier élément
473 for (var i = num; i < this.conversations.length - 1; i++)
474 this.conversations[i] = this.conversations[i+1]
475 this.conversations.pop()
476 }
477
478 Client.prototype.getJSONLogin = function(login, password)
479 {
480 return {
481 "action" : "authentification",
482 "login" : login,
483 "password" : password
484 }
485 }
486
487 Client.prototype.getJSONLoginCookie = function()
488 {
489 return {
490 "action" : "authentification",
491 "cookie" : this.cookie
492 }
493 }
494
495 /**
496 * le couple (login, password) est facultatif. S'il n'est pas fournit alors il ne sera pas possible
497 * de s'autentifier avec (login, password).
498 */
499 Client.prototype.getJSONEnregistrement = function(login, password)
500 {
501 var mess = { "action" : "register" }
502
503 if (login != undefined && password != undefined)
504 {
505 mess["login"] = login
506 mess["password"] = password
507 }
508
509 return mess;
510 }
511
512 Client.prototype.getJSONConversations = function()
513 {
514 var conversations = new Array()
515 for (var i = 0; i < this.conversations.length; i++)
516 conversations.push({ "root" : this.conversations[i].root, "page" : this.conversations[i].page})
517 return conversations
518 }
519
520 Client.prototype.getJSONProfile = function()
521 {
522 return {
523 "action" : "set_profile",
524 "cookie" : this.cookie,
525 "login" : this.login,
526 "password" : this.password,
527 "nick" : this.pseudo,
528 "email" : this.email,
529 "css" : this.css,
530 "main_page" : this.pagePrincipale < 1 ? 1 : this.pagePrincipale,
531 "conversations" : this.getJSONConversations()
532 }
533 }
534
535 /**
536 * Renvoie null si pas définit.
537 */
538 Client.prototype.getCookie = function()
539 {
540 var cookie = this.regexCookie.exec(document.cookie)
541 if (cookie == null) this.cookie = null
542 else this.cookie = cookie[1]
543 }
544
545 Client.prototype.delCookie = function()
546 {
547 document.cookie = "cookie=; max-age=0"
548 }
549
550 Client.prototype.setCookie = function(cookie)
551 {
552 if (this.cookie == null)
553 return
554
555 document.cookie =
556 "cookie="+this.cookie+
557 "; max-age=" + (60 * 60 * 24 * 365)
558 }
559
560 Client.prototype.authentifie = function()
561 {
562 return this.statut == statutType.auth_registered || this.statut == statutType.auth_not_registered
563 }
564
565 Client.prototype.setStatut = function(statut)
566 {
567 // conversation en "enum" si en "string"
568 if (typeof(statut) == "string")
569 {
570 statut =
571 statut == "auth_registered" ?
572 statutType.auth_registered :
573 (statut == "auth_not_registered" ? statutType.auth_not_registered : statutType.deconnected)
574 }
575
576 if (statut == this.statut) return
577
578 this.statut = statut
579 this.majMenu()
580 }
581
582 /**
583 * Effectue la connexion vers le serveur.
584 * Cette fonction est bloquante tant que la connexion n'a pas été établie.
585 * S'il existe un cookie en local on s'authentifie directement avec lui.
586 * Si il n'est pas possible de s'authentifier alors on affiche un captcha anti-bot.
587 */
588 Client.prototype.connexionCookie = function()
589 {
590 this.getCookie()
591 if (this.cookie == null) return false;
592 return this.connexion(this.getJSONLoginCookie())
593 }
594
595 Client.prototype.connexionLogin = function(login, password)
596 {
597 return this.connexion(this.getJSONLogin(login, password))
598 }
599
600 Client.prototype.enregistrement = function(login, password)
601 {
602 if (this.authentifie())
603 {
604 this.login = login
605 this.password = password
606 if(this.flush())
607 this.setStatut(statutType.auth_registered)
608 return true
609 }
610 else
611 {
612 return this.connexion(this.getJSONEnregistrement(login, password))
613 }
614 }
615
616 Client.prototype.connexion = function(messageJson)
617 {
618 ;;; dumpObj(messageJson)
619 thisClient = this
620 jQuery.ajax(
621 {
622 async: false,
623 type: "POST",
624 url: "request",
625 dataType: "json",
626 data: this.util.jsonVersAction(messageJson),
627 success:
628 function(data)
629 {
630 ;;; dumpObj(data)
631 thisClient.chargerDonnees(data)
632 }
633 }
634 )
635 return this.authentifie()
636 }
637
638 Client.prototype.deconnexion = function()
639 {
640 this.setStatut(statutType.deconnected) // deconnexion
641 this.resetDonneesPersonnelles()
642 this.delCookie ()
643 }
644
645 Client.prototype.chargerDonnees = function(data)
646 {
647 var thisClient = this
648
649 this.setStatut(data["status"])
650
651 if (this.authentifie())
652 {
653 this.cookie = data["cookie"]
654 this.setCookie()
655
656 this.login = data["login"]
657 this.pseudo = data["nick"]
658 this.email = data["email"]
659 this.css = data["css"]
660
661 // la page de la conversation principale
662 this.pagePrincipale = data["main_page"] == undefined ? 1 : data["main_page"]
663
664 // met à jour la css
665 if (this.css != "")
666 {
667 jQuery("link#cssPrincipale").attr("href", this.css)
668 this.majMenu()
669 }
670 // les conversations
671 thisClient.conversations = data["conversations"]
672
673 }
674 this.dernierMessageErreur = data["error_message"]
675 }
676
677 /**
678 * Met à jour les données personne sur serveur.
679 * @param async de manière asynchrone ? défaut = true
680 * @return false si le flush n'a pas pû se faire sinon true
681 */
682 Client.prototype.flush = function(async)
683 {
684 if (async == undefined)
685 async = true
686
687 if (!this.authentifie())
688 return false
689
690 thisClient = this
691 ;;; dumpObj(this.getJSONProfile())
692 jQuery.ajax(
693 {
694 async: async,
695 type: "POST",
696 url: "request",
697 dataType: "json",
698 data: this.util.jsonVersAction(this.getJSONProfile()),
699 success:
700 function(data)
701 {
702 //thisClient.util.log(thisClient.util.serializer.serializeToString(data))
703 }
704 }
705 )
706 // TODO : retourner false si un problème est survenu lors de l'update du profile
707 return true
708 }
709
710 Client.prototype.majMenu = function()
711 {
712 var displayType = this.css == "css/3/euphorik.css" ? "block" : "inline" //this.client
713
714 // met à jour le menu
715 if (this.statut == statutType.auth_registered)
716 {
717 jQuery("#menu .profile").css("display", displayType).text("profile")
718 jQuery("#menu .logout").css("display", displayType)
719 jQuery("#menu .register").css("display", "none")
720 }
721 else if (this.statut == statutType.auth_not_registered)
722 {
723 jQuery("#menu .profile").css("display", "none")
724 jQuery("#menu .logout").css("display", displayType)
725 jQuery("#menu .register").css("display", displayType)
726 }
727 else
728 {
729 jQuery("#menu .profile").css("display", displayType).text("login")
730 jQuery("#menu .logout").css("display", "none")
731 jQuery("#menu .register").css("display", displayType)
732 }
733 }
734
735 ///////////////////////////////////////////////////////////////////////////////////////////////////
736
737 function initialiserListeStyles(client)
738 {
739 jQuery("#menuCss").change(
740 function()
741 {
742 client.setCss("css/" + jQuery("option:selected", this).attr("value") + "/euphorik.css")
743 }
744 )
745 }
746
747 jQuery.noConflict()
748
749 // charge dynamiquement le script de debug
750 ;;; jQuery.ajax({async : false, url : "js/debug.js", dataType : "script"})
751
752 // le main
753 jQuery(document).ready(
754 function()
755 {
756 /* FIXME : ce code pose problème sur konqueror, voir : http://www.kde-forum.org/thread.php?threadid=17993
757 var p = new DOMParser();
758 var doc = p.parseFromString("<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<action/>", "text/xml")
759 var s = new XMLSerializer()
760 alert(s.serializeToString(doc)) */
761
762 var util = new Util()
763 var client = new Client(util)
764 var pages = new Pages()
765 var formateur = new Formateur()
766
767 // connexion vers le serveur (utilise un cookie qui traine)
768 client.connexionCookie()
769
770 initialiserListeStyles(client)
771
772 // TODO : pourquoi jQuery(document).unload ne fonctionne pas ?
773 jQuery(window).unload(
774 function()
775 {
776 //alert("ok")
777 client.flush(false)
778 }
779 )
780
781 jQuery("#menu .minichat").click(function(){ pages.afficherPage("minichat") })
782 jQuery("#menu .profile").click(function(){ pages.afficherPage("profile") })
783 jQuery("#menu .logout").click(function(){
784 util.messageDialogue("Êtes-vous sur de vouloir vous délogger ?", messageType.question,
785 {"Oui" : function()
786 {
787 client.deconnexion();
788 pages.afficherPage("minichat", true)
789 },
790 "Non" : function(){}
791 }
792 )
793 })
794 jQuery("#menu .register").click(function(){ pages.afficherPage("register") })
795
796 pages.ajouterPage(new PageMinichat(client, formateur, util))
797 pages.ajouterPage(new PageProfile(client, formateur, util))
798 pages.ajouterPage(new PageRegister(client, formateur, util))
799 pages.afficherPage("minichat")
800 }
801 )