bug 204572, "land latest venkman", a=sspitzer

check in differences between 0.9.67 and 0.9.75
* Fixes literal tab expansion in the new source view
* Fixes places where search() was used instead of indexOf.  bug 204341
* Makes it so that editing properties on a hard breakpoint also modifies
properties on the future breakpoint.
* Makes it so that venkman can load source for files are are currently being
loaded by mozilla.  bug 166935
* Catches exceptions thrown by file picker widget
* fixes a typo in the change-container command
* fixes a bug where splitters would be misplaced if you dragged a view directly from one tab container to another
* adds tooltips to the buttons in the toolbar
This commit is contained in:
rginda%netscape.com 2003-05-16 05:03:39 +00:00
parent 4782f6ba84
commit f7f04032cd
16 changed files with 147 additions and 105 deletions

View File

@ -29,7 +29,7 @@ function getAccessKey (str)
return str[i + 1];
}
function CommandRecord (name, func, usage, help, label, flags, keystr)
function CommandRecord (name, func, usage, help, label, flags, keystr, tip)
{
this.name = name;
this.func = func;
@ -38,6 +38,7 @@ function CommandRecord (name, func, usage, help, label, flags, keystr)
this.help = help;
this.label = label ? label : name;
this.labelstr = label.replace ("&", "");
this.tip = tip;
this.flags = flags;
this._enabled = true;
this.keyNodes = new Array();
@ -195,8 +196,9 @@ function cmgr_defcmds (cmdary)
var help = getMsgFrom(bundle, "cmd." + name + ".help", null,
helpDefault);
var keystr = getMsgFrom (bundle, "cmd." + name + ".key", null, "");
var tip = getMsgFrom (bundle, "cmd." + name + ".tip", null, "");
var command = new CommandRecord (name, func, usage, help, label, flags,
keystr);
keystr, tip);
if (aliasFor)
command.aliasFor = aliasFor;
this.addCommand(command);

View File

@ -171,12 +171,33 @@ function pickSaveAs (title, typeList, defaultFile, defaultDir)
picker.init (window, title ? title : futils.MSG_SAVE_AS,
Components.interfaces.nsIFilePicker.modeSave);
var rv = picker.show();
var reason;
if (rv != PICK_CANCEL)
try
{
reason = picker.show();
}
catch (ex)
{
dd ("caught exception from file picker: " + ex);
}
var obj = new Object();
obj.reason = reason;
obj.picker = picker;
if (reason != PICK_CANCEL)
{
obj.file = picker.file;
futils.lastSaveAsDir = picker.file.parent;
}
else
{
obj.file = null;
}
return {reason: rv, file: picker.file, picker: picker};
return obj;
}
function pickOpen (title, typeList, defaultFile, defaultDir)

View File

@ -396,6 +396,8 @@ function mmgr_addtb (parentNode, beforeNode, commandName, attribs)
var id = parentNode.getAttribute("id") + ":" + commandName;
tbitem.setAttribute ("id", id);
tbitem.setAttribute ("class", "toolbarbutton-1");
if (command.tip)
tbitem.setAttribute ("tooltiptext", command.tip);
tbitem.setAttribute ("label", command.label.replace("&", ""));
tbitem.setAttribute ("oncommand",
"dispatch('" + commandName + "');");

View File

@ -115,8 +115,8 @@ function bov_scrollto (line, align)
}
else if (align > 0)
{
if (line < viz) /* underscroll, can't put a row from the first page at */
line = 0; /* the bottom. */
if (line < viz) /* underscroll, can't put a row from the first page */
line = 0; /* at the bottom. */
else
line = line - viz + headerRows;
@ -411,9 +411,9 @@ function bov_pactcell (action)
}
/*
* record for the XULTreeView. these things take care of keeping the XULTreeView
* properly informed of changes in value and child count. you shouldn't have
* to maintain tree state at all.
* record for the XULTreeView. these things take care of keeping the
* XULTreeView properly informed of changes in value and child count. you
* shouldn't have to maintain tree state at all.
*
* |share| should be an otherwise empty object to store cache data.
* you should use the same object as the |share| for the XULTreeView that you
@ -788,12 +788,6 @@ function xtvr_remchild (index)
if (!orphan.isHidden && "isContainerOpen" in this && this.isContainerOpen)
{
//XXX why would we need to resort on a remove?
//if (this.calculateVisualRow() >= 0)
//{
// this.resort(true); /* resort, don't invalidate. we're going to do
// * that in the onVisualFootprintChanged call. */
// }
this.onVisualFootprintChanged (changeStart, fpDelta);
}
}
@ -834,8 +828,8 @@ function xtvr_uhide ()
}
/*
* open this record, exposing it's children. DONT call this method if the record
* has no children.
* open this record, exposing it's children. DONT call this method if the
* record has no children.
*/
XULTreeViewRecord.prototype.open =
function xtvr_open ()
@ -859,9 +853,10 @@ function xtvr_open ()
this.visualFootprint += delta;
if ("parentRecord" in this)
{
this.parentRecord.onVisualFootprintChanged(this.calculateVisualRow(), 0);
this.parentRecord.onVisualFootprintChanged(this.calculateVisualRow() + 1,
delta);
this.parentRecord.onVisualFootprintChanged(this.calculateVisualRow(),
0);
this.parentRecord.onVisualFootprintChanged(this.calculateVisualRow() +
1, delta);
}
}
@ -880,9 +875,10 @@ function xtvr_close ()
this.visualFootprint += delta;
if ("parentRecord" in this)
{
this.parentRecord.onVisualFootprintChanged(this.calculateVisualRow(), 0);
this.parentRecord.onVisualFootprintChanged(this.calculateVisualRow() + 1,
delta);
this.parentRecord.onVisualFootprintChanged(this.calculateVisualRow(),
0);
this.parentRecord.onVisualFootprintChanged(this.calculateVisualRow() +
1, delta);
}
if ("onPostClose" in this)
@ -964,7 +960,6 @@ function xtvr_calcrow ()
this._share.lastIndexOwner = this;
this._share.lastComputedIndex = vrow;
//@DEBUG-cvr dd ("cvr: returning " + vrow);
return vrow;
}
@ -979,24 +974,6 @@ function xtvr_find (targetRow, myRow)
if (targetRow in this._share.rowCache)
return this._share.rowCache[targetRow];
else if (0) {
/* XXX take this out later */
if (typeof myRow == "undefined")
myRow = this.calculateVisualRow();
else
{
ASSERT (myRow == this.calculateVisualRow(), "someone lied to me, " +
myRow + " != " + this.calculateVisualRow());
}
if (targetRow < myRow || targetRow > myRow + this.visualFootprint)
{
ASSERT (0, "I don't contain visual row " + targetRow + ", only " +
myRow + "..." + (myRow + this.visualFootprint));
return null;
}
}
/* if this is true, we *are* the index */
if (targetRow == myRow)
return (this._share.rowCache[targetRow] = this);
@ -1027,12 +1004,6 @@ function xtvr_find (targetRow, myRow)
childStart += child.visualFootprint;
}
if (0) {
/* XXX take this out later */
ASSERT (0, "locateChildByVisualRow() failed. Asked for row " + targetRow +
", record only contains " + myRow + "..." +
(myRow + this.visualFootprint));
}
return null;
}
@ -1070,8 +1041,8 @@ function tolr_getshare()
return null;
}
/* XTRootRecord is used internally by XULTreeView, you probably don't need to make
* any of these */
/* XTRootRecord is used internally by XULTreeView, you probably don't need to
* make any of these */
function XTRootRecord (tree, share)
{
this._share = share;
@ -1101,7 +1072,8 @@ function torr_calcrow ()
XTRootRecord.prototype.resort =
function torr_resort ()
{
if ("_treeView" in this && this._treeView.frozen) {
if ("_treeView" in this && this._treeView.frozen)
{
this._treeView.needsResort = true;
return;
}
@ -1479,7 +1451,7 @@ function xtv_getprgmode (index, colID)
XULTreeView.prototype.getCellValue =
function xtv_getcellval (index, colID)
{
}
}
XULTreeView.prototype.getCellText =
function xtv_getcelltxt (index, colID)
@ -1664,7 +1636,7 @@ function xtv_rkeypress (event)
}
}
/*******************************************************************************/
/******************************************************************************/
function xtv_formatRecord (rec, indent)
{

View File

@ -315,11 +315,11 @@ function cmdChangeContainer(e)
return;
}
var view = console.views[e.viewIs];
var view = console.views[e.viewId];
if (!view.currentContent)
{
display(getMsg(MSN_ERR_INVALID_PARAM, ["<view-name>", e.viewId]),
display(getMsg(MSN_ERR_INVALID_PARAM, ["<view-id>", e.viewId]),
MT_ERROR);
return;
}

View File

@ -591,6 +591,7 @@ function ScriptInstance (manager)
this.creationDate = new Date();
this.topLevel = null;
this.functions = new Object();
this.nestLevel = 0;
this.isSealed = false;
this.scriptCount = 0;
this.breakpointCount = 0;
@ -1253,6 +1254,9 @@ function bi_getCondEnabled ()
BreakInstance.prototype.__defineSetter__ ("conditionEnabled", bi_setCondEnabled);
function bi_setCondEnabled (state)
{
if (this.parentBP)
return this.parentBP.conditionEnabled = state;
return this._conditionEnabled = state;
}
@ -1271,6 +1275,9 @@ function bi_getCondition ()
BreakInstance.prototype.__defineSetter__ ("condition", bi_setCondition);
function bi_setCondition (value)
{
if (this.parentBP)
return this.parentBP.condition = value;
return this._condition = value;
}
@ -1290,6 +1297,9 @@ function bi_getException ()
BreakInstance.prototype.__defineSetter__ ("passExceptions", bi_setException);
function bi_setException (state)
{
if (this.parentBP)
return this.parentBP.passExceptions = state;
return this._passExceptions = state;
}
@ -1309,6 +1319,9 @@ function bi_getLogResult ()
BreakInstance.prototype.__defineSetter__ ("logResult", bi_setLogResult);
function bi_setLogResult (state)
{
if (this.parentBP)
return this.parentBP.logResult = state;
return this._logResult = state;
}
@ -1328,6 +1341,9 @@ function bi_getResultAction ()
BreakInstance.prototype.__defineSetter__ ("resultAction", bi_setResultAction);
function bi_setResultAction (state)
{
if (this.parentBP)
return this.parentBP.resultAction = state;
return this._resultAction = state;
}
@ -1396,7 +1412,7 @@ function fb_reseti ()
{
for (var url in console.scriptManagers)
{
if (url.search(this.url) != -1)
if (url.indexOf(this.url) != -1)
console.scriptManagers[url].setBreakpoint(this.lineNumber);
}
}
@ -1406,7 +1422,7 @@ function fb_cleari ()
{
for (var url in console.scriptManagers)
{
if (url.search(this.url) != -1)
if (url.indexOf(this.url) != -1)
console.scriptManagers[url].clearBreakpoint(this.lineNumber);
}
}
@ -1988,7 +2004,7 @@ function clearFutureBreakpoint (urlPattern, lineNumber)
for (url in console.scriptManagers)
{
if (url.search(urlPattern) != -1)
if (url.indexOf(urlPattern) != -1)
console.scriptManagers[url].noteFutureBreakpoint(lineNumber, false);
}

View File

@ -897,8 +897,8 @@ function svc_source (response, parsedURL)
if (status != Components.results.NS_OK)
{
response.start();
response.append(getMsg(MSN_JSDURL_ERRPAGE, [safeHTML(parsedURL.spec),
status]));
response.append(getMsg(MSN_JSDURL_ERRPAGE,
[safeHTML(parsedURL.spec), status]));
response.end();
display (getMsg (MSN_ERR_SOURCE_LOAD_FAILED,
[parsedURL.spec, status]),

View File

@ -132,7 +132,8 @@
</menubar>
<!-- Debug toolbar -->
<toolbar id="maintoolbar-outer" collapsed="true">
<toolbar id="maintoolbar-outer" collapsed="true"
grippytooltiptext="&DebugBar.tooltip;">
<hbox id="maintoolbar">
</hbox>
<!--

View File

@ -54,6 +54,7 @@ function initPrefs()
["menubarInFloaters", navigator.platform.indexOf ("Mac") != -1],
["permitStartupHit", true],
["prettyprint", false],
["rememberPrettyprint", false],
["saveSettingsOnExit", false],
["settingsFile", defaultSettingsFile],
["startupCount", 0],

View File

@ -41,8 +41,8 @@ function initProfiler ()
["profile.template.html", "chrome://venkman/locale/profile.html.tpl"],
["profile.template.csv", "chrome://venkman/locale/profile.csv.tpl"],
["profile.template.txt", "chrome://venkman/locale/profile.txt.tpl"],
["profile.ranges.default", "1000000, 5000, 2500, 1000, 750, 500, 250," +
"100, 75, 50, 25, 10, 7.5, 5, 2.5, 1, 0.75, 0.5, 0.25"]
["profile.ranges.default", "1000000, 5000, 2500, 1000, 750, 500, " +
"250, 100, 75, 50, 25, 10, 7.5, 5, 2.5, 1, 0.75, 0.5, 0.25"]
];
console.prefManager.addPrefs(prefs);

View File

@ -33,7 +33,7 @@
*
*/
const __vnk_version = "0.9.67";
const __vnk_version = "0.9.75";
const __vnk_requiredLocale = "0.9.51+";
var __vnk_versionSuffix = "";
@ -562,7 +562,10 @@ function init()
if (console.prefs["sessionView.requireSlash"])
display (MSG_TIP3_HELP);
dispatch ("pprint", { toggle: console.prefs["prettyprint"] });
if (console.prefs["rememberPrettyprint"])
dispatch ("pprint", { toggle: console.prefs["prettyprint"] });
else
dispatch ("pprint", { toggle: false });
if (MSG_LOCALE_VERSION != __vnk_requiredLocale)
{
@ -689,7 +692,7 @@ function hookScriptSealed (e)
for (var fbp in console.fbreaks)
{
if (console.fbreaks[fbp].enabled &&
e.scriptInstance.url.search(console.fbreaks[fbp].url) != -1)
e.scriptInstance.url.indexOf(console.fbreaks[fbp].url) != -1)
{
e.scriptInstance.setBreakpoint(console.fbreaks[fbp].lineNumber,
console.fbreaks[fbp]);
@ -1027,13 +1030,14 @@ function st_reloadsrc (cb)
this.isLoaded = false;
this.lines = new Array();
delete this.markup;
delete this.charset;
this.loadSource(reloadCB);
}
SourceText.prototype.onSourceLoaded =
function st_oncomplete (data, url, status)
{
dd ("source loaded " + url + ", " + status);
//dd ("source loaded " + url + ", " + status);
var sourceText = this;
@ -1061,7 +1065,7 @@ function st_oncomplete (data, url, status)
var matchResult;
// Check before split because xml declarlation may contain newline.
// search for xml charset
if (data.substring(0, 5) == "<?xml" && !("charset" in this))
{
var s = data.substring(6, data.indexOf("?>"));
@ -1069,33 +1073,50 @@ function st_oncomplete (data, url, status)
if (matchResult)
this.charset = matchResult[2];
}
var ary = data.split(/\r\n|\n|\r/m);
var charsetRE =
/meta\s+http-equiv\s+content-type\s+charset=([^\;\"\'\s]+)/i;
for (var i = 0; i < ary.length; ++i)
// kill control characters, except \t, \r, and \n
data = data.replace(/[\x00-\x08]|[\x0B\x0C]|[\x0E-\x1F]/g, "?");
// check for a html style charset declaration
if (!("charset" in this))
{
/*
* The replace() strips control characters, we leave the tabs in
* so we can expand them to a per-file width before actually
* displaying them.
*/
ary[i] = ary[i].replace(/[\x00-\x08]|[\x0A-\x1F]/g, "?");
if (!("charset" in this))
{
matchResult = ary[i].match(charsetRE);
if (matchResult)
this.charset = matchResult[1];
}
matchResult =
data.match(/meta\s+http-equiv.*content-type.*charset\s*=\s*([^\;\"\'\s]+)/i);
if (matchResult)
this.charset = matchResult[1];
}
// look for an emacs mode line
matchResult = data.match (/-\*-.*tab-width\:\s*(\d+).*-\*-/);
if (matchResult)
this.tabWidth = matchResult[1];
// replace tabs
data = data.replace(/\x09/g, leftPadString ("", this.tabWidth, " "));
var ary = data.split(/\r\n|\n|\r/m);
if (0)
{
for (var i = 0; i < ary.length; ++i)
{
/*
* The replace() strips control characters, we leave the tabs in
* so we can expand them to a per-file width before actually
* displaying them.
*/
ary[i] = ary[i].replace(/[\x00-\x08]|[\x0A-\x1F]/g, "?");
if (!("charset" in this))
{
matchResult = ary[i].match(charsetRE);
if (matchResult)
this.charset = matchResult[1];
}
}
}
this.lines = ary;
ary = ary[0].match (/tab-?width*:\s*(\d+)/i);
if (ary)
this.tabWidth = ary[1];
if ("scriptInstance" in this)
{
this.scriptInstance.guessFunctionNames(sourceText);

View File

@ -39,6 +39,7 @@ const SIS_CTRID = "@mozilla.org/scriptableinputstream;1"
const nsIScriptableInputStream = Components.interfaces.nsIScriptableInputStream;
const nsIChannel = Components.interfaces.nsIChannel;
const nsIInputStream = Components.interfaces.nsIInputStream;
const nsIRequest = Components.interfaces.nsIRequest;
function _getChannelForURL (url)
{
@ -53,7 +54,7 @@ function _getChannelForURL (url)
function loadURLNow (url)
{
var chan = _getChannelForURL (url);
chan.loadFlags |= nsIRequest.LOAD_BYPASS_CACHE;
var instream =
Components.classes[SIS_CTRID].createInstance(nsIScriptableInputStream);
instream.init (chan.open());
@ -64,6 +65,7 @@ function loadURLNow (url)
function loadURLAsync (url, observer)
{
var chan = _getChannelForURL (url);
chan.loadFlags |= nsIRequest.LOAD_BYPASS_CACHE;
return chan.asyncOpen (new StreamListener (url, observer), null);
}

View File

@ -1179,7 +1179,8 @@ function scv_oninput (event)
function onTimeout ()
{
var textbox = getChildById(scriptsView.currentContent, "scripts-search");
var textbox = getChildById(scriptsView.currentContent,
"scripts-search");
dispatch ("search-scripts", { pattern: textbox.value });
};
@ -2306,7 +2307,9 @@ function cmdSaveTab (e)
if (source2View.tabs && e.index == null)
{
e.index = source2View.tabs.selectedIndex;
e.index = source2View.tabs.selectedIndex;
if (!(e.index in source2View.sourceTabList))
return;
}
else if (!source2View.tabs || e.index < 0 ||
e.index > source2View.sourceTabList.length - 1)
@ -3763,7 +3766,6 @@ function sv_dsource (sourceText, skipScrollRestore)
this.childData = sourceText;
this.rowCount = sourceText.lines.length;
this.tabString = leftPadString ("", sourceText.tabWidth, " ");
//var hdr = document.getElementById("source-line-text");
//hdr.setAttribute ("label", sourceText.fileName);
@ -3980,7 +3982,7 @@ function sv_getcelltext (row, colID)
switch (colID)
{
case "col-2":
return this.childData.lines[row].replace(/\t/g, this.tabString);
return this.childData.lines[row];
case "col-1":
return row + 1;

View File

@ -148,7 +148,7 @@ function vmrg_endmm()
var window = this.windows[w];
var container =
window.document.getElementById(VMGR_DEFAULT_CONTAINER);
if (container.viewCount == 0)
if (container && container.viewCount == 0)
window.close();
}
}
@ -1072,6 +1072,9 @@ function vmgr_grouttab (viewManager, container)
content = nextContent;
}
if (container.parentNode.localName == "viewcontainer")
viewManager.groutContainer(container.parentNode);
if (container.viewCount == 0)
{
//dd ("tab container is empty, hiding");
@ -1091,9 +1094,6 @@ function vmgr_grouttab (viewManager, container)
//dd ("unhiding tab container");
container.removeAttribute("collapsed");
if (container.parentNode.localName == "viewcontainer")
viewManager.groutContainer(container.parentNode);
if (container.viewCount == 1 && !viewManager.multiMoveDepth)
{
var parentLocation =

View File

@ -46,11 +46,6 @@
<!ENTITY Help.about "About Venkman">
<!-- toolips -->
<!ENTITY Cont.tooltip "Continue debugging">
<!ENTITY Stop.tooltip "Stop the current operation">
<!ENTITY StepOver.tooltip "Step over statement">
<!ENTITY StepIn.tooltip "Step into statement">
<!ENTITY StepOut.tooltip "Step out of statement">
<!ENTITY DebugBar.tooltip "Debugging Toolbar">
<!ENTITY MenuBar.tooltip "Menu Bar">

View File

@ -451,7 +451,7 @@ cmd.break-props.params = <break-wrapper>
cmd.break-props.help = Display the properties dialog for the breakpoint represented by <break-wrapper>.
cmd.change-container.params = <view-id> <new-type>
cmd.change-container.help = Changes the type of the container in which <view-name> resides to <new-type>. <view-id> must be one of: ``scripts'', ``windows'', ``locals'', ``watches'', ``breaks'', ``stack'', ``source'', ``source2'', or ``session''. <new-type> must be one of: ``horizontal'' for a horizontal layout, ``vertical'' for a vertical layout, or ``tab'' for a tab box layout.
cmd.change-container.help = Changes the type of the container in which <view-id> resides to <new-type>. <view-id> must be one of: ``scripts'', ``windows'', ``locals'', ``watches'', ``breaks'', ``stack'', ``source'', ``source2'', or ``session''. <new-type> must be one of: ``horizontal'' for a horizontal layout, ``vertical'' for a vertical layout, or ``tab'' for a tab box layout.
cmd.change-value.label = Change &Value...
cmd.change-value.params = <parent-value> <property-name> [<new-value>]
@ -498,6 +498,7 @@ cmd.copy-frames.help = Copy the selected frames to the clipboard.
cmd.cont.label = &Continue
cmd.cont.key = VK_F5
cmd.cont.tip = Continue debugging
cmd.cont.help = Continue execution of the debug target.
cmd.debug-script.label = Don't &Debug
@ -604,6 +605,7 @@ cmd.find-url-soft.help = Functions the same as |find-url|, except the view is
cmd.finish.label = S&tep Out
cmd.finish.key = shift VK_F11
cmd.finish.tip = Step out of the current function
cmd.finish.help = Execute until the current stack frame returns.
cmd.focus-input.key = VK_ESCAPE
@ -631,6 +633,7 @@ cmd.mozilla-help.help = Display the table of contents for the Mozilla help syst
cmd.next.label = Step &Over
cmd.next.key = VK_F10
cmd.next.tip = Step over function call
cmd.next.help = Executes the next line of script. If a function call is encountered it is traced as a single instruction.
cmd.open-dialog.params = <url> [<window-name> [<window-flags>]]
@ -666,6 +669,7 @@ cmd.profile-instance-off.params = <script-instance> [<...>]
cmd.profile-instance-off.help = Enable profiling in all functions contained by the script instance <script-instance>.
cmd.profile-tb.label = Profile
cmd.profile-tb.tip = Toggle profile mode
cmd.props.params = <expression>
cmd.props.help = Lists the properties of the value returned by <expression>. The expression is evaluated in the scope of the debug target's current frame. See also: |where|, |frame|, |eval|, and |propsd|.
@ -777,10 +781,12 @@ cmd.source-coloring.help = Enables or disables the source code coloring featur
cmd.stop.label = Sto&p
cmd.stop.key = VK_F4
cmd.stop.tip = Stop the current operation
cmd.stop.help = Stop before the next line of code is executed.
cmd.step.label = Step &Into
cmd.step.key = VK_F11
cmd.step.tip = Step into function call
cmd.step.help = Executes the next line of script and stops.
cmd.testargs.params = <int> <word> [<word2> <word3>]
@ -808,6 +814,7 @@ cmd.toggle-float.help = If the view specified by <view-id> is currently displa
cmd.toggle-pprint.label = &Pretty Print
cmd.toggle-pprint.key = accel P
cmd.toggle-pprint.tip = Toggle pretty print mode
cmd.toggle-pprint.help = Toggle Pretty Print mode.
cmd.toggle-save-layout.label = Save Default Layout On &Exit