resolve #1448, fix 'no help entry' not popping up in webclient
This commit is contained in:
parent
70fea693e6
commit
53a4fc0b66
5 changed files with 15 additions and 9 deletions
|
|
@ -267,7 +267,7 @@ class CmdHelp(Command):
|
||||||
return
|
return
|
||||||
|
|
||||||
# no exact matches found. Just give suggestions.
|
# no exact matches found. Just give suggestions.
|
||||||
self.msg(self.format_help_entry("", "No help entry found for '%s'" % query, None, suggested=suggestions))
|
self.msg((self.format_help_entry("", "No help entry found for '%s'" % query, None, suggested=suggestions), {"type": "help"}))
|
||||||
|
|
||||||
|
|
||||||
def _loadhelp(caller):
|
def _loadhelp(caller):
|
||||||
|
|
|
||||||
|
|
@ -436,9 +436,12 @@ def webclient_options(session, *args, **kwargs):
|
||||||
"""
|
"""
|
||||||
account = session.account
|
account = session.account
|
||||||
|
|
||||||
clientoptions = settings.WEBCLIENT_OPTIONS.copy()
|
clientoptions = account.db._saved_webclient_options
|
||||||
storedoptions = account.db._saved_webclient_options or {}
|
if not clientoptions:
|
||||||
clientoptions.update(storedoptions)
|
# No saved options for this account, copy and save the default.
|
||||||
|
account.db._saved_webclient_options = settings.WEBCLIENT_OPTIONS.copy()
|
||||||
|
# Get the _SaverDict created by the database.
|
||||||
|
clientoptions = account.db._saved_webclient_options
|
||||||
|
|
||||||
# The webclient adds a cmdid to every kwargs, but we don't need it.
|
# The webclient adds a cmdid to every kwargs, but we don't need it.
|
||||||
try:
|
try:
|
||||||
|
|
@ -448,7 +451,8 @@ def webclient_options(session, *args, **kwargs):
|
||||||
|
|
||||||
if not kwargs:
|
if not kwargs:
|
||||||
# No kwargs: we are getting the stored options
|
# No kwargs: we are getting the stored options
|
||||||
session.msg(webclient_options=clientoptions)
|
# Convert clientoptions to regular dict for sending.
|
||||||
|
session.msg(webclient_options=dict(clientoptions))
|
||||||
|
|
||||||
# Create a monitor. If a monitor already exists then it will replace
|
# Create a monitor. If a monitor already exists then it will replace
|
||||||
# the previous one since it would use the same idstring
|
# the previous one since it would use the same idstring
|
||||||
|
|
@ -461,5 +465,3 @@ def webclient_options(session, *args, **kwargs):
|
||||||
# kwargs provided: persist them to the account object
|
# kwargs provided: persist them to the account object
|
||||||
for key, value in kwargs.iteritems():
|
for key, value in kwargs.iteritems():
|
||||||
clientoptions[key] = value
|
clientoptions[key] = value
|
||||||
|
|
||||||
account.db._saved_webclient_options = clientoptions
|
|
||||||
|
|
|
||||||
|
|
@ -31,6 +31,8 @@ strong {font-weight: bold;}
|
||||||
|
|
||||||
div {margin:0px;}
|
div {margin:0px;}
|
||||||
|
|
||||||
|
.hidden { display: none; }
|
||||||
|
|
||||||
/* Utility messages (green) */
|
/* Utility messages (green) */
|
||||||
.sys { color: #0f0 }
|
.sys { color: #0f0 }
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -289,6 +289,7 @@ function onPrompt(args, kwargs) {
|
||||||
|
|
||||||
// Called when the user logged in
|
// Called when the user logged in
|
||||||
function onLoggedIn() {
|
function onLoggedIn() {
|
||||||
|
$('#optionsbutton').removeClass('hidden');
|
||||||
Evennia.msg("webclient_options", [], {});
|
Evennia.msg("webclient_options", [], {});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -323,6 +324,8 @@ function onSilence(cmdname, args, kwargs) {}
|
||||||
|
|
||||||
// Handle the server connection closing
|
// Handle the server connection closing
|
||||||
function onConnectionClose(conn_name, evt) {
|
function onConnectionClose(conn_name, evt) {
|
||||||
|
$('#optionsbutton').addClass('hidden');
|
||||||
|
closePopup("#optionsdialog");
|
||||||
onText(["The connection was closed or lost."], {'cls': 'err'});
|
onText(["The connection was closed or lost."], {'cls': 'err'});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@
|
||||||
|
|
||||||
<div id="wrapper">
|
<div id="wrapper">
|
||||||
<div id="toolbar">
|
<div id="toolbar">
|
||||||
<button id="optionsbutton" type="button">⚙</button>
|
<button id="optionsbutton" type="button" class="hidden">⚙</button>
|
||||||
</div>
|
</div>
|
||||||
<div id="messagewindow" role="log"></div>
|
<div id="messagewindow" role="log"></div>
|
||||||
<div id="inputform">
|
<div id="inputform">
|
||||||
|
|
@ -48,4 +48,3 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue