REPORT de la branche 1.1 : 477->494
[euphorik.git] / js / euphorik.js
index 5dff115..4d0d302 100755 (executable)
 // You should have received a copy of the GNU General Public License
 // along with Euphorik.  If not, see <http://www.gnu.org/licenses/>.
 
+/*jslint laxbreak:true */
+
 // tout euphorik est contenu dans cet objet
-var euphorik = {}
+var euphorik = {};
 
 // le main
 $(document).ready(
@@ -25,8 +27,13 @@ $(document).ready(
       var fragment = new Fragment();
       var formateur = new euphorik.Formateur();
       var util = new euphorik.Util(formateur); 
-      var client = new euphorik.Client(util);
-      var pages = new euphorik.Pages(fragment);
+      var communication = new euphorik.Communication(
+         function(data) { util.messageDialogue(data.error_message); },
+         function() { $("#waitbar").show(); },
+         function() { $("#waitbar").hide(); }
+      );
+      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();
@@ -49,21 +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 : <span class="lien" href="conditions">Conditions d'utilisation</span>
       $("#footer .conditions").click(function(){ pages.afficherPage("conditions_utilisation"); });
-
-      pages.ajouterPage(new euphorik.PageMinichat(client, formateur, util), true);
-      pages.ajouterPage(new euphorik.PageAdmin(client, formateur, util));
+      
+      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));
+      pages.ajouterPage(new euphorik.PageAbout(client, formateur, util, communication));
       pages.ajouterPage("conditions_utilisation");
       
       pages.afficherPage();
    }
-)
+);