From 7e898842b9f3054a7544574350c4bed63f31b8f6 Mon Sep 17 00:00:00 2001 From: Griatch Date: Tue, 7 Dec 2010 21:46:26 +0000 Subject: [PATCH] Fixed a string error in the webclient that could appear on some server setups. Added URL parsing to the webclient. --- src/server/telnet.py | 3 --- src/server/webclient.py | 2 +- src/utils/{ansi2html.py => text2html.py} | 4 ++-- src/web/media/css/webclient.css | 12 ++++++++++-- 4 files changed, 13 insertions(+), 8 deletions(-) rename src/utils/{ansi2html.py => text2html.py} (98%) diff --git a/src/server/telnet.py b/src/server/telnet.py index 891e53d7c..897b8cdd9 100644 --- a/src/server/telnet.py +++ b/src/server/telnet.py @@ -22,9 +22,6 @@ class TelnetProtocol(StatefulTelnetProtocol, session.Session): communication between game and player goes through here. """ - # identifier in case one needs to easily separate protocols at run-time. - protocol_key = "telnet" - # telnet-specific hooks def connectionMade(self): diff --git a/src/server/webclient.py b/src/server/webclient.py index 29bfda71a..ac514d37d 100644 --- a/src/server/webclient.py +++ b/src/server/webclient.py @@ -43,7 +43,7 @@ class LazyEncoder(simplejson.JSONEncoder): return force_unicode(obj) return super(LazyEncoder, self).default(obj) def jsonify(obj): - return simplejson.dumps(obj, ensure_ascii=False, cls=LazyEncoder) + return utils.to_str(simplejson.dumps(obj, ensure_ascii=False, cls=LazyEncoder)) # diff --git a/src/utils/ansi2html.py b/src/utils/text2html.py similarity index 98% rename from src/utils/ansi2html.py rename to src/utils/text2html.py index c773956cd..745189c59 100644 --- a/src/utils/ansi2html.py +++ b/src/utils/text2html.py @@ -13,7 +13,7 @@ import re import cgi from src.utils import ansi -class ANSItoHTMLparser(object): +class TextToHTMLparser(object): """ This class describes a parser for converting from ansi to html. """ @@ -124,7 +124,7 @@ class ANSItoHTMLparser(object): return result -HTML_PARSER = ANSItoHTMLparser() +HTML_PARSER = TextToTMLparser() # # Access function diff --git a/src/web/media/css/webclient.css b/src/web/media/css/webclient.css index 1a88f0b60..94aeeda2f 100644 --- a/src/web/media/css/webclient.css +++ b/src/web/media/css/webclient.css @@ -1,15 +1,23 @@ /* Style sheet for Evennia's web client. -Possibly this should somehow be incoorporated with the +This should possibly somehow be incoorporated with the overall website theme in the future? */ +/*Overall element look */ body{ background:#000; color:#fff; - font-size:.9em; + font-size:.9em; } +a:link{ + color:#fff; +} +a:visited{ + color:#ccc; +} + /*Base style for new messages in the main message area.*/ .msg{ background:#000;