Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Added group functionality... Better documentation, and icons for erro…

…rs, warnings, and info...
  • Loading branch information...
commit 13510ca4a9f0b3a3226fe432e0639d0bc930ab0c 1 parent 0a6dc4f
authored July 08, 2010
8  README.md
Source Rendered
@@ -24,8 +24,10 @@ Setup
24 24
 
25 25
 * Paste `<script type="application/x-javascript" src="http://YOUR_IP:8001/ibug.js"></script>` into the page you want to debug.
26 26
 
27  
-* Open the page you want to debug in your browser. This is your **client**.
  27
+* Open the page you want to debug in your phone browser. This is your **client**.
28 28
 
29  
-* Type `alert('Hello world!')` in your console window.
  29
+* Type `alert('Hello world!')` in your console window, if your phone displays 'Hello World' you are in business...
30 30
 
31  
-* BAM.
  31
+* It will then act like a firebug console, you can examine variables by typing their name... To get a proper breakdown type console.dir(varName).
  32
+
  33
+* The following console functions are supported: console.log, console.debug, console.info, console.warn, console.assert, console.dir, console.dirxml, console.group, console.groupEnd, console.time, console.timeEnd, console.onError, console.$ (shortcut for document.getElementById), console.$$ (shortcut for document.getElementsByTagName), console.command (default action) 
21  ibug.js
@@ -364,7 +364,26 @@ if (!("console" in window) || !("firebug" in console)) {
364 364
     function logRow(message, className, handler) {    
365 365
         sendMessage(className + "||" + message.join(""));
366 366
     }
367  
-        
  367
+       
  368
+
  369
+    function pushGroup(message, className)
  370
+    {
  371
+        logFormatted(message, className);
  372
+
  373
+        var groupRow = consoleBody.ownerDocument.createElement("div");
  374
+        groupRow.className = "logGroup";
  375
+        var groupRowBox = consoleBody.ownerDocument.createElement("div");
  376
+        groupRowBox.className = "logGroupBox";
  377
+        groupRow.appendChild(groupRowBox);
  378
+        appendRow(groupRowBox);
  379
+        groupStack.push(groupRowBox);
  380
+    }
  381
+
  382
+    function popGroup()
  383
+    {
  384
+        groupStack.pop();
  385
+    }
  386
+
368 387
     function logFormatted(objects, className) {
369 388
         var html = [];
370 389
 
36  server.js
@@ -47,8 +47,8 @@ var channel = new function () {
47 47
     queue[messageNumber][bitNumber] = encodedBit
48 48
         
49 49
     // If all bits in a message are here, send it.
50  
-    if (queue[messageNumber][bitLength] >= bitLength && queue.callback) {
51  
-      sys.puts('All bits are here, sending message');
  50
+    if (queue[messageNumber][bitLength] >= bitLength && queue.callback) { 
  51
+      // sys.puts('All bits are here, sending message');
52 52
       var message;
53 53
       var callback = queue.callback;
54 54
       queue.callback = null;
@@ -66,21 +66,23 @@ var channel = new function () {
66 66
     
67 67
       callback(message);
68 68
     }
69  
-    else
70  
-    {
71  
-        if (!queue.callback)
72  
-        {
73  
-            sys.puts('No callback set');
74  
-        }
75  
-        else
76  
-        {
77  
-            sys.puts('Waiting for more bits, queueBitlength: ' + queue[messageNumber][bitLength] + ' requested: ' + bitLength);
78  
-        }
79  
-    }
  69
+//    else
  70
+//    {
  71
+//        if (!queue.callback)
  72
+//        {
  73
+//            sys.puts('No callback set');
  74
+//        }
  75
+//        else
  76
+//        {
  77
+//            sys.puts('Waiting for more bits, queueBitlength: ' + queue[messageNumber][bitLength] + ' requested: ' + bitLength);
  78
+//        }
  79
+//    }
  80
+
  81
+
80 82
   };
81 83
   
82  
-  this.listen = function (queueName, callback) {
83  
-    sys.puts("Adding callback for channel " + queueName);
  84
+  this.listen = function (queueName, callback) { 
  85
+    // sys.puts('All bits are here, sending message');
84 86
     var queue = this.getQueue(queueName);
85 87
     queue.callback = callback;
86 88
   };
@@ -92,8 +94,10 @@ fu.get("/", fu.staticHandler("firebug.html"));
92 94
 fu.get("/firebug.css", fu.staticHandler("firebug.css"));
93 95
 fu.get("/firebug.js", fu.staticHandler("firebug.js"));
94 96
 fu.get("/ibug.js", fu.staticHandler("ibug.js"));
  97
+fu.get("/warningIcon.png", fu.staticHandler("warningIcon.png"));
  98
+fu.get("/errorIcon.png", fu.staticHandler("errorIcon.png"));
  99
+fu.get("/infoIcon.png", fu.staticHandler("infoIcon.png"));
95 100
 
96  
-// TODO: DRY us up!
97 101
 
98 102
 fu.get("/response", function (req, res) {
99 103
   // HACK: The message has been split, so don't decode it until it's all here.

0 notes on commit 13510ca

Please sign in to comment.
Something went wrong with that request. Please try again.