Bug 301318. Fix initial focus in help and remove unnecessary throbber code. r=mconnor, a=mconnor

This commit is contained in:
aaronleventhal%moonset.net 2005-07-20 03:55:24 +00:00
Родитель ad48b3491d
Коммит b49257c1eb
1 изменённых файлов: 2 добавлений и 64 удалений

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

@ -173,18 +173,10 @@ function init() {
getWebNavigation().sessionHistory =
Components.classes["@mozilla.org/browser/shistory;1"]
.createInstance(Components.interfaces.nsISHistory);
window.XULBrowserWindow = new nsHelpStatusHandler();
//Start the status handler.
window.XULBrowserWindow.init();
// Hook up UI through Progress Listener
const interfaceRequestor = helpBrowser.docShell.QueryInterface(Components.interfaces.nsIInterfaceRequestor);
const webProgress = interfaceRequestor.getInterface(Components.interfaces.nsIWebProgress);
webProgress.addProgressListener(window.XULBrowserWindow, Components.interfaces.nsIWebProgress.NOTIFY_ALL);
gClickSelectsAll = getBoolPref("browser.urlbar.clickSelectsAll", true);
setTimeout(focusSearch, 0);
}
function showSearchSidebar() {
@ -510,60 +502,6 @@ function gotoHistoryIndex(aEvent) {
return true;
}
function nsHelpStatusHandler() {
this.init();
}
nsHelpStatusHandler.prototype = {
onStateChange : function(aWebProgress, aRequest, aStateFlags, aStatus)
{
const nsIWebProgressListener = Components.interfaces.nsIWebProgressListener;
# //Turn on and off the throbber depending on whether or not a page is loading. This is used in case
# //someone has a Help Viewer Content Pack that gets pages off of a web server.
if (aStateFlags & nsIWebProgressListener.STATE_START) {
if (this.throbberElement)
this.throbberElement.setAttribute("busy", "true");
} else if (aStateFlags & nsIWebProgressListener.STATE_STOP) {
if (aRequest && this.throbberElement) {
this.throbberElement.removeAttribute("busy");
}
}
},
onProgressChange : function(aWebProgress, aRequest, aCurSelfProgress,
aMaxSelfProgress, aCurTotalProgress, aMaxTotalProgress) {},
onStatusChange : function(aWebProgress, aRequest, aStatus, aMessage) {},
onSecurityChange : function(aWebProgress, aRequest, state) {},
onLocationChange : function(aWebProgress, aRequest, aLocation) {
UpdateBackForwardButtons();
},
QueryInterface : function(aIID) {
if (aIID.equals(Components.interfaces.nsIWebProgressListener) ||
aIID.equals(Components.interfaces.nsISupportsWeakReference) ||
aIID.equals(Components.interfaces.nsIXULBrowserWindow) ||
aIID.equals(Components.interfaces.nsISupports)) {
return this;
}
throw Components.results.NS_NOINTERFACE;
},
init : function()
{
this.throbberElement = document.getElementById("help-throbber");
},
destroy : function()
{
//this needed to avoid memory leaks, see bug 60729
this.throbberElement = null;
},
setJSStatus : function(status) {},
setJSDefaultStatus : function(status) {},
setOverLink : function(link) {}
}
function UpdateBackForwardButtons() {
var backBroadcaster = document.getElementById("canGoBack");
var forwardBroadcaster = document.getElementById("canGoForward");