diff -rwNpu6 repository/chrome/content/firebug/browserOverlay.xul watches/chrome/content/firebug/browserOverlay.xul
--- repository/chrome/content/firebug/browserOverlay.xul 2006-08-16 19:48:26.000000000 +0200
+++ watches/chrome/content/firebug/browserOverlay.xul 2006-08-01 12:19:48.000000000 +0200
@@ -45,12 +45,13 @@
disabled="true"/>
+
@@ -288,18 +289,32 @@
oncommand="FireBug.toggleOption(this)"
option="enableDebugger"/>
-
-
diff -rwNpu6 repository/chrome/content/firebug/firebug.js watches/chrome/content/firebug/firebug.js
--- repository/chrome/content/firebug/firebug.js 2006-08-16 19:48:26.000000000 +0200
+++ watches/chrome/content/firebug/firebug.js 2006-08-01 15:59:26.000000000 +0200
@@ -59,14 +59,14 @@ var FireBug =
boolPrefNames: [
"disabled", "closedByDefault",
"showJSErrors", "showJSWarnings", "showCSSErrors", "showXMLErrors",
"showWebErrors", "showChromeErrors", "showMessages", "showExternalErrors",
"showXMLHttpRequests", "throttleMessages", "showStackTrace",
- "showAllStyles", "showFunctions", "showConstants",
- "enableDebugger", "breakOnErrors"],
+ "showAllStyles", "showFunctions", "showConstants", "showLocals",
+ "showWatches", "enableDebugger", "breakOnErrors"],
inspecting: false,
inspectedWindow: null,
inspectedElement: null,
inspectingStack: [],
highlightedElements: []
@@ -461,12 +462,17 @@ FireBug.createContext = function(win)
window: win,
browser: browser,
contextNodes: {},
selectedObject: null,
errorCount: 0,
spies: [],
+ watches: {},
+ treeState: {
+ property: {},
+ watch: {}
+ },
history: [],
historyIndex: -1,
messageQueue: [],
hoverNode: null,
attachedStyles: false
};
@@ -506,12 +512,13 @@ FireBug.destroyContext = function(contex
for (var i in context.spies)
{
var spy = context.spies[i];
spy.detach();
}
context.spies = null;
+ context.watches = null;
var win = context.window;
win.removeEventListener("unload", context.onUnload, true);
function detach(context, win) { FireBug.unhookWindow(context, win); }
this.iterateWindows(context, win, detach);
@@ -788,12 +795,42 @@ FireBug.validateViews = function(object)
FireBug.updateObjectPath = function(object)
{
this.pathText.value = this.getObjectPath(object);
}
+
+/**
+ * Keeps track of node expanding and collapsing in the DOM/JS trees.
+ */
+FireBug.expandObjectNode = function(dataType, expr)
+{
+ if (dataType == "DOM")
+ return;
+ var nodeToExpand = this.currentContext.treeState[dataType];
+ while (expr.length > 0)
+ {
+ var currentExpr = expr.shift();
+ if (!nodeToExpand[currentExpr])
+ nodeToExpand[currentExpr] = {};
+
+ nodeToExpand = nodeToExpand[currentExpr];
+ }
+}
+
+FireBug.collapseObjectNode = function(dataType, expr)
+{
+ if (dataType == "DOM")
+ return;
+ var nodeToDelete = this.currentContext.treeState[dataType];
+ while (nodeToDelete && (expr[0] in nodeToDelete) && (expr.length > 1))
+ nodeToDelete = nodeToDelete[expr.shift()];
+ delete nodeToDelete[expr.shift()];
+}
+
+
FireBug.viewSupportsObject = function(view, object)
{
if (view)
{
try {
// This tends to throw exceptions a lot because some objects are weird
@@ -1121,19 +1158,38 @@ FireBug.toggleOption = function(menuitem
for (var i in this.boolPrefNames)
{
var prefName = this.boolPrefNames[i];
if (prefName == option)
{
this.setBoolPref(prefName, checked);
+ this.setOption(prefName, checked);
if (this.currentContext)
this.currentContext.view.setOption(prefName, checked);
break;
}
}
}
+FireBug.setOption = function(name, value)
+{
+ if (name == "showFunctions")
+ {
+ if ("contextNode" in this.views.dom)
+ this.views.dom.contextNode.setAttribute("showFunctions", value);
+ if (this.views.js.context && this.views.js.context.contextNodes["trace"])
+ this.views.js.context.contextNodes["trace"].setAttribute("showFunctions", value);
+ }
+ else if (name == "showConstants")
+ {
+ if ("contextNode" in this.views.dom)
+ this.views.dom.contextNode.setAttribute("showConstants", value);
+ if (this.views.js.context && this.views.js.context.contextNodes["trace"])
+ this.views.js.context.contextNodes["trace"].setAttribute("showConstants", value);
+ }
+}
+
FireBug.clearConsole = function()
{
this.currentContext.view.clear();
}
FireBug.focusCommandLine = function()
@@ -1153,15 +1209,14 @@ FireBug.focusSearch = function()
FireBug.increaseErrorCount = function(context)
{
if (!context)
context = this.currentContext;
- context.errorCount++;
- if (this.currentContext)
- this.showErrorCount(this.currentContext.errorCount);
+ if (context)
+ this.showErrorCount(++context.errorCount);
}
FireBug.showErrorCount = function(errorCount)
{
if (errorCount)
{
@@ -1654,12 +1709,79 @@ FireBug.stepOutDebugger = function()
FireBug.clearAllBreakpoints = function()
{
this.debuggr.clearAllBreakpoints(this.currentContext);
}
+FireBug.onDOMValueDblClick = function(event)
+{
+ var node = event.target;
+ while (node.nodeName != "TR")
+ node = node.parentNode;
+ FireBug.changeValue(node);
+}
+FireBug.changeValue = function(node)
+{
+ function onKP(e) {
+ if (e.keyCode == 13) // return
+ FireBugCommandLine.evaluate(varName + " = " + input.value);
+
+ if ((e.keyCode == 27) || (e.keyCode == 13)) // escape or return
+ {
+ me.views.js.updateWatchNode(me.currentContext);
+
+ // Make sure we clear our references (memleaks and all that)
+ input.removeEventListener("keypress", onKP, false);
+ input = null;
+ node = null;
+ me = null;
+ }
+ }
+ var me = this;
+ var varName = makeExpression(FireBug_makeObjectExpressionAry(node));
+ FireBugUtils.clearNode(node.lastChild);
+
+ var input = node.ownerDocument.createElement("input");
+ input.addEventListener("keypress", onKP, false);
+ input.className = "inlineJSEditor";
+
+ var initialValue = FireBugCommandLine.evaluate(varName)
+ if (typeof(initialValue) == "undefined")
+ initialValue = "undefined";
+ else if (initialValue === null)
+ initialValue = "null";
+ else
+ initialValue = initialValue.toSource();
+
+ // toSource gets a bit tedious for simple things:
+ input.value = initialValue.replace(/^\(new (?:String|Number|Boolean)\((.*)\)\)$/, "$1");
+ node.lastChild.appendChild(input);
+ input.focus();
+
+}
+
+FireBug.setWatch = function(str)
+{
+ this.currentContext.watches[str] = null;
+ this.views.js.updateWatchNode(this.currentContext);
+}
+
+FireBug.clearWatch = function(e)
+{
+ var node = e.target.parentNode.parentNode;
+ var varName = node.firstChild.lastChild.textContent;
+ delete this.currentContext.watches[varName];
+ this.views.js.updateWatchNode(this.currentContext);
+}
+
+FireBug.clearAllWatches = function()
+{
+ this.currentContext.watches = {};
+ this.currentContext.view.updateWatchNode(this.currentContext);
+}
+
///////////////////////////////////////////////////////////////////////////////////////////////////
FireBug.search = function(text)
{
this.searchBox.value = text;
this.updateSearch();
@@ -1938,34 +2060,23 @@ var FireBugConsoleListener =
{
try
{
if (object instanceof Components.interfaces.nsIScriptError)
{
var isWarning = object.flags & Components.interfaces.nsIScriptError.warningFlag;
- var isJSError = (object.category.indexOf("javascript") > -1) && !isWarning;
- var context = null;
- try {
- if (!FireBug.showExternalErrors)
- {
- var win = FireBug.views.js.firebugService.lastErrorWindow;
- var context = FireBug.getContextByWindow(win);
- }
- }
- catch (ex) {}
-
- if (!FireBug.categoryFilter(object.sourceName, object.category, isWarning) ||
- ((!isJSError || !context) && !FireBug.domainFilter(object.sourceName)))
+ if (!FireBug.categoryFilter(object.sourceName, object.category, isWarning)
+ || !FireBug.domainFilter(object.sourceName))
return;
if (!isWarning)
- FireBug.increaseErrorCount(context);
+ FireBug.increaseErrorCount();
if (object.flags & Components.interfaces.nsIScriptError.warningFlag)
- FireBug.console.log(object, "consoleWarning", null, context);
+ FireBug.console.log(object, "consoleWarning");
else
- FireBug.console.log(object, "consoleError", null, context);
+ FireBug.console.log(object, "consoleError");
}
else if (FireBug.showMessages)
FireBug.console.log(object, "object");
}
catch (exc)
{
diff -rwNpu6 repository/chrome/content/firebug/loggers.js watches/chrome/content/firebug/loggers.js
--- repository/chrome/content/firebug/loggers.js 2006-08-16 19:45:42.000000000 +0200
+++ watches/chrome/content/firebug/loggers.js 2006-08-01 15:41:32.000000000 +0200
@@ -676,142 +676,194 @@ function FireBug_logSourceFile(sourceFil
loadURLAsync(sourceFile.href, loader);
}
else
FireBug_logSourceString(sourceFile.text, logRow, precision);
}
-function FireBug_logDOM(object, logRow, precision, partial)
+function FireBug_logDOM(object, logRow, precision, partial, dataType)
{
var doc = logRow.ownerDocument;
function isFunction(value) { return (typeof value) == "function"; }
function isNotFunction(value) { return (typeof value) != "function"; }
precision = precision > 0 ? precision-1 : 0;
+ if (!dataType)
+ dataType = "DOM";
var objectType = typeof(object);
if (objectType == "function")
{
FireBug_logSourceString(object+"", logRow);
}
else if (objectType == "string")
{
FireBug_logSourceString(object, logRow);
}
else if (objectType == "object")
{
- var table = doc.createElement("table");
-
+ if (logRow.nodeName.toLowerCase() != "table")
+ {
+ var table = doc.createElement("table")
+ logRow.appendChild(table);
+ logRow = table;
+ }
+ var tbody = doc.createElement("tbody");
+ tbody.setAttribute("jsExpression", logRow.getAttribute("jsExpression"));
+ tbody.className = dataType + "Body";
+ logRow.appendChild(tbody);
for (var name in object)
{
try
{
- FireBug_createObjectRow(name, object[name], isNotFunction, table, precision);
+ FireBug_createObjectRow(name, object[name], isNotFunction, tbody, precision, dataType);
}
catch (exc) {}
}
for (var name in object)
{
try
{
- FireBug_createObjectRow(name, object[name], isFunction, table, precision);
+ FireBug_createObjectRow(name, object[name], isFunction, tbody, precision, dataType);
}
catch (exc) {}
}
-
- logRow.appendChild(table);
}
}
-function FireBug_createObjectRow(name, value, filter, table, precision)
+function FireBug_createObjectRow(name, value, filter, table, precision, dataType)
{
if ((filter && !filter(value)))
return;
var isFunction = typeof(value) == "function";
var isConstant = FireBugUtils.isAllUpperCase(name);
var doc = table.ownerDocument;
var tr = doc.createElement("tr");
- tr.className = "propertyRow" +
- (isFunction ? " propertyRow-function" : "") +
- (isConstant ? " propertyRow-constant" : "");
+ tr.setAttribute("jsExpression", name);
+ tr.className = dataType + "Row" +
+ (isFunction ? " " + dataType + "Row-function" : "") +
+ (isConstant ? " " + dataType + "Row-constant" : "");
var td = doc.createElement("td");
td.setAttribute("valign", "top");
td.noWrap = true;
- td.className = "propertyLabel";
+ td.className = dataType + "Label";
// Create the property name
var labelElt = doc.createElement("span");
- labelElt.className = "propertyName";
+ labelElt.className = dataType + "Name";
var labelText = doc.createTextNode(name);
labelElt.appendChild(labelText);
tr.appendChild(td);
// Create the twisty if the value is an object
var valueType = typeof(value);
if (valueType == "function" || (valueType == "object" && value != null)
|| (valueType == "string" && value.length > FireBug.stringCropLength))
{
- td.className += " propertyContainerLabel"
- labelElt.className += " propertyContainerName"
+ td.className += " " + dataType + "ContainerLabel"
+ labelElt.className += " " + dataType + "ContainerName"
var twisty = doc.createElement("img");
twisty.src = "blank.gif";
- twisty.className = "twisty propertyTwisty";
+ twisty.className = "twisty " + dataType + "Twisty";
td.appendChild(twisty);
var self = this;
labelElt.onclick = function() { FireBug_toggleObjectRow(value, tr); }
twisty.onclick = function() { FireBug_toggleObjectRow(value, tr); }
}
td.appendChild(labelElt);
// Create the property value
td = doc.createElement("td");
- td.className = "propertyValue";
+ td.className = dataType + "Value";
td.setAttribute("valign", "top");
+ if (dataType == "property")
+ td.addEventListener("dblclick", FireBug.onDOMValueDblClick, false);
FireBug_appendObject(value, td, 0, true);
tr.appendChild(td);
+ // Make sure we don't add X's to all rows, just the top ones.
+ if (dataType == "watch" && table && table.parentNode &&
+ table.parentNode.className.indexOf("traceTable") >= 0)
+ {
+ const XUL_NS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
+ var closeButton = doc.createElementNS(XUL_NS, "xul:image");
+ closeButton.className = "watchRemoveButton";
+ closeButton.addEventListener("click", function(e) { FireBug.clearWatch(e) }, false);
+ var secondTD = doc.createElement("td");
+ secondTD.appendChild(closeButton);
+ secondTD.setAttribute("width", "16px");
+ tr.appendChild(secondTD);
+ // Most important cell:
+ td.setAttribute("width", "*");
+ }
+ else
+ {
+ td.setAttribute("colspan", 2);
+ }
table.appendChild(tr);
if (valueType == "object" && value != null && precision > 0)
FireBug_toggleObjectRow(value, tr, precision);
}
function FireBug_toggleObjectRow(object, tr, precision)
{
var doc = tr.ownerDocument;
var twisty = tr.firstChild.firstChild;
+ var dataType = tr.className.match(/property|watch|DOM/)[0];
+ var expr = tr.getAttribute("jsExpression");
+ var exprAry = FireBug_makeObjectExpressionAry(tr);
- if (tr.nextSibling && tr.nextSibling.className == "propertyChildRow")
+ if (tr.nextSibling && (tr.nextSibling.className == (dataType + "ChildRow")))
{
FireBugUtils.removeClass(twisty, "open");
-
tr.parentNode.removeChild(tr.nextSibling);
+
+ FireBug.collapseObjectNode(dataType, exprAry);
}
else
{
FireBugUtils.setClass(twisty, "open");
var td = doc.createElement("td");
- td.className = "propertyChildBox";
- td.setAttribute("colspan", 2);
+ td.className = dataType + "ChildBox";
+ td.setAttribute("colspan", 3);
+ var table = doc.createElement("table");
+ table.setAttribute("jsExpression", expr);
+ td.appendChild(table);
- FireBug_logDOM(object, td, precision);
+ FireBug_logDOM(object, td.firstChild, precision, null, dataType);
var newRow = doc.createElement("tr");
- newRow.className = "propertyChildRow";
+ newRow.setAttribute("jsExpression", expr);
+ newRow.className = dataType + "ChildRow";
newRow.appendChild(td);
if (tr.nextSibling)
tr.parentNode.insertBefore(newRow, tr.nextSibling);
else
tr.parentNode.appendChild(newRow);
+ FireBug.expandObjectNode(dataType, exprAry);
+ }
+}
+
+function FireBug_makeObjectExpressionAry(tr)
+{
+ var ary = [tr.getAttribute("jsExpression")];
+ while (tr && tr.parentNode && tr.parentNode.parentNode &&
+ tr.parentNode.parentNode.parentNode &&
+ tr.parentNode.parentNode.className.indexOf("traceTable") == -1)
+ {
+ tr = tr.parentNode.parentNode.parentNode.parentNode.previousSibling;
+ ary.unshift(tr.getAttribute("jsExpression"));
}
+ return ary;
}
diff -rwNpu6 repository/chrome/content/firebug/utils.js watches/chrome/content/firebug/utils.js
--- repository/chrome/content/firebug/utils.js 2006-08-16 19:48:26.000000000 +0200
+++ watches/chrome/content/firebug/utils.js 2006-08-01 18:22:28.000000000 +0200
@@ -951,6 +951,31 @@ function sliceArray(array, index)
var slice = [];
for (var i = index; i < array.length; ++i)
slice.push(array[i]);
return slice;
}
+
+function makeExpression(items)
+{
+ function escapeItem(item)
+ {
+ // Numbers.
+ if (item.match(/^[0-9]+$/i))
+ return "[" + item + "]";
+ // Words/other items that don't need quoting.
+ if (item.match(/^[a-z_][a-z0-9_]+$/i))
+ return "." + item;
+ // Quote everything else.
+ return "[" + item.quote() + "]";
+ };
+
+ if ((/\s/).test(items[0]))
+ var expression = "(" + items[0] + ")";
+ else
+ expression = items[0];
+
+ for (var i = 1; i < items.length; i++)
+ expression += escapeItem(items[i], false);
+
+ return expression;
+}
diff -rwNpu6 repository/chrome/content/firebug/views/dom.js watches/chrome/content/firebug/views/dom.js
--- repository/chrome/content/firebug/views/dom.js 2006-08-16 19:45:40.000000000 +0200
+++ watches/chrome/content/firebug/views/dom.js 2006-08-01 12:19:48.000000000 +0200
@@ -74,11 +74,8 @@ FireBugDOMView.prototype.inspect = funct
FireBugDOMView.prototype.stopInspecting = function(cancelled)
{
}
FireBugDOMView.prototype.setOption = function(name, value)
{
- if (name == "showFunctions")
- this.contextNode.setAttribute("showFunctions", value);
- else if (name == "showConstants")
- this.contextNode.setAttribute("showConstants", value);
+
}
diff -rwNpu6 repository/chrome/content/firebug/views/js.js watches/chrome/content/firebug/views/js.js
--- repository/chrome/content/firebug/views/js.js 2006-08-16 19:48:26.000000000 +0200
+++ watches/chrome/content/firebug/views/js.js 2006-08-10 13:22:32.000000000 +0200
@@ -124,18 +124,27 @@ FireBugJSView.prototype.saveState = func
state.lastScriptScrollY = contextNode.scrollTop;
}
}
FireBugJSView.prototype.setOption = function(name, value)
{
- if (name == "enableDebugger")
+ var cxNode = FireBug.currentContext.contextNodes["trace"];
+ switch (name)
{
+ case "enableDebugger":
if (value)
this.enable();
else
this.disable();
+ break;
+ case "showLocals":
+ cxNode.setAttribute("showLocals", value)
+ break;
+ case "showWatches":
+ cxNode.setAttribute("showWatches", value)
+ break;
}
}
FireBugJSView.prototype.searchable = true;
FireBugJSView.prototype.search = function(text)
@@ -625,35 +634,15 @@ FireBugJSView.prototype.showStackFrame =
if (!this.browserLoaded)
{
this.postBrowserLoad = bindFunction(this.showStackFrame, this, context, frame);
return;
}
- else if (!context.contextNodes["trace"])
- {
- context.contextNodes["trace"] = FireBug.createContextNode("trace");
- this.debugBrowser.contentDocument.body.appendChild(context.contextNodes["trace"]);
- }
- else
- FireBugUtils.clearNode(context.contextNodes["trace"]);
- var data = {};
- data["this"] = frame.thisValue.getWrappedValue();
-
- var listValue = {value: null}, lengthValue = {value: 0};
- frame.scope.getProperties(listValue, lengthValue);
-
- for (var i = 0; i < lengthValue.value; ++i)
- {
- var prop = listValue.value[i];
- var name = prop.name.getWrappedValue();
- var value = prop.value.getWrappedValue();
- data[name] = value;
- }
-
- FireBug_logDOM(data, context.contextNodes["trace"]);
+ // Display locals & watches
+ this.updateWatchNode(context);
for (var menu = this.stackMenu.firstChild; menu; menu = menu.nextSibling)
{
if (menu.stackFrame == frame)
{
this.stackList.selectedItem = menu;
@@ -674,12 +663,123 @@ FireBugJSView.prototype.showStackFrame =
this.showScript(scriptFile, frame.line);
this.showWatchNode(context.contextNodes["trace"]);
}
+FireBugJSView.prototype.updateWatchNode = function(context)
+{
+ function onKP(e) {
+ if (e.keyCode == 13) // return
+ FireBug.setWatch(input.value);
+
+ if (e.keyCode == 27 || e.keyCode == 13) // escape or return
+ input.value = "";
+ };
+
+ var doc = this.debugBrowser.contentDocument;
+ if (!context.contextNodes["trace"])
+ {
+ context.contextNodes["trace"] = FireBug.createContextNode("trace");
+ doc.body.appendChild(context.contextNodes["trace"]);
+
+ // Quick watch entering
+ // Tiny table to frame this in:
+ var container = doc.createElement("table");
+ container.id = "watchEntryContainer";
+ container.appendChild(doc.createElement("tr"));
+ container.firstChild.appendChild(doc.createElement("td"));
+ container.firstChild.appendChild(doc.createElement("td"));
+ var watchLabel = doc.createTextNode(FireBug.strings.getString("Watch"));
+ container.firstChild.firstChild.appendChild(watchLabel);
+
+ // Actual input:
+ var input = doc.createElement("input");
+ input.id = "quickWatchBox";
+ input.className = "inlineJSEditor";
+ input.addEventListener("keypress", onKP, false);
+ container.firstChild.lastChild.appendChild(input);
+ context.contextNodes["trace"].appendChild(container);
+ }
+
+ // Create a table for the locals and watches.
+ var table = doc.createElement("table");
+ table.className = "traceTable";
+
+ // Display watches
+ for (var expr in context.watches)
+ context.watches[expr] = FireBugCommandLine.evaluate(expr);
+
+
+ FireBug_logDOM(context.watches, table, null, null, "watch");
+
+ var frame = context.currentFrame;
+
+ // Gather local variables
+ var locals = {};
+ locals["this"] = frame.thisValue.getWrappedValue();
+
+ var listValue = {value: null}, lengthValue = {value: 0};
+ frame.scope.getProperties(listValue, lengthValue);
+
+ for (var i = 0; i < lengthValue.value; ++i)
+ {
+ var prop = listValue.value[i];
+ var name = prop.name.getWrappedValue();
+ var value = prop.value.getWrappedValue();
+ locals[name] = value;
+ }
+
+
+ // Display local variables
+ FireBug_logDOM(locals, table, null, null, "property");
+
+ // Expand the nodes if they were expanded before:
+ var newTreeState = {
+ property: {},
+ watch: {}
+ };
+
+ function expandSubNodes(treeNode, newTreeNode, parentTable, obj)
+ {
+ for (var i = 0; i < parentTable.rows.length; ++i)
+ {
+ // Skip child containers:
+ var tr = parentTable.rows[i];
+ if (tr.className.indexOf("ChildRow") > 0)
+ continue;
+
+ var currentExpr = tr.getAttribute("jsExpression");
+ if (currentExpr in treeNode)
+ {
+ // This used to be expanded, so do that now
+ FireBug_toggleObjectRow(obj[currentExpr], tr);
+ if (!(currentExpr in newTreeNode))
+ newTreeNode[currentExpr] = {};
+
+ // Maybe some of its child nodes were expanded as well.
+ expandSubNodes(treeNode[currentExpr], newTreeNode[currentExpr],
+ tr.nextSibling.firstChild.firstChild, obj[currentExpr]);
+ }
+ }
+ }
+ expandSubNodes(context.treeState.watch, newTreeState.watch, table.firstChild, context.watches);
+ expandSubNodes(context.treeState.property, newTreeState.property, table.lastChild, locals);
+ // Update so we lose nodes that are no longer there:
+ context.treeState = newTreeState;
+
+ var traceNode = context.contextNodes["trace"];
+ traceNode.setAttribute("showFunctions", FireBug.showFunctions);
+ traceNode.setAttribute("showConstants", FireBug.showConstants);
+ traceNode.setAttribute("showLocals", FireBug.showLocals);
+ traceNode.setAttribute("showWatches", FireBug.showWatches);
+ if (FireBugUtils.hasClass(traceNode.lastChild.nodeName, "traceTable"))
+ traceNode.removeChild(traceNode.lastChild);
+ traceNode.appendChild(table);
+}
+
FireBugJSView.prototype.showWatchNode = function(watchNode)
{
if (watchNode == this.watchNode)
return;
if (this.watchNode)
@@ -888,6 +988,7 @@ FireBugJSView.prototype.onBrowserLoad =
{
var postBrowserLoad = this.postBrowserLoad;
this.postBrowserLoad = null;
postBrowserLoad();
}
}
+
diff -rwNpu6 repository/chrome/locale/en-US/firebug.dtd watches/chrome/locale/en-US/firebug.dtd
--- repository/chrome/locale/en-US/firebug.dtd 2006-08-16 19:48:26.000000000 +0200
+++ watches/chrome/locale/en-US/firebug.dtd 2006-08-01 12:19:48.000000000 +0200
@@ -42,12 +42,15 @@
+
+
+
diff -rwNpu6 repository/chrome/locale/en-US/firebug.properties watches/chrome/locale/en-US/firebug.properties
--- repository/chrome/locale/en-US/firebug.properties 2006-08-16 19:48:26.000000000 +0200
+++ watches/chrome/locale/en-US/firebug.properties 2006-08-01 12:19:48.000000000 +0200
@@ -3,6 +3,7 @@ Loading=Loading...
Post=Post
Response=Response
Headers=Headers
Assertion=Assertion Failure
Line=%S (line %S)
StackItem=%S (%S line %S)
+Watch=Watch:
diff -rwNpu6 repository/chrome/skin/classic/views/console.css watches/chrome/skin/classic/views/console.css
--- repository/chrome/skin/classic/views/console.css 2006-08-16 19:48:26.000000000 +0200
+++ watches/chrome/skin/classic/views/console.css 2006-08-01 12:19:48.000000000 +0200
@@ -304,47 +304,99 @@ body {
.infoLabel {
font-weight: bold;
}
/*****************************************************************************************/
-.propertyLabel {
+.traceTable {
+ border-spacing: 0;
+ border-collapse: collapse;
+}
+
+.propertyLabel,
+.DOMLabel,
+.watchLabel {
padding-left: 20px;
- padding-right: 20px;
+ padding-right: 25px;
font-weight: bold;
width: 200px;
-moz-user-select: none;
}
-.propertyContainerLabel {
+.propertyContainerLabel,
+.DOMContainerLabel,
+.watchContainerLabel {
padding-left: 0;
}
-.propertyContainerName:hover {
+.propertyContainerName:hover,
+.DOMContainerName:hover,
+.watchContainerName:hover {
cursor: pointer;
color: #0000FF;
text-decoration: underline;
}
-.propertyValue {
+.propertyValue,
+.DOMValue,
+.watchValue {
vertical-align: top;
font-family: Monaco, monospace;
}
-.propertyChildBox {
+.propertyChildBox,
+.DOMChildBox,
+.watchChildBox {
padding-left: 20px;
}
-.contextNode[showFunctions="false"] .propertyRow-function {
- display: none;
+.watchBody {
+ background-color: #FAFAD2;
}
-.contextNode[showConstants="false"] .propertyRow-constant {
+.contextNode[showLocals="false"] .propertyBody,
+.contextNode[showWatches="false"] .watchBody,
+.contextNode[showFunctions="false"] .propertyRow-function,
+.contextNode[showFunctions="false"] .DOMRow-function,
+.contextNode[showFunctions="false"] .watchRow-function,
+.contextNode[showConstants="false"] .propertyRow-constant,
+.contextNode[showConstants="false"] .DOMRow-constant,
+.contextNode[showConstants="false"] .watchRow-constant {
display: none;
}
+.watchRemoveButton {
+ list-style-image: url("chrome://global/skin/icons/close.png");
+ -moz-image-region: rect(0px, 16px, 16px, 0px);
+}
+
+.watchRemoveButton:hover {
+ -moz-image-region: rect(0px, 32px, 16px, 16px);
+}
+
+.watchRemoveButton:hover:active {
+ -moz-image-region: rect(0px, 48px, 16px, 32px);
+}
+
+#watchEntryContainer {
+ width: 95%;
+}
+
+.inlineJSEditor {
+ -moz-appearance: none;
+ margin: 0;
+ padding: 2px 4px;
+ font-family: Monaco, monospace;
+}
+
+#quickWatchBox {
+ width: 100%;
+ padding: 0;
+ padding-bottom: 3px;
+}
+
/*****************************************************************************************/
.editor {
outline: none !important;
border: 1px solid red !important;
padding: 0;
diff -rwNpu6 repository/components/firebug-service.js watches/components/firebug-service.js
--- repository/components/firebug-service.js 2006-08-16 21:12:54.000000000 +0200
+++ watches/components/firebug-service.js 2006-08-16 22:30:30.000000000 +0200
@@ -230,27 +230,12 @@ FireBugService.prototype.enable = functi
catch (exc)
{
return RETURN_CONTINUE;
}
}
- function throwHook(frame, type, rv)
- {
- service.lastErrorWindow = null;
- try
- {
- var result = {};
- frame.eval("window", "", 0, result)
- var win = result.value.getWrappedValue();
- if (win)
- service.lastErrorWindow = win;
- }
- catch (exc) { }
- return RETURN_CONTINUE;
- }
-
function errorHook(message, fileName, line, pos, flags, errnum, exc)
{
try
{
return service.onError(message, fileName, line, pos, flags, errnum, exc);
}
@@ -259,13 +244,13 @@ FireBugService.prototype.enable = functi
return true;
}
}
this.jsd.debuggerHook = { onExecute: executionHook };
this.jsd.breakpointHook = { onExecute: executionHook };
- this.jsd.throwHook = { onExecute: throwHook };
+ //this.jsd.throwHook = { onExecute: executionHook };
this.jsd.debugHook = { onExecute: executionHook };
this.jsd.errorHook = { onError: errorHook };
}
FireBugService.prototype.disable = function()
{
diff -rwNpu6 repository/components/nsIFireBug.idl watches/components/nsIFireBug.idl
--- repository/components/nsIFireBug.idl 2006-08-16 21:12:54.000000000 +0200
+++ watches/components/nsIFireBug.idl 2006-08-16 22:30:30.000000000 +0200
@@ -35,10 +35,8 @@ interface nsIFireBug : nsISupports
void unregisterDebugger(in nsIFireBugDebugger debugger);
void setBreakpoint(in string href, in unsigned long line);
void clearBreakpoint(in string href, in unsigned long line);
void clearAllBreakpoints();
void enumerateBreakpoints(in string href, in nsIFireBugBreakpointCallback cb);
-
- readonly attribute nsIDOMWindow lastErrorWindow;
};
diff -rwNpu6 repository/defaults/preferences/firebug.js watches/defaults/preferences/firebug.js
--- repository/defaults/preferences/firebug.js 2006-08-16 21:12:54.000000000 +0200
+++ watches/defaults/preferences/firebug.js 2006-08-16 22:30:30.000000000 +0200
@@ -17,8 +17,11 @@ pref("extensions.firebug.throttleLimit",
pref("extensions.firebug.showAllStyles", false);
pref("extensions.firebug.showFunctions", true);
pref("extensions.firebug.showConstants", false);
+pref("extensions.firebug.showLocals", true);
+pref("extensions.firebug.showWatches", true);
+
pref("extensions.firebug.enableDebugger", true);
pref("extensions.firebug.breakOnErrors", false);
diff -rwNpu6 repository/install.rdf watches/install.rdf
--- repository/install.rdf 2006-08-16 21:12:54.000000000 +0200
+++ watches/install.rdf 2006-08-16 22:30:30.000000000 +0200
@@ -2,13 +2,13 @@
firebug@software.joehewitt.com
- 0.4.0.0.1
+ 0.4.0.0.2
2
{ec8030f7-c20a-464f-9b0e-13a3a9e97384}