\n @@ -32,3 +32,5 @@ errorFromServer=A News (NNTP) error occurred: enterUsername=Please enter a username for news server access enterPassword=Please enter a password for news server access enterPasswordTitle=News Password +okButtonText=Download + diff --git a/mozilla/xpfe/browser/resources/content/navigator.js b/mozilla/xpfe/browser/resources/content/navigator.js index 68b9db6c721..0565e95a29c 100644 --- a/mozilla/xpfe/browser/resources/content/navigator.js +++ b/mozilla/xpfe/browser/resources/content/navigator.js @@ -438,6 +438,8 @@ function Startup() } if (homepage) setTooltipText("homebutton", homepage); + + initConsoleListener(); } function Shutdown() @@ -1220,14 +1222,6 @@ function BrowserEditBookmarks() window.open("chrome://messenger/content/addressbook/addressbook.xul", "_blank", "chrome,menubar,toolbar,resizable"); } - function BrowserSendLink(pageUrl, pageTitle) - { - window.openDialog( "chrome://messenger/content/messengercompose/messengercompose.xul", "_blank", - "chrome,all,dialog=no", - "body='" + pageUrl + "',subject='" + pageTitle + - "',bodyislink=true"); - } - function BrowserSendPage(pageUrl, pageTitle) { window.openDialog( "chrome://messenger/content/messengercompose/messengercompose.xul", "_blank", @@ -1476,4 +1470,63 @@ function dumpMemoryLeaks() { if (leakDetector != null) leakDetector.dumpLeaks(); } - + +var consoleListener = { + observe: function (aMsgObject) + { + const nsIScriptError = Components.interfaces.nsIScriptError; + var scriptError = aMsgObject.QueryInterface(nsIScriptError); + var isWarning = scriptError.flags & nsIScriptError.warningFlag != 0; + if (!isWarning) + { + var statusbarDisplay = document.getElementById("statusbar-display"); + statusbarDisplay.setAttribute("error", "true"); + statusbarDisplay.addEventListener("click", loadErrorConsole, true); + statusbarDisplay.value = bundle.GetStringFromName("jserror"); + this.isShowingError = true; + } + }, + + // whether or not an error alert is being displayed + isShowingError: false, + +}; + +function initConsoleListener() +{ + var consoleService = nsJSComponentManager.getService("mozilla.consoleservice.1", "nsIConsoleService"); + + /** + * XXX - console launch hookup requires some work that I'm not sure how to + * do. + * + * 1) ideally, the notification would disappear when the document that had the + * error was flushed. how do I know when this happens? All the nsIScriptError + * object I get tells me is the URL. Where is it located in the content area? + * 2) the notification service should not display chrome script errors. + * web developers and users are not interested in the failings of our shitty, + * exception unsafe js. One could argue that this should also extend to + * the console by default (although toggle-able via setting for chrome authors) + * At any rate, no status indication should be given for chrome script + * errors. + * + * As a result I am commenting out this for the moment. + **/ + //if (consoleService) + // consoleService.registerListener(consoleListener); +} + +function loadErrorConsole(aEvent) +{ + if (aEvent.detail == 2) + toJavaScriptConsole(); +} + +function clearErrorNotification() +{ + var statusbarDisplay = document.getElementById("statusbar-display"); + statusbarDisplay.removeAttribute("error"); + statusbarDisplay.removeEventListener("click", loadErrorConsole, true); + consoleListener.isShowingError = false; +} + diff --git a/mozilla/xpfe/browser/resources/content/navigator.xul b/mozilla/xpfe/browser/resources/content/navigator.xul index 7ecc9dadf8d..0dd34b92bbb 100644 --- a/mozilla/xpfe/browser/resources/content/navigator.xul +++ b/mozilla/xpfe/browser/resources/content/navigator.xul @@ -24,10 +24,10 @@ Contributor(s): ______________________________________. --> - - - + + + value="&openLinkCmd.label;" accesskey="" oncommand="contextMenu.openLink();"/> +