Skip to content
Browse files

Created client main and app

  • Loading branch information...
1 parent bea4ec5 commit 0d3597bc947fa7fe9cf6c128abdc0443ed303a40 @a727891 committed
Showing with 38 additions and 0 deletions.
  1. +1 −0 Client/index.html
  2. +17 −0 Client/js/app.js
  3. +20 −0 Client/js/main.js
View
1 Client/index.html
@@ -5,5 +5,6 @@
</head>
<body>
Greetings
+<script data-main="js/main" src="js/lib/require-jquery.js"></script>
</body>
</html>
View
17 Client/js/app.js
@@ -0,0 +1,17 @@
+/**
+ * app class
+ **/
+define([], function () {
+ var app = Class.extend({
+ init:function (IO) {
+ this.socket = IO.connect('http://localhost:8080');
+
+ this.socket.on('1', function () {
+ console.log('on 1');
+ });
+ },
+ });
+
+ return app
+});
+
View
20 Client/js/main.js
@@ -0,0 +1,20 @@
+/**
+ * main class
+ **/
+var galaxies;
+define(['jquery', 'lib/class', 'lib/socket.io', 'app'], function ($, Class, IO, APP) {
+ var app;
+
+ var initApp = function () {
+
+ $(document).ready(function () {
+ app = new APP(IO);
+ galaxies = app;
+ })
+
+ };
+
+
+ initApp();
+});
+

0 comments on commit 0d3597b

Please sign in to comment.
Something went wrong with that request. Please try again.