From 5ddaf940ed46ab52f12ce55e6b660263134f2b09 Mon Sep 17 00:00:00 2001 From: Arthur Mayer Date: Fri, 18 Feb 2011 07:08:29 +0100 Subject: [PATCH] chat interface added, config option changed from showchatballoons: ture/false to showchat: balloons/modal --- src/main/java/org/dynmap/DynmapPlugin.java | 4 +- web/chat.js | 0 web/chat_style.css | 58 +++++++++ web/index.html | 2 + web/map.js | 130 ++++++++++++++++----- 5 files changed, 162 insertions(+), 32 deletions(-) create mode 100644 web/chat.js create mode 100644 web/chat_style.css diff --git a/src/main/java/org/dynmap/DynmapPlugin.java b/src/main/java/org/dynmap/DynmapPlugin.java index 992a25b7..7a5826f6 100644 --- a/src/main/java/org/dynmap/DynmapPlugin.java +++ b/src/main/java/org/dynmap/DynmapPlugin.java @@ -94,8 +94,8 @@ public class DynmapPlugin extends JavaPlugin { messageHandler.onMessageReceived.addListener(new Listener() { @Override public void triggered(Message t) { - log.info("[WEB] " + t.name + ": " + t.message); - getServer().broadcastMessage("[WEB] " + t.name + ": " + t.message); + log.info("[WEB]" + t.name + ": " + t.message); + getServer().broadcastMessage("[WEB]" + t.name + ": " + t.message); } }); webServer.handlers.put("/up/sendmessage", messageHandler); diff --git a/web/chat.js b/web/chat.js new file mode 100644 index 00000000..e69de29b diff --git a/web/chat_style.css b/web/chat_style.css new file mode 100644 index 00000000..253f90bd --- /dev/null +++ b/web/chat_style.css @@ -0,0 +1,58 @@ +#chat { + position:absolute; + bottom:14px; + left:14px; + border: 1px solid rgba(0,0,0,0.5); + background: rgba(0, 0, 0, 0.6); +} +#chatcursor { + position:absolute; + left:5px; + bottom:5px; + font-size:10px; + color: white; + padding:0px; +} +#chatinput { + margin:4px; + width:608px; + height:12px; + font-family:sans-serif; + font-size:10px; + padding:1px; + padding-left:15px; + color: white; + border: 0px; + background: rgba(0, 0, 0, 0.6); +} +#messagelist { + margin:4px 4px 0px 4px; + width:622px; + max-height:198px; + font-family:sans-serif; + font-size: 10px; + padding:1px; + color: white; + background: rgba(0, 0, 0, 0.6); + overflow:hidden; + display:none; +} +#messagerow { + position:relative; + left:0px; + bottom:0px; + max-height:200px; + font-family:sans-serif; + font-size: 10px; + color: white; +} +.messageicon { + position:relative; + left:0px; + top:1px; +} +.messagetext { + position:relative; + left:0px; + top:-3px; +} \ No newline at end of file diff --git a/web/index.html b/web/index.html index a5eb61e9..9886c1d6 100644 --- a/web/index.html +++ b/web/index.html @@ -12,6 +12,7 @@ + @@ -21,6 +22,7 @@ +