--- no_pager/jquery-log.js 2006/08/18 11:54:32 30 +++ no_pager/jquery-log.js 2006/08/18 15:35:54 37 @@ -4,13 +4,12 @@ 2006-08-18 Dobrica Pavlinusic */ -var _log_count = { - info: 0, - debug: 0, - error: 0 -}; +var _log_count; $.log = { + + /* semi-private functions */ + join: function(a) { var m = ''; for (var i=0; i' + m + ''; + $('#jql').append( html ); + //$('#jql').prepend( html ); + + // refresh count + $('#jql-counter').html( + ''+_log_count.info+' ' + + ''+_log_count.debug+' ' + + ''+_log_count.error+'' + ); + }, + + /* public functions */ + + create: function() { - counter: function() { - $('#debug-counter').html( - ''+_log_count.info+' ' + - ''+_log_count.debug+' ' + - ''+_log_count.error+'' + $('body').append( + '
' + + 'X' + + '
' + + '
' + + '?' + + '
' ); + + _log_count = { + info: 0, + debug: 0, + error: 0 + }; + + this.debug('created logger'); + }, + + toggle: function() { + $('#jql').toggle(); + $('#jql-show').toggle(); + return false; }, info: function() { - if (arguments) { - _log_count.info++; - $('#debug').append( '
'+this.join(arguments)+'
' ); - this.counter(); - } + if (arguments) this.insert( 'info', this.join(arguments) ); }, debug: function() { - if (arguments) { - _log_count.debug++; - $('#debug').append( '
'+this.join(arguments)+'
' ); - this.counter(); - } + if (arguments) this.insert( 'debug', this.join(arguments) ); }, error: function() { - if (arguments) { - _log_count.error++; - $('#debug').append( '
'+this.join(arguments)+'
' ); - this.counter(); - } - }, + if (arguments) this.insert( 'error', this.join(arguments) ); + } }; +