Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 17 additions & 14 deletions content/firebug1.4/trace.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ this.initialize = function()
{
if (!this.messageQueue)
this.messageQueue = [];

for (var name in traceOptions)
this[name] = traceOptions[name];
this[name] = traceOptions[name];
};

// ************************************************************************************************
Expand All @@ -46,10 +46,10 @@ this.dumpStack = function()
this.flush = function(module)
{
this.module = module;

var queue = this.messageQueue;
this.messageQueue = [];

for (var i = 0; i < queue.length; ++i)
this.writeMessage(queue[i][0], queue[i][1], queue[i][2]);
};
Expand All @@ -65,13 +65,13 @@ this.logFormatted = function(objects, className)
{
var html = this.DBG_TIMESTAMP ? [getTimestamp(), " | "] : [];
var length = objects.length;

for (var i = 0; i < length; ++i)
{
appendText(" ", html);

var object = objects[i];

if (i == 0)
{
html.push("<b>");
Expand All @@ -81,21 +81,24 @@ this.logFormatted = function(objects, className)
else
appendText(object, html);
}
return this.logRow(html, className);

return this.logRow(html, className);
};

this.logRow = function(message, className)
{
var panel = this.getPanel();

if (panel && panel.panelNode)
this.writeMessage(message, className);
else
{
if (typeof this.messageQueue == 'undefined') {
this.messageQueue = [];
}
this.messageQueue.push([message, className]);
}

return this.LOG_COMMAND;
};

Expand All @@ -104,9 +107,9 @@ this.writeMessage = function(message, className)
var container = this.getPanel().containerNode;
var isScrolledToBottom =
container.scrollTop + container.offsetHeight >= container.scrollHeight;

this.writeRow.call(this, message, className);

if (isScrolledToBottom)
container.scrollTop = container.scrollHeight - container.offsetHeight;
};
Expand Down Expand Up @@ -137,7 +140,7 @@ function getTimestamp()
var now = new Date();
var ms = "" + (now.getMilliseconds() / 1000).toFixed(3);
ms = ms.substr(2);

return now.toLocaleTimeString() + "." + ms;
};

Expand Down