mirror of
https://github.com/evennia/evennia.git
synced 2026-04-02 14:07:16 +02:00
Converted webclient to use websockets on port 8001. Ideally one would make it so the ajax and websocket clients work under the same django wrapper, but for now this functionality is elusive.
This commit is contained in:
parent
2a6cfaca7d
commit
ede6634081
11 changed files with 326 additions and 37 deletions
|
|
@ -9,13 +9,26 @@
|
|||
<link rel='stylesheet' type="text/css" media="screen" href="/media/css/webclient.css">
|
||||
|
||||
<!-- Importing the online jQuery javascript library -->
|
||||
<script src="http://code.jquery.com/jquery-1.6.1.js" type="text/javascript" charset="utf-8"></script>
|
||||
<!--script src="http://code.jquery.com/jquery-1.6.1.js" type="text/javascript" charset="utf-8"></script-->
|
||||
<script src="http://code.jquery.com/jquery-1.11.1.min.js" type="text/javascript" charset="utf-8"></script>
|
||||
|
||||
<!--for offline testing, download the jquery library from jquery.com-->
|
||||
<!--script src="/media/javascript/jquery-1.4.4.js" type="text/javascript" charset="utf-8"></script-->
|
||||
<!--script src="/media/javascript/jquery-1.11.1.js" type="text/javascript" charset="utf-8"></script-->
|
||||
|
||||
{% if websocket_enabled %}
|
||||
<script language="javascript" type="text/javascript">
|
||||
if ("WebSocket" in window) {
|
||||
<!-- Importing the Evennia websocket webclient component (requires jQuery) -->
|
||||
document.write("\<script src=\"/media/javascript/evennia_websocket_webclient.js\" type=\"text/javascript\" charset=\"utf-8\"\>\</script\>")}
|
||||
else {
|
||||
<!-- Importing the Evennia ajax webclient component (requires jQuery) -->
|
||||
document.write("\<script src=\"/media/javascript/evennia_ajax_webclient.js\" type=\"text/javascript\" charset=\"utf-8\"\>\</script\>")}
|
||||
</script>
|
||||
{% else %}
|
||||
<!-- websocket not enabled; use ajax -->
|
||||
<script src="/media/javascript/evennia_ajax_webclient.js" type="text/javascript" charset="utf-8"></script>
|
||||
{% endif %}
|
||||
|
||||
<!-- Importing the Evennia ajax webclient component (requires jQuery) -->
|
||||
<script src="/media/javascript/evennia_webclient.js" type="text/javascript" charset="utf-8"></script>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
|
|
@ -38,7 +51,7 @@
|
|||
</div>
|
||||
<form id="inputform" action="javascript:void(0);">
|
||||
<div id="playercount">Logged in Players: {{num_players_connected}}</div>
|
||||
<div id="inputcontrol"><input type="text" id="inputfield" autocomplete="off"><input id="inputsend" type="button" value="send" onClick="webclient_input()" /></div>
|
||||
<div id="inputcontrol"><input type="text" id="inputfield" autocomplete="off"><input id="inputsend" type="button" value="send" onClick="doSend()" /></div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue