bug 197106, land venkman 0.9.53, venkman only

* adds the abillity to change values right from the Local Variables or Watch
views.  Just double-click on the value and enter a new expression to be evaluated.
* adds the ability to add watches from the Local Variables view.  Just select
"Add Watch Expression" from the context menu of the Local Variables view.
* adds the ability to save and restore breakpoints and watches.
* adds close buttons to the source view tabs.
* adds a pref to enable "clost tab on middle click" behavior, and a pref to
disable the new close buttons.
* changed from "type" attribute to "orient".
This commit is contained in:
rginda%netscape.com 2003-03-25 19:50:32 +00:00
Родитель 404f8fdaa9
Коммит 9d5388e629
19 изменённых файлов: 945 добавлений и 239 удалений

Просмотреть файл

@ -220,7 +220,25 @@ function LocalFile(file, mode, perms, tmp)
if (typeof perms == "undefined")
perms = 0666 & ~futils.umask;
if (typeof mode == "string")
{
switch (mode)
{
case ">":
mode = MODE_WRONLY | MODE_CREATE | MODE_TRUNCATE;
break;
case ">>":
mode = MODE_WRONLY | MODE_CREATE | MODE_APPEND;
break;
case "<":
mode = MODE_RDONLY;
break;
default:
throw "Invalid mode ``" + mode + "''";
}
}
if (typeof file == "string")
{
this.localFile = classes[LOCALFILE_CTRID].createInstance(nsILocalFile);

Просмотреть файл

@ -203,12 +203,11 @@ function pm_addpref (prefName, defaultValue)
}
return value;
}
};
if (!arrayContains(prefManager.prefNames, prefName))
prefManager.prefNames.push(prefName);
if (prefName in prefManager)
return;
prefManager.prefNames.push(prefName);
prefManager.prefNames.sort();
prefManager.prefs.__defineGetter__(prefName, prefGetter);
prefManager.prefs.__defineSetter__(prefName, prefSetter);

Просмотреть файл

@ -1183,7 +1183,6 @@ function xtv_thaw ()
delete this.changeStart;
delete this.changeAmount;
}
XULTreeView.prototype.saveBranchState =
@ -1502,6 +1501,88 @@ function xtv_pactcell (action)
{
}
XULTreeView.prototype.onRouteFocus =
function xtv_rfocus (event)
{
if (this.tree && this.tree.treeBody)
this.tree.treeBody.setAttribute("focused", true)
if ("onFocus" in this)
this.onFocus(event);
}
XULTreeView.prototype.onRouteBlur =
function xtv_rblur (event)
{
if (this.tree && this.tree.treeBody)
this.tree.treeBody.removeAttribute("focused");
if ("onBlur" in this)
this.onBlur(event);
}
XULTreeView.prototype.onRouteDblClick =
function xtv_rdblclick (event)
{
if (!("onRowCommand" in this) || event.target.localName != "treechildren")
return;
var rowIndex = this.tree.selection.currentIndex;
if (rowIndex == -1 || rowIndex > this.rowCount)
return;
var rec = this.childData.locateChildByVisualRow(rowIndex);
if (!rec)
{
ASSERT (0, "bogus row index " + rowIndex);
return;
}
this.onRowCommand(rec, event);
}
XULTreeView.prototype.onRouteKeyPress =
function xtv_rkeypress (event)
{
var rec;
if ("onRowCommand" in this && (event.keyCode == 13 || event.charCode == 32))
{
if (!this.selection)
return;
var rowIndex = this.tree.selection.currentIndex;
if (rowIndex == -1 || rowIndex > this.rowCount)
return;
rec = this.childData.locateChildByVisualRow(rowIndex);
if (!rec)
{
ASSERT (0, "bogus row index " + rowIndex);
return;
}
this.onRowCommand(rec, event);
}
else if ("onKeyPress" in this)
{
var rowIndex = this.tree.selection.currentIndex;
if (rowIndex != -1 && rowIndex < this.rowCount)
{
var rec = this.childData.locateChildByVisualRow(rowIndex);
if (!rec)
{
ASSERT (0, "bogus row index " + rowIndex);
return;
}
}
else
{
rec = null;
}
this.onKeyPress(rec, event);
}
}
/*******************************************************************************/
function xtv_formatRecord (rec, indent)

Просмотреть файл

@ -82,7 +82,7 @@
<binding id="viewcontainer">
<content>
<xul:box xbl:inherits="type" class="view-container" flex="1">
<xul:box xbl:inherits="orient=type" class="view-container" flex="1">
<children/>
</xul:box>
</content>

Просмотреть файл

@ -47,6 +47,7 @@ function initCommands()
["about-mozilla", cmdAboutMozilla, 0],
["break", cmdBreak, CMD_CONSOLE],
["break-props", cmdBreakProps, CMD_CONSOLE],
["change-value", cmdChangeValue, 0],
["chrome-filter", cmdChromeFilter, CMD_CONSOLE],
["clear", cmdClear, CMD_CONSOLE],
["clear-all", cmdClearAll, CMD_CONSOLE],
@ -104,16 +105,19 @@ function initCommands()
["propsd", cmdProps, CMD_CONSOLE],
["quit", cmdQuit, CMD_CONSOLE],
["restore-layout", cmdRestoreLayout, CMD_CONSOLE],
["restore-settings", cmdRestoreSettings, CMD_CONSOLE],
["release-notes", cmdReleaseNotes, 0],
["run-to", cmdRunTo, CMD_NEED_STACK],
["save-breakpoints", cmdSaveBreakpoints, CMD_CONSOLE],
["save-layout", cmdSaveLayout, CMD_CONSOLE],
["save-profile", cmdSaveProfile, CMD_CONSOLE],
["save-settings", cmdSaveSettings, CMD_CONSOLE],
["scan-source", cmdScanSource, 0],
["scope", cmdScope, CMD_CONSOLE | CMD_NEED_STACK],
["this-expr", cmdThisExpr, CMD_CONSOLE],
["toggle-float", cmdToggleFloat, CMD_CONSOLE],
["toggle-save-layout", cmdToggleSaveLayout, 0],
["toggle-view", cmdToggleView, CMD_CONSOLE],
["toggle-pref", cmdTogglePref, CMD_CONSOLE],
["startup-init", cmdStartupInit, CMD_CONSOLE],
["step", cmdStep, CMD_CONSOLE | CMD_NEED_STACK],
["stop", cmdStop, CMD_CONSOLE | CMD_NO_STACK],
@ -130,6 +134,8 @@ function initCommands()
["toggle-ias", "startup-init toggle", 0],
["toggle-pprint", "pprint toggle", 0],
["toggle-profile", "profile toggle", 0],
["toggle-save-layout", "toggle-pref saveLayoutOnExit", 0],
["toggle-save-settings", "toggle-pref saveSettingsOnExit", 0],
["em-cycle", "emode cycle", 0],
["em-ignore", "emode ignore", 0],
["em-trace", "emode trace", 0],
@ -253,16 +259,24 @@ function cmdBreak (e)
}
else
{
var fbreak = getFutureBreakpoint(url, e.lineNumber);
var props = e.properties;
var fbreak;
if (e.parent)
fbreak = e.parent;
else
fbreak = getFutureBreakpoint(url, e.lineNumber);
if (!fbreak)
{
dispatch ("fbreak", { isInteractive: e.isInteractive,
urlPattern: url,
lineNumber: e.lineNumber });
lineNumber: e.lineNumber,
props: props});
fbreak = getFutureBreakpoint(url, e.lineNumber);
props = null; // hard breakpoint properties will be inherited
}
console.scriptManagers[url].setBreakpoint (e.lineNumber, fbreak);
console.scriptManagers[url].setBreakpoint (e.lineNumber, fbreak,
props);
feedback (e, getMsg(MSN_BP_CREATED, [url, e.lineNumber]));
}
}
@ -288,6 +302,60 @@ function cmdBreakProps (e)
"chrome,extrachrome,menubar,resizable", e.breakWrapper);
}
function cmdChangeValue(e)
{
var obj = e.parentValue.getWrappedValue();
if (!e.newValue)
{
var ok;
var current = obj[e.propertyName];
if (typeof current == "string")
current = current.quote();
else if (typeof current == "object")
current = "";
else
current = String(current);
while (!ok)
{
var expr = prompt(getMsg(MSN_ENTER_EXPRESSION, e.propertyName),
current);
if (expr == null || expr == "")
return;
try
{
if ("frames" in console)
{
e.newValue = evalInTargetScope(expr, true);
e.newValue = e.newValue.getWrappedValue();
}
else
{
var parent = e.parentValue.jsParent.getWrappedValue();
e.newValue = eval(expr, parent);
}
ok = true;
}
catch(ex)
{
if (ex instanceof jsdIValue)
alert (String(ex.getWrappedValue));
else
alert (String(ex));
current = expr;
}
}
}
obj[e.propertyName] = e.newValue;
dispatch ("hook-eval-done");
}
function cmdChromeFilter (e)
{
const FLAGS = SCRIPT_NODEBUG | SCRIPT_NOPROFILE;
@ -721,11 +789,13 @@ function cmdFBreak(e)
if (i == 0)
display (MSG_NO_FBREAKS_SET);
return;
return null;
}
else
{
if (setFutureBreakpoint (e.urlPattern, e.lineNumber))
var fbreak = setFutureBreakpoint (e.urlPattern, e.lineNumber,
e.properties);
if (fbreak)
{
feedback (e, getMsg(MSN_FBP_CREATED, [e.urlPattern, e.lineNumber]));
}
@ -734,6 +804,7 @@ function cmdFBreak(e)
feedback (e, getMsg(MSN_FBP_EXISTS, [e.urlPattern, e.lineNumber]),
MT_ERROR);
}
return fbreak;
}
}
@ -1015,7 +1086,11 @@ function cmdFrame (e)
e.frameIndex = getCurrentFrameIndex();
}
dispatch ("find-frame", { frameIndex: e.frameIndex });
if (!("isInteractive" in e))
e.isInteractive = false;
dispatch ("find-frame", { frameIndex: e.frameIndex,
isInteractive: e.isInteractive });
return true;
}
@ -1080,7 +1155,7 @@ function cmdLoadd (e)
var rv = rvStr = console._loader.loadSubScript(e.url, obj);
if (typeof rv == "function")
rvStr = MSG_TYPE_FUNCTION;
display(getMsg(MSN_SUBSCRIPT_LOADED, [e.url, rvStr]), MT_INFO);
feedback(e, getMsg(MSN_SUBSCRIPT_LOADED, [e.url, rvStr]), MT_INFO);
return rv;
}
catch (ex)
@ -1321,6 +1396,23 @@ function cmdRestoreLayout (e)
console.viewManager.reconstituteVURLs (layout.split (/\s*;\s*/));
}
function cmdRestoreSettings(e)
{
if (!e.settingsFile || e.settingsFile == "?")
{
var rv = pickOpen(MSG_OPEN_FILE, "*.js");
if (rv.reason == PICK_CANCEL)
return;
e.settingsFile = getURLSpecFromFile(rv.file);
}
else if (e.settingsFile.indexOf("file:") != 0)
{
e.settingsFile = getURLSpecFromFile(e.settingsFile);
}
dispatch("loadd", { url: e.settingsFile });
}
function cmdReleaseNotes (e)
{
openTopWin(MSG_RELEASE_URL);
@ -1337,7 +1429,90 @@ function cmdRunTo (e)
dispatch ("cont");
}
function cmdSaveLayout (e)
function cmdSaveBreakpoints(e)
{
var needClose = false;
var file = e.settingsFile;
if (!file || file == "?")
{
var rv = pickSaveAs(MSG_SAVE_FILE, "*.js");
if (rv.reason == PICK_CANCEL)
return;
e.settingsFile = file = fopen(rv.file, ">");
needClose = true;
}
else if (typeof file == "string")
{
e.settingsFile = file = fopen(file, ">");
needClose = true;
}
var fbp, bp;
var params;
file.write ("\n//Breakpoint settings start...\n");
for (i in console.fbreaks)
{
var wroteVar;
fbp = console.fbreaks[i];
params = {
urlPattern: fbp.url,
lineNumber: fbp.lineNumber,
properties: fbp.getProperties()
};
if (keys(fbp.childrenBP).length)
{
if (!wroteVar)
{
file.write ("var fbreak;\n\n");
wroteVar = true;
}
file.write("fbreak = ");
}
file.write("dispatch('fbreak', " + params.toSource() + ");\n\n");
for (i in fbp.childrenBP)
{
bp = fbp.childrenBP[i];
file.write("dispatch('break', {" +
"urlPattern:" + bp.url.quote() + ", " +
"lineNumber:" + bp.lineNumber + ", " +
"parent:fbreak, " +
"properties:" + bp.getProperties().toSource() +
"});\n");
};
file.write("\n");
}
for (i in console.breaks)
{
bp = console.breaks[i];
if (!bp.parentBP)
{
params = {
urlPattern: bp.url,
lineNumber: bp.lineNumber,
properties: bp.getProperties()
};
file.write("dispatch('break', " + params.toSource() + ");\n");
}
}
file.write (MSG_BREAKPOINTS_RESTORED.quote() + ";\n");
if (needClose)
file.close();
}
function cmdSaveLayout(e)
{
if (!e.name)
{
@ -1393,7 +1568,7 @@ function cmdSaveProfile (e)
e.targetFile = rv.file;
}
var file = fopen (e.targetFile, MODE_WRONLY | MODE_CREATE | MODE_TRUNCATE);
var file = fopen (e.targetFile, ">");
var templateName;
var ary = file.localFile.path.match(/\.([^.]+)$/);
@ -1451,6 +1626,28 @@ function cmdSaveProfile (e)
return file.localFile;
}
function cmdSaveSettings(e)
{
if (!e.settingsFile || e.settingsFile == "?")
{
var rv = pickSaveAs(MSG_SAVE_FILE, "*.js");
if (rv.reason == PICK_CANCEL)
return;
e.settingsFile = fopen(rv.file, ">");
}
else if (typeof e.settingsFile == "string")
{
e.settingsFile = fopen(e.settingsFile, ">");
}
dispatch ("save-breakpoints", { settingsFile: e.settingsFile });
dispatch ("save-watches", { settingsFile: e.settingsFile });
e.settingsFile.write("\n" + MSG_SETTINGS_RESTORED.quote() + ";\n");
e.settingsFile.close();
}
function cmdScanSource (e)
{
e.scriptInstance.scanForMetaComments();
@ -1516,10 +1713,21 @@ function cmdToggleSomething (e)
function cmdSetEvalObj (e)
{
if (e.jsdValue instanceof jsdIStackFrame)
console.currentEvalObject = e.jsdValue;
else
console.currentEvalObject = e.jsdValue.getWrappedValue();
if (!(e.jsdValue instanceof jsdIStackFrame))
{
e.jsdValue = e.jsdValue.getWrappedValue();
}
if (e.jsdValue == console.currentEvalObject)
{
var frame = getCurrentFrame();
if (frame)
e.jsdValue = frame;
else
e.jsdValue = console;
}
console.currentEvalObject = e.jsdValue;
}
function cmdSetScriptFlag (e)
@ -1747,11 +1955,12 @@ function cmdToggleFloat (e)
dispatch ("move-view", { viewId: e.viewId, locationUrl: locationUrl });
}
function cmdToggleSaveLayout (e)
function cmdTogglePref (e)
{
var state = !console.prefs["saveLayoutOnExit"];
console.prefs["saveLayoutOnExit"] = state;
feedback (e, getMsg (MSN_SAVE_LAYOUT, state ? MSG_VAL_ON : MSG_VAL_OFF));
var state = !console.prefs[e.prefName];
console.prefs[e.prefName] = state;
feedback (e, getMsg (MSN_FMT_PREFVALUE,
[e.prefName, state ? MSG_VAL_ON : MSG_VAL_OFF]));
}
function cmdToggleView (e)

Просмотреть файл

@ -501,12 +501,12 @@ function smgr_hasbp (line)
}
ScriptManager.prototype.setBreakpoint =
function smgr_break (line, parentBP)
function smgr_break (line, parentBP, props)
{
var found = false;
for (var i in this.instances)
found |= this.instances[i].setBreakpoint(line, parentBP);
found |= this.instances[i].setBreakpoint(line, parentBP, props);
return found;
}
@ -683,6 +683,9 @@ function si_linemap()
{
if (!this._lineMapInited)
{
if (this.topLevel && this.topLevel.jsdScript.isValid)
this.topLevel.addToLineMap(this._lineMap);
for (var i in this.functions)
{
if (this.functions[i].jsdScript.isValid)
@ -754,21 +757,22 @@ function si_getbp (line)
}
ScriptInstance.prototype.setBreakpoint =
function si_setbp (line, parentBP)
function si_setbp (line, parentBP, props)
{
function setBP (scriptWrapper)
{
var jsdScript = scriptWrapper.jsdScript;
if (!jsdScript.isValid)
if (!scriptWrapper.jsdScript.isValid)
return false;
var jsdScript = scriptWrapper.jsdScript;
if (line >= jsdScript.baseLineNumber &&
line <= jsdScript.baseLineNumber + jsdScript.lineExtent &&
jsdScript.isLineExecutable (line, PCMAP_SOURCETEXT))
(jsdScript.isLineExecutable (line, PCMAP_SOURCETEXT) ||
jsdScript.baseLineNumber == line))
{
scriptWrapper.setBreakpoint(jsdScript.lineToPc(line,
PCMAP_SOURCETEXT),
parentBP);
var pc = jsdScript.lineToPc(line, PCMAP_SOURCETEXT);
scriptWrapper.setBreakpoint(pc, parentBP, props);
return true;
}
return false;
@ -975,7 +979,7 @@ function sw_hasbp (pc)
}
ScriptWrapper.prototype.setBreakpoint =
function sw_setbp (pc, parentBP)
function sw_setbp (pc, parentBP, props)
{
var key = this.jsdScript.tag + ":" + pc;
@ -985,6 +989,9 @@ function sw_setbp (pc, parentBP)
return null;
var brk = new BreakInstance (parentBP, this, pc);
if (props)
brk.setProperties(props);
console.breaks[key] = brk;
this.breaks[key] = brk;
@ -1139,6 +1146,39 @@ function bi_getURL ()
"&enabled=" + this.enabled);
}
BreakInstance.prototype.getProperties =
function bi_getprops()
{
var rv = new Object();
rv.enabled = this._enabled;
if ("_conditionEnabled" in this)
rv.conditionEnabled = this._conditionEnabled;
if ("_condition" in this)
rv.condition = this._condition;
if ("_passExceptions" in this)
rv.passExceptions = this._passExceptions;
if ("_logResult" in this)
rv.logResult = this._logResult;
if ("_resultAction" in this)
rv.resultAction = this._resultAction;
return rv;
}
BreakInstance.prototype.setProperties =
function bi_setprops(obj)
{
for (var p in obj)
{
if (p.search(/pc|url|lineNumber/) == -1)
this[p] = obj[p];
}
if ("propsWindow" in this)
this.propsWindow.populateFromBreakpoint();
}
BreakInstance.prototype.clearBreakpoint =
function bi_clear()
{
@ -1264,7 +1304,7 @@ function FutureBreakpoint (url, lineNumber)
this.url = url;
this.lineNumber = lineNumber;
this.enabled = true;
this.childrenBP = new Object;
this.childrenBP = new Object();
this.conditionEnabled = false;
this.condition = "";
this.passExceptions = false;
@ -1285,6 +1325,34 @@ function fb_getURL ()
"&enabled=" + this.enabled);
}
FutureBreakpoint.prototype.getProperties =
function fb_getprops()
{
var rv = new Object();
rv.conditionEnabled = this.conditionEnabled;
rv.condition = this.condition;
rv.passExceptions = this.passExceptions;
rv.logResult = this.logResult;
rv.resultAction = this.resultAction;
return rv;
}
FutureBreakpoint.prototype.setProperties =
function fb_setprops(obj)
{
for (var p in obj)
{
if (p.search(/url|lineNumber|childrenBP/) == -1)
this[p] = obj[p];
}
if ("propsWindow" in this)
this.propsWindow.populateFromBreakpoint();
}
FutureBreakpoint.prototype.clearFutureBreakpoint =
function fb_clear ()
{
@ -1413,7 +1481,8 @@ function debugTrap (frame, type, rv)
[rv.value.stringValue, formatFrame(frame)]),
MT_ETRACE);
if (rv.value.jsClassName == "Error")
display (formatProperty(rv.value.getProperty("message")));
display (formatProperty(rv.value.getProperty("message")),
MT_EVAL_OUT);
if (console.throwMode != TMODE_BREAK)
return jsdIExecutionHook.RETURN_CONTINUE_THROW;
@ -1736,7 +1805,7 @@ function displayProperties (v)
var p = new Object();
v.getProperties (p, {});
for (var i in p.value) display(formatProperty (p.value[i]));
for (var i in p.value) display(formatProperty (p.value[i]), MT_EVAL_OUT);
}
function displaySourceContext (sourceText, line, contextLines)
@ -1793,7 +1862,7 @@ function displayFrame (jsdFrame, idx, showHeader, sourceContext)
if (typeof sourceContext == "undefined")
sourceContext = null;
display(getMsg(MSN_FMT_FRAME_LINE, [idx, formatFrame(jsdFrame)]));
display(getMsg(MSN_FMT_FRAME_LINE, [idx, formatFrame(jsdFrame)]), MT_OUTPUT);
if (!jsdFrame.isNative && sourceContext != null)
{
@ -1826,7 +1895,7 @@ function getFutureBreakpoint (urlPattern, lineNumber)
return null;
}
function setFutureBreakpoint (urlPattern, lineNumber)
function setFutureBreakpoint (urlPattern, lineNumber, props)
{
var key = urlPattern + "#" + lineNumber;
@ -1848,6 +1917,8 @@ function setFutureBreakpoint (urlPattern, lineNumber)
}
var fbreak = new FutureBreakpoint (urlPattern, lineNumber);
if (props)
fbreak.setProperties(props);
console.fbreaks[key] = fbreak;
dispatch ("hook-fbreak-set", { fbreak: fbreak });

Просмотреть файл

@ -91,8 +91,11 @@ function updateTitle()
for (v in containedViews)
ary.push(containedViews[v].caption);
document.title = getMsg(opener.MSN_FLOATER_TITLE,
ary.join(opener.MSG_COMMASP));
var views = ary.join(opener.MSG_COMMASP);
if (views == "")
views = opener.MSG_VAL_NONE;
document.title = getMsg(opener.MSN_FLOATER_TITLE, views);
}

Просмотреть файл

@ -84,11 +84,20 @@ function initMenus()
[
["open-url"],
["find-file"],
["-"],
["close-source-tab",
{enabledif: "console.views.source2.currentContent && " +
"console.views.source2.sourceTabList.length"}],
["close"],
["-"],
["save-source-tab", { enabledif: "console.views.source2.canSave()" }],
["save-profile"],
["-"],
["save-settings"],
["restore-settings"],
["toggle-save-settings",
{type: "checkbox",
checkedif: "console.prefs['saveSettingsOnExit']"}],
["-"],
[navigator.platform.search(/win/i) == -1 ? "quit" : "exit"]
]
};

Просмотреть файл

@ -104,7 +104,7 @@ function getMsgFrom (bundle, msgName, params, deflt)
if (params && params instanceof Array)
rv = bundle.formatStringFromName (msgName, params, params.length);
else if (params)
else if (params || params == 0)
rv = bundle.formatStringFromName (msgName, [params], 1);
else
rv = bundle.GetStringFromName (msgName);
@ -139,16 +139,17 @@ const MT_HELLO = "HELLO";
const MT_HELP = "HELP";
const MT_WARN = "WARN";
const MT_INFO = "INFO";
const MT_SOURCE = "SOURCE";
const MT_STEP = "STEP";
const MT_OUTPUT = "#OUTPUT";
const MT_SOURCE = "#SOURCE";
const MT_STEP = "#STEP";
const MT_STOP = "STOP";
const MT_ETRACE = "ETRACE";
const MT_LOG = "LOG";
const MT_ETRACE = "#ETRACE";
const MT_LOG = "#LOG";
const MT_USAGE = "USAGE";
const MT_EVAL_IN = "EVAL-IN";
const MT_EVAL_OUT = "EVAL-OUT";
const MT_FEVAL_IN = "FEVAL-IN";
const MT_FEVAL_OUT = "FEVAL-OUT";
const MT_EVAL_IN = "#EVAL-IN";
const MT_EVAL_OUT = "#EVAL-OUT";
const MT_FEVAL_IN = "#FEVAL-IN";
const MT_FEVAL_OUT = "#FEVAL-OUT";
/* these messages might be needed to report an exception at startup, before
* initMsgs() has been called. */

Просмотреть файл

@ -50,10 +50,13 @@ a.venkman-link:hover {
.msg { /* .msg = a single message in the */
width: 100%; /* output window */
font: 11pt lucida, sans-serif;
font-family: monospace;
white-space: -moz-pre-wrap;
}
.msg[monospace] {
font-family: monospace;
}
.msg-data[msg-type="USAGE"] {
font-weight: bold;
font-style: italic;

Просмотреть файл

@ -35,25 +35,30 @@
function initPrefs()
{
var dir = getSpecialDirectory("ProfD");
dir.append("venkman-settings.js");
var defaultSettingsFile = dir.path;
console.prefManager = new PrefManager("extensions.venkman.");
console.prefs = console.prefManager.prefs;
var prefs =
[
["maxStringLength", 100],
["startupCount", 0],
["enableChromeFilter", true],
["tabWidth", 4],
["initialScripts", ""],
["prettyprint", false],
["guessContext", 5],
["guessPattern", "(\\w+)\\s*[:=]\\s*$"],
["permitStartupHit", true],
["statusDuration", 5 * 1000],
["menubarInFloaters", navigator.platform.indexOf ("Mac") != -1],
["initialScripts", ""],
["lastErrorMode", "ignore"],
["lastThrowMode", "ignore"]
["lastThrowMode", "ignore"],
["maxStringLength", 4000],
["menubarInFloaters", navigator.platform.indexOf ("Mac") != -1],
["permitStartupHit", true],
["prettyprint", false],
["saveSettingsOnExit", false],
["settingsFile", defaultSettingsFile],
["startupCount", 0],
["statusDuration", 5 * 1000],
["tabWidth", 4]
];
console.prefManager.addPrefs(prefs);

Просмотреть файл

@ -611,9 +611,13 @@ function vr_refresh ()
}
catch (ex)
{
/*
dd ("caught exception refreshing " + this.displayName);
dd (dumpObjectTree(ex));
if (typeof ex == "object")
dd (dumpObjectTree(ex));
else
dd(ex);
*/
if (!(ex instanceof jsdIValue))
ex = console.jsds.wrapValue(ex);

Просмотреть файл

@ -33,8 +33,8 @@
*
*/
const __vnk_version = "0.9.48";
const __vnk_requiredLocale = "0.9.47+";
const __vnk_version = "0.9.57";
const __vnk_requiredLocale = "0.9.51+";
var __vnk_versionSuffix = "";
const __vnk_counter_url =
@ -282,6 +282,8 @@ function dispatchCommand (command, e, flags)
dd (getMsg(MSN_ERR_INTERNAL_HOOK, h));
}
dd ("Caught exception calling " +
(isBefore ? "before" : "after") + " hook " + h);
dd (formatException(ex));
if (typeof ex == "object" && "stack" in ex)
dd (ex.stack);
@ -553,18 +555,13 @@ function init()
for (i = 0; i < startupMsgs.length; ++i)
display (startupMsgs[i][0], startupMsgs[i][1]);
display (getMsg(MSN_TIP1_HELP,
console.prefs["sessionView.requireSlash"] ? "/" : ""));
display (MSG_TIP2_HELP);
if (console.prefs["sessionView.requireSlash"])
display (MSG_TIP3_HELP);
//if (console.prefs["sessionView.requireSlash"])
// display (MSG_SLASH_REQUIRED, MT_ATTENTION);
//dispatch ("commands");
//dispatch ("help");
dispatch ("pprint", { toggle: console.prefs["prettyprint"] });
if (MSG_LOCALE_VERSION != __vnk_requiredLocale)
@ -575,6 +572,13 @@ function init()
}
console.initialized = true;
if (console.prefs["saveSettingsOnExit"])
{
dispatch ("restore-settings",
{settingsFile: console.prefs["settingsFile"]});
}
dispatch ("hook-venkman-started");
dd ("}");
@ -585,6 +589,12 @@ function destroy ()
if (console.prefs["saveLayoutOnExit"])
dispatch ("save-layout default");
if (console.prefs["saveSettingsOnExit"])
{
dispatch ("save-settings",
{settingsFile: console.prefs["settingsFile"]});
}
delete console.currentEvalObject;
delete console.jsdConsole;
@ -629,14 +639,16 @@ function fetchLaunchCount()
{
var ary = String(r.responseText).match(/(\d+)/);
if (ary)
{
display (getMsg(MSN_LAUNCH_COUNT,
[console.prefs["startupCount"], ary[1]]));
}
};
var r = new XMLHttpRequest();
r.onload = onLoad;
r.open ("GET",
__vnk_counter_url + "?local=" + console.prefs["startupCount"] +
__vnk_counter_url + "?local=" + console.prefs["startupCount"] +
"&version=" + __vnk_version);
r.send (null);
}
@ -649,7 +661,6 @@ function con_ua ()
{
return ("Venkman " + __vnk_version + __vnk_versionSuffix +
" [Mozilla " + ary[1] + "/" + ary[2] + "]");
}
return ("Venkman " + __vnk_version + __vnk_versionSuffix + " [" +

Просмотреть файл

@ -32,6 +32,8 @@ const nsIInterfaceRequestor = Components.interfaces.nsIInterfaceRequestor;
const nsIWebNavigation = Components.interfaces.nsIWebNavigation;
const nsIDocShellTreeItem = Components.interfaces.nsIDocShellTreeItem;
var utils = new Object();
if (typeof document == "undefined") /* in xpcshell */
{
dumpln = print;
@ -330,15 +332,69 @@ function insertHyphenatedWord (longWord, containerTag)
function insertLink (matchText, containerTag)
{
var href;
var linkText;
if (matchText.indexOf ("://") == -1 && matchText.indexOf("x-jsd") != 0)
href = "http://" + matchText;
var trailing;
ary = matchText.match(/([.,]+)$/);
if (ary)
{
linkText = RegExp.leftContext;
trailing = ary[1];
}
else
href = matchText;
{
linkText = matchText;
}
var ary = linkText.match (/^(\w[\w-]+):/);
if (ary)
{
if (!("schemes" in utils))
{
var pfx = "@mozilla.org/network/protocol;1?name=";
var len = pfx.length
utils.schemes = new Object();
for (var c in Components.classes)
{
if (c.indexOf(pfx) == 0)
utils.schemes[c.substr(len)] = true;
}
}
if (!(ary[1] in utils.schemes))
{
insertHyphenatedWord(matchText, containerTag);
return;
}
href = linkText;
}
else
{
href = "http://" + linkText;
}
var anchor = htmlVA (null, href, "");
insertHyphenatedWord(matchText, anchor);
containerTag.appendChild (anchor);
insertHyphenatedWord (linkText, anchor);
containerTag.appendChild (anchor);
if (trailing)
insertHyphenatedWord (trailing, containerTag);
}
function insertQuote (matchText, containerTag, msgtype)
{
if (msgtype[0] == "#")
{
containerTag.appendChild(document.createTextNode(matchText));
return;
}
if (matchText == "``")
containerTag.appendChild(document.createTextNode("\u201c"));
else
containerTag.appendChild(document.createTextNode("\u201d"));
}
/* length should be an even number >= 6 */
@ -531,6 +587,20 @@ function getBaseWindowFromWindow (win)
return rv;
}
function getSpecialDirectory(name)
{
if (!("directoryService" in utils))
{
const DS_CTR = "@mozilla.org/file/directory_service;1";
const nsIProperties = Components.interfaces.nsIProperties;
utils.directoryService =
Components.classes[DS_CTR].getService(nsIProperties);
}
return utils.directoryService.get(name, Components.interfaces.nsIFile);
}
function getPathFromURL (url)
{
var ary = url.match(/^(.*\/)([^\/?#]+)(\?|#|$)/);
@ -559,13 +629,6 @@ function getURLSpecFromFile (file)
const nsIIOService = Components.interfaces.nsIIOService;
const nsILocalFile = Components.interfaces.nsILocalFile;
/* bug 166792 added this interface in Sept. 2002, but we need to work on
* older versions too. */
var nsIFileProtocolHandler;
if ("nsIFileProtocolHandler" in Components.interfaces)
nsIFileProtocolHandler = Components.interfaces.nsIFileProtocolHandler;
else
nsIFileProtocolHandler = null;
if (typeof file == "string")
{
@ -576,9 +639,12 @@ function getURLSpecFromFile (file)
}
var service = Components.classes[IOS_CTRID].getService(nsIIOService);
if (!nsIFileProtocolHandler)
/* In sept 2002, bug 166792 moved this method to the nsIFileProtocolHandler
* interface, but we need to support older versions too. */
if ("getURLSpecFromFile" in service)
return service.getURLSpecFromFile(file);
var nsIFileProtocolHandler = Components.interfaces.nsIFileProtocolHandler;
var fileHandler = service.getProtocolHandler("file");
fileHandler = fileHandler.QueryInterface(nsIFileProtocolHandler);
return fileHandler.getURLSpecFromFile(file);

Просмотреть файл

@ -98,6 +98,11 @@ function destroyViews()
*/
function syncTreeView (treeContent, treeView, cb)
{
function ondblclick(event) { treeView.onRouteDblClick(event); };
function onkeypress(event) { treeView.onRouteKeyPress(event); };
function onfocus(event) { treeView.onRouteFocus(event); };
function onblur(event) { treeView.onRouteBlur(event); };
function tryAgain()
{
if ("treeBoxObject" in treeContent)
@ -119,6 +124,7 @@ function syncTreeView (treeContent, treeView, cb)
treeContent.treeBoxObject.view = treeView;
if (treeContent.treeBoxObject.selection)
treeContent.treeBoxObject.selection.tree = treeContent.treeBoxObject;
}
catch (ex)
{
@ -126,6 +132,23 @@ function syncTreeView (treeContent, treeView, cb)
return;
}
if (!treeContent._listenersInstalled)
{
try
{
treeContent.addEventListener("dblclick", ondblclick, false);
treeContent.addEventListener("keypress", onkeypress, false);
treeContent.addEventListener("focus", onfocus, false);
treeContent.addEventListener("blur", onblur, false);
}
catch (ex)
{
dd ("caught exception setting listeners: " + ex);
}
treeContent._listenersInstalled = true;
}
if (typeof cb == "function")
cb();
}
@ -334,6 +357,9 @@ function bv_init ()
["clear-all"],
["fclear-all"],
["-"],
["save-breakpoints"],
["restore-settings"],
["-"],
["break-props"]
]
};
@ -357,24 +383,24 @@ function bv_hide()
syncTreeView (getChildById(this.currentContent, "break-tree"), null);
}
console.views.breaks.onDblClick =
function bv_sel (e)
console.views.breaks.onRowCommand =
function bv_rowcommand (rec)
{
if (e.target.localName != "treechildren")
return;
if (rec instanceof BPRecord)
dispatch ("find-bp", {breakpoint: rec.breakWrapper});
}
var rowIndex = this.tree.selection.currentIndex;
if (rowIndex == -1 || rowIndex > this.rowCount)
return;
var row = this.childData.locateChildByVisualRow(rowIndex);
if (!row)
console.views.breaks.onKeyPress =
function bv_keypress(rec, e)
{
if (e.keyCode == 46)
{
ASSERT (0, "bogus row index " + rowIndex);
return;
cx = this.getContext({});
if ("hasBreak" in cx)
dispatch ("clear-break", cx);
if ("hasFBreak" in cx)
dispatch ("clear-fbreak", cx);
}
if (row instanceof BPRecord)
dispatch ("find-bp", {breakpoint: row.breakWrapper});
}
console.views.breaks.getContext =
@ -462,6 +488,9 @@ function lv_init ()
getContext: this.getContext,
items:
[
["change-value", {enabledif: "cx.parentValue"}],
["watch-expr"],
["-"],
["set-eval-obj", {type: "checkbox",
checkedif: "has('jsdValue') && " +
"cx.jsdValue.getWrappedValue() == " +
@ -668,10 +697,15 @@ function lv_hide ()
syncTreeView (getChildById(this.currentContent, "locals-tree"), null);
}
console.views.locals.onDblClick =
function lv_dblclick ()
console.views.locals.onRowCommand =
function lv_rowcommand(rec)
{
//dd ("locals double click");
if (this.isContainerEmpty(rec.childIndex) && "value" in rec.parentRecord)
{
dispatch ("change-value",
{parentValue: rec.parentRecord.value,
propertyName: rec.displayName});
}
}
console.views.locals.getCellProperties =
@ -696,6 +730,8 @@ function lv_cellprops (index, colID, properties)
console.views.locals.getContext =
function lv_getcx(cx)
{
var locals = console.views.locals;
cx.jsdValueList = new Array();
function recordContextGetter (cx, rec, i)
@ -703,6 +739,24 @@ function lv_getcx(cx)
if (i == 0)
{
cx.jsdValue = rec.value;
cx.expression = rec.displayName;
if ("value" in rec.parentRecord)
{
cx.parentValue = rec.parentRecord.value;
var cur = rec.parentRecord;
while (cur != locals.childData &&
cur != locals.scopeRecord)
{
cx.expression = cur.displayName + "." + cx.expression;
cur = cur.parentRecord;
}
}
else
{
cx.parentValue = null;
}
cx.propertyName = rec.displayName;
}
else
{
@ -1130,32 +1184,14 @@ function scv_hide ()
syncTreeView (getChildById(this.currentContent, "scripts-tree"), null);
}
console.views.scripts.onDblClick =
function scv_dblclick (e)
console.views.scripts.onRowCommand =
function scv_rowcommand (rec)
{
if (e.target.localName != "treechildren")
return;
var scriptsView = console.views.scripts;
var rowIndex = scriptsView.tree.selection.currentIndex;
if (rowIndex == -1)
return;
if (rowIndex == -1 || rowIndex > scriptsView.rowCount)
{
//dd ("row out of bounds");
return;
}
var row = scriptsView.childData.locateChildByVisualRow(rowIndex);
ASSERT (row, "bogus row");
if (row instanceof ScriptRecord)
dispatch ("find-script", { scriptWrapper: row.scriptWrapper });
else if (row instanceof ScriptInstanceRecord)
if (rec instanceof ScriptRecord)
dispatch ("find-script", { scriptWrapper: rec.scriptWrapper });
else if (rec instanceof ScriptInstanceRecord)
dispatch ("find-sourcetext",
{ sourceText: row.scriptInstance.sourceText });
{ sourceText: rec.scriptInstance.sourceText });
}
console.views.scripts.onClick =
@ -1335,7 +1371,7 @@ function ss_init ()
["sessionView.outputWindow",
"chrome://venkman/content/venkman-output-window.html?$css"],
["sessionView.currentCSS",
"chrome://venkman/skin/venkman-output-default.css"],
"chrome://venkman/skin/venkman-output-dark.css"],
["sessionView.defaultCSS",
"chrome://venkman/skin/venkman-output-default.css"],
["sessionView.darkCSS",
@ -1403,6 +1439,7 @@ function ss_init ()
this.munger = new CMunger();
this.munger.enabled = true;
this.munger.addRule ("quote", /(``|'')/, insertQuote);
this.munger.addRule
("link", /((\w+):\/\/[^<>()\'\"\s:]+|www(\.[^.<>()\'\"\s:]+){2,}|x-jsd:help[\w&\?%]*)/,
insertLink);
@ -1509,7 +1546,19 @@ console.views.session.hooks["hook-session-display"] =
function ss_hookDisplay (e)
{
var message = e.message;
var msgtype = ("msgtype" in e) ? e.msgtype : MT_INFO;
var msgtype = (e.msgtype) ? e.msgtype : MT_INFO;
var monospace;
var mtname;
if (msgtype[0] == "#")
{
monospace = true;
mtname = msgtype.substr(1);
}
else
{
mtname = msgtype;
}
function setAttribs (obj, c, attrs)
{
@ -1519,7 +1568,9 @@ function ss_hookDisplay (e)
obj.setAttribute (a, attrs[a]);
}
obj.setAttribute("class", c);
obj.setAttribute("msg-type", msgtype);
obj.setAttribute("msg-type", mtname);
if (monospace)
obj.setAttribute("monospace", "true");
}
var msgRow = htmlTR("msg");
@ -1528,7 +1579,7 @@ function ss_hookDisplay (e)
var msgData = htmlTD();
setAttribs(msgData, "msg-data");
if (typeof message == "string")
msgData.appendChild(console.views.session.stringToDOM(message));
msgData.appendChild(console.views.session.stringToDOM(message, msgtype));
else
msgData.appendChild(message);
@ -1664,14 +1715,14 @@ function ss_hide ()
}
console.views.session.stringToDOM =
function ss_stringToDOM (message)
function ss_stringToDOM (message, msgtype)
{
var ary = message.split ("\n");
var span = htmlSpan();
for (var l in ary)
{
this.munger.munge(ary[l], span);
this.munger.munge(ary[l], span, msgtype);
span.appendChild (htmlBR());
}
@ -2009,17 +2060,11 @@ function skv_hide()
syncTreeView (getChildById(this.currentContent, "stack-tree"), null);
}
console.views.stack.onDblClick =
function skv_select (e)
console.views.stack.onRowCommand =
function skv_rowcommand (rec)
{
if (e.target.localName != "treechildren")
return;
var rowIndex = console.views.stack.tree.selection.currentIndex;
var rowIndex = rec.childIndex;
if (rowIndex == -1)
return;
if (rowIndex >= 0 && rowIndex < console.frames.length)
dispatch ("frame", { frameIndex: rowIndex });
}
@ -2096,7 +2141,14 @@ console.views.source2.viewId = VIEW_SOURCE2;
console.views.source2.init =
function ss_init ()
{
console.prefManager.addPref ("source2View.maxTabs", 5);
var prefs =
[
["source2View.maxTabs", 5],
["source2View.showCloseButton", true],
["source2View.middleClickClose", false]
];
console.prefManager.addPrefs(prefs);
this.cmdary =
[
@ -2709,16 +2761,16 @@ function s2v_syncframe (iframe)
{
if ("contentDocument" in iframe && "webProgress" in iframe)
{
var listener = console.views.source2.progressListener;
iframe.addProgressListener (listener, WINDOW);
iframe.loadURI (iframe.getAttribute ("targetSrc"));
if (iframe.hasAttribute ("raiseOnSync"))
{
var i = this.getIndexOfDOMWindow (iframe.webProgress.DOMWindow);
this.showTab(i);
iframe.removeAttribute ("raiseOnSync");
}
var listener = console.views.source2.progressListener;
iframe.addProgressListener (listener, WINDOW);
iframe.loadURI (iframe.getAttribute ("targetSrc"));
}
else
{
@ -2727,11 +2779,11 @@ function s2v_syncframe (iframe)
}
catch (ex)
{
// dd ("caught exception showing session view, will try again later.");
// dd (dumpObjectTree(ex));
dd ("caught exception showing session view, will try again later.");
dd (ex);
dd (dumpObjectTree(ex));
setTimeout (tryAgain, 500);
}
}
console.views.source2.syncOutputDeck =
@ -2776,6 +2828,7 @@ function s2v_cleardeck ()
bloke.setAttribute ("id", "source2-bloke");
bloke.setAttribute ("hidden", "true");
this.tabs.appendChild (bloke);
bloke.selected = true;
}
}
@ -2785,26 +2838,52 @@ function s2v_createframe (sourceTab, index, raiseFlag)
if (!ASSERT(this.deck, "we're deckless"))
return null;
if (this.tabs.childNodes.length == 1)
{
var bloke = getChildById (this.tabs, "source2-bloke");
if (bloke)
this.tabs.removeChild(bloke);
}
var bloke = getChildById (this.tabs, "source2-bloke");
if (bloke)
this.tabs.removeChild(bloke);
var document = this.currentContent.ownerDocument;
var tab = document.createElement ("tab");
var tab = document.createElement ("tab");
tab.selected = false;
tab.setAttribute ("class", "source2-tab");
tab.setAttribute ("context", "context:source2");
tab.setAttribute ("crop", "center");
tab.setAttribute ("align", "center");
tab.setAttribute ("flex", "1");
tab.setAttribute ("label", sourceTab.sourceText.shortName);
tab.setAttribute("onclick",
"console.views.source2.onTabClick(event)");
var tabicon = document.createElement("image");
tabicon.setAttribute("class", "tab-icon");
tab.appendChild(tabicon);
var label = document.createElement("label");
tab.label = label;
label.setAttribute("value", sourceTab.sourceText.shortName);
label.setAttribute("crop", "center");
label.setAttribute("flex", "1");
tab.appendChild(label);
tab.appendChild(document.createElement("spacer"));
if (console.prefs["source2View.showCloseButton"])
{
var closeButton = document.createElement("image");
closeButton.setAttribute("class", "tab-close-button");
closeButton.setAttribute("onclick",
"console.views.source2.onCloseButton(event)");
tab.appendChild(closeButton);
}
if (index < this.tabs.childNodes.length)
this.tabs.insertBefore (tab, this.tabs.childNodes[index]);
else
this.tabs.appendChild (tab);
if (!this.tabs.firstChild.hasAttribute("first-tab"))
{
this.tabs.firstChild.setAttribute("first-tab", "true");
if (this.tabs.firstChild.nextSibling)
this.tabs.firstChild.nextSibling.removeAttribute("first-tab");
}
sourceTab.tab = tab;
var tabPanel = document.createElement("tabpanel");
@ -2849,7 +2928,7 @@ function s2v_loadsource (sourceText, index)
{
return null;
}
sourceTab.tab.setAttribute("label", sourceText.shortName);
sourceTab.tab.label.setAttribute("value", sourceText.shortName);
sourceTab.iframe.setAttribute("targetSrc", sourceText.jsdURL);
sourceTab.iframe.setAttribute("raiseOnSync", "true");
this.syncOutputFrame(sourceTab.iframe);
@ -2894,6 +2973,30 @@ function s2v_addsource (sourceText)
return this.loadSourceTextAtIndex (sourceText, index);
}
console.views.source2.onCloseButton =
function s2v_onclose(e)
{
var index = this.getIndexOfTab(e.target.parentNode);
this.removeSourceTabAtIndex(index);
e.preventBubble()
}
console.views.source2.onTabClick =
function s2v_ontab(e)
{
var tab;
if (e.target.localName == "tab")
tab = e.target;
else
tab = e.target.parentNode;
var index = this.getIndexOfTab(tab);
if (e.which == 2 && console.prefs["source2View.middleClickClose"])
this.removeSourceTabAtIndex(index);
else
this.showTab(index);
}
console.views.source2.removeSourceText =
function s2v_removetext (sourceText)
{
@ -2923,6 +3026,8 @@ function s2v_removeindex (index)
lastIndex = this.sourceTabList.length - 1;
if (lastIndex >= 0)
this.showTab(lastIndex);
if (index == 0 && this.tabs.firstChild)
this.tabs.firstChild.setAttribute("first-tab", "true");
}
else if (this.lastSelectedTab > this.sourceTabList.length)
{
@ -2994,6 +3099,7 @@ function s2v_getindex (window)
{
if (child.firstChild.webProgress.DOMWindow == window)
return i;
++i;
child = child.nextSibling;
}
@ -3016,7 +3122,32 @@ function s2v_showtab (index)
{
//dd ("show tab " + index);
if (this.tabs)
this.tabs.selectedItem = this.tabs.childNodes[index];
{
for (var i = 0; i < this.tabs.childNodes.length; ++i)
{
var tab = this.tabs.childNodes[i];
tab.selected = false;
tab.removeAttribute("selected");
tab.removeAttribute("beforeselected");
tab.removeAttribute("afterselected");
}
tab = this.tabs.childNodes[index];
tab.selected = true;
tab.setAttribute("selected", "true");
if (tab.previousSibling)
tab.previousSibling.setAttribute("beforeselected", "true");
if (tab.nextSibling)
tab.nextSibling.setAttribute("afterselected", "true");
this.tabs.selectedItem = tab;
if (!ASSERT(index <= (this.deck.childNodes.length - 1) && index >= 0,
"index ``" + index + "'' out of range"))
{
return;
}
this.deck.selectedIndex = index;
}
else
this.lastSelectedTab = index;
}
@ -3210,16 +3341,16 @@ function s2v_show ()
source2View.onShow();
};
var version;
var help;
//var version;
//var help;
try
{
this.tabs = getChildById (this.currentContent, "source2-tabs");
this.deck = getChildById (this.currentContent, "source2-deck");
//this.bloke = getChildById (this.currentContent, "source2-bloke");
version = getChildById (this.currentContent, "source2-version-label");
help = getChildById (this.currentContent, "source2-help-label");
//version = getChildById (this.currentContent, "source2-version-label");
//help = getChildById (this.currentContent, "source2-help-label");
}
catch (ex)
{
@ -3233,8 +3364,8 @@ function s2v_show ()
return;
}
version.setAttribute ("value", console.userAgent);
help.setAttribute ("value", MSG_SOURCE2_HELP);
//version.setAttribute ("value", console.userAgent);
//help.setAttribute ("value", MSG_SOURCE2_HELP);
this.syncOutputDeck();
initContextMenu(this.currentContent.ownerDocument, "context:source2");
}
@ -3242,7 +3373,8 @@ function s2v_show ()
console.views.source2.onHide =
function s2v_hide ()
{
this.lastSelectedTab = this.tabs.selectedIndex;
if (this.sourceTabList.length > 0)
this.lastSelectedTab = this.tabs.selectedIndex;
this.clearOutputDeck();
this.deck = null;
this.tabs = null;
@ -3825,6 +3957,7 @@ function wv_init()
["watch-expr", cmdWatchExpr, CMD_CONSOLE],
["watch-exprd", cmdWatchExpr, CMD_CONSOLE],
["remove-watch", cmdUnwatch, CMD_CONSOLE],
["save-watches", cmdSaveWatches, CMD_CONSOLE],
["watch-property", cmdWatchProperty, 0],
];
@ -3832,6 +3965,8 @@ function wv_init()
getContext: this.getContext,
items:
[
["change-value", {enabledif: "cx.parentValue"}],
["-"],
["watch-expr"],
["remove-watch"],
["set-eval-obj", {type: "checkbox",
@ -3855,8 +3990,10 @@ function wv_init()
checkedif: "ValueRecord.prototype.showFunctions"}],
["toggle-ecmas",
{type: "checkbox",
checkedif: "ValueRecord.prototype.showECMAProps"}]
checkedif: "ValueRecord.prototype.showECMAProps"}],
["-"],
["save-watches"],
["restore-settings"]
]
};
@ -3929,6 +4066,11 @@ function wv_getcx(cx)
if (i == 0)
{
cx.jsdValue = rec.value;
if ("value" in rec.parentRecord)
cx.parentValue = rec.parentRecord.value;
else
cx.parentValue = null;
cx.propertyName = rec.displayName;
if (rec.parentRecord == console.views.watches.childData)
cx.index = rec.childIndex;
}
@ -3964,10 +4106,26 @@ function wv_refresh()
this.tree.invalidate();
}
console.views.watches.onDblClick =
function wv_dblclick ()
console.views.watches.onRowCommand =
function wv_rowcommand(rec)
{
//dd ("watches double click");
if ("value" in rec.parentRecord)
{
dispatch ("change-value",
{parentValue: rec.parentRecord.value,
propertyName: rec.displayName});
}
}
console.views.watches.onKeyPress =
function wv_keypress(rec, e)
{
if (e.keyCode == 46)
{
var cx = this.getContext({});
if ("index" in cx)
dispatch ("remove-watch", cx);
}
}
function cmdUnwatch (e)
@ -4003,10 +4161,16 @@ function cmdWatchExpr (e)
if (!e.expression)
{
if (e.isInteractive)
if ("isInteractive" in e && e.isInteractive)
{
var watchData = console.views.watches.childData;
var watchData = console.views.watches.childData.childData;
var len = watchData.length;
if (len == 0)
{
display (getMsg(MSG_NO_WATCHES_SET));
return null;
}
display (getMsg(MSN_WATCH_HEADER, len));
for (var i = 0; i < len; ++i)
{
@ -4038,25 +4202,12 @@ function cmdWatchExpr (e)
return null;
}
if (console.currentEvalObject instanceof jsdIStackFrame)
{
refresher = function () {
if ("frames" in console)
{
this.value =
evalInTargetScope(e.expression, true);
}
};
}
else
{
var evalObject = console.currentEvalObject;
refresher = function () {
rv = console.doEval.apply(evalObject,
[e.expression, parent]);
this.value = console.jsds.wrapValue(rv);
};
}
refresher = function () {
if ("frames" in console)
this.value = evalInTargetScope(e.expression, true);
else
throw MSG_VAL_NA;
};
}
else
{
@ -4089,6 +4240,40 @@ function cmdWatchProperty (e)
return rec;
}
function cmdSaveWatches(e)
{
var needClose = false;
var file = e.settingsFile;
if (!file || file == "?")
{
rv = pickSaveAs(MSG_SAVE_FILE, "*.js");
if (rv.reason == PICK_CANCEL)
return;
e.settingsFile = file = fopen(rv.file, ">");
needClose = true;
}
else if (typeof file == "string")
{
e.settingsFile = file = fopen(file, ">");
needClose = true;
}
file.write ("\n//Watch settings start...\n");
var watchData = console.views.watches.childData.childData;
var len = watchData.length;
for (var i = 0; i < len; ++i)
{
file.write("dispatch('watch-expr " + watchData[i].displayName + "');\n");
}
file.write ("\n" + MSG_WATCHES_RESTORED.quote() + ";\n");
if (needClose)
file.close();
}
/*******************************************************************************
* Windows View
*******************************************************************************/
@ -4186,25 +4371,11 @@ function winv_cellprops (index, colID, properties)
return;
}
console.views.windows.onDblClick =
function winv_dblclick (e)
console.views.windows.onRowCommand =
function winv_rowcommand (rec)
{
if (e.target.localName != "treechildren")
return;
var rowIndex = this.tree.selection.currentIndex;
if (rowIndex == -1 || rowIndex > this.rowCount)
return;
var row = this.childData.locateChildByVisualRow(rowIndex);
if (!row)
{
ASSERT (0, "bogus row index " + rowIndex);
return;
}
if ("url" in row)
dispatch ("find-url", { url: row.url });
if ("url" in rec)
dispatch ("find-url", { url: rec.url });
}
console.views.windows.getContext =

Просмотреть файл

@ -49,7 +49,6 @@
<floatingview id="breaks" title="&Break.label;" flex="1">
<vbox id="break-view-content" flex="1">
<tree flex="1" id="break-tree" persist="height" hidecolumnpicker="true"
ondblclick="console.views.breaks.onDblClick(event);"
context="context:breaks">
<treecols>
@ -72,7 +71,6 @@
<floatingview id="locals" title="&Locals.label;" flex="1">
<vbox id="locals-view-content" flex="1">
<tree flex="1" id="locals-tree" persist="height"
ondblclick="console.views.locals.onDblClick(event);"
context="context:locals">
<treecols>
@ -119,7 +117,6 @@
oninput="console.views.scripts.onSearchInput(event);"/>
</hbox>
<tree flex="1" id="scripts-tree" persist="height"
ondblclick="console.views.scripts.onDblClick(event);"
context="context:scripts">
<treecols>
@ -143,10 +140,6 @@
<floatingview id="source2" title="&Source.label;" flex="1">
<stack flex="1">
<vbox flex="1" pack="center" align="center">
<label id="source2-version-label" value="Venkman!" crop="center"/>
<label id="source2-help-label" value="I feel so funky" crop="center"/>
</vbox>
<tabbox id="source2-tabbox" flex="1">
<tabs id="source2-tabs">
<!--
@ -196,8 +189,7 @@
<floatingview id="stack" title="&Stack.label;" flex="1"
grippytooltiptext="&Stack.label;">
<vbox id="stack-view-content" flex="1">
<tree flex="2" id="stack-tree" persist="width" context="context:stack"
ondblclick="console.views.stack.onDblClick(event);">
<tree flex="2" id="stack-tree" persist="width" context="context:stack">
<treecols>
<treecol id="stack:col-0" flex="1" persist="hidden width"
@ -219,7 +211,6 @@
<floatingview id="watches" title="&Watch.label;" flex="1">
<vbox id="watch-view-content" flex="1">
<tree flex="1" id="watch-tree" persist="height"
ondblclick="console.views.watches.onDblClick(event);"
context="context:watches">
<treecols>
@ -248,7 +239,6 @@
<vbox id="windows-view-content" flex="1">
<tree flex="1" id="windows-tree" persist="height"
context="context:windows"
ondblclick="console.views.windows.onDblClick(event);"
hidecolumnpicker="true">
<treecols>

Просмотреть файл

@ -53,7 +53,7 @@
# character set to convert unicode messages to before writing them to a
# profile report, or generated help text.
msg.report.charset = utf-8
msg.locale.version = 0.9.47+
msg.locale.version = 0.9.51+
msn.bad.locale = This version of Venkman is meant to work with a ``%1$S'' locale, but you are currently using a locale marked ``%2$S''. Chances are, you're going to have problems. Please change to the default locale, or upgrade your language pack.
msg.release.url = http://www.mozilla.org/releases/
@ -185,6 +185,7 @@ msg.tip2.help = Visit <x-jsd:help> for a searchable command reference.
msg.tip3.help = Commands start with a forward-slash ('/') character. Any text that DOES NOT start with a forward-slash will be evaluated as JavaScript. For example, to execute the ``step'' command, type ``/step''. To evaluate ``1 + 1'', just type ``1 + 1''.
msg.no.breaks.set = No breakpoints set.
msg.no.fbreaks.set = No future breakpoints set.
msg.no.watches.set = No watches set.
msn.no.properties = %1$S has no properties.
msn.no.cmdmatch = No commands match ``%1$S''.
msn.cmdmatch = Commands matching ``%1$S'' are [%2$S].
@ -198,6 +199,7 @@ msn.bp.created = Breakpoint at <%1$S> line %2$S created
msn.bp.cleared = Breakpoint at <%1$S> line %2$S deleted
msn.bp.exists = Breakpoint at <%1$S> line %2$S already set.
msn.watch.header = %1$S watches set:
msn.enter.expression = Enter expression for new value of \u201c%1$S\u201d:
# 1 index, 2 file name, 3 line
msn.fbp.line = #%1$S <%2$S> line %3$S
@ -212,7 +214,6 @@ msg.tmode.ignore = Exceptions will now be ignored.
msg.tmode.trace = Exceptions will now be traced.
msg.tmode.break = Exceptions will now stop the debug target.
msn.iasmode = Initialize at Startup is now %1$S.
msn.save.layout = Save Layout on Exit is now %1$S.
msn.layout.list = The following layouts have already been saved [%1$S]. Use ``save-layout <name>'' to save the current layout, or ``restore-layout <name>'' to restore a specific layout.
msn.chrome.filter = Chrome filtering is now %1$S.
# 1 value, 2 frame
@ -226,6 +227,7 @@ msn.profile.saved = Profile data saved to <%1$S>.
msg.profile.cleared = Profile data cleared.
msn.profile.saving = Generating profile report, file %1$S of %2$S
msg.open.file = Open File...
msg.save.file = Save As...
msg.open.url = Enter a URL to Load...
msg.save.profile = Save Profile Data As...
msg.save.source = Save Source As...
@ -353,6 +355,11 @@ msg.view.source = Source Code (old)
msg.view.source2 = Source Code (new)
msg.view.watches = Watches
# settings file return values
msg.breakpoints.restored = Breakpoints restored.
msg.watches.restored = Watches restored.
msg.settings.restored = Breakpoints and watches restored.
###################### DO NO LOCALIZE THE *.params STRINGS ######################
## hooks ##
@ -436,13 +443,17 @@ cmd.about-mozilla.label = &About Mozilla
cmd.about-mozilla.help = Display information about your Mozilla installation.
cmd.break.label = S&et Breakpoint
cmd.break.params = [<url-pattern> <line-number>]
cmd.break.help = Set a breakpoint in all urls matching <url-pattern> at the line number <line-number>. If no parameters are specified all active breakpoints will be listed. See also: |clear|.
cmd.break.params = [<url-pattern> <line-number> [<properties> [<parent>]]]
cmd.break.help = Set a breakpoint in all urls matching <url-pattern> at the line number <line-number>. <properties> is a JavaScript object representing the properties of the breakpoint. <parent> is a reference to the Future Breakpoint object to assign as the parent. If no parameters are specified all active breakpoints will be listed. See also: |clear|.
cmd.break-props.label = Breakpoint &Properties...
cmd.break-props.params = <break-wrapper>
cmd.break-props.help = Display the properties dialog for the breakpoint represented by <break-wrapper>.
cmd.change-value.label = Change &Value...
cmd.change-value.params = <parent-value> <property-name> [<new-value>]
cmd.change-value.help = Changes the value of the property named <property-name> of the jsdValue <parent-value>. If the jsdValue <new-value> is specified, this will become the new value of the property, otherwise a dialog box is displayed, allowing the user to enter a new expression for the value.
cmd.chrome-filter.params = [<toggle>]
cmd.chrome-filter.help = Enables or disabled the filtering of chrome: urls. With chrome: filtering on, the JavaScript files which make up the browser will not be displayed in the Script View, and the debugger will not step through them while debugging. The value of <toggle> can be |true|, |on|, |yes|, or |1| to turn the flag on; |false|, |off|, |no|, or |0| to turn it off; or |toggle| to invert the current state. If <toggle> is not provided, the current state will be displayed.
@ -472,7 +483,7 @@ cmd.clear-instance.label = &Clear Breakpoint
cmd.clear-instance.params = <script-instance> [<...>]
cmd.clear-instance.help = Clear all breakpoints in the script instance referred to by <script-instance>.
cmd.close.label = &Close
cmd.close.label = Close &Window
cmd.close.help = Close the debugger.
cmd.commands.params = [<pattern>]
@ -527,12 +538,12 @@ cmd.em-ignore.label = Ig&nore Errors
cmd.em-trace.label = Tr&ace Errors
cmd.fbreak.label = Set &Future Breakpoint
cmd.fbreak.params = [<url-pattern> <line-number>]
cmd.fbreak.help = Sets a ``future'' breakpoint. Any time a script whose file name matches <url-pattern> is loaded, a breakpoint a <line-number> is set. Setting a breakpoint at line 1 will cause the debugger to break when the script is loaded. fbreak with no parameters will list all future breakponts. This command is the same as |set-fbreak|, except the parameters are optional. See also: |break|.
cmd.fbreak.params = [<url-pattern> <line-number> [<properties>]]
cmd.fbreak.help = Sets a ``future'' breakpoint. Any time a script whose file name matches <url-pattern> is loaded, a breakpoint a <line-number> is set. Setting a breakpoint at line 1 will cause the debugger to break when the script is loaded. fbreak with no parameters will list all future breakponts. <properties> is a JavaScript object representing the properties for this breakpoint. This command is the same as |set-fbreak|, except the parameters are optional. See also: |break|.
cmd.set-fbreak.label = Set &Future Breakpoint
cmd.set-fbreak.params = <url-pattern> <line-number>
cmd.set-fbreak.help = Sets a ``future'' breakpoint. Any time a script whose file name matches <url-pattern> is loaded, a breakpoint a <line-number> is set. Setting a breakpoint at line 1 will cause the debugger to break when the script is loaded. This command is the same as |fbreak|, except the parameters are not optional. See also: |break|.
cmd.set-fbreak.params = <url-pattern> <line-number> [<properties>]
cmd.set-fbreak.help = Sets a ``future'' breakpoint. Any time a script whose file name matches <url-pattern> is loaded, a breakpoint a <line-number> is set. Setting a breakpoint at line 1 will cause the debugger to break when the script is loaded. <properties> is a JavaScript object representing the properties for this breakpoint. This command is the same as |fbreak|, except the parameters are not optional. See also: |break|.
cmd.fclear.label = Clear F&uture Breakpoint
cmd.fclear.params = <url-pattern> [<line-number>]
@ -682,6 +693,10 @@ cmd.close-source-tab.help = Close the tab located at the index specified by <i
cmd.restore-layout.params = [<name>]
cmd.restore-layout.help = Restores the view layout named <name>. If <name> is not provided, the list of available layouts will be displayed. The special name |factory| can be used to restore a default layout.
cmd.restore-settings.label = Restore Break/Watch Se&ttings...
cmd.restore-settings.params = [<settings-file>]
cmd.restore-settings.help = This command is basically an alias to |loadd|, except that <settings-file> is optional. If <settings-file> is not provided, or is ``?'', a file chooser widget will be displayed. This command is placed in the context menu of the Breakpoints and Watch views to make it easy to restore saved breakpoints and watches.
cmd.reloadui.key = accel alt R
cmd.run-to.label = Run To &Line
@ -702,6 +717,18 @@ cmd.save-profile.label = Save P&rofile Data As...
cmd.save-profile.params = [<target-file> [<url> [<...>]]
cmd.save-profile.help = Saves the profile data collected for one or more source files specified by <url> into the file at <target-file>. If <target-file> is not provided, or is the character '?', a file chooser widget will be displayed. If <url> is not provided, all profile data is saved. <target-file> is an operating system specific path string, <url> is a complete url.
cmd.save-breakpoints.label = &Save Breakpoint Settings...
cmd.save-breakpoints.params = [<settings-file>]
cmd.save-breakpoints.help = Save the current list of breakpoints to a JavaScript file, so that they can be restored later. If <settings-file> is not provided, or is the character '?', a file chooser widget will be displayed. <settings-file> can be a reference to a |LocalFile| object or a string represetation of a native path. See also: |save-settings|, |save-watches|, |restore-settings|.
cmd.save-settings.label = Sa&ve Break/Watch Settings...
cmd.save-settings.params = [<settings-file>]
cmd.save-settings.help = Save the current list of breakpoints and watches to a JavaScript file, so that they can be restored later. If <settings-file> is not provided, or is the character '?', a file chooser widget will be displayed. <settings-file> can be a reference to a |LocalFile| object or a string represetation of a native path. See also: |save-watches|, |save-breakpoints|, |restore-settings|.
cmd.save-watches.label = &Save Watch Settings...
cmd.save-watches.params = [<settings-file>]
cmd.save-watches.help = Save the current list of watches to a JavaScript file, so that they can be restored later. If <settings-file> is not provided, or is the character '?', a file chooser widget will be displayed. <settings-file> can be a reference to a |LocalFile| object or a string represetation of a native path. See also: |save-settings|, |save-breakpoints|, |restore-settings|.
cmd.search-scripts.params = [<pattern>]
cmd.search-scripts.help = Removes any scripts with URLs that do not match <pattern> from the Loaded Scripts view. If <pattern> is not provided, all scripts will be displayed.
@ -760,7 +787,7 @@ cmd.testargs1.params = <int> [<...>]
cmd.testargs1.help = Function for testing argument parsing. Pass it what it wants, and it'll spit out the event object to stdout.
cmd.this-expr.params = <expression>
cmd.this-expr.help = Sets the ``evaluation object'' to the result of <expression>. The evaluation object is used as the |this| object in all evaluations. The result of <expression> *must* be an object. See also: |eval|, |props|, |watch-expr|, and |set-this-obj|.
cmd.this-expr.help = Sets the ``evaluation object'' to the result of <expression>. The evaluation object is used as the |this| object in all evaluations. The result of <expression> *must* be an object. See also: |eval|, |props|, |watch-expr|, and |set-eval-obj|.
cmd.tmode.params = [<mode>]
cmd.tmode.help = Sets what action the debugger should take when an exception is thrown from the debug target. |tmode ignore| ignores all exceptions, |tmode trace| shows a log of the exception to the console, and |tmode break| stops excecution when an exception is thrown. |tmode| without any parameter will display the current throw mode. Note that |tmode| controls what happens when an exception is *thrown*, to control what happens when an exception reaches the top level and becomes an error, use |emode|. The key combination Control + T can be used to cycle the throw mode.
@ -783,6 +810,12 @@ cmd.toggle-pprint.help = Toggle Pretty Print mode.
cmd.toggle-save-layout.label = Save Default Layout On &Exit
cmd.toggle-save-layout.help = If set, the window layout will be saved before Venkman exits.
cmd.toggle-save-settings.label = Save Break/Watch Settings On E&xit
cmd.toggle-save-settings.help = If set, the breakpoint and watch settings will be saved before Venkman exits, and restored at startup.
cmd.toggle-pref.params = <pref-name>
cmd.toggle-pref.help = Toggles the boolean preference specified by <pref-name>.
cmd.toggle-view.params = <view-id>
cmd.toggle-view.help = If the view specified by <view-id> is currently displayed, it will be hidden. Otherwise the view will be displayed in its last known location.
@ -806,7 +839,7 @@ cmd.remove-watch.label = &Remove Watch
cmd.remove-watch.params = <index> [<...>]
cmd.remove-watch.help = Removes the watch(es) at the 0 based index specified by <index>.
cmd.watch-expr.label = Add Watch Expression...
cmd.watch-expr.label = Add &Watch Expression...
cmd.watch-expr.params = [<expression>]
cmd.watch-expr.help = Evaluates <expression> in the debug target scope and adds the result to the watch window. If <expression> is not provided, all watches are printed to the console.

Просмотреть файл

@ -49,7 +49,7 @@ a.venkman-link:visited {
}
.msg-data[msg-type="ERROR"] {
background: darkred;
background: #550000;
color: white;
}

Просмотреть файл

@ -35,6 +35,12 @@
@import url(chrome://communicator/skin/);
/*
* we have to explicitly import this css, because we're overriding the binding
* of the supremely awful <tab> tag.
*/
@import url(chrome://global/skin/tabbox.css);
viewcontainer {
-moz-binding: url(chrome://venkman/content/venkman-bindings.xml#viewcontainer);
}
@ -59,7 +65,15 @@ treecol[hideheader="true"] {
}
tree {
margin: 0px 0px 0px 0px;
margin: 0px;
}
treechildren {
border: 1px white solid;
}
treechildren[focused] {
border: 1px black solid;
}
tabpanels {
@ -266,6 +280,17 @@ browser {
margin: 1px;
}
tab {
-moz-binding: none;
padding-right: 5px;
}
.tab-close-button:hover {
border: 1px silver outset;
margin: 0px;
margin-top: 1px;
}
.view-title-pop:hover,
.view-title-close:hover {
border: 1px silver outset;
@ -300,6 +325,13 @@ floatingview[dragover="left"] {
list-style-image: url("chrome://venkman/skin/images/arrow-left.png") !important;
}
.tab-close-button {
list-style-image: url("chrome://venkman/skin/images/view-close-button.png");
margin: 1px;
margin-top: 2px;
}
floatingview[dragover="up"] {
padding-top: 0px;
border-top: 4px black solid;