44295, partially patch from timeless@bemail.org (some people have beaten me to part of it), r=myself and some general cleanup (js console)

This commit is contained in:
ben%netscape.com 2000-08-24 04:44:01 +00:00
parent baf7a88dea
commit b308c5fc72
7 changed files with 40 additions and 13 deletions

View File

@ -20,6 +20,8 @@
* Contributor(s):
*/
var bundle;
/*
* Functions for initializing and updating the JavaScript Console.
*/
@ -89,6 +91,8 @@ function onLoadJSConsole()
cs.registerListener(consoleListener);
bundle = srGetStrBundle("chrome://global/locale/console.properties");
return true;
}
@ -112,6 +116,9 @@ function onUnloadJSConsole()
return true;
}
gErrorCount = 0;
gWarningCount = 0;
/*
* Given a message, write it to the page.
*
@ -167,6 +174,7 @@ function appendMessage(messageObject)
cell.setAttribute("col", scriptError.columnNumber);
cell.setAttribute("msg", scriptError.message);
cell.setAttribute("error", scriptError.sourceLine);
} catch (exn) {
// dump(exn + '\n');
// QI failed, just try to treat it as an nsIConsoleMessage
@ -175,10 +183,26 @@ function appendMessage(messageObject)
row.appendChild(cell);
item.appendChild(row);
c.appendChild(item);
num_errors++;
//Deletes top error if error console is long
if(num_errors>250) { deleteOne(); }
/*
var warningBroadcaster = document.getElementById("Console:ShowWarnings");
var errorBroadcaster = document.getElementById("Console:ShowErrors");
var allBroadcaster = document.getElementById("Console:ShowAll");
if (warning) gWarningCount++;
else gErrorCount++;
warningBroadcaster.setAttribute("value",
(bundle.GetStringFromName("warningsLabel") + " (" + gWarningCount + ")"));
errorBroadcaster.setAttribute("value",
(bundle.GetStringFromName("errorsLabel") + " (" + gErrorCount + ")"));
allBroadcaster.setAttribute("value",
(bundle.GetStringFromName("allMsgsLabel") + " (" + (gErrorCount + gWarningCount) + ")"));
*/
num_errors++;
//Deletes top error if error console is long
if(num_errors>250) { deleteOne(); }
}

View File

@ -47,18 +47,18 @@ Contributor(s): ______________________________________. -->
<script language="javascript" src="chrome://global/content/console.js"/>
<broadcasterset>
<broadcaster id="cmd_quit"/>
<broadcaster id="cmd_quit"/>
</broadcasterset>
<toolbox>
<menubar id="main-menubar" class="chromeclass-menubar">
<menu accesskey="&filemenu.accesskey;" id="menu_File">
<menu id="menu_File">
<menupopup id="menu_FilePopup">
<menuitem id="menu_close" oncommand="window.close()"/>
</menupopup>
</menu>
<menu accesskey="&editmenu.accesskey;" id="menu_Edit">
<menu id="menu_Edit">
<menupopup id="dummyid">
<menuitem id="menu_cut" disabled="true"/>
<menuitem id="menu_copy" disabled="true"/>
@ -67,10 +67,10 @@ Contributor(s): ______________________________________. -->
</menu>
<!-- tasks menu filled from tasksOverlay -->
<menu accesskey="&tasksmenu.accesskey;" id="tasksMenu"/>
<menu id="tasksMenu"/>
<!-- help menu filled from globalOverlay -->
<menu accesskey="&helpmenu.accesskey;" id="menu_Help"/>
<menu id="menu_Help"/>
</menubar>
<toolbar id="toolbar">

View File

@ -1 +1,2 @@
console.dtd
console.properties

View File

@ -32,6 +32,7 @@ CHROME_L10N_DIR = global/locale
CHROME_L10N = \
console.dtd \
console.properties \
$(NULL)
include $(topsrcdir)/config/rules.mk

View File

@ -20,11 +20,6 @@ Contributor(s): ______________________________________. -->
<!ENTITY console.title "JavaScript Console">
<!ENTITY filemenu.accesskey "f">
<!ENTITY editmenu.accesskey "e">
<!ENTITY tasksmenu.accesskey "t">
<!ENTITY helpmenu.accesskey "h">
<!ENTITY url.label "Source File:">
<!ENTITY line.label "Line:">
<!ENTITY col.label "Column:">
@ -34,3 +29,4 @@ Contributor(s): ______________________________________. -->
<!ENTITY errors.label "Errors">
<!ENTITY warnings.label "Warnings">
<!ENTITY clear.label "Clear">

View File

@ -0,0 +1,4 @@
allMsgsLabel=All Messages
errorsLabel=Errors
warningsLabel=Warnings

View File

@ -28,6 +28,7 @@ CHROME_L10N_DIR = global\locale
CHROME_L10N = \
.\console.dtd \
.\console.properties \
$(NULL)
include <$(DEPTH)\config\rules.mak>