/[jquery]/jquery/jquery-log.js
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /jquery/jquery-log.js

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 32 by dpavlin, Fri Aug 18 13:09:28 2006 UTC revision 37 by dpavlin, Fri Aug 18 15:35:54 2006 UTC
# Line 17  $.log = { Line 17  $.log = {
17                  return m;                  return m;
18          },          },
19    
20          counter: function() {          insert: function(class, m) {
21                  $('#debug-counter').html(                  if (! _log_count) this.create();
                         '<span class="log-info">'+_log_count.info+'</span> ' +  
                         '<span class="log-debug">'+_log_count.debug+'</span> ' +  
                         '<span class="log-error">'+_log_count.error+'</span>'  
                 );  
         },  
22    
23          toggle: function() {                  _log_count[ class ]++;
24                  $('#debug').toggle();  
25                  $('#debug_show').toggle();                  var html = '<div class="jql-' + class + '">' + m + '</div>';
26                  return false;                  $('#jql').append( html );
27                    //$('#jql').prepend( html );
28    
29                    // refresh count
30                    $('#jql-counter').html(
31                            '<span class="jql-info">'+_log_count.info+'</span> ' +
32                            '<span class="jql-debug">'+_log_count.debug+'</span> ' +
33                            '<span class="jql-error">'+_log_count.error+'</span>'
34                    );
35          },          },
36    
37          /* public functions */          /* public functions */
# Line 36  $.log = { Line 39  $.log = {
39          create: function() {          create: function() {
40    
41                  $('body').append(                  $('body').append(
42                  '<div id="debug" class="debug">' +                  '<div id="jql" class="jql">' +
43                  '<a class="hide" href="#" onclick="javascript:return $.log.toggle();">X</a>' +                  '<a class="hide" href="#" onclick="javascript:return $.log.toggle();">X</a>' +
44                  '</div>' +                  '</div>' +
45                  '<div id="debug_show" class="debug">' +                  '<div id="jql-show" class="jql">' +
46                  '<a class="hide" href="#" onclick="javascript:return $.log.toggle();"><span id="debug-counter">?</span></a>' +                  '<a class="hide" href="#" onclick="javascript:return $.log.toggle();"><span id="jql-counter">?</span></a>' +
47                  '</div>'                  '</div>'
48                  );                  );
49    
# Line 53  $.log = { Line 56  $.log = {
56                  this.debug('created logger');                  this.debug('created logger');
57          },          },
58    
59            toggle: function() {
60                    $('#jql').toggle();
61                    $('#jql-show').toggle();
62                    return false;
63            },
64    
65          info: function() {          info: function() {
66                  if (arguments) {                  if (arguments) this.insert( 'info', this.join(arguments) );
                         if (! _log_count) this.create();  
                         _log_count.info++;  
                         $('#debug').append( '<div class="log-info">'+this.join(arguments)+'</div>' );  
                         this.counter();  
                 }  
67          },          },
68          debug: function() {          debug: function() {
69                  if (arguments) {                  if (arguments) this.insert( 'debug', this.join(arguments) );
                         if (! _log_count) this.create();  
                         _log_count.debug++;  
                         $('#debug').append( '<div class="log-debug">'+this.join(arguments)+'</div>' );  
                         this.counter();  
                 }  
70          },          },
71          error: function() {          error: function() {
72                  if (arguments) {                  if (arguments) this.insert( 'error', this.join(arguments) );
                         if (! _log_count) this.create();  
                         _log_count.error++;  
                         $('#debug').append( '<div class="log-error">'+this.join(arguments)+'</div>' );  
                         this.counter();  
                 }  
73          }          }
74  };  };
75    

Legend:
Removed from v.32  
changed lines
  Added in v.37

  ViewVC Help
Powered by ViewVC 1.1.26