Permalink
Browse files

[1.10] Remove external editors from page context menu

  • Loading branch information...
1 parent 5ef688e commit 46c2ea223b26bf906ddc9bb46660d6b33ac6e73d @janodvarko janodvarko committed Feb 15, 2012
@@ -48,7 +48,6 @@ locale firebug zh-TW locale/zh-TW/
#overlay chrome://browser/content/browser.xul chrome://firebug/content/browserOverlay.xul
#overlay chrome://browser/content/browser.xul chrome://firebug/content/firefox/browserOverlayWithFrame.xul
-#overlay chrome://browser/content/browser.xul chrome://firebug/content/firefox/external-editors/editorsBrowserOverlay.xul
#overlay chrome://global/content/customizeToolbar.xul chrome://firebug/content/firefox/start-button/customizeToolbarOverlay.xul
#overlay chrome://mozapps/content/extensions/about.xul chrome://firebug/content/firefox/aboutOverlay.xul
@@ -2,47 +2,16 @@
// ********************************************************************************************* //
-// xxxHonza: this file should be transformed into AMD module
-function OpenEditorShowHide(event)
-{
- var doc = event.target.ownerDocument;
- var item = doc.getElementById("menu_firebugOpenWithEditor");
-
- var popupNode = doc.popupNode;
- var hidden = (popupNode instanceof HTMLInputElement
- || popupNode instanceof HTMLIFrameElement
- || popupNode instanceof HTMLTextAreaElement)
-
- if (hidden)
- {
- item.hidden = true;
- return;
- }
-
- var editor = Firebug.ExternalEditors.getDefaultEditor();
- if (!editor)
- {
- item.hidden = true;
- return;
- }
-
- item.hidden = false;
- item.setAttribute('image', editor.image);
- item.setAttribute('label', editor.label);
- item.value = editor.id;
-}
-
+// xxxHonza: this file should be transformed into AMD module.
+// Or perhaps joined with an existing module?
function addOpenEditorShowHide(event)
{
top.window.removeEventListener("load", addOpenEditorShowHide, false);
var doc = top.window.document;
var contextMenu = doc.getElementById("contentAreaContextMenu");
if (contextMenu)
- {
addContextToForms();
- contextMenu.addEventListener("popupshowing", OpenEditorShowHide, false);
- }
};
function addContextToForms(contextMenu)
@@ -1,21 +0,0 @@
-<?xml version="1.0"?>
-<!-- See license.txt for terms of usage -->
-
-<overlay xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
- <!-- Basic editing related commands -->
- <commandset id="mainCommandSet">
- <command id="cmd_openInEditor" oncommand="Firebug.ExternalEditors.onContextMenuCommand(event)"/>
- </commandset>
-
- <!-- Firefox page context menu -->
- <menupopup id="contentAreaContextMenu">
- <menu type="splitmenu" label="firebug.OpenWith" id="menu_firebugOpenWithEditor"
- insertbefore="context-viewsource" iconic="true" class="fbInternational"
- command="cmd_openInEditor" openFromContext="true">
- <menupopup id="menu_firebugOpenWith"
- onpopupshowing="return Firebug.ExternalEditors.onEditorsShowing(this, 1);"/>
- </menu>
- </menupopup>
-
-</overlay>

0 comments on commit 46c2ea2

Please sign in to comment.