X-Git-Url: http://git.euphorik.ch/?a=blobdiff_plain;f=js%2Feuphorik.js;h=4706eb878f3277310f13de45baf5ac4a06d6bd47;hb=09608ab29e1c39ea51b51a5f8669dcde36efb306;hp=14528a261340fef8026eda5dae833bb87172019e;hpb=e0c2c2fa82cf13cd55b8d5006ad2c7e0689dc6cb;p=euphorik.git diff --git a/js/euphorik.js b/js/euphorik.js index 14528a2..4706eb8 100755 --- a/js/euphorik.js +++ b/js/euphorik.js @@ -16,16 +16,24 @@ // You should have received a copy of the GNU General Public License // along with Euphorik. If not, see . +/*jslint laxbreak:true */ + // tout euphorik est contenu dans cet objet -var euphorik = {} +var euphorik = {}; // le main $(document).ready( function() { - var formateur = new euphorik.Formateur(); - var util = new euphorik.Util(formateur); - var client = new euphorik.Client(util); - var pages = new euphorik.Pages(); + var fragment = new Fragment(); + var formateur = new euphorik.Formater(); + var util = new euphorik.Util(formater); + var communication = new euphorik.Communication( + function(data) { util.messageDialogue(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(); @@ -48,23 +56,21 @@ $(document).ready( }, "Non" : function() {} } - ) + ); }); $("#menu .register").click(function(){ pages.afficherPage("register"); }); $("#menu .about").click(function(){ pages.afficherPage("about"); }); // TODO : simplifier et pouvoir créer des liens par exemple : Conditions d'utilisation $("#footer .conditions").click(function(){ pages.afficherPage("conditions_utilisation"); }); - - pages.ajouterPage(new euphorik.PageMinichat(client, formateur, util)); - pages.ajouterPage(new euphorik.PageAdmin(client, formateur, util)); - pages.ajouterPage(new euphorik.PageProfile(client, formateur, util)); - pages.ajouterPage(new euphorik.PageRegister(client, formateur, util)); - pages.ajouterPage(new euphorik.PageAbout(client, formateur, util)); - pages.ajouterPage("conditions_utilisation"); - pages.afficherPage("minichat"); + pages.ajouterPage(new euphorik.PageMinichat(client, formater, util, communication), true); + pages.ajouterPage(new euphorik.PageAdmin(client, formater, util, communication)); + pages.ajouterPage(new euphorik.PageProfile(client, formater, util)); + pages.ajouterPage(new euphorik.PageRegister(client, formater, util)); + pages.ajouterPage(new euphorik.PageAbout(client, formater, util, communication)); + pages.ajouterPage("conditions_utilisation"); - window.location.hash = "pouet=2;truc=4;conv=[1,2,3]" + pages.afficherPage(); } -) +);