Bug 267227 (be able to use Window and Help menus in every window) - Move the Window and Help menus to a new overlay. r=mconnor

This commit is contained in:
mozilla.mano%sent.com 2005-03-24 16:00:01 +00:00
parent 2cbd16eda1
commit 590c879372
18 changed files with 283 additions and 291 deletions

View File

@ -0,0 +1,114 @@
<?xml version="1.0"?>
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
# http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
# for the specific language governing rights and limitations under the
# License.
#
# The Original Code is Mozilla.org Code.
#
# The Initial Developer of the Original Code is Netscape
# Communications Corporation. Portions created by Netscape are
# Copyright (C) 1998-2000 Netscape Communications Corporation. All
# Rights Reserved.
#
# Contributor(s):
# Asaf Romano <mozilla.mano@sent.com>
#
# Alternatively, the contents of this file may be used under the terms of
# either the GNU General Public License Version 2 or later (the "GPL"), or
# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
# in which case the provisions of the GPL or the LGPL are applicable instead
# of those above. If you wish to allow use of your version of this file only
# under the terms of either the GPL or the LGPL, and not to allow others to
# use your version of this file under the terms of the MPL, indicate your
# decision by deleting the provisions above and replace them with the notice
# and other provisions required by the LGPL or the GPL. If you do not delete
# the provisions above, a recipient may use your version of this file under
# the terms of any one of the MPL, the GPL or the LGPL.
#
# ***** END LICENSE BLOCK *****
<!DOCTYPE overlay [
<!ENTITY % brandDTD SYSTEM "chrome://branding/locale/brand.dtd">
%brandDTD;
<!ENTITY % baseMenuOverlayDTD SYSTEM "chrome://browser/locale/baseMenuOverlay.dtd">
%baseMenuOverlayDTD;
]>
<overlay id="baseMenuOverlay"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<script type="application/x-javascript" src="chrome://browser/content/utilityOverlay.js"/>
<script type="application/x-javascript" src="chrome://help/content/contextHelp.js"/>
#ifdef XP_MACOSX
<!-- nsMenuBarX moves menu_preferences to the Application Menu -->
<menupopup id="menu_ToolsPopup">
<menuitem id="menu_preferences" oncommand="openPreferences();"/>
</menupopup>
<!-- Mac window menu -->
#include ../../../toolkit/content/macWindowMenu.inc
#endif
#ifdef XP_WIN
<menu id="helpMenu"
label="&helpMenuWin.label;"
accesskey="&helpMenuWin.accesskey;">
#else
<menu id="helpMenu"
label="&helpMenu.label;"
accesskey="&helpMenu.accesskey;">
#endif
<menupopup id="menu_HelpPopup">
<menuitem oncommand="openHelp('firefox-help');"
#ifdef XP_MACOSX
label="&helpContentsMac.label;"
#else
label="&helpContents.label;"
#endif
accesskey="&helpContents.accesskey;"
key="key_openHelp"/>
# Show IE Users menu item on Windows only
#ifdef XP_WIN
<menuitem label="&helpForIEUsers.label;"
accesskey="&helpForIEUsers.accesskey;"
oncommand="openHelp('ieusers');"/>
#endif
<menuseparator/>
<menuitem accesskey="&promote.accesskey;"
label="&promote.label;"
oncommand="openUILink(getUILink('promote'), event, false, true);"
onclick="checkForMiddleClick(this, event);"/>
#ifndef XP_MACOSX
<menuseparator/>
#endif
<menuitem id="aboutName"
accesskey="&aboutCmd.accesskey;"
label="&aboutCmd.label;"
#ifdef XP_MACOSX
hidden="true"
#endif
oncommand="openAboutDialog();"/>
</menupopup>
</menu>
<keyset id="baseMenuKeyset">
<key id="key_openHelp"
oncommand="openHelp('firefox-help');"
# VK_HELP doesn't work on other platforms yet
#ifdef XP_MACOSX
keycode="&openHelpMac.commandkey;"/>
#else
keycode="&openHelp.commandkey;"/>
#endif
</keyset>
</overlay>

View File

@ -420,56 +420,14 @@
label="&preferencesCmd.label;"
accesskey="&preferencesCmd.accesskey;"
oncommand="openPreferences();"/>
#else
#ifdef XP_MACOSX
<menuitem id="menu_preferences" oncommand="openPreferences();"/>
#endif
#endif
</menupopup>
</menu>
#ifdef XP_MACOSX
<menu id="windowMenu" label="&windowMenu.label;"
datasources="rdf:window-mediator" ref="NC:WindowMediatorRoot"
onpopupshowing="checkFocusedWindow();">
<template>
<rule>
<menupopup>
<menuitem uri="rdf:*" label="rdf:http://home.netscape.com/NC-rdf#Name" type="radio"
name="windowList" oncommand="ShowWindowFromResource(event.target)"/>
</menupopup>
</rule>
</template>
<menupopup id="windowPopup">
<menuitem command="minimizeWindow" key="key_minimizeWindow"/>
<menuitem command="zoomWindow"/>
<menuseparator/>
<menuitem label="&bringAllToFront.label;" disabled="true"/>
<menuseparator id="sep-window-list"/>
</menupopup>
</menu>
<menu id="windowMenu" />
#endif
#ifdef XP_WIN
<menu label="&helpMenuWin.label;"
accesskey="&helpMenuWin.accesskey;">
#else
<menu label="&helpMenu.label;"
accesskey="&helpMenu.accesskey;">
#endif
<menupopup id="menu_HelpPopup">
<menuseparator/>
<menuitem accesskey="&promote.accesskey;"
label="&promote.label;"
oncommand="openUILink(getUILink('promote'), event, false, true);"
onclick="checkForMiddleClick(this, event);"/>
<menuseparator/>
<menuitem id="aboutName"
accesskey="&aboutCmd.accesskey;"
label="&aboutCmd.label;"
oncommand="openAboutDialog();"/>
</menupopup>
</menu>
<menu id="helpMenu" />
</menubar>

View File

@ -164,11 +164,6 @@
<command id="Tools:Extensions" oncommand="BrowserOpenExtensions('extensions');"/>
<command id="Tools:Themes" oncommand="BrowserOpenExtensions('themes');"/>
<command id="Tools:Sanitize" oncommand="gSanitizeListener.sanitize(window || null);"/>
#ifdef XP_MACOSX
<command id="minimizeWindow" label="&minimizeWindow.label;" oncommand="window.minimize();" />
<command id="zoomWindow" label="&zoomWindow.label;" oncommand="zoomWindow();" />
#endif
</commandset>
<broadcasterset id="mainBroadcasterSet">
@ -329,10 +324,12 @@
<key id="key_textZoomReset" key="&textZoomResetCmd.commandkey;" command="cmd_textZoomReset" modifiers="accel"/>
<key id="key_switchTextDirection" key="&bidiSwitchTextDirectionItem.commandkey;" command="cmd_switchTextDirection" modifiers="accel,shift" />
#ifdef XP_MACOSX
<key id="key_minimizeWindow" command="minimizeWindow" key="&minimizeWindow.key;" modifiers="accel"/>
#endif
<key id="key_sanitize" command="Tools:Sanitize" keycode="VK_DELETE" modifiers="accel,shift"/>
</keyset>
# Used by baseMenuOverlay
#ifdef XP_MACOSX
<commandset id="baseMenuCommandSet" />
#endif
<keyset id="baseMenuKeyset" />

View File

@ -2755,16 +2755,6 @@ function OpenBrowserWindow()
}
}
function openAboutDialog()
{
#ifdef XP_MACOSX
// XXXmano: define minimizable=no although it does nothing on OS X (see Bug 287162); remove this comment once Bug 287162 is fixed...
window.open("chrome://browser/content/aboutDialog.xul", "About", "centerscreen,chrome,resizable=no, minimizable=no");
#else
window.openDialog("chrome://browser/content/aboutDialog.xul", "About", "modal,centerscreen,chrome,resizable=no");
#endif
}
function BrowserCustomizeToolbar()
{
// Disable the toolbar context menu items
@ -5064,44 +5054,6 @@ function charsetLoadListener (event)
}
}
#ifdef XP_MACOSX
const nsIWindowDataSource = Components.interfaces.nsIWindowDataSource;
function checkFocusedWindow()
{
var windowManagerDS = Components.classes['@mozilla.org/rdf/datasource;1?name=window-mediator'].getService(nsIWindowDataSource);
var sep = document.getElementById("sep-window-list");
// Using double parens to avoid warning
while ((sep = sep.nextSibling)) {
var url = sep.getAttribute('id');
var win = windowManagerDS.getWindowForResource(url);
if (win == window) {
sep.setAttribute("checked", "true");
break;
}
}
}
function toOpenWindow( aWindow )
{
aWindow.document.commandDispatcher.focusedWindow.focus();
}
function ShowWindowFromResource( node )
{
var windowManagerDS = Components.classes['@mozilla.org/rdf/datasource;1?name=window-mediator'].getService(nsIWindowDataSource);
var desiredWindow = null;
var url = node.getAttribute('id');
desiredWindow = windowManagerDS.getWindowForResource( url );
if ( desiredWindow )
{
toOpenWindow(desiredWindow);
}
}
#endif
/* Begin Page Style Functions */
function getStyleSheetArray(frame)
{
@ -5746,16 +5698,6 @@ function SwitchDocumentDirection(){
GetFrameDocumentsFromWindow(window.content);
}
#ifdef XP_MACOSX
function zoomWindow()
{
if (window.windowState == STATE_NORMAL)
window.maximize();
else
window.restore();
}
#endif
function missingPluginInstaller(){
this.missingPlugins = new Object();
}

View File

@ -49,6 +49,8 @@
#ifdef XP_MACOSX
<?xul-overlay href="chrome://browser/content/macBrowserOverlay.xul"?>
#else
<?xul-overlay href="chrome://browser/content/baseMenuOverlay.xul"?>
#endif
# All DTD information is stored in a separate file so that it can be shared by

View File

@ -49,6 +49,8 @@
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<?xul-overlay href="chrome://browser/content/baseMenuOverlay.xul"?>
# All JS files that browser.xul wishes to include *must* go into the browser-scripts.inc file
# so that they can be shared by hiddenWindow.xul.
#include browser-scripts.inc

View File

@ -401,3 +401,13 @@ function isBidiEnabled() {
return rv;
}
function openAboutDialog()
{
#ifdef XP_MACOSX
// XXXmano: define minimizable=no although it does nothing on OS X (see Bug 287162); remove this comment once Bug 287162 is fixed...
window.open("chrome://browser/content/aboutDialog.xul", "About", "centerscreen,chrome,resizable=no, minimizable=no");
#else
window.openDialog("chrome://browser/content/aboutDialog.xul", "About", "modal,centerscreen,chrome,resizable=no");
#endif
}

View File

@ -28,6 +28,7 @@ browser.jar:
* content/browser/utilityOverlay.js (content/utilityOverlay.js)
* content/browser/web-panels.js (content/web-panels.js)
* content/browser/web-panels.xul (content/web-panels.xul)
* content/browser/baseMenuOverlay.xul (content/baseMenuOverlay.xul)
#ifndef MOZ_USE_OFFICIAL_BRANDING
content/branding/contents.rdf (branding/contents.rdf)
content/branding/about.png (branding/about.png)

View File

@ -0,0 +1,23 @@
<!ENTITY minimizeWindow.key "m">
<!ENTITY minimizeWindow.label "Minimize">
<!ENTITY bringAllToFront.label "Bring All to Front">
<!ENTITY zoomWindow.label "Zoom">
<!ENTITY windowMenu.label "Window">
<!ENTITY helpMenu.label "Help">
<!ENTITY helpMenu.accesskey "H">
<!-- LOCALIZATION NOTE some localizations of Windows (ex:french, german) use "?"
for the help button in the menubar but Gnome does not. -->
<!ENTITY helpMenuWin.label "Help">
<!ENTITY helpMenuWin.accesskey "H">
<!ENTITY aboutCmd.label "About &brandFullName;">
<!ENTITY aboutCmd.accesskey "A">
<!ENTITY helpContents.label "Help Contents">
<!ENTITY helpContents.accesskey "H">
<!ENTITY helpContentsMac.label "&brandShortName; Help">
<!ENTITY helpForIEUsers.label "For Internet Explorer Users">
<!ENTITY helpForIEUsers.accesskey "I">
<!ENTITY openHelp.commandkey "VK_F1">
<!ENTITY openHelpMac.commandkey "VK_HELP">
<!ENTITY promote.label "Promote &brandShortName;">
<!ENTITY promote.accesskey "P">

View File

@ -184,19 +184,9 @@
<!ENTITY goHomeCmd.accesskey "h">
<!ENTITY earlierHistory.label "Earlier History">
<!ENTITY helpMenu.label "Help">
<!ENTITY helpMenu.accesskey "H">
<!-- LOCALIZATION NOTE some localizations of Windows (ex:french, german) use "?"
for the help button in the menubar but Gnome does not. -->
<!ENTITY helpMenuWin.label "Help">
<!ENTITY helpMenuWin.accesskey "H">
<!ENTITY releaseCmd.accesskey "R">
<!ENTITY releaseCmd.label "Release Notes">
<!ENTITY aboutCmd.label "About &brandFullName;">
<!ENTITY aboutCmd.accesskey "A">
<!ENTITY openCmd.commandkey "l">
<!ENTITY urlbar.accesskey "d">
@ -341,12 +331,6 @@
<!ENTITY closeCmd.key "W">
<!ENTITY closeCmd.accesskey "C">
<!ENTITY minimizeWindow.key "m">
<!ENTITY minimizeWindow.label "Minimize">
<!ENTITY bringAllToFront.label "Bring All to Front">
<!ENTITY zoomWindow.label "Zoom">
<!ENTITY windowMenu.label "Window">
<!ENTITY pageStyleMenu.label "Page Style">
<!ENTITY pageStyleMenu.accesskey "y">
<!ENTITY pageStyleButton.label "Page Styles">

View File

@ -5,6 +5,7 @@
locale/browser/aboutDialog.dtd (%chrome/browser/aboutDialog.dtd)
locale/browser/credits.dtd (%chrome/browser/credits.dtd)
* locale/browser/browser.dtd (%chrome/browser/browser.dtd)
locale/browser/baseMenuOverlay.dtd (%chrome/browser/baseMenuOverlay.dtd)
locale/browser/browser.properties (%chrome/browser/browser.properties)
locale/browser/metaData.dtd (%chrome/browser/metaData.dtd)
locale/browser/metaData.properties (%chrome/browser/metaData.properties)

View File

@ -51,23 +51,4 @@
<RDF:Description RDF:about="urn:mozilla:package:help"
chrome:name="help" />
# Overlays Points
<RDF:Seq RDF:about="urn:mozilla:overlays">
#ifdef MOZ_THUNDERBIRD
<RDF:li RDF:resource="chrome://messenger/content/mailWindowOverlay.xul"/>
#elifdef MOZ_PHOENIX
<RDF:li RDF:resource="chrome://browser/content/browser.xul"/>
#endif
</RDF:Seq>
# Overlays
#ifdef MOZ_THUNDERBIRD
<RDF:Seq RDF:about="chrome://messenger/content/mailWindowOverlay.xul">
<RDF:li>chrome://help/content/helpMenuOverlay.xul</RDF:li>
</RDF:Seq>
#elifdef MOZ_PHOENIX
<RDF:Seq RDF:about="chrome://browser/content/browser.xul">
<RDF:li>chrome://help/content/helpMenuOverlay.xul</RDF:li>
</RDF:Seq>
#endif
</RDF:RDF>

View File

@ -1,98 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
#
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
# http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
# for the specific language governing rights and limitations under the
# License.
#
# The Original Code is Mozilla Application Suite.
#
# The Initial Developer of the Original Code is
# Ian Oeschger.
# Portions created by the Initial Developer are Copyright (C) 2003
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
# brantgurganus2001@cherokeescouting.org
# Jswalden86@netzero.net
#
# Alternatively, the contents of this file may be used under the terms of
# either the GNU General Public License Version 2 or later (the "GPL"), or
# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
# in which case the provisions of the GPL or the LGPL are applicable instead
# of those above. If you wish to allow use of your version of this file only
# under the terms of either the GPL or the LGPL, and not to allow others to
# use your version of this file under the terms of the MPL, indicate your
# decision by deleting the provisions above and replace them with the notice
# and other provisions required by the GPL or the LGPL. If you do not delete
# the provisions above, a recipient may use your version of this file under
# the terms of any one of the MPL, the GPL or the LGPL.
#
# ***** END LICENSE BLOCK *****
<!DOCTYPE overlay [
<!ENTITY % helpMenuDTD SYSTEM "chrome://help/locale/helpMenuOverlay.dtd">
%helpMenuDTD;
]>
<overlay id="helpMenuID" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<script type="application/x-javascript" src="chrome://help/content/contextHelp.js"/>
# Use the Thunderbird content pack if we're building thunderbird. Otherwise use the Firefox content
# pack. We should use else instead of elseif to prevent build errors if MOZ_PHOENIX and MOZ_THUNDERBIRD
# are not built.
# These keyset ids have to be used to show the key shortcut in the menu
#ifdef MOZ_THUNDERBIRD
<keyset id="mailKeys">
<key id="key_openHelp"
oncommand="openHelp('smtp-docs','chrome://help/locale/thunderbirdhelp.rdf');"
#else
<keyset id="mainKeyset">
<key id="key_openHelp"
oncommand="openHelp('firefox-help');"
#endif
# VK_HELP doesn't work on other platforms yet
#ifdef XP_MACOSX
keycode="&openHelpMac.commandkey;"/>
#else
keycode="&openHelp.commandkey;"/>
#endif
</keyset>
<menupopup id="menu_HelpPopup">
<menuitem label="&helpContents.label;"
position="1"
accesskey="&helpContents.accesskey;"
key="key_openHelp"
# Use the Thunderbird content pack if we're building thunderbird. Otherwise use the Firefox content
# pack. We should use else instead of elseif to prevent build errors if MOZ_PHOENIX and MOZ_THUNDERBIRD
# are not built.
#ifdef MOZ_THUNDERBIRD
oncommand="openHelp('smtp-docs','chrome://help/locale/thunderbirdhelp.rdf');"/>
#else
oncommand="openHelp('firefox-help');"/>
#endif
# Disable For IE Users menu item on Unix systems and if we're not building
# Firefox (since Thunderbird Help wouldn't need Help for IE Users because IE
# is a web browser).
#ifndef MOZ_THUNDERBIRD
#ifndef XP_UNIX
#ifndef XP_OS2
<menuitem label="&helpForIEUsers.label;"
position="2"
accesskey="&helpForIEUsers.accesskey;"
oncommand="openHelp('ieusers');"/>
#endif
#endif
#endif
</menupopup>
</overlay>

View File

@ -3,7 +3,6 @@ help.jar:
* content/help/contextHelp.js (content/contextHelp.js)
* content/help/help.js (content/help.js)
* content/help/contents.rdf (content/contents.rdf)
* content/help/helpMenuOverlay.xul (content/helpMenuOverlay.xul)
* content/help/helpContextOverlay.xul (content/helpContextOverlay.xul)
* content/help/customizeToolbar.xul (content/customizeToolbar.xul)
* content/help/toolbarCustomization.js (content/toolbarCustomization.js)
@ -11,4 +10,3 @@ help.jar:
locale/en-US/help/contents.rdf (locale/en-US/contents.rdf)
locale/en-US/help/help.properties (locale/en-US/help.properties)
locale/en-US/help/help.dtd (locale/en-US/help.dtd)
locale/en-US/help/helpMenuOverlay.dtd (locale/en-US/helpMenuOverlay.dtd)

View File

@ -1,46 +0,0 @@
<!-- ***** BEGIN LICENSE BLOCK *****
- Version: MPL 1.1/GPL 2.0/LGPL 2.1
-
- The contents of this file are subject to the Mozilla Public License Version
- 1.1 (the "License"); you may not use this file except in compliance with
- the License. You may obtain a copy of the License at
- http://www.mozilla.org/MPL/
-
- Software distributed under the License is distributed on an "AS IS" basis,
- WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- for the specific language governing rights and limitations under the
- License.
-
- The Original Code is Mozilla Application Suite.
-
- The Initial Developer of the Original Code is
- Ian Oeschger.
- Portions created by the Initial Developer are Copyright (C) 2003
- the Initial Developer. All Rights Reserved.
-
- Contributor(s):
- brantgurganus2001@cherokeescouting.org
- rlk@trfenv.com
- Jswalden86@netzero.net
-
- Alternatively, the contents of this file may be used under the terms of
- either the GNU General Public License Version 2 or later (the "GPL"), or
- the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- in which case the provisions of the GPL or the LGPL are applicable instead
- of those above. If you wish to allow use of your version of this file only
- under the terms of either the GPL or the LGPL, and not to allow others to
- use your version of this file under the terms of the MPL, indicate your
- decision by deleting the provisions above and replace them with the notice
- and other provisions required by the LGPL or the GPL. If you do not delete
- the provisions above, a recipient may use your version of this file under
- the terms of any one of the MPL, the GPL or the LGPL.
-
- ***** END LICENSE BLOCK ***** -->
<!ENTITY helpContents.label "Help Contents">
<!ENTITY helpContents.accesskey "H">
<!ENTITY helpForIEUsers.label "For Internet Explorer Users">
<!ENTITY helpForIEUsers.accesskey "I">
<!ENTITY openHelp.commandkey "VK_F1">
<!ENTITY openHelpMac.commandkey "VK_HELP">

View File

@ -67,3 +67,6 @@ toolkit.jar:
content/global/bindings/autoscroll_all.png (widgets/autoscroll_all.png)
content/global/bindings/autoscroll_h.png (widgets/autoscroll_h.png)
content/global/bindings/autoscroll_v.png (widgets/autoscroll_v.png)
#ifdef XP_MACOSX
* content/global/macWindowMenu.js (macWindowMenu.js)
#endif

View File

@ -0,0 +1,40 @@
<script type="application/x-javascript" src="chrome://global/content/macWindowMenu.js"/>
<commandset id="baseMenuCommandSet">
<command id="minimizeWindow"
label="&minimizeWindow.label;"
oncommand="window.minimize();" />
<command id="zoomWindow"
label="&zoomWindow.label;"
oncommand="zoomWindow();" />
</commandset>
<keyset id="baseMenuKeyset">
<key id="key_minimizeWindow"
command="minimizeWindow"
key="&minimizeWindow.key;"
modifiers="accel"/>
</keyset>
<menu id="windowMenu"
label="&windowMenu.label;"
datasources="rdf:window-mediator" ref="NC:WindowMediatorRoot"
onpopupshowing="checkFocusedWindow();"
hidden="false">
<template>
<rule>
<menupopup>
<menuitem uri="rdf:*"
label="rdf:http://home.netscape.com/NC-rdf#Name"
type="radio"
name="windowList"
oncommand="ShowWindowFromResource(event.target)"/>
</menupopup>
</rule>
</template>
<menupopup id="windowPopup">
<menuitem command="minimizeWindow" key="key_minimizeWindow"/>
<menuitem command="zoomWindow"/>
<!-- decomment when "BringAllToFront" is implemented
<menuseparator/>
<menuitem label="&bringAllToFront.label;" disabled="true"/> -->
<menuseparator id="sep-window-list"/>
</menupopup>
</menu>

View File

@ -0,0 +1,80 @@
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
# http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
# for the specific language governing rights and limitations under the
# License.
#
# The Original Code is Mozilla.org Code.
#
# The Initial Developer of the Original Code is Netscape
# Communications Corporation. Portions created by Netscape are
# Copyright (C) 1998-2000 Netscape Communications Corporation. All
# Rights Reserved.
#
# Contributor(s):
# Asaf Romano <mozilla.mano@sent.com>
#
# Alternatively, the contents of this file may be used under the terms of
# either the GNU General Public License Version 2 or later (the "GPL"), or
# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
# in which case the provisions of the GPL or the LGPL are applicable instead
# of those above. If you wish to allow use of your version of this file only
# under the terms of either the GPL or the LGPL, and not to allow others to
# use your version of this file under the terms of the MPL, indicate your
# decision by deleting the provisions above and replace them with the notice
# and other provisions required by the LGPL or the GPL. If you do not delete
# the provisions above, a recipient may use your version of this file under
# the terms of any one of the MPL, the GPL or the LGPL.
#
# ***** END LICENSE BLOCK *****
const nsIWindowDataSource = Components.interfaces.nsIWindowDataSource;
function checkFocusedWindow()
{
var windowManagerDS = Components.classes['@mozilla.org/rdf/datasource;1?name=window-mediator'].getService(nsIWindowDataSource);
var sep = document.getElementById("sep-window-list");
// Using double parens to avoid warning
while ((sep = sep.nextSibling)) {
var url = sep.getAttribute('id');
var win = windowManagerDS.getWindowForResource(url);
if (win == window) {
sep.setAttribute("checked", "true");
break;
}
}
}
function toOpenWindow( aWindow )
{
aWindow.document.commandDispatcher.focusedWindow.focus();
}
function ShowWindowFromResource( node )
{
var windowManagerDS = Components.classes['@mozilla.org/rdf/datasource;1?name=window-mediator']
.getService(nsIWindowDataSource);
var desiredWindow = null;
var url = node.getAttribute('id');
desiredWindow = windowManagerDS.getWindowForResource( url );
if (desiredWindow)
toOpenWindow(desiredWindow);
}
function zoomWindow()
{
if (window.windowState == STATE_NORMAL)
window.maximize();
else
window.restore();
}