зеркало из https://github.com/mozilla/gecko-dev.git
144828 - nav-only installs do not have send link, send image, new message menuitems. r=jag, sr/a=sspitzer.
This commit is contained in:
Родитель
1beeeafa40
Коммит
b48b53992f
|
@ -1,147 +0,0 @@
|
|||
<?xml version="1.0"?>
|
||||
|
||||
<!-- retrieve generic commands -->
|
||||
<?xul-overlay href="chrome://messenger/content/mailOverlay.xul"?>
|
||||
|
||||
<!DOCTYPE overlay SYSTEM "chrome://messenger/locale/mailNavigatorOverlay.dtd" >
|
||||
|
||||
<overlay id="mailNavigatorOverlay"
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
|
||||
|
||||
<script type="application/x-javascript">
|
||||
<![CDATA[
|
||||
// attachment: 0 - link
|
||||
// 1 - page
|
||||
// 2 - image
|
||||
function openComposeWindow(url, title, attachment)
|
||||
{
|
||||
var params = Components.classes["@mozilla.org/messengercompose/composeparams;1"].createInstance(Components.interfaces.nsIMsgComposeParams);
|
||||
if (params)
|
||||
{
|
||||
params.composeFields = Components.classes['@mozilla.org/messengercompose/composefields;1'].createInstance(Components.interfaces.nsIMsgCompFields);
|
||||
if (params.composeFields)
|
||||
{
|
||||
if (attachment == 0 || attachment == 1)
|
||||
{
|
||||
params.composeFields.body = url;
|
||||
params.composeFields.subject = title;
|
||||
params.bodyIsLink = true;
|
||||
}
|
||||
if (attachment == 1 || attachment == 2)
|
||||
{
|
||||
var attachmentData = Components.classes["@mozilla.org/messengercompose/attachment;1"].createInstance(Components.interfaces.nsIMsgAttachment);
|
||||
if (attachmentData)
|
||||
{
|
||||
attachmentData.url = url;
|
||||
params.composeFields.addAttachment(attachmentData);
|
||||
}
|
||||
}
|
||||
var composeService = Components.classes["@mozilla.org/messengercompose;1"].getService(Components.interfaces.nsIMsgComposeService);
|
||||
if (composeService) {
|
||||
// it is possible you won't have a default identity
|
||||
// like if you've never launched mail before on a new profile.
|
||||
// see bug #196073
|
||||
try {
|
||||
params.identity = composeService.defaultIdentity;
|
||||
}
|
||||
catch (ex) {
|
||||
params.identity = null;
|
||||
}
|
||||
composeService.OpenComposeWindowWithParams(null, params);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function sendLink(pageUrl, pageTitle)
|
||||
{
|
||||
try {
|
||||
openComposeWindow(pageUrl, pageTitle, 0);
|
||||
} catch(ex) { dump("Cannot Send Link: " + ex + "\n"); }
|
||||
}
|
||||
|
||||
function sendImage(imageURL)
|
||||
{
|
||||
try {
|
||||
openComposeWindow(imageURL, null, 2);
|
||||
} catch(ex) { dump("Cannot Send Image: " + ex + "\n"); }
|
||||
}
|
||||
|
||||
function sendPage(aDocument)
|
||||
{
|
||||
if (!aDocument)
|
||||
aDocument = window._content.document;
|
||||
|
||||
var pageUrl = aDocument.URL;
|
||||
var pageTitle = Components.lookupMethod(aDocument, 'title').call(aDocument);
|
||||
|
||||
try {
|
||||
openComposeWindow(pageUrl, pageTitle, 1);
|
||||
} catch(ex) { dump("Cannot Send Page: " + ex + "\n"); }
|
||||
}
|
||||
|
||||
function initMailContextMenuItems(aEvent)
|
||||
{
|
||||
var shouldShowSendPage = !(gContextMenu.onTextInput || gContextMenu.isTextSelected) && !(gContextMenu.onLink && gContextMenu.onImage);
|
||||
gContextMenu.showItem("context-sendpage", shouldShowSendPage);
|
||||
|
||||
gContextMenu.showItem("context-sep-apps", gContextMenu.shouldShowSeparator("context-sep-apps"));
|
||||
}
|
||||
|
||||
var gAddedMailContextMenuPopupListener = false;
|
||||
function initMailContextMenuPopupListener(aEvent)
|
||||
{
|
||||
// This is really lame, but we can't seem to add a bubbling listener to the DOMWindow (!)
|
||||
if (gAddedMailContextMenuPopupListener)
|
||||
return;
|
||||
var popup = document.getElementById("contentAreaContextMenu");
|
||||
popup.addEventListener("popupshowing", initMailContextMenuItems, false);
|
||||
gAddedMailContextMenuPopupListener = true;
|
||||
}
|
||||
|
||||
addEventListener("load", initMailContextMenuPopupListener, true);
|
||||
]]>
|
||||
</script>
|
||||
|
||||
<!-- navigator specific commands -->
|
||||
<commandset id="tasksCommands">
|
||||
<command id="cmd_sendPage" oncommand="sendPage();"/>
|
||||
<command id="Browser:SendLink"
|
||||
oncommand="sendLink(Components.lookupMethod(window._content, 'location').call(window._content).href,
|
||||
Components.lookupMethod(window._content.document, 'title').call(window._content.document));"/>
|
||||
</commandset>
|
||||
|
||||
<!-- navigator specific UI items -->
|
||||
<menupopup id="menu_NewPopup">
|
||||
<menuitem id="menu_newCard" insertafter="navBeginGlobalNewItems"/>
|
||||
<menuitem id="menu_newMessage" insertafter="navBeginGlobalNewItems"/>
|
||||
</menupopup>
|
||||
|
||||
<menupopup id="menu_FilePopup">
|
||||
<menuitem id="menu_sendPage" label="&sendPage.label;" accesskey="&sendPage.accesskey;" command="cmd_sendPage" position="9"/>
|
||||
<menuitem id="menu_sendLink" label="&sendLinkCmd.label;" accesskey="&sendLinkCmd.accesskey;" command="Browser:SendLink" position="10"/>
|
||||
</menupopup>
|
||||
|
||||
<popup id="contentAreaContextMenu">
|
||||
<menuitem id="context-sendpage"
|
||||
label="&contextSendPage.label;"
|
||||
accesskey="&contextSendPage.accesskey;"
|
||||
oncommand="sendPage();"
|
||||
insertafter="context-savepage"/>
|
||||
<menuitem id="context-sendimage"
|
||||
label="&contextSendImage.label;"
|
||||
accesskey="&contextSendImage.accesskey;"
|
||||
oncommand="sendImage(gContextMenu.imageURL);"
|
||||
insertafter="context-saveimage"/>
|
||||
<menu id="frame">
|
||||
<menupopup id="frame_popup">
|
||||
<menuitem insertafter="saveframeas"
|
||||
label="&contextSendFrame.label;"
|
||||
accesskey="&contextSendFrame.accesskey;"
|
||||
oncommand="sendPage(gContextMenu.target.ownerDocument);"/>
|
||||
</menupopup>
|
||||
</menu>
|
||||
</popup>
|
||||
|
||||
</overlay>
|
||||
|
|
@ -139,7 +139,6 @@ messenger.jar:
|
|||
content/messenger/msgPrintEngine.js (base/resources/content/msgPrintEngine.js)
|
||||
content/messenger/msgPrintEngine.xul (base/resources/content/msgPrintEngine.xul)
|
||||
content/messenger/mailTasksOverlay.xul (base/resources/content/mailTasksOverlay.xul)
|
||||
content/messenger/mailNavigatorOverlay.xul (base/resources/content/mailNavigatorOverlay.xul)
|
||||
content/messenger/mailEditorOverlay.xul (base/resources/content/mailEditorOverlay.xul)
|
||||
content/messenger/mailABOverlay.xul (base/resources/content/mailABOverlay.xul)
|
||||
content/messenger/mailMessengerOverlay.xul (base/resources/content/mailMessengerOverlay.xul)
|
||||
|
@ -222,7 +221,6 @@ en-US.jar:
|
|||
locale/en-US/messenger/msgHdrViewOverlay.dtd (base/resources/locale/en-US/msgHdrViewOverlay.dtd)
|
||||
locale/en-US/messenger/mailTasksOverlay.dtd (base/resources/locale/en-US/mailTasksOverlay.dtd)
|
||||
locale/en-US/messenger/mailTurboMenu.properties (base/resources/locale/en-US/mailTurboMenu.properties)
|
||||
locale/en-US/messenger/mailNavigatorOverlay.dtd (base/resources/locale/en-US/mailNavigatorOverlay.dtd)
|
||||
locale/en-US/messenger/mailEditorOverlay.dtd (base/resources/locale/en-US/mailEditorOverlay.dtd)
|
||||
locale/en-US/messenger/mailOverlay.dtd (base/resources/locale/en-US/mailOverlay.dtd)
|
||||
locale/en-US/messenger/msgSynchronize.dtd (base/resources/locale/en-US/msgSynchronize.dtd)
|
||||
|
|
|
@ -27,6 +27,7 @@ comm.jar:
|
|||
content/navigator/viewSourceOverlay.xul (resources/content/viewSourceOverlay.xul)
|
||||
content/navigator/viewPartialSource.js (resources/content/viewPartialSource.js)
|
||||
content/navigator/viewPartialSource.xul (resources/content/viewPartialSource.xul)
|
||||
content/navigator/mailNavigatorOverlay.xul (resources/content/mailNavigatorOverlay.xul)
|
||||
en-US.jar:
|
||||
locale/en-US/navigator/contents.rdf (resources/locale/en-US/contents.rdf)
|
||||
locale/en-US/navigator/viewSource.dtd (resources/locale/en-US/viewSource.dtd)
|
||||
|
@ -39,6 +40,7 @@ en-US.jar:
|
|||
locale/en-US/navigator/linkToolbar.dtd (resources/locale/en-US/linkToolbar.dtd)
|
||||
locale/en-US/navigator/turboDialog.dtd (resources/locale/en-US/turboDialog.dtd)
|
||||
locale/en-US/navigator/turboMenu.properties (resources/locale/en-US/turboMenu.properties)
|
||||
locale/en-US/navigator/mailNavigatorOverlay.dtd (resources/locale/en-US/mailNavigatorOverlay.dtd)
|
||||
|
||||
US.jar:
|
||||
locale/US/navigator-region/contents.rdf (resources/locale/en-US/contents-region.rdf)
|
||||
|
|
|
@ -0,0 +1,226 @@
|
|||
<?xml version="1.0"?>
|
||||
|
||||
<!-- retrieve generic commands -->
|
||||
|
||||
<!DOCTYPE overlay SYSTEM "chrome://navigator/locale/mailNavigatorOverlay.dtd" >
|
||||
|
||||
<overlay id="mailNavigatorOverlay"
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
|
||||
|
||||
<script type="application/x-javascript">
|
||||
<![CDATA[
|
||||
var gHasIntegratedMailClient = ("@mozilla.org/messengercompose/composeparams;1" in Components.classes);
|
||||
|
||||
// attachment: 0 - link
|
||||
// 1 - page
|
||||
// 2 - image
|
||||
function openComposeWindow(url, title, attachment)
|
||||
{
|
||||
if (gHasIntegratedMailClient) {
|
||||
var params = Components.classes["@mozilla.org/messengercompose/composeparams;1"]
|
||||
.createInstance(Components.interfaces.nsIMsgComposeParams);
|
||||
if (params)
|
||||
{
|
||||
params.composeFields = Components.classes['@mozilla.org/messengercompose/composefields;1']
|
||||
.createInstance(Components.interfaces.nsIMsgCompFields);
|
||||
if (params.composeFields)
|
||||
{
|
||||
if (attachment == 0 || attachment == 1)
|
||||
{
|
||||
params.composeFields.body = url;
|
||||
params.composeFields.subject = title;
|
||||
params.bodyIsLink = true;
|
||||
}
|
||||
if (attachment == 1 || attachment == 2)
|
||||
{
|
||||
var attachmentData = Components.classes["@mozilla.org/messengercompose/attachment;1"]
|
||||
.createInstance(Components.interfaces.nsIMsgAttachment);
|
||||
if (attachmentData)
|
||||
{
|
||||
attachmentData.url = url;
|
||||
params.composeFields.addAttachment(attachmentData);
|
||||
}
|
||||
}
|
||||
var composeService = Components.classes["@mozilla.org/messengercompose;1"]
|
||||
.getService(Components.interfaces.nsIMsgComposeService);
|
||||
if (composeService) {
|
||||
// it is possible you won't have a default identity
|
||||
// like if you've never launched mail before on a new profile.
|
||||
// see bug #196073
|
||||
try {
|
||||
params.identity = composeService.defaultIdentity;
|
||||
}
|
||||
catch (ex) {
|
||||
params.identity = null;
|
||||
}
|
||||
composeService.OpenComposeWindowWithParams(null, params);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
openExternalMailer(url);
|
||||
}
|
||||
}
|
||||
|
||||
function openExternalMailer(url) {
|
||||
var extProtocolSvc = Components.classes["@mozilla.org/uriloader/external-protocol-service;1"]
|
||||
.getService(Components.interfaces.nsIExternalProtocolService);
|
||||
var ioService = Components.classes["@mozilla.org/network/io-service;1"]
|
||||
.getService(Components.interfaces.nsIIOService);
|
||||
var mailto = url ? "mailto:?body="+url : "mailto:";
|
||||
var uri = ioService.newURI(mailto, null, null);
|
||||
|
||||
extProtocolSvc.loadUrl(uri);
|
||||
}
|
||||
|
||||
function openNewCardDialog()
|
||||
{
|
||||
window.openDialog("chrome://messenger/content/addressbook/abNewCardDialog.xul",
|
||||
"",
|
||||
"chrome,resizable=no,titlebar,modal");
|
||||
}
|
||||
|
||||
function goOpenNewMessage()
|
||||
{
|
||||
if (gHasIntegratedMailClient) {
|
||||
if ("MsgNewMessage" in window)
|
||||
{
|
||||
MsgNewMessage(null);
|
||||
return;
|
||||
}
|
||||
var msgComposeService = Components.classes["@mozilla.org/messengercompose;1"].getService();
|
||||
msgComposeService = msgComposeService.QueryInterface(Components.interfaces.nsIMsgComposeService);
|
||||
msgComposeService.OpenComposeWindow(null, null,
|
||||
Components.interfaces.nsIMsgCompType.New,
|
||||
Components.interfaces.nsIMsgCompFormat.Default,
|
||||
null, null);
|
||||
}
|
||||
else {
|
||||
openExternalMailer();
|
||||
}
|
||||
}
|
||||
|
||||
function sendLink(pageUrl, pageTitle)
|
||||
{
|
||||
try {
|
||||
openComposeWindow(pageUrl, pageTitle, 0);
|
||||
} catch(ex) { dump("Cannot Send Link: " + ex + "\n"); }
|
||||
}
|
||||
|
||||
function sendImage(imageURL)
|
||||
{
|
||||
try {
|
||||
openComposeWindow(imageURL, null, 2);
|
||||
} catch(ex) { dump("Cannot Send Image: " + ex + "\n"); }
|
||||
}
|
||||
|
||||
function sendPage(aDocument)
|
||||
{
|
||||
if (!aDocument)
|
||||
aDocument = window._content.document;
|
||||
|
||||
var pageUrl = aDocument.URL;
|
||||
var pageTitle = Components.lookupMethod(aDocument, 'title').call(aDocument);
|
||||
|
||||
try {
|
||||
openComposeWindow(pageUrl, pageTitle, 1);
|
||||
} catch(ex) { dump("Cannot Send Page: " + ex + "\n"); }
|
||||
}
|
||||
|
||||
function initMailContextMenuItems(aEvent)
|
||||
{
|
||||
var shouldShowSendPage = !(gContextMenu.onTextInput ||
|
||||
gContextMenu.isTextSelected) &&
|
||||
!(gContextMenu.onLink && gContextMenu.onImage) &&
|
||||
gHasIntegratedMailClient;
|
||||
gContextMenu.showItem("context-sendpage", shouldShowSendPage);
|
||||
|
||||
gContextMenu.showItem("context-sep-apps", gContextMenu.shouldShowSeparator("context-sep-apps"));
|
||||
}
|
||||
|
||||
var gAddedMailContextMenuPopupListener = false;
|
||||
function initMailContextMenuPopupListener(aEvent)
|
||||
{
|
||||
// This is really lame, but we can't seem to add a bubbling listener to the DOMWindow (!)
|
||||
if (gAddedMailContextMenuPopupListener)
|
||||
return;
|
||||
var popup = document.getElementById("contentAreaContextMenu");
|
||||
popup.addEventListener("popupshowing", initMailContextMenuItems, false);
|
||||
gAddedMailContextMenuPopupListener = true;
|
||||
}
|
||||
|
||||
function hideMenuitems() {
|
||||
document.getElementById("menu_newCard").hidden = !gHasIntegratedMailClient;
|
||||
document.getElementById("menu_sendPage").hidden = !gHasIntegratedMailClient;
|
||||
}
|
||||
|
||||
function initOverlay(aEvent) {
|
||||
initMailContextMenuPopupListener(aEvent);
|
||||
hideMenuitems();
|
||||
}
|
||||
|
||||
addEventListener("load", initOverlay, true);
|
||||
]]>
|
||||
</script>
|
||||
|
||||
<!-- navigator specific commands -->
|
||||
<commandset id="tasksCommands">
|
||||
<command id="cmd_newMessage" oncommand="goOpenNewMessage();"/>
|
||||
<command id="cmd_newCard" oncommand="openNewCardDialog()"/>
|
||||
<command id="cmd_sendPage" oncommand="sendPage();"/>
|
||||
<command id="Browser:SendLink"
|
||||
oncommand="sendLink(Components.lookupMethod(window._content, 'location').call(window._content).href,
|
||||
Components.lookupMethod(window._content.document, 'title').call(window._content.document));"/>
|
||||
</commandset>
|
||||
|
||||
<!-- navigator specific UI items -->
|
||||
<menupopup id="menu_NewPopup">
|
||||
<menuitem id="menu_newCard"
|
||||
label="&newCardCmd.label;"
|
||||
accesskey="&newCardCmd.accesskey;"
|
||||
command="cmd_newCard"
|
||||
insertafter="navBeginGlobalNewItems"/>
|
||||
<menuitem id="menu_newMessage"
|
||||
label="&newMessageCmd.label;"
|
||||
accesskey="&newMessageCmd.accesskey;"
|
||||
command="cmd_newMessage"
|
||||
insertafter="navBeginGlobalNewItems"/>
|
||||
</menupopup>
|
||||
|
||||
<menupopup id="menu_FilePopup">
|
||||
<menuitem id="menu_sendPage"
|
||||
label="&sendPage.label;"
|
||||
accesskey="&sendPage.accesskey;"
|
||||
command="cmd_sendPage"
|
||||
position="9"/>
|
||||
<menuitem id="menu_sendLink"
|
||||
label="&sendLinkCmd.label;"
|
||||
accesskey="&sendLinkCmd.accesskey;"
|
||||
command="Browser:SendLink"
|
||||
position="10"/>
|
||||
</menupopup>
|
||||
|
||||
<popup id="contentAreaContextMenu">
|
||||
<menuitem id="context-sendpage"
|
||||
label="&contextSendPage.label;"
|
||||
accesskey="&contextSendPage.accesskey;"
|
||||
oncommand="sendPage();"
|
||||
insertafter="context-savepage"/>
|
||||
<menuitem id="context-sendimage"
|
||||
label="&contextSendImage.label;"
|
||||
accesskey="&contextSendImage.accesskey;"
|
||||
oncommand="sendImage(gContextMenu.imageURL);"
|
||||
insertafter="context-saveimage"/>
|
||||
<menu id="frame">
|
||||
<menupopup id="frame_popup">
|
||||
<menuitem insertafter="saveframeas"
|
||||
label="&contextSendFrame.label;"
|
||||
accesskey="&contextSendFrame.accesskey;"
|
||||
oncommand="sendPage(gContextMenu.target.ownerDocument);"/>
|
||||
</menupopup>
|
||||
</menu>
|
||||
</popup>
|
||||
|
||||
</overlay>
|
||||
|
|
@ -29,6 +29,7 @@
|
|||
<?xul-overlay href="chrome://communicator/content/tasksOverlay.xul"?>
|
||||
<?xul-overlay href="chrome://global/content/charsetOverlay.xul"?>
|
||||
<?xul-overlay href="chrome://navigator/content/platformNavigationBindings.xul"?>
|
||||
<?xul-overlay href="chrome://navigator/content/mailNavigatorOverlay.xul"?>
|
||||
|
||||
<!DOCTYPE overlay [
|
||||
<!ENTITY % navigatorDTD SYSTEM "chrome://navigator/locale/navigator.dtd" >
|
||||
|
|
|
@ -1,7 +1,10 @@
|
|||
|
||||
<!-- File->New->Message -->
|
||||
<!ENTITY newMessageCmd.label "Message">
|
||||
<!ENTITY newMessageCmd.accesskey "m">
|
||||
<!ENTITY newMessageCmd.accesskey "M">
|
||||
|
||||
<!ENTITY newCardCmd.label "Address Book Card...">
|
||||
<!ENTITY newCardCmd.accesskey "C">
|
||||
|
||||
<!ENTITY sendPage.label "Send Page...">
|
||||
<!ENTITY sendPage.accesskey "S">
|
Загрузка…
Ссылка в новой задаче