add offline indicator to statusbar and menu
git-svn-id: svn://10.0.0.236/trunk@210336 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
parent
88c77bc3ca
commit
124d15ad96
@ -378,6 +378,9 @@ function Startup()
|
||||
var url_bar = document.getElementById("urlbar");
|
||||
if ( url_bar )
|
||||
url_bar.focus();
|
||||
|
||||
// set the offline/online mode
|
||||
setOfflineStatus();
|
||||
|
||||
tryToSetContentWindow();
|
||||
|
||||
@ -559,12 +562,14 @@ function BrowserForward()
|
||||
|
||||
function BrowserBackMenu(event)
|
||||
{
|
||||
//FillHistoryMenu(event.target, "back");
|
||||
appCore.backButtonPopup(event.target);
|
||||
}
|
||||
|
||||
|
||||
function BrowserForwardMenu(event)
|
||||
{
|
||||
//FillHistoryMen(event.target, "forward");
|
||||
appCore.forwardButtonPopup(event.target);
|
||||
}
|
||||
|
||||
@ -1459,3 +1464,26 @@ function dumpMemoryLeaks() {
|
||||
leakDetector.dumpLeaks();
|
||||
}
|
||||
|
||||
/**
|
||||
* Go into online/offline mode
|
||||
**/
|
||||
function setOfflineStatus(aToggleFlag)
|
||||
{
|
||||
var ioService = nsJSComponentManager.getServiceByID("{9ac9e770-18bc-11d3-9337-00104ba0fd40}",
|
||||
"nsIIOService");
|
||||
var statusIndicator = document.getElementById("offline-status");
|
||||
var menuItem = document.getElementById("goOffline");
|
||||
if (aToggleFlag)
|
||||
ioService.offline = !ioService.offline;
|
||||
|
||||
if (ioService.offline)
|
||||
{
|
||||
statusIndicator.setAttribute("offline", "true");
|
||||
menuItem.setAttribute("value", bundle.GetStringFromName("goonline"));
|
||||
}
|
||||
else
|
||||
{
|
||||
statusIndicator.removeAttribute("offline");
|
||||
menuItem.setAttribute("value", bundle.GetStringFromName("gooffline"));
|
||||
}
|
||||
}
|
||||
|
||||
@ -121,7 +121,6 @@ Contributor(s): ______________________________________. -->
|
||||
<broadcaster id="Browser:SendLink" value="&sendLinkCmd.label;" oncommand="BrowserSendLink(window.content.location.href, window.content.document.title);"/>
|
||||
<broadcaster id="Browser:EditPage" value="&editPageCmd.label;" oncommand="BrowserEditPage(window.content.location.href);"/>
|
||||
|
||||
<broadcaster id="Browser:GoOffline" value="&offlineGoOfflineCmd.label;" disabled="true" oncommand="BrowserReload();"/>
|
||||
<broadcaster id="Browser:Synchronize" value="&offlineSynchronizeCmd.label;" disabled="true" oncommand="BrowserReload();"/>
|
||||
|
||||
<broadcaster id="Browser:PrintSetup" value="&printSetupCmd.label;" disabled ="true" oncommand="BrowserReload();"/>
|
||||
@ -174,9 +173,9 @@ Contributor(s): ______________________________________. -->
|
||||
<menuitem accesskey="&printPreviewCmd.accesskey;" observes="Browser:PrintPreview"/>
|
||||
<menuitem accesskey="&printCmd.accesskey;" key="printKb" observes="Browser:Print"/>
|
||||
<menuseparator />
|
||||
<menu value="&offlineMenu.label;" disabled ="true" accesskey="&offlineMenu.accesskey;">
|
||||
<menu value="&offlineMenu.label;" accesskey="&offlineMenu.accesskey;">
|
||||
<menupopup>
|
||||
<menuitem accesskey="&offlineGoOfflineCmd.accesskey;" observes="Browser:GoOffline"/>
|
||||
<menuitem id="goOffline" accesskey="&offlineGoOfflineCmd.accesskey;" value="&offlineGoOfflineCmd.label;" oncommand="setOfflineStatus(true);"/>
|
||||
<menuseparator />
|
||||
<menuitem accesskey="&offlineSynchronizeCmd.accesskey;" observes="Browser:Synchronize"/>
|
||||
</menupopup>
|
||||
@ -502,6 +501,7 @@ END of Deprecated -->
|
||||
<progressmeter id="statusbar-icon" mode="normal" value="0"/>
|
||||
<statusbarpanel id="statusbar-display" value="&statusText.label;" crop="right" flex="1"/>
|
||||
<statusbarpanel id="statusbar-buildid" value="&buildId.label;"/>
|
||||
<statusbarpanel id="offline-status" oncommand="setOfflineStatus(true);"/>
|
||||
<statusbarpanel id="security-button"/>
|
||||
</statusbar>
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user