Bug 135607 Add throbber to help toolbar p=rlk@trvenv.com r=me sr=alecf

This commit is contained in:
neil%parkwaycc.co.uk 2003-11-10 16:25:46 +00:00
Родитель 441bf34ce6
Коммит 567b29c470
3 изменённых файлов: 59 добавлений и 27 удалений

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

@ -120,6 +120,9 @@ function init() {
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);
@ -321,7 +324,17 @@ function nsHelpStatusHandler()
nsHelpStatusHandler.prototype =
{
onStateChange : function(aWebProgress, aRequest, aStateFlags, aStatus) {},
onStateChange : function(aWebProgress, aRequest, aStateFlags, aStatus)
{
const nsIWebProgressListener = Components.interfaces.nsIWebProgressListener;
// Turn on the throbber.
if (aStateFlags & nsIWebProgressListener.STATE_START)
this.throbberElement.setAttribute("busy", "true");
else if (aStateFlags & nsIWebProgressListener.STATE_STOP)
this.throbberElement.removeAttribute("busy");
},
onStatusChange : function(aWebProgress, aRequest, aStateFlags, aStatus) {},
onProgressChange : function(aWebProgress, aRequest, aCurSelfProgress,
aMaxSelfProgress, aCurTotalProgress, aMaxTotalProgress) {},
onSecurityChange : function(aWebProgress, aRequest, state) {},
@ -338,6 +351,18 @@ nsHelpStatusHandler.prototype =
return this;
throw Components.results.NS_NOINTERFACE;
},
init : function()
{
this.throbberElement = document.getElementById("navigator-throbber");
},
destroy : function()
{
//this is needed to avoid memory leaks, see bug 60729
this.throbberElement = null;
},
setJSStatus : function(status) {},
setJSDefaultStatus : function(status) {},
setOverLink : function(link) {}

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

@ -25,7 +25,8 @@
width="480"
height="360"
persist="width height screenX screenY"
onload="init();" >
onload="init();"
onunload="window.XULBrowserWindow.destroy();">
<script type="application/x-javascript" src="chrome://help/content/help.js"/>
<script type="application/x-javascript" src="chrome://navigator/content/sessionHistoryUI.js"/>
@ -111,6 +112,10 @@
<toolbarbutton id="print" class="toolbarbutton-1"
label="&printButton.label;" oncommand="print();"
tooltiptext="&printButton.tooltip;"/>
<hbox id="throbber-box" align="center">
<button id="navigator-throbber" oncommand="goHome();" tooltiptext="&helpThrobber.tooltip;"/>
</hbox>
</toolbar>
</toolbox>

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

@ -1,25 +1,27 @@
<!ENTITY helpWin.ttl "&brandShortName; Help" >
<!ENTITY toolbar.tooltip "Help Toolbar" >
<!ENTITY backBtn.label "Back" >
<!ENTITY fwdBtn.label "Forward" >
<!ENTITY homeBtn.label "Home" >
<!ENTITY backBtn.tooltip "Back" >
<!ENTITY fwdBtn.tooltip "Forward" >
<!ENTITY homeBtn.tooltip "Help Home Page" >
<!ENTITY tab1.label "Contents">
<!ENTITY tab2.label "Index">
<!-- added bt PW 1/29/02- please check for correctness-->
<!ENTITY searchtab.label "Search">
<!ENTITY searchbtn.label "Find">
<!ENTITY toctab.label "Contents">
<!ENTITY indextab.label "Index">
<!ENTITY ixname.label "Name">
<!ENTITY glossarytab.label "Glossary">
<!ENTITY glossname.label "Name">
<!-- added IO 2/7/01 -->
<!ENTITY gobtn.label "Search">
<!ENTITY name.label "Item">
<!ENTITY helpWin.ttl "&brandShortName; Help" >
<!ENTITY toolbar.tooltip "Help Toolbar" >
<!ENTITY backBtn.label "Back" >
<!ENTITY fwdBtn.label "Forward" >
<!ENTITY homeBtn.label "Home" >
<!ENTITY backBtn.tooltip "Back" >
<!ENTITY fwdBtn.tooltip "Forward" >
<!ENTITY homeBtn.tooltip "Help Home Page" >
<!ENTITY tab1.label "Contents">
<!ENTITY tab2.label "Index">
<!-- added bt PW 1/29/02- please check for correctness-->
<!ENTITY searchtab.label "Search">
<!ENTITY searchbtn.label "Find">
<!ENTITY toctab.label "Contents">
<!ENTITY indextab.label "Index">
<!ENTITY ixname.label "Name">
<!ENTITY glossarytab.label "Glossary">
<!ENTITY glossname.label "Name">
<!-- added IO 2/7/01 -->
<!ENTITY gobtn.label "Search">
<!ENTITY name.label "Item">
<!ENTITY helpThrobber.tooltip "Go to the Help Home Page">