--- jquery/jquery-log.js 2006/08/18 17:13:13 40 +++ jquery/jquery-log.js 2006/08/22 16:14:55 60 @@ -17,13 +17,14 @@ return m; }, - insert: function(class, m) { + insert: function(what, m) { if (! _jql) this.create(); + if (! _jql.on[what]) return; - _jql.count[ class ]++; + _jql.count[ what ]++; - var html = '
'; $('#jql-log').append( html ); //$('#jql-log').prepend( html ); @@ -34,6 +35,14 @@ ''+_jql.count.debug+' ' + ''+_jql.count.error+'' ); + + this.scroll(); + }, + + scroll: function() { + // poor man's scroll to bottom + var e = document.getElementById('jql-log'); + e.scrollTop = e.scrollHeight - e.clientHeight; }, /* public functions */ @@ -43,9 +52,9 @@ $('body').append( '
' + 'clean | ' + - 'info ' + - 'debug ' + - 'error | ' + + 'info ' + + 'debug ' + + 'error | ' + 'close' + '
' + '
' + @@ -74,13 +83,19 @@ toggle: function( what ) { if (what) { $.log.debug('toggle '+what); - $('.jql-'+what).toggle(); + $('#jql-log .jql-'+what).toggle(); _jql.on[what] = ! _jql.on[what]; + if (_jql.on[what]) { + $('#jql-bar .jql-'+what).removeClass('jql-disabled'); + } else { + $('#jql-bar .jql-'+what).addClass('jql-disabled'); + } } else { $.log.debug('toggle logger'); $('#jql').toggle(); $('#jql-show').toggle(); } + this.scroll(); return false; },