Thomas Dy před 11 roky
rodič
revize
9dda964d17

+ 2 - 7
app/controllers/Application.scala

@@ -8,25 +8,20 @@ import play.api.libs.iteratee._
 
 import models._
 
-import akka.actor._
-import scala.concurrent.duration._
-
 object Application extends Controller {
 
   /**
    * Just display the home page.
    */
   def index = Action { implicit request =>
-    Ok(views.html.chatRoomNg())
+    Ok(views.html.index())
   }
 
   /**
    * Handles the chat websocket.
    */
   def chat(username: String, room: String = "default") = WebSocket.async[JsValue] { request  =>
-
     ChatRoom.join(room, username)
-
   }
 
   val routeCache = {
@@ -36,9 +31,9 @@ object Application extends Controller {
     controllers.flatMap { controller =>
       controller.getClass().getDeclaredMethods().map { action =>
         action.invoke(controller).asInstanceOf[play.core.Router.JavascriptReverseRoute]
-  }
       }
     }
+  }
 
   def javascriptRoutes = Action { implicit request =>
     Ok(Routes.javascriptRouter("jsRoutes")(routeCache:_*)).as("text/javascript")

+ 0 - 60
app/views/chatRoomNg.scala.html

@@ -1,60 +0,0 @@
-@()
-<!DOCTYPE html>
-
-<html ng-app="taboo">
-    <head>
-        <title>Game n' Chat</title>
-        <link rel="stylesheet" media="screen" href="@routes.Assets.at("stylesheets/bootstrap.css")">
-        <link rel="stylesheet" media="screen" href="@routes.Assets.at("stylesheets/main.css")">
-        <link rel="shortcut icon" type="image/png" href="@routes.Assets.at("images/favicon.png")">
-    </head>
-    <body ng-controller="ViewCtrl">
-
-        <div class="topbar">
-            <div class="fill">
-                <div class="container">
-                    <a class="brand">Game n' Chat</a>
-                    <div class="nav nav-collapse">
-                        <ul class="nav">
-                            <li ng-repeat="li in nav" class="{{li.partial == view ? 'active' : ''}}">
-                                <a ng-click="setView(li.partial)">{{li.name}}</a>
-                            </li>
-                        </ul>
-                    </div>
-
-                    <span ng-controller="LoginCtrl">
-                    <p class="pull-right" ng-show="service.isConnected()">
-                        Logged in as {{service.username}} —
-                        <a ng-click="service.disconnect()">Disconnect</a>
-                    </p>
-
-                    <form class="pull-right" ng-hide="service.isConnected()">
-                        <input id="username" name="username" class="input-small" type="text" ng-model="username" placeholder="Username">
-                        <button class="btn" type="submit" ng-click="service.connect(username); username=''">Sign in</button>
-                    </form>
-                    </span>
-
-                </div>
-            </div>
-        </div>
-
-        <div class="container">
-
-            <div class="content" ng-include="partial(view)">
-            </div>
-
-            <footer>
-                <p><a href="http://twitter.com/pleasantprog" target="_blank">@@pleasantprog</a></p>
-            </footer>
-
-        </div>
-
-        <script src="@routes.Application.javascriptRoutes" type="text/javascript"></script>
-        <script src="@routes.Assets.at("components/jquery/jquery.min.js")" type="text/javascript"></script>
-        <script src="@routes.Assets.at("components/angular/angular.min.js")" type="text/javascript"></script>
-        <script src="@routes.Assets.at("javascripts/chatServices.js")" type="text/javascript"></script>
-        <script src="@routes.Assets.at("javascripts/tabooServices.js")" type="text/javascript"></script>
-        <script src="@routes.Assets.at("javascripts/main.js")" type="text/javascript"></script>
-
-    </body>
-</html>

+ 57 - 0
app/views/index.scala.html

@@ -0,0 +1,57 @@
+@()
+<!DOCTYPE html>
+
+<html ng-app="taboo">
+<head>
+  <title>Game n' Chat</title>
+  <link rel="stylesheet" media="screen" href="@routes.Assets.at("stylesheets/bootstrap.css")">
+  <link rel="stylesheet" media="screen" href="@routes.Assets.at("stylesheets/main.css")">
+  <link rel="shortcut icon" type="image/png" href="@routes.Assets.at("images/favicon.png")">
+</head>
+<body ng-controller="ViewCtrl">
+
+<div class="topbar">
+  <div class="fill">
+    <div class="container">
+      <a class="brand">Game n' Chat</a>
+      <div class="nav nav-collapse">
+        <ul class="nav">
+          <li ng-repeat="li in nav" class="{{li.partial == view ? 'active' : ''}}">
+            <a ng-click="setView(li.partial)">{{li.name}}</a>
+          </li>
+        </ul>
+      </div>
+
+      <span ng-controller="LoginCtrl">
+        <p class="pull-right" ng-show="service.isConnected()">
+          Logged in as {{service.username}} —
+          <a ng-click="service.disconnect()">Disconnect</a>
+        </p>
+
+        <form class="pull-right" ng-hide="service.isConnected()">
+          <input id="username" name="username" class="input-small" type="text" ng-model="username" placeholder="Username">
+          <button class="btn" type="submit" ng-click="service.connect(username); username=''">Sign in</button>
+        </form>
+      </span>
+
+    </div>
+  </div>
+</div>
+
+<div class="container">
+  <div class="content" ng-include="partial(view)"> </div>
+
+  <footer>
+    <p><a href="http://twitter.com/pleasantprog" target="_blank">@@pleasantprog</a></p>
+  </footer>
+</div>
+
+<script src="@routes.Application.javascriptRoutes" type="text/javascript"></script>
+<script src="@routes.Assets.at("components/jquery/jquery.min.js")" type="text/javascript"></script>
+<script src="@routes.Assets.at("components/angular/angular.min.js")" type="text/javascript"></script>
+<script src="@routes.Assets.at("javascripts/chatServices.js")" type="text/javascript"></script>
+<script src="@routes.Assets.at("javascripts/tabooServices.js")" type="text/javascript"></script>
+<script src="@routes.Assets.at("javascripts/main.js")" type="text/javascript"></script>
+
+</body>
+</html>