From b308c5fc725983b6004671ba263b72c9336e8e84 Mon Sep 17 00:00:00 2001 From: "ben%netscape.com" Date: Thu, 24 Aug 2000 04:44:01 +0000 Subject: [PATCH] 44295, partially patch from timeless@bemail.org (some people have beaten me to part of it), r=myself and some general cleanup (js console) --- .../console/resources/content/console.js | 30 +++++++++++++++++-- .../console/resources/content/console.xul | 10 +++---- .../console/resources/locale/en-US/MANIFEST | 1 + .../resources/locale/en-US/Makefile.in | 1 + .../resources/locale/en-US/console.dtd | 6 +--- .../resources/locale/en-US/console.properties | 4 +++ .../resources/locale/en-US/makefile.win | 1 + 7 files changed, 40 insertions(+), 13 deletions(-) create mode 100644 xpfe/components/console/resources/locale/en-US/console.properties diff --git a/xpfe/components/console/resources/content/console.js b/xpfe/components/console/resources/content/console.js index bcdb41d107d6..4075d89c75ef 100644 --- a/xpfe/components/console/resources/content/console.js +++ b/xpfe/components/console/resources/content/console.js @@ -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(); } } diff --git a/xpfe/components/console/resources/content/console.xul b/xpfe/components/console/resources/content/console.xul index 49a43679317d..37fa23918e8d 100644 --- a/xpfe/components/console/resources/content/console.xul +++ b/xpfe/components/console/resources/content/console.xul @@ -47,18 +47,18 @@ Contributor(s): ______________________________________. -->