changes to statusbarpanel/progressmeter to accommodate offline UI

This commit is contained in:
ben%netscape.com 2000-06-05 03:44:32 +00:00
parent e1de241d59
commit 2f1cfacf40
9 changed files with 8 additions and 417 deletions

View File

@ -1,27 +1,7 @@
var goPrefWindow = 0;
function getBrowserURL() {
try {
var prefs = Components.classes["component://netscape/preferences"];
if (prefs) {
prefs = prefs.getService();
if (prefs)
prefs = prefs.QueryInterface(Components.interfaces.nsIPref);
}
if (prefs) {
var url = prefs.CopyCharPref("browser.chromeURL");
if (url)
return url;
}
} catch(e) {
}
return "chrome://navigator/content/navigator.xul";
}
function goPageSetup()
{
}
/**
* Mozilla Widget Toolkit Globabl Utility Library
* ONLY for shared JS glue that affects the entire toolkit
**/
function goQuitApplication()
@ -55,168 +35,6 @@ function goQuitApplication()
return true;
}
function goOpenNewMessage()
{
var msgComposeService = Components.classes["component://netscape/messengercompose"].getService();
msgComposeService = msgComposeService.QueryInterface(Components.interfaces.nsIMsgComposeService);
msgComposeService.OpenComposeWindow(null,
null,
Components.interfaces.nsIMsgCompType.New,
Components.interfaces.nsIMsgCompFormat.Default,
null);
}
function goNewCardDialog(selectedAB)
{
window.openDialog("chrome://messenger/content/addressbook/abNewCardDialog.xul",
"",
"chrome,resizeable=no,modal",
{selectedAB:selectedAB});
}
function goEditCardDialog(abURI, card, okCallback)
{
window.openDialog("chrome://messenger/content/addressbook/abEditCardDialog.xul",
"",
"chrome,resizeable=no,modal",
{abURI:abURI, card:card, okCallback:okCallback});
}
function goPreferences(id, paneURL, paneID)
{
var prefWindowModalityPref;
try {
var pref = Components.classes["component://netscape/preferences"].getService();
if( pref )
pref = pref.QueryInterface( Components.interfaces.nsIPref );
if( pref )
prefWindowModalityPref = pref.GetBoolPref( "browser.prefWindowModal");
}
catch(e) {
prefWindowModalityPref = true;
}
var modality = prefWindowModalityPref ? "yes" : "no";
var prefWindow = window.openDialog("chrome://communicator/content/pref/pref.xul","PrefWindow", "chrome,modal=" + modality+ ",resizable=yes", paneURL, paneID);
}
function goToggleToolbar( id, elementID )
{
dump( "toggling toolbar "+id+"\n");
var toolbar = document.getElementById( id );
var element = document.getElementById( elementID );
if ( toolbar )
{
var attribValue = toolbar.getAttribute("hidden") ;
//dump("set hidden to "+!attribValue+"\n");
if ( attribValue != false )
{
// dump( "Show \n");
toolbar.setAttribute("hidden", "" );
if ( element )
element.setAttribute("checked","true")
}
else
{
// dump("hide \n");
toolbar.setAttribute("hidden", true );
if ( element )
element.setAttribute("checked","false")
}
document.persist(id, 'hidden');
document.persist(elementID, 'checked');
}
}
function goClickThrobber( urlPref )
{
var url;
try {
var pref = Components.classes["component://netscape/preferences"].getService();
if( pref )
pref = pref.QueryInterface( Components.interfaces.nsIPref );
url = pref.CopyCharPref(urlPref);
}
catch(e) {
url = null;
}
if ( url )
openTopWin(url);
}
//No longer needed. Rip this out since we are using openTopWin
function goHelpMenu( url )
{
/* note that this chrome url should probably change to not have all of the navigator controls */
/* also, do we want to limit the number of help windows that can be spawned? */
window.openDialog( getBrowserURL(), "_blank", "chrome,all,dialog=no", url );
}
function openTopWin( url )
{
/* note that this chrome url should probably change to not have all of the navigator controls,
but if we do this we need to have the option for chrome controls because goClickThrobber()
needs to use this function with chrome controls */
/* also, do we want to limit the number of help windows that can be spawned? */
dump("SetPrefToCurrentPage("+ url +") \n ");
if ((url == null) || (url == "")) return;
var windowManager = Components.classes['component://netscape/rdf/datasource?name=window-mediator'].getService();
var windowManagerInterface = windowManager.QueryInterface( Components.interfaces.nsIWindowMediator);
var topWindowOfType = windowManagerInterface.getMostRecentWindow( "navigator:browser" );
if ( topWindowOfType )
{
dump("setting page: " + topWindowOfType.content.location.href + "\n");
topWindowOfType.focus();
// urn:
var pos = url.indexOf("urn:");
dump("\n ** openTopWin, url=" + url + ", pos=" + pos + "\n");
if (pos == 0) {
topWindowOfType.content.location.href = xlateURL(url);
}
else
{
topWindowOfType.content.location.href = url;
}
}
else
{
dump(" No browser window. Should be disabling this button \n");
window.openDialog( getBrowserURL(), "_blank", "chrome,all,dialog=no", url );
}
}
function goAboutDialog()
{
var defaultAboutState = false;
try {
var pref = Components.classes["component://netscape/preferences"].getService();
if( pref )
pref = pref.QueryInterface( Components.interfaces.nsIPref );
defaultAboutState = pref.GetBoolPref("browser.show_about_as_stupid_modal_window");
}
catch(e) {
defaultAboutState = false;
}
if( defaultAboutState )
window.openDialog("chrome:global/content/about.xul", "About", "modal,chrome,resizable=yes,height=450,width=550");
else
window.openDialog( getBrowserURL(), "_blank", "chrome,all,dialog=no", 'chrome://global/content/about.html' );
}
//
// Command Updater functions
//
@ -265,40 +83,6 @@ function goSetMenuValue(command, valueAttribute)
}
}
function goUpdateGlobalEditMenuItems()
{
//dump("Updating edit menu items\n");
goUpdateCommand('cmd_undo');
goUpdateCommand('cmd_redo');
goUpdateCommand('cmd_cut');
goUpdateCommand('cmd_copy');
goUpdateCommand('cmd_paste');
goUpdateCommand('cmd_pasteQuote');
goUpdateCommand('cmd_selectAll');
goUpdateCommand('cmd_delete');
}
// update menu items that rely on the current selection
function goUpdateSelectEditMenuItems()
{
//dump("Updating select menu items\n");
goUpdateCommand('cmd_cut');
goUpdateCommand('cmd_copy');
goUpdateCommand('cmd_delete');
}
// update menu items that relate to undo/redo
function goUpdateUndoEditMenuItems()
{
//dump("Updating undo/redo menu items\n");
goUpdateCommand('cmd_undo');
goUpdateCommand('cmd_redo');
// we shouldn't really do this here, but we don't get the right notifications now
goUpdateCommand('cmd_paste');
goUpdateCommand('cmd_pasteQuote');
}
// this function is used to inform all the controllers attached to a node that an event has occurred
// (e.g. the tree controllers need to be informed of blur events so that they can change some of the
// menu items back to their default values)
@ -315,52 +99,6 @@ function goOnEvent(node, event)
}
}
// This used to be BrowserNewEditorWindow in navigator.js
function NewEditorWindow()
{
dump("In NewEditorWindow()...\n");
// Open editor window with blank page
// Kludge to leverage openDialog non-modal!
window.openDialog( "chrome://editor/content", "_blank", "chrome,all,dialog=no", "about:blank");
}
function NewEditorFromTemplate()
{
dump("NOT IMPLEMENTED: Write NewEditorFromTemplate()!\n")
}
function NewEditorFromDraft()
{
dump("NOT IMPLEMENTED: Write NewEditorFromDraft()!\n")
}
function helpMenuCreate()
{
//adding the brand string to the about
var BrandBundle = srGetStrBundle("chrome://global/locale/brand.properties");
var aboutStrName = BrandBundle.GetStringFromName("aboutStrName");
var aboutItem = document.getElementById( "releaseName" );
aboutItem.setAttribute("value", aboutStrName);
//Adding the release url since it will change based on brand
var BrandRelUrl = BrandBundle.GetStringFromName("releaseUrl");
var relCommand = "openTopWin(\'" + BrandRelUrl + "\')";
var relItem = document.getElementById( "releaseUrl" );
relItem.setAttribute("oncommand", relCommand);
}
function SendPage()
{
var pageUrl = window.content.location.href;
var pageTitle = window.content.document.title;
window.openDialog( "chrome://messenger/content/messengercompose/messengercompose.xul", "_blank",
"chrome,all,dialog=no",
"attachment='" + pageUrl + "',body='" + pageUrl +
"',subject='" + pageTitle + "',bodyislink=true");
}
function FillInTooltip ( tipElement )
{
var retVal = false;

View File

@ -1,5 +1,4 @@
<?xml version="1.0"?>
<?xul-overlay href="chrome://global/content/platformGlobalOverlay.xul"?>
<!DOCTYPE window SYSTEM "chrome://global/locale/globalOverlay.dtd">
@ -8,143 +7,8 @@
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<!-- script language="JavaScript" src="chrome://global/content/strres.js"/ -->
<script language="javascript" src="chrome://global/content/builtinURLs.js" />
<script language="JavaScript" src="chrome://global/content/globalOverlay.js"/>
<script language="JavaScript" src="chrome://global/content/globalOverlay.js"></script>
<!-- File Menu -->
<menu id="menu_File" value="&fileMenu.label;" accesskey="&fileMenu.accesskey;"/>
<!-- New SubMenu (Under File Menu) -->
<broadcaster id="cmd_newNavigator" oncommand="OpenBrowserWindow()"/>
<broadcaster id="cmd_newMessage" oncommand="goOpenNewMessage()"/>
<broadcaster id="cmd_newEditor" oncommand="NewEditorWindow();"/>
<broadcaster id="cmd_sendPage" oncommand="SendPage();"/>
<!-- NOT IMPLEMENTED, so temporarily disabled -->
<broadcaster id="cmd_newEditorTemplate" disabled="true" oncommand="NewEditorFromTemplate();"/>
<broadcaster id="cmd_newEditorDraft" disabled="true" oncommand="NewEditorFromDraft();"/>
<broadcaster id="cmd_pageSetup" value="&pageSetupCmd.label;" disabled="true" oncommand="goPageSetup();"/>
<menuitem id="menu_newEditor" value="&newBlankPageCmd.label;" accesskey="&newBlankPageCmd.accesskey;" key="key_newBlankPage" observes="cmd_newEditor"/>
<menuitem id="menu_newEditorTemplate" value="&newPageFromTemplateCmd.label;" accesskey="&newPageFromTemplateCmd.accesskey;" observes="cmd_newEditorTemplate"/>
<menuitem id="menu_newEditorDraft" value="&newPageFromDraftCmd.label;" accesskey="&newPageFromDraftCmd.accesskey;" observes="cmd_newEditorDraft"/>
<menu id="menu_New" value="&newMenu.label;" accesskey="&newMenu.accesskey;"/>
<menuitem id="menu_newNavigator" value="&newNavigatorCmd.label;" accesskey="&newNavigatorCmd.accesskey;" key="key_newNavigator" observes="cmd_newNavigator"/>
<menuitem id="menu_newMessage" value="&newMessageCmd.label;" accesskey="&newMessageCmd.accesskey;" key="key_newMessage" observes="cmd_newMessage"/>
<menuitem id="cmd_newCard" value="&newCardCmd.label;" accesskey="&newCardCmd.accesskey;" oncommand="goNewCardDialog(0)"/>
<menuitem id="menu_sendPage" value="&sendPage.label;" accesskey="&sendPage.accesskey;" key="key_sendPage" observes="cmd_sendPage"/>
<key id="key_newBlankPage" xulkey="true" shift="true" key="&newBlankPageCmd.key;" observes="cmd_newEditor"/>
<key id="key_newNavigator" xulkey="true" shift="false" key="&newNavigatorCmd.key;" observes="cmd_newNavigator"/>
<key id="key_newMessage" xulkey="true" key="&newMessageCmd.key;" observes="cmd_newMessage"/>
<!-- Edit Menu -->
<menu id="menu_Edit" value="&editMenu.label;" accesskey="&editMenu.accesskey;"/>
<menuitem id="menu_undo" value="&undoCmd.label;" key="key_undo" accesskey="&undoCmd.accesskey;" observes="cmd_undo"/>
<menuitem id="menu_redo" value="&redoCmd.label;" key="key_redo" accesskey="&redoCmd.accesskey;" observes="cmd_redo"/>
<menuitem id="menu_cut" value="&cutCmd.label;" key="key_cut" accesskey="&cutCmd.accesskey;" observes="cmd_cut"/>
<menuitem id="menu_copy" value="&copyCmd.label;" key="key_copy" accesskey="&copyCmd.accesskey;" observes="cmd_copy"/>
<menuitem id="menu_paste" value="&pasteCmd.label;" key="key_paste" accesskey="&pasteCmd.accesskey;" observes="cmd_paste"/>
<menuitem id="menu_delete" value="&deleteCmd.label;" key="key_delete" accesskey="&deleteCmd.accesskey;" observes="cmd_delete"/>
<menuitem id="menu_selectAll" value="&selectAllCmd.label;" key="key_selectAll" accesskey="&selectAllCmd.accesskey;" observes="cmd_selectAll"/>
<key id="key_undo" xulkey="true" key="&undoCmd.key;" observes="cmd_undo"/>
<key id="key_redo" xulkey="true" key="&redoCmd.key;" observes="cmd_redo"/>
<key id="key_cut" xulkey="true" key="&cutCmd.key;" observes="cmd_cut"/>
<key id="key_copy" xulkey="true" key="&copyCmd.key;" observes="cmd_copy"/>
<key id="key_paste" xulkey="true" key="&pasteCmd.key;" observes="cmd_paste"/>
<key id="key_selectAll" xulkey="true" key="&selectAllCmd.key;" observes="cmd_selectAll"/>
<key id="key_preferences" observes="cmd_preferences"/>
<commandset id="globalEditMenuItems"
commandupdater="true"
events="focus"
oncommandupdate="goUpdateGlobalEditMenuItems()"/>
<commandset id="selectEditMenuItems"
commandupdater="true"
events="select"
oncommandupdate="goUpdateSelectEditMenuItems()"/>
<commandset id="undoEditMenuItems"
commandupdater="true"
events="undo"
oncommandupdate="goUpdateUndoEditMenuItems()"/>
<broadcaster id="cmd_undo"
oncommand="goDoCommand('cmd_undo')"
disabled="true"/>
<broadcaster id="cmd_redo"
oncommand="goDoCommand('cmd_redo')"
disabled="true"/>
<broadcaster id="cmd_cut"
oncommand="goDoCommand('cmd_cut')"
disabled="true"/>
<broadcaster id="cmd_copy"
oncommand="goDoCommand('cmd_copy')"
disabled="true"/>
<broadcaster id="cmd_paste"
oncommand="goDoCommand('cmd_paste')"
disabled="true"/>
<broadcaster id="cmd_delete"
oncommand="goDoCommand('cmd_delete')"
valueDefault="&deleteCmd.label;"
disabled="true"/>
<broadcaster id="cmd_selectAll"
oncommand="goDoCommand('cmd_selectAll')"
disabled="true"/>
<!-- Not needed yet, window just needs a broadcaster with this id and oncommand= broadcaster id="cmd_preferences"/-->
<menuitem id="menu_preferences"
value="&preferencesCmd.label;"
key="key_preferences"
accesskey="&preferencesCmd.accesskey;"
observes="cmd_preferences"/>
<!-- Search Menu -->
<!-- View Menu -->
<menu id="menu_View" value="&viewMenu.label;" accesskey="&viewMenu.accesskey;"/>
<menu id="menu_Toolbars" value="&viewToolbarsMenu.label;" accesskey="&viewToolbarsMenu.accesskey;"/>
<menuitem id="menu_showTaskbar"
value="&showTaskbarCmd.label;"
accesskey="&showTaskbarCmd.accesskey;"
oncommand="goToggleToolbar('taskbar', 'menu_showTaskbar')"
checked="true"/>
<!-- Help Menu -->
<menu id="menu_Help" value="&helpMenu.label;">
<menupopup id="helpPopup" oncreate="helpMenuCreate()">
<menuitem value="&releaseCommCmd.label;" id="releaseUrl" />
<menuitem value="&aboutCommCmd.label;" name="&aboutCommCmd.label;" id="releaseName" oncommand="goAboutDialog();"/>
</menupopup>
</menu>
<!-- Gray horizontal splitter -->
<splitter id="gray_horizontal_splitter" class="gray-horizontal-splitter">
<box id="begincap" align="horizontal">
<spring flex="100%"/>
</box>
<spring flex="100%"/>
<grippy/>
<spring flex="100%"/>
<box id="endcap" align="horizontal">
<spring flex="100%"/>
</box>
</splitter>
<!-- Toolbar boxes -->
<box id="toolbar_button_box" align="horizontal" flex="100%"/>
<!-- Status Bar -->
<box id="status-bar" align="horizontal">
<box id="status-bar-leftcap" position="0"/>
<box id="status-bar-rightcap"/>
</box>
<popupset id="aTooltipSet">
<popup id="aTooltip" class="tooltip" oncreate="return FillInTooltip(document.tooltipNode);" >
<text id="TOOLTIP_tooltipText"/>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.6 KiB

After

Width:  |  Height:  |  Size: 8.2 KiB

View File

@ -1,7 +1,4 @@
platformDialogOverlay.xul
platformGlobalOverlay.xul
platformBrowserBindings.xul
platformInputBindings.xul
platformTextAreaBindings.xul
platformEditorBindings.xul
platformHTMLBindings.xml

View File

@ -181,6 +181,7 @@ var nsDragAndDrop = {
nsDragAndDrop.mDragSession.getData(trans, i);
supportsArray.AppendElement(trans);
}
dump("*** supportsArray = " + supportsArray.Count() + "\n");
return supportsArray;
}

View File

@ -30,12 +30,9 @@ CHROME_DIR = packages/widget-toolkit
CHROME_CONTENT_DIR = global/content
CHROME_CONTENT = \
platformGlobalOverlay.xul \
platformDialogOverlay.xul \
platformInputBindings.xul \
platformBrowserBindings.xul \
platformInputBindings.xul \
platformEditorBindings.xul \
platformTextAreaBindings.xul \
platformHTMLBindings.xml \
$(NULL)

View File

@ -30,12 +30,9 @@ CHROME_DIR = packages/widget-toolkit
CHROME_CONTENT_DIR = global/content
CHROME_CONTENT = \
platformGlobalOverlay.xul \
platformDialogOverlay.xul \
platformInputBindings.xul \
platformBrowserBindings.xul \
platformInputBindings.xul \
platformEditorBindings.xul \
platformTextAreaBindings.xul \
platformHTMLBindings.xml \
$(NULL)

View File

@ -25,12 +25,9 @@ CHROME_DIR = packages\widget-toolkit
CHROME_CONTENT_DIR = global\content
CHROME_CONTENT = \
.\platformGlobalOverlay.xul \
.\platformDialogOverlay.xul \
.\platformBrowserBindings.xul \
.\platformInputBindings.xul \
.\platformTextAreaBindings.xul \
.\platformEditorBindings.xul \
.\platformHTMLBindings.xml \
$(NULL)

View File

@ -212,7 +212,7 @@
<content excludes="observes,template">
<xul:box class="progressmeter-internal-box" flex="1">
<xul:stack class="progressmeter-stack" flex="1">
<xul:progressbar class="progressmeter-progressbar" inherits="value">
<xul:progressbar class="progressmeter-progressbar" inherits="value,statusbar">
<xul:box class="progress-bar"/>
<xul:box class="progress-remainder"/>
</xul:progressbar>
@ -515,7 +515,7 @@
<!-- XUL <statusbar> -->
<binding id="statusbar" extends="xul:box"/>
<binding id="statusbar-panel" extends="xul:box">
<binding id="statusbar-panel" extends="xul:button">
<content excludes="observes,template" autostretch="never" valign="middle">
<xul:image class="statusbar-panel-icon" inherits="src"/>
<xul:text class="statusbar-panel-text" inherits="value,crop" crop="right" flex="1"/>