expose interface to the initAtStartup setting
This commit is contained in:
rginda%netscape.com 2001-10-31 23:33:41 +00:00
Родитель f947caa567
Коммит da857da996
4 изменённых файлов: 92 добавлений и 83 удалений

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

@ -137,6 +137,36 @@ function con_ondc ()
console.sourceView.outliner.invalidate(); console.sourceView.outliner.invalidate();
} }
console.onDebugMenuShowing =
function con_showdebug ()
{
console.ui["menu_initAtStartup"].setAttribute ("checked",
console.jsds.initAtStartup);
var check;
switch (getThrowMode())
{
case TMODE_IGNORE:
check = "menu_TModeIgnore";
break;
case TMODE_TRACE:
check = "menu_TModeTrace";
break;
case TMODE_BREAK:
check = "menu_TModeBreak";
break;
}
var menu = console.ui["menu_TModeIgnore"];
console.ui["menu_TModeIgnore"].setAttribute("checked",
"menu_TModeIgnore" == check);
console.ui["menu_TModeTrace"].setAttribute("checked",
"menu_TModeTrace" == check);
console.ui["menu_TModeBreak"].setAttribute("checked",
"menu_TModeBreak" == check);
}
console.onLoad = console.onLoad =
function con_load (e) function con_load (e)
{ {
@ -444,7 +474,7 @@ function cli_ihelp (e)
for (var i in ary) for (var i in ary)
{ {
display (getMsg(MSN_FMT_USAGE, [ary[i].name, ary[i].usage], MT_USAGE)); display (getMsg(MSN_FMT_USAGE, [ary[i].name, ary[i].usage]), MT_USAGE);
display (ary[i].help, MT_HELP); display (ary[i].help, MT_HELP);
} }
@ -928,34 +958,6 @@ function con_tabcomplete (e)
} }
console.onTModeMenuCreate =
function con_tmodecreate()
{
var check;
switch (getThrowMode())
{
case TMODE_IGNORE:
check = "menu_TModeIgnore";
break;
case TMODE_TRACE:
check = "menu_TModeTrace";
break;
case TMODE_BREAK:
check = "menu_TModeBreak";
break;
}
var menu = document.getElementById("menu_TModeIgnore");
menu.setAttribute("checked", "menu_TModeIgnore" == check);
menu = document.getElementById("menu_TModeTrace");
menu.setAttribute("checked", "menu_TModeTrace" == check);
menu = document.getElementById("menu_TModeBreak");
menu.setAttribute("checked", "menu_TModeBreak" == check);
}
console.onUnload = console.onUnload =
function con_unload (e) function con_unload (e)
{ {

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

@ -74,6 +74,8 @@
<command id="cmd_tmode_break" oncommand="setThrowMode(TMODE_BREAK);"/> <command id="cmd_tmode_break" oncommand="setThrowMode(TMODE_BREAK);"/>
<command id="cmd_stop" oncommand="console.doCommandToggleStop();"/> <command id="cmd_stop" oncommand="console.doCommandToggleStop();"/>
<command id="cmd_reload" oncommand="console.doCommandReload();"/> <command id="cmd_reload" oncommand="console.doCommandReload();"/>
<command id="cmd_init_at_startup"
oncommand="console.jsds.initAtStartup = !console.jsds.initAtStartup"/>
<!-- Tasks commands, from overlay --> <!-- Tasks commands, from overlay -->
<commandset id="tasksCommands"/> <commandset id="tasksCommands"/>
@ -167,7 +169,8 @@
<!-- Debug menu --> <!-- Debug menu -->
<menu id="menu_Debug" label="&Debug.label;" accesskey="&Debug.aKey;"> <menu id="menu_Debug" label="&Debug.label;" accesskey="&Debug.aKey;">
<menupopup id="menu_DebugPopup"> <menupopup id="menu_DebugPopup"
onpopupshowing="console.onDebugMenuShowing(event);">
<menuitem id="menu_Stop" key="key_stop" <menuitem id="menu_Stop" key="key_stop"
observes="cmd_stop" observes="cmd_stop"
label="&Stop.label;" accesskey="&Stop.aKey;"/> label="&Stop.label;" accesskey="&Stop.aKey;"/>
@ -184,27 +187,24 @@
observes="cmd_step_out" observes="cmd_step_out"
label="&StepOut.label;" accesskey="&StepOut.aKey;"/> label="&StepOut.label;" accesskey="&StepOut.aKey;"/>
<menuseparator/> <menuseparator/>
<menu id="menu_ThrowMode" label="&TModeMenu.label;"
accesskey="&TModeMenu.aKey;"> <menuitem id="menu_TModeIgnore"
<menupopup onpopupshowing="console.onTModeMenuCreate();"> observes="cmd_tmode_ignore" type="radio"
<menuitem id="menu_TModeIgnore" label="&TModeIgnore.label;"
observes="cmd_tmode_ignore" type="radio" accesskey="&TModeIgnore.aKey;"/>
label="&TModeIgnore.label;" <menuitem id="menu_TModeTrace"
accesskey="&TModeIgnore.aKey;"/> observes="cmd_tmode_trace" type="radio"
<menuitem id="menu_TModeTrace" label="&TModeTrace.label;"
observes="cmd_tmode_trace" type="radio" accesskey="&TModeTrace.aKey;"/>
label="&TModeTrace.label;" <menuitem id="menu_TModeBreak"
accesskey="&TModeTrace.aKey;"/> observes="cmd_tmode_break" type="radio"
<menuitem id="menu_TModeBreak" label="&TModeBreak.label;"
observes="cmd_tmode_break" type="radio" accesskey="&TModeBreak.aKey;"/>
label="&TModeBreak.label;" <menuseparator/>
accesskey="&TModeBreak.aKey;"/>
<menuseparator/> <menuitem id="menu_initAtStartup" observes="cmd_init_at_startup"
<menuitem id="menu_TModeCycle" label = "&TModeCycle.label;" type="checkbox"
observes="cmd_tmode_cycle" key="key_tmode_cycle" label="&InitAtStartup.label;" accesskey="&InitAtStartup.aKey;"/>
accesskey="&TModeCycle.aKey;"/>
</menupopup>
</menu>
</menupopup> </menupopup>
</menu> </menu>

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

@ -403,8 +403,16 @@ function init()
display(getMsg(MSN_VERSION, console.version), MT_HELLO); display(getMsg(MSN_VERSION, console.version), MT_HELLO);
displayCommands(); displayCommands();
console._statusElement = document.getElementById ("status-text"); console.ui = new Object();
console.ui["menu_initAtStartup"] =
document.getElementById ("menu_initAtStartup");
console.ui["menu_TModeIgnore"] = document.getElementById("menu_TModeIgnore");
console.ui["menu_TModeTrace"] = document.getElementById("menu_TModeTrace");
console.ui["menu_TModeBreak"] = document.getElementById("menu_TModeBreak");
console.ui["status-text"] = document.getElementById ("status-text");
console._statusStack = new Array(); console._statusStack = new Array();
startupTests(); startupTests();
} }
@ -570,7 +578,7 @@ console.load = load;
console.__defineGetter__ ("status", con_getstatus); console.__defineGetter__ ("status", con_getstatus);
function con_getstatus () function con_getstatus ()
{ {
return console._statusElement.getAttribute ("label"); return console.ui["status-text"].getAttribute ("label");
} }
console.__defineSetter__ ("status", con_setstatus); console.__defineSetter__ ("status", con_setstatus);
@ -579,7 +587,7 @@ function con_setstatus (msg)
if (!msg) if (!msg)
msg = console._statusStack[console._statusStack.length - 1]; msg = console._statusStack[console._statusStack.length - 1];
console._statusElement.setAttribute ("label", msg); console.ui["status-text"].setAttribute ("label", msg);
} }
console.pushStatus = console.pushStatus =

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

@ -34,37 +34,35 @@
- -
--> -->
<!ENTITY app.name.short "venkman">
<!ENTITY app.name.long "JavaScript Debugger">
<!ENTITY app.version "prototype_a">
<!ENTITY app.author "mozilla.org">
<!ENTITY MainWindow.title "JavaScript Debugger"> <!ENTITY MainWindow.title "JavaScript Debugger">
<!ENTITY Reload.label "Reload">
<!ENTITY Reload.aKey "R">
<!ENTITY Debug.label "Debug">
<!ENTITY Debug.aKey "D">
<!ENTITY Cont.label "Continue">
<!ENTITY Cont.aKey "C">
<!ENTITY StepIn.label "Step Into">
<!ENTITY StepIn.aKey "I">
<!ENTITY StepOver.label "Step Over">
<!ENTITY StepOver.aKey "O">
<!ENTITY StepOut.label "Step Out">
<!ENTITY StepOut.aKey "T">
<!ENTITY Stop.label "Stop">
<!ENTITY Stop.aKey "p">
<!ENTITY TModeMenu.label "Exceptions">
<!ENTITY TModeMenu.aKey "E">
<!ENTITY TModeIgnore.label "Ignore">
<!ENTITY TModeIgnore.aKey "I">
<!ENTITY TModeTrace.label "Trace">
<!ENTITY TModeTrace.aKey "T">
<!ENTITY TModeBreak.label "Break">
<!ENTITY TModeBreak.aKey "B">
<!ENTITY TModeCycle.label "Cycle">
<!ENTITY TModeCycle.aKey "C">
<!-- view menu -->
<!ENTITY Reload.label "Reload">
<!ENTITY Reload.aKey "R">
<!-- debug menu -->
<!ENTITY Debug.label "Debug">
<!ENTITY Debug.aKey "D">
<!ENTITY Cont.label "Continue">
<!ENTITY Cont.aKey "C">
<!ENTITY StepIn.label "Step Into">
<!ENTITY StepIn.aKey "I">
<!ENTITY StepOver.label "Step Over">
<!ENTITY StepOver.aKey "O">
<!ENTITY StepOut.label "Step Out">
<!ENTITY StepOut.aKey "t">
<!ENTITY Stop.label "Stop">
<!ENTITY Stop.aKey "p">
<!ENTITY TModeIgnore.label "Ignore Exceptions">
<!ENTITY TModeIgnore.aKey "g">
<!ENTITY TModeTrace.label "Trace Exceptions">
<!ENTITY TModeTrace.aKey "r">
<!ENTITY TModeBreak.label "Stop for Exceptions">
<!ENTITY TModeBreak.aKey "E">
<!ENTITY InitAtStartup.label "Initialize at Startup">
<!ENTITY InitAtStartup.aKey "n">
<!-- toolips -->
<!ENTITY Cont.tooltip "Continue debugging"> <!ENTITY Cont.tooltip "Continue debugging">
<!ENTITY Stop.tooltip "Stop the current operation"> <!ENTITY Stop.tooltip "Stop the current operation">
<!ENTITY StepOver.tooltip "Step over statement"> <!ENTITY StepOver.tooltip "Step over statement">
@ -73,6 +71,7 @@
<!ENTITY DebugBar.tooltip "Debugging Toolbar"> <!ENTITY DebugBar.tooltip "Debugging Toolbar">
<!ENTITY MenuBar.tooltip "Menu Bar"> <!ENTITY MenuBar.tooltip "Menu Bar">
<!-- status bar -->
<!ENTITY StatusText.label "Welcome to the JavaScript Debugger"> <!ENTITY StatusText.label "Welcome to the JavaScript Debugger">
<!-- source outliner --> <!-- source outliner -->