Added debug menu option and started tidying up 'window' handling

This commit is contained in:
Jon Benson
2013-05-07 14:09:30 +10:00
parent d97b78fafb
commit 0108d1b49c
11 changed files with 62 additions and 30 deletions

View File

@ -48,16 +48,23 @@ window.debug.console = function() {
$('#debugconsole').text();
}
window.debug.console.create = function() {
if($('#debugconsole').length) return;
$('#chatcontrols').append('<a>debug</a>');
$('#chatcontrols a:last').click(function() {
window.debug.console.show = function() {
$('#scrollwrapper, #updatestatus').hide();
// not displaying the map causes bugs in Leaflet
$('#map').css('visibility', 'hidden');
$('#chat, #chatinput').show();
window.debug.console.create();
$('#chatinput mark').css('cssText', 'color: #bbb !important').text('debug:');
$('#chat > div').hide();
$('#debugconsole').show();
$('#chatcontrols .active').removeClass('active');
$(this).addClass('active');
});
}
window.debug.console.create = function() {
if($('#debugconsole').length) return;
$('#chatcontrols').append('<a>debug</a>');
$('#chatcontrols a:last').click(window.debug.console.show);
$('#chat').append('<div style="display: none" id="debugconsole"><table></table></div>');
}