Bug 356590 - Clean up nsContextMenu and make it a bit more window-agnostic, partly fixes bug 281490. r=gavin.

This commit is contained in:
mozilla.mano%sent.com 2006-11-02 22:26:22 +00:00
Родитель 5d1ba10a53
Коммит d9d1462cee
8 изменённых файлов: 1096 добавлений и 1036 удалений

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

@ -35,9 +35,6 @@
#
# ***** END LICENSE BLOCK *****
<popup id="contentAreaContextMenu"
onpopupshowing="if (event.target != this) return true; gContextMenu = new nsContextMenu( this ); return gContextMenu.shouldDisplay;"
onpopuphiding="if (event.target == this) { gContextMenu = null; }">
<menuitem id="spell-no-suggestions"
disabled="true"
label="&spellNoSuggestions.label;"/>
@ -79,7 +76,7 @@
<menuitem id="context-copylink"
label="&copyLinkCmd.label;"
accesskey="&copyLinkCmd.accesskey;"
command="cmd_copyLink"/>
oncommand="goDoCommand('cmd_copyLink');"/>
<menuseparator id="context-sep-copylink"/>
<menuitem id="context-viewimage"
label="&viewImageCmd.label;"
@ -90,12 +87,12 @@
<menuitem id="context-copyimage-contents"
label="&copyImageContentsCmd.label;"
accesskey="&copyImageContentsCmd.accesskey;"
command="cmd_copyImageContents"/>
oncommand="goDoCommand('cmd_copyImageContents');"/>
#endif
<menuitem id="context-copyimage"
label="&copyImageCmd.label;"
accesskey="&copyImageCmd.accesskey;"
command="cmd_copyImageLocation"/>
oncommand="goDoCommand('cmd_copyImageLocation');"/>
<menuseparator id="context-sep-copyimage"/>
<menuitem id="context-saveimage"
label="&saveImageCmd.label;"
@ -136,12 +133,12 @@
#ifdef MOZ_PLACES
command="Browser:AddBookmarkAs"/>
#else
oncommand="addBookmarkAs(document.getElementById('content'));"/>
oncommand="gContextMenu.bookmarkThisPage();"/>
#endif
<menuitem id="context-savepage"
label="&savePageCmd.label;"
accesskey="&savePageCmd.accesskey2;"
oncommand="saveDocument(window.content.document);"/>
oncommand="gContextMenu.savePageAs();"/>
<menuitem id="context-sendpage"
label="&sendPageCmd.label;"
accesskey="&sendPageCmd.accesskey;"
@ -269,4 +266,4 @@
label="&bidiSwitchPageDirectionItem.label;"
accesskey="&bidiSwitchPageDirectionItem.accesskey;"
oncommand="SwitchDocumentDirection(window.content);"/>
</popup>

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

@ -105,16 +105,8 @@
<command id="cmd_closeWindow" oncommand="BrowserTryToCloseWindow()"/>
<command id="cmd_toggleTaskbar" oncommand="goToggleToolbar('status-bar','toggle_taskbar');"/>
<command id="cmd_CustomizeToolbars" oncommand="BrowserCustomizeToolbar()"/>
<command id="cmd_copyLink"
oncommand="goDoCommand('cmd_copyLink')"
disabled="false"/>
<command id="cmd_copyImageLocation"
oncommand="goDoCommand('cmd_copyImageLocation')"
disabled="false"/>
<command id="cmd_copyImageContents"
oncommand="goDoCommand('cmd_copyImageContents')"
disabled="false"/>
<command id="cmd_undo"
oncommand="goDoCommand('cmd_undo')"
disabled="true"/>

Разница между файлами не показана из-за своего большого размера Загрузить разницу

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

@ -80,7 +80,8 @@
# wishes to include *must* go into the global-scripts.inc file
# so that they can be shared by macBrowserOverlay.xul.
#include global-scripts.inc
<script type="application/x-javascript" src="chrome://browser/content/nsContextMenu.js"/>
#ifdef MOZ_SAFE_BROWSING
<script type="application/x-javascript" src="chrome://browser/content/safebrowsing/sb-loader.js"/>
#endif
@ -121,7 +122,11 @@
<menuseparator observes="blockedPopupsSeparator"/>
</popup>
<popup id="contentAreaContextMenu"
onpopupshowing="if (event.target != this) return true; gContextMenu = new nsContextMenu(this, window.getBrowser()); return gContextMenu.shouldDisplay;"
onpopuphiding="if (event.target == this) { gContextMenu = null; }">
#include browser-context.inc
</popup>
#ifdef MOZ_PLACES
#include ../../components/places/content/context.inc

Разница между файлами не показана из-за своего большого размера Загрузить разницу

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

@ -284,9 +284,8 @@ function onLoadPageInfo()
if ("arguments" in window && window.arguments.length >= 1 &&
window.arguments[0] && window.arguments[0].doc)
{
theWindow = null;
theDocument = window.arguments[0].doc;
docTitle = theBundle.getString("frameInfo.title");
theWindow = theDocument.defaultView;
}
else
{
@ -295,11 +294,10 @@ function onLoadPageInfo()
else
theWindow = window.opener.frames[0];
theDocument = theWindow.document;
docTitle = theBundle.getString("pageInfo.title");
}
document.title = docTitle;
document.title = theBundle.getString(theWindow != theWindow.top ?
"frameInfo.title" :
"pageInfo.title");
document.getElementById("main-window").setAttribute("relatedUrl", theDocument.location.toString());

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

@ -39,6 +39,7 @@
# ***** END LICENSE BLOCK *****
<?xml-stylesheet href="chrome://browser/skin/" type="text/css"?>
<?xul-overlay href="chrome://global/content/editMenuOverlay.xul"?>
<!DOCTYPE window SYSTEM "chrome://browser/locale/browser.dtd">
@ -52,17 +53,24 @@
<script type="application/x-javascript" src="chrome://global/content/contentAreaUtils.js"/>
<script type="application/x-javascript" src="chrome://browser/content/browser.js"/>
<script type="application/x-javascript" src="chrome://global/content/inlineSpellCheckUI.js"/>
<script type="application/x-javascript" src="chrome://browser/content/nsContextMenu.js"/>
<script type="application/x-javascript" src="chrome://browser/content/web-panels.js"/>
<script type="application/x-javascript" src="chrome://browser/content/bookmarks/bookmarks.js"/>
<script type="application/x-javascript" src="chrome://browser/content/bookmarks/bookmarksMenu.js"/>
<stringbundleset id="stringbundleset">
<stringbundle id="bundle_browser" src="chrome://browser/locale/browser.properties"/>
</stringbundleset>
<popupset id="mainPopupSet">
<popup id="contentAreaContextMenu"
onpopupshowing="if (event.target != this) return true; gContextMenu = new nsContextMenu(this, document.getElementById('web-panels-browser')); return gContextMenu.shouldDisplay;"
onpopuphiding="if (event.target == this) { gContextMenu = null; }">
#include browser-context.inc
</popup>
</popupset>
<commandset id="editMenuCommands"/>
<browser id="web-panels-browser" persist="cachedurl" type="content" flex="1"
context="contentAreaContextMenu"
onclick="return window.parent.contentAreaClick(event, true);"/>

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

@ -39,6 +39,7 @@ browser.jar:
* 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)
* content/browser/nsContextMenu.js (content/nsContextMenu.js)
# XXX: We should exclude this one as well (bug 71895)
* content/browser/hiddenWindow.xul (content/hiddenWindow.xul)
#ifdef XP_MACOSX