X-Git-Url: http://git.euphorik.ch/?a=blobdiff_plain;f=js%2Feuphorik.js;h=e3bd7200111b79fde0aea76e7648d04d4fae3fd7;hb=5dc140390551c133ac5525725a86854ca69679af;hp=c1253b97e5b93f3190797bb0a39adcfb5c9ef5f9;hpb=0cca28444881b1a405525b10960915a638936fdd;p=euphorik.git
diff --git a/js/euphorik.js b/js/euphorik.js
index c1253b9..e3bd720 100755
--- a/js/euphorik.js
+++ b/js/euphorik.js
@@ -17,60 +17,62 @@
// along with Euphorik. If not, see .
/*jslint laxbreak:true */
-
-// tout euphorik est contenu dans cet objet
+
+// all euphorik is contained in this object
var euphorik = {};
// le main
$(document).ready(
function() {
var fragment = new Fragment();
- var formateur = new euphorik.Formateur();
- var util = new euphorik.Util(formateur);
+ var formater = new euphorik.Formater();
+ var util = new euphorik.Util(formater);
var communication = new euphorik.Communication(
- function(data) { util.messageDialogue(data.error_message); },
+ function(data) { util.messageDialog(data.error_message); },
function() { util.showWaitBar(); },
function() { util.hideWaitBar(); }
);
var client = new euphorik.Client(util, communication);
var pages = new euphorik.Pages(fragment, communication);
-
- // connexion vers le serveur (utilise un cookie qui traine)
- client.connexionCookie();
+
+ // Client authentification with the cookie information (if it exists).
+ client.connectionCookie();
$("#menuCss").change(function() { client.setCss("styles/" + $("option:selected", this).attr("value") + "/euphorik.css"); });
- // FIXME : ne fonctionne pas sous opera
- // voir : http://dev.jquery.com/ticket/2892#preview
+ // FIXME : doesn't work under Opera
+ // see : http://dev.jquery.com/ticket/2892#preview
$(window).unload(function() { client.flush(); });
- $("#menu .minichat").click(function() { pages.afficherPage("minichat"); });
- $("#menu .admin").click(function() { pages.afficherPage("admin"); });
- $("#menu .profile").click(function() { pages.afficherPage("profile"); });
+ $("#menu .minichat").click(function() { pages.displayPage("minichat"); });
+ $("#menu .admin").click(function() { pages.displayPage("admin"); });
+ $("#menu .profile").click(function() { pages.displayPage("profile"); });
$("#menu .logout").click(function() {
- util.messageDialogue("Ãtes-vous sur de vouloir vous délogger ?", euphorik.Util.messageType.question,
+ util.messageDialog("Are you sure you want to log out?", euphorik.Util.messageType.question,
{
- "Oui" : function() {
- client.deconnexion();
- pages.afficherPage("minichat", true);
+ "Yes" : function() {
+ client.disconnect();
+ pages.displayPage("minichat", true);
},
- "Non" : function() {}
+ "No" : function() {}
}
);
});
- $("#menu .register").click(function(){ pages.afficherPage("register"); });
- $("#menu .about").click(function(){ pages.afficherPage("about"); });
+ $("#menu .register").click(function(){ pages.displayPage("register"); });
+ $("#menu .about").click(function(){ pages.displayPage("about"); });
- // TODO : simplifier et pouvoir créer des liens par exemple : Conditions d'utilisation
- $("#footer .conditions").click(function(){ pages.afficherPage("conditions_utilisation"); });
+ // TODO : simplification : such link[1] should be created and automatically open the right page without
+ // explicitly add a page.
+ // [1] : Terms of use
+ $("#footer .termsOfUse").click(function(){ pages.displayPage("terms_of_use"); });
- pages.ajouterPage(new euphorik.PageMinichat(client, formateur, util, communication), true);
- pages.ajouterPage(new euphorik.PageAdmin(client, formateur, util, communication));
- pages.ajouterPage(new euphorik.PageProfile(client, formateur, util));
- pages.ajouterPage(new euphorik.PageRegister(client, formateur, util));
- pages.ajouterPage(new euphorik.PageAbout(client, formateur, util, communication));
- pages.ajouterPage("conditions_utilisation");
+ pages.addPage(new euphorik.PageMinichat(client, formater, util, communication), true);
+ pages.addPage(new euphorik.PageAdmin(client, formater, util, communication));
+ pages.addPage(new euphorik.PageProfile(client, formater, util));
+ pages.addPage(new euphorik.PageRegister(client, formater, util));
+ pages.addPage(new euphorik.PageAbout(client, formater, util, communication));
+ pages.addPage("terms_of_use");
- pages.afficherPage();
+ pages.displayPage(); // display the default page
}
);