From 3484816325e2db50f2a9f87093b3a12b13648016 Mon Sep 17 00:00:00 2001 From: Mike Primm Date: Mon, 9 Jan 2012 01:53:28 +0800 Subject: [PATCH] Add 'hidechat=true' URL parameter to hide all chat input/output --- web/js/chat.js | 4 ++++ web/js/chatballoon.js | 4 ++++ web/js/chatbox.js | 4 ++++ 3 files changed, 12 insertions(+) diff --git a/web/js/chat.js b/web/js/chat.js index d5b13e0f..d9a459e8 100644 --- a/web/js/chat.js +++ b/web/js/chat.js @@ -8,6 +8,10 @@ $.ajax({ componentconstructors['chat'] = function(dynmap, configuration) { var me = this; + + if(dynmap.getBoolParameterByName("hidechat")) + return; + // Provides 'chat'-events by monitoring the world-updates. $(dynmap).bind('worldupdate', function(event, update) { swtch(update.type, { diff --git a/web/js/chatballoon.js b/web/js/chatballoon.js index 0155fe81..ec4becc7 100644 --- a/web/js/chatballoon.js +++ b/web/js/chatballoon.js @@ -1,5 +1,9 @@ componentconstructors['chatballoon'] = function(dynmap, configuration) { var me = this; + + if(dynmap.getBoolParameterByName("hidechat")) + return; + me.chatpopups = {}; $(dynmap).bind('playerupdated', function(event, player) { var popup = me.chatpopups[player.name]; diff --git a/web/js/chatbox.js b/web/js/chatbox.js index bdd8b82f..119dd4aa 100644 --- a/web/js/chatbox.js +++ b/web/js/chatbox.js @@ -1,5 +1,9 @@ componentconstructors['chatbox'] = function(dynmap, configuration) { var me = this; + + if(dynmap.getBoolParameterByName("hidechat")) + return; + var chat = $('
') .addClass('chat') .appendTo(dynmap.options.container);