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