mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-03 10:33:33 +00:00
Fixed busted 'New' command in Composer, b=121939, r=brade, sr=hewitt
This commit is contained in:
parent
320952d8c3
commit
50a6dacb14
@ -66,6 +66,7 @@
|
||||
<script type="application/x-javascript" src="chrome://editor/content/editor.js"/>
|
||||
<script type="application/x-javascript" src="chrome://editor/content/EditorCommandsDebug.js"/>
|
||||
<script type="application/x-javascript" src="chrome://editor/content/EditorContextMenu.js"/>
|
||||
<script type="application/x-javascript" src="chrome://editor/content/editorApplicationOverlay.js"/>
|
||||
<script type="application/x-javascript" src="chrome://global/content/strres.js"/>
|
||||
<script type="application/x-javascript" src="chrome://communicator/content/contentAreaDD.js"/>
|
||||
<script type="application/x-javascript" src="chrome://communicator/content/contentAreaClick.js"/>
|
||||
|
@ -37,28 +37,6 @@
|
||||
|
||||
/* Implementations of nsIControllerCommand for composer commands */
|
||||
|
||||
function editLink(aLinkURL)
|
||||
{
|
||||
urlSecurityCheck(aLinkURL, window.document); // XXX what is this? Why do we pass the chrome doc?
|
||||
editPage(aLinkURL, window, false);
|
||||
}
|
||||
|
||||
// XXX Cleanup needed here! Specifically:
|
||||
// 1) rename this function to |editPage|
|
||||
// 2) move |editPage| from utilityOverlay.js into this file, as well as any UI that uses it
|
||||
// (which, at time of writing, is:
|
||||
// * view source "edit page" menu item
|
||||
// * navigator "edit page" menu item
|
||||
// * "Open in Composer" item in Open Location dialog
|
||||
// |editPage| should be renamed |editURL|
|
||||
function overlay_editPage(aDocument)
|
||||
{
|
||||
if (!aDocument)
|
||||
aDocument = window._content.document;
|
||||
|
||||
editPage(aDocument.URL, window, false);
|
||||
}
|
||||
|
||||
function initEditorContextMenuItems(aEvent)
|
||||
{
|
||||
var shouldShowEditPage = !gContextMenu.onImage && !gContextMenu.onLink && !gContextMenu.onTextInput && !gContextMenu.inDirList;
|
||||
@ -79,6 +57,20 @@ function initEditorContextMenuListener(aEvent)
|
||||
|
||||
addEventListener("load", initEditorContextMenuListener, false);
|
||||
|
||||
function editLink(aLinkURL)
|
||||
{
|
||||
urlSecurityCheck(aLinkURL, window.document); // XXX what is this? Why do we pass the chrome doc?
|
||||
editPage(aLinkURL, window, false);
|
||||
}
|
||||
|
||||
function editDocument(aDocument)
|
||||
{
|
||||
if (!aDocument)
|
||||
aDocument = window._content.document;
|
||||
|
||||
editPage(aDocument.URL, window, false);
|
||||
}
|
||||
|
||||
function editPageOrFrame()
|
||||
{
|
||||
var url;
|
||||
|
@ -28,7 +28,7 @@
|
||||
<menuitem id="context-editpage"
|
||||
label="&editPageCmd.label;"
|
||||
accesskey="&editPageCmd.accesskey;"
|
||||
oncommand="overlay_editPage(gContextMenu.target.ownerDocument);"
|
||||
oncommand="editDocument(gContextMenu.target.ownerDocument);"
|
||||
insertafter="context-sep-save"/>
|
||||
<menuitem id="context-editlink"
|
||||
label="&editLinkCmd.label;"
|
||||
|
Loading…
Reference in New Issue
Block a user