This repository has been archived by the owner on Mar 13, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
remote actors (no response from future: class not found)
- Loading branch information
1 parent
5f0ebb0
commit 19f9ed7
Showing
9 changed files
with
89 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,11 @@ | ||
@(message: String) | ||
@(implicit request: RequestHeader) | ||
|
||
@main("Welcome") { | ||
<h1>Hello world</h1> | ||
} | ||
@main("Hey") { | ||
<form action="@routes.Application.eval.webSocketURL()"> | ||
<input name="op1"> + <input name="op2"> | ||
<input type="submit"> | ||
<span class="result"></span> | ||
</form> | ||
}{ | ||
<script src="@routes.Assets.at("javascripts/chat.js")"></script> | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
GET / controllers.Application.index | ||
GET /assets/*file controllers.Assets.at(path="/public", file) | ||
GET /webjars/*file controllers.WebJarAssets.at(file) | ||
GET / controllers.Application.index | ||
GET /eval controllers.Application.eval | ||
|
||
|
||
GET /assets/*file controllers.Assets.at(path="/public", file) | ||
GET /webjars/*file controllers.WebJarAssets.at(file) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
$(function(){ | ||
'use strict'; | ||
|
||
var chatSocket = new WebSocket($('form').attr("action")); | ||
|
||
$("[type='submit']").click(function(e){ | ||
e.preventDefault(); | ||
|
||
chatSocket.send( | ||
JSON.stringify({ | ||
op1: parseInt($("[name='op1']").val()), | ||
op2: parseInt($("[name='op2']").val()) | ||
}) | ||
); | ||
return false; | ||
}); | ||
|
||
chatSocket.onmessage = function(e){ | ||
var data = JSON.parse(event.data) | ||
$(".result").text(data.result || data.error); | ||
}; | ||
}); |