Merge branch 'develop' into master
This commit is contained in:
commit
ab1bd6415d
64 changed files with 7206 additions and 2051 deletions
|
|
@ -6,6 +6,7 @@
|
|||
# tuple.
|
||||
#
|
||||
|
||||
import os
|
||||
from django.conf import settings
|
||||
from evennia.utils.utils import get_evennia_version
|
||||
|
||||
|
|
@ -52,7 +53,11 @@ def set_webclient_settings():
|
|||
global WEBCLIENT_ENABLED, WEBSOCKET_CLIENT_ENABLED, WEBSOCKET_PORT, WEBSOCKET_URL
|
||||
WEBCLIENT_ENABLED = settings.WEBCLIENT_ENABLED
|
||||
WEBSOCKET_CLIENT_ENABLED = settings.WEBSOCKET_CLIENT_ENABLED
|
||||
WEBSOCKET_PORT = settings.WEBSOCKET_CLIENT_PORT
|
||||
# if we are working through a proxy or uses docker port-remapping, the webclient port encoded
|
||||
# in the webclient should be different than the one the server expects. Use the environment
|
||||
# variable WEBSOCKET_CLIENT_PROXY_PORT if this is the case.
|
||||
WEBSOCKET_PORT = int(os.environ.get("WEBSOCKET_CLIENT_PROXY_PORT", settings.WEBSOCKET_CLIENT_PORT))
|
||||
# this is determined dynamically by the client and is less of an issue
|
||||
WEBSOCKET_URL = settings.WEBSOCKET_CLIENT_URL
|
||||
set_webclient_settings()
|
||||
|
||||
|
|
|
|||
|
|
@ -51,9 +51,9 @@ class TestGeneralContext(TestCase):
|
|||
mock_settings.WEBCLIENT_ENABLED = "webclient"
|
||||
mock_settings.WEBSOCKET_CLIENT_URL = "websocket_url"
|
||||
mock_settings.WEBSOCKET_CLIENT_ENABLED = "websocket_client"
|
||||
mock_settings.WEBSOCKET_CLIENT_PORT = "websocket_port"
|
||||
mock_settings.WEBSOCKET_CLIENT_PORT = 5000
|
||||
general_context.set_webclient_settings()
|
||||
self.assertEqual(general_context.WEBCLIENT_ENABLED, "webclient")
|
||||
self.assertEqual(general_context.WEBSOCKET_URL, "websocket_url")
|
||||
self.assertEqual(general_context.WEBSOCKET_CLIENT_ENABLED, "websocket_client")
|
||||
self.assertEqual(general_context.WEBSOCKET_PORT, "websocket_port")
|
||||
self.assertEqual(general_context.WEBSOCKET_PORT, 5000)
|
||||
|
|
|
|||
|
|
@ -16,9 +16,43 @@ JQuery available.
|
|||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||
|
||||
|
||||
<!-- Bootstrap CSS -->
|
||||
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta/css/bootstrap.min.css" integrity="sha384-/Y6pD6FV/Vv2HJnA6t+vslU6fwYXjCFtcEpHbNJ0lyAFsXTsjBbfaDjzALeQsN6M" crossorigin="anonymous">
|
||||
|
||||
<!-- Import JQuery and warn if there is a problem -->
|
||||
{% block jquery_import %}
|
||||
<script src="https://code.jquery.com/jquery-2.1.1.min.js" type="text/javascript" charset="utf-8"></script>
|
||||
{% endblock %}
|
||||
|
||||
<script type="text/javascript" charset="utf-8">
|
||||
if(!window.jQuery) {
|
||||
document.write("<div class='err'>jQuery library not found or the online version could not be reached. Check so Javascript is not blocked in your browser.</div>");
|
||||
}
|
||||
</script>
|
||||
|
||||
<!-- Set up Websocket url and load the evennia.js library-->
|
||||
<script language="javascript" type="text/javascript">
|
||||
{% if websocket_enabled %}
|
||||
var wsactive = true;
|
||||
{% else %}
|
||||
var wsactive = false;
|
||||
{% endif %}
|
||||
|
||||
{% if browser_sessid %}
|
||||
var csessid = "{{browser_sessid}}";
|
||||
{% else %}
|
||||
var csessid = false;
|
||||
{% endif %}
|
||||
|
||||
{% if websocket_url %}
|
||||
var wsurl = "{{websocket_url}}";
|
||||
{% else %}
|
||||
var wsurl = "ws://" + this.location.hostname + ":{{websocket_port}}";
|
||||
{% endif %}
|
||||
</script>
|
||||
<script src={% static "webclient/js/evennia.js" %} language="javascript" type="text/javascript" charset="utf-8"/></script>
|
||||
|
||||
<link rel='stylesheet' type="text/css" media="screen" href={% static "webclient/css/webclient.css" %}>
|
||||
|
||||
<script src="https://cdn.rawgit.com/ejci/favico.js/master/favico-0.3.10.min.js" language="javascript" type="text/javascript" charset="utf-8"></script>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue