# HG changeset patch # User Khushil Mistry # Date 1568068800 -7200 # Node ID 2c47346623c48da709386b8dded13565ed627e1e # Parent 23c18a98eb9b9787791b75932a448b0d39c4bdb5 Bug 1571687 - copy the parts of editor that are used by Thunderbird to mail/components/compose. r=mkmelin,pike diff --git a/mail/app.mozbuild b/mail/app.mozbuild --- a/mail/app.mozbuild +++ b/mail/app.mozbuild @@ -23,11 +23,10 @@ DIRS += ['/%s' % CONFIG['MOZ_BRANDING_DI if CONFIG['MOZ_CALENDAR']: DIRS += [ '/%s/calendar/lightning' % CONFIG['commreltopsrcdir'], '/%s/calendar/timezones' % CONFIG['commreltopsrcdir'] ] DIRS += [ '/%s/chat' % CONFIG['commreltopsrcdir'], - '/%s/editor/ui' % CONFIG['commreltopsrcdir'], '/%s/mail' % CONFIG['commreltopsrcdir'], ] diff --git a/editor/ui/composer.js b/mail/components/compose/composer.js copy from editor/ui/composer.js copy to mail/components/compose/composer.js diff --git a/editor/ui/composer/content/ComposerCommands.js b/mail/components/compose/content/ComposerCommands.js copy from editor/ui/composer/content/ComposerCommands.js copy to mail/components/compose/content/ComposerCommands.js --- a/editor/ui/composer/content/ComposerCommands.js +++ b/mail/components/compose/content/ComposerCommands.js @@ -597,17 +597,17 @@ var nsSaveAndChangeEncodingCommand = doCommandParams: function(aCommand, aParams, aRefCon) {}, doCommand: function(aCommand) { SetEditMode(gPreviousNonSourceDisplayMode); window.ok = false; window.exportToText = false; var oldTitle = GetDocumentTitle(); - window.openDialog("chrome://editor/content/EditorSaveAsCharset.xul","_blank", "chrome,close,titlebar,modal,resizable=yes"); + window.openDialog("chrome://messenger/content/messengercompose/EditorSaveAsCharset.xul","_blank", "chrome,close,titlebar,modal,resizable=yes"); if (GetDocumentTitle() != oldTitle) UpdateWindowTitle(); if (window.ok) { if (window.exportToText) { @@ -665,17 +665,17 @@ var nsPublishCommand = } if (showPublishDialog || !publishData) { // Show the publish dialog publishData = {}; window.ok = false; let oldTitle = GetDocumentTitle(); - window.openDialog("chrome://editor/content/EditorPublish.xul","_blank", + window.openDialog("chrome://messenger/content/messengercompose/EditorPublish.xul", "_blank", "chrome,close,titlebar,modal", "", "", publishData); if (GetDocumentTitle() != oldTitle) UpdateWindowTitle(); if (!window.ok) return false; } if (publishData) @@ -702,17 +702,17 @@ var nsPublishAsCommand = { if (GetCurrentEditor()) { SetEditMode(gPreviousNonSourceDisplayMode); window.ok = false; var publishData = {}; var oldTitle = GetDocumentTitle(); - window.openDialog("chrome://editor/content/EditorPublish.xul","_blank", + window.openDialog("chrome://messenger/content/messengercompose/EditorPublish.xul", "_blank", "chrome,close,titlebar,modal", "", "", publishData); if (GetDocumentTitle() != oldTitle) UpdateWindowTitle(); if (window.ok) return Publish(publishData); } return false; @@ -1815,17 +1815,17 @@ function Publish(publishData) try { // We launch dialog as a dependent // Don't allow editing document! SetDocumentEditable(false); // Start progress monitoring gProgressDialog = - window.openDialog("chrome://editor/content/EditorPublishProgress.xul", "_blank", + window.openDialog("chrome://messenger/content/messengercompose/EditorPublishProgress.xul", "_blank", "chrome,dependent,titlebar", gPublishData, gPersistObj); } catch (e) {} // Network transfer is often too quick for the progress dialog to be initialized // and we can completely miss messages for quickly-terminated bad URLs, // so we can't call OutputFileWithPersistAPI right away. // StartPublishing() is called at the end of the dialog's onload method @@ -1983,17 +1983,17 @@ var nsPublishSettingsCommand = doCommandParams: function(aCommand, aParams, aRefCon) {}, doCommand: function(aCommand) { if (GetCurrentEditor()) { // Launch Publish Settings dialog - window.ok = window.openDialog("chrome://editor/content/EditorPublishSettings.xul","_blank", "chrome,close,titlebar,modal", ""); + window.ok = window.openDialog("chrome://messenger/content/messengercompose/EditorPublishSettings.xul", "_blank", "chrome,close,titlebar,modal", ""); return window.ok; } return false; } } //----------------------------------------------------------------------------------- var nsRevertCommand = @@ -2267,17 +2267,17 @@ var nsFindReplaceCommand = return editorElement.getEditor(editorElement.contentWindow) != null; }, getCommandStateParams: function(aCommand, aParams, editorElement) {}, doCommandParams: function(aCommand, aParams, editorElement) {}, doCommand: function(aCommand, editorElement) { - window.openDialog("chrome://editor/content/EdReplace.xul", "_blank", + window.openDialog("chrome://messenger/content/messengercompose/EdReplace.xul", "_blank", "chrome,modal,titlebar", editorElement); } }; //----------------------------------------------------------------------------------- var nsFindCommand = { isCommandEnabled: function(aCommand, editorElement) @@ -2344,17 +2344,17 @@ var nsSpellingCommand = getCommandStateParams: function(aCommand, aParams, aRefCon) {}, doCommandParams: function(aCommand, aParams, aRefCon) {}, doCommand: function(aCommand) { window.cancelSendMessage = false; try { var skipBlockQuotes = (window.document.documentElement.getAttribute("windowtype") == "msgcompose"); - window.openDialog("chrome://editor/content/EdSpellCheck.xul", "_blank", + window.openDialog("chrome://messenger/content/messengercompose/EdSpellCheck.xul", "_blank", "dialog,close,titlebar,modal,resizable", false, skipBlockQuotes, true); } catch(ex) {} } }; // Validate using http://validator.w3.org/file-upload.html var URL2Validate; @@ -2421,102 +2421,102 @@ var nsFormCommand = return (IsDocumentEditable() && IsEditingRenderedHTML()); }, getCommandStateParams: function(aCommand, aParams, aRefCon) {}, doCommandParams: function(aCommand, aParams, aRefCon) {}, doCommand: function(aCommand) { - window.openDialog("chrome://editor/content/EdFormProps.xul", "_blank", "chrome,close,titlebar,modal"); + window.openDialog("chrome://messenger/content/messengercompose/EdFormProps.xul", "_blank", "chrome,close,titlebar,modal"); } }; //----------------------------------------------------------------------------------- var nsInputTagCommand = { isCommandEnabled: function(aCommand, dummy) { return (IsDocumentEditable() && IsEditingRenderedHTML()); }, getCommandStateParams: function(aCommand, aParams, aRefCon) {}, doCommandParams: function(aCommand, aParams, aRefCon) {}, doCommand: function(aCommand) { - window.openDialog("chrome://editor/content/EdInputProps.xul", "_blank", "chrome,close,titlebar,modal"); + window.openDialog("chrome://messenger/content/messengercompose/EdInputProps.xul", "_blank", "chrome,close,titlebar,modal"); } }; //----------------------------------------------------------------------------------- var nsInputImageCommand = { isCommandEnabled: function(aCommand, dummy) { return (IsDocumentEditable() && IsEditingRenderedHTML()); }, getCommandStateParams: function(aCommand, aParams, aRefCon) {}, doCommandParams: function(aCommand, aParams, aRefCon) {}, doCommand: function(aCommand) { - window.openDialog("chrome://editor/content/EdInputImage.xul", "_blank", "chrome,close,titlebar,modal"); + window.openDialog("chrome://messenger/content/messengercompose/EdInputImage.xul", "_blank", "chrome,close,titlebar,modal"); } }; //----------------------------------------------------------------------------------- var nsTextAreaCommand = { isCommandEnabled: function(aCommand, dummy) { return (IsDocumentEditable() && IsEditingRenderedHTML()); }, getCommandStateParams: function(aCommand, aParams, aRefCon) {}, doCommandParams: function(aCommand, aParams, aRefCon) {}, doCommand: function(aCommand) { - window.openDialog("chrome://editor/content/EdTextAreaProps.xul", "_blank", "chrome,close,titlebar,modal"); + window.openDialog("chrome://messenger/content/messengercompose/EdTextAreaProps.xul", "_blank", "chrome,close,titlebar,modal"); } }; //----------------------------------------------------------------------------------- var nsSelectCommand = { isCommandEnabled: function(aCommand, dummy) { return (IsDocumentEditable() && IsEditingRenderedHTML()); }, getCommandStateParams: function(aCommand, aParams, aRefCon) {}, doCommandParams: function(aCommand, aParams, aRefCon) {}, doCommand: function(aCommand) { - window.openDialog("chrome://editor/content/EdSelectProps.xul", "_blank", "chrome,close,titlebar,modal"); + window.openDialog("chrome://messenger/content/messengercompose/EdSelectProps.xul", "_blank", "chrome,close,titlebar,modal"); } }; //----------------------------------------------------------------------------------- var nsButtonCommand = { isCommandEnabled: function(aCommand, dummy) { return (IsDocumentEditable() && IsEditingRenderedHTML()); }, getCommandStateParams: function(aCommand, aParams, aRefCon) {}, doCommandParams: function(aCommand, aParams, aRefCon) {}, doCommand: function(aCommand) { - window.openDialog("chrome://editor/content/EdButtonProps.xul", "_blank", "chrome,close,titlebar,modal"); + window.openDialog("chrome://messenger/content/messengercompose/EdButtonProps.xul", "_blank", "chrome,close,titlebar,modal"); } }; //----------------------------------------------------------------------------------- var nsLabelCommand = { isCommandEnabled: function(aCommand, dummy) { @@ -2534,17 +2534,17 @@ var nsLabelCommand = // Find selected label or if start/end of selection is in label var labelElement = editor.getSelectedElement(tagName); if (!labelElement) labelElement = editor.getElementOrParentByTagName(tagName, editor.selection.anchorNode); if (!labelElement) labelElement = editor.getElementOrParentByTagName(tagName, editor.selection.focusNode); if (labelElement) { // We only open the dialog for an existing label - window.openDialog("chrome://editor/content/EdLabelProps.xul", "_blank", "chrome,close,titlebar,modal", labelElement); + window.openDialog("chrome://messenger/content/messengercompose/EdLabelProps.xul", "_blank", "chrome,close,titlebar,modal", labelElement); } else { EditorSetTextProperty(tagName, "", ""); } } catch (e) {} } }; //----------------------------------------------------------------------------------- @@ -2555,17 +2555,17 @@ var nsFieldSetCommand = return (IsDocumentEditable() && IsEditingRenderedHTML()); }, getCommandStateParams: function(aCommand, aParams, aRefCon) {}, doCommandParams: function(aCommand, aParams, aRefCon) {}, doCommand: function(aCommand) { - window.openDialog("chrome://editor/content/EdFieldSetProps.xul", "_blank", "chrome,close,titlebar,modal"); + window.openDialog("chrome://messenger/content/messengercompose/EdFieldSetProps.xul", "_blank", "chrome,close,titlebar,modal"); } }; //----------------------------------------------------------------------------------- var nsIsIndexCommand = { isCommandEnabled: function(aCommand, dummy) { @@ -2594,17 +2594,17 @@ var nsImageCommand = return (IsDocumentEditable() && IsEditingRenderedHTML()); }, getCommandStateParams: function(aCommand, aParams, aRefCon) {}, doCommandParams: function(aCommand, aParams, aRefCon) {}, doCommand: function(aCommand) { - window.openDialog("chrome://editor/content/EdImageProps.xul","_blank", "chrome,close,titlebar,modal"); + window.openDialog("chrome://messenger/content/messengercompose/EdImageProps.xul","_blank", "chrome,close,titlebar,modal"); } }; //----------------------------------------------------------------------------------- var nsHLineCommand = { isCommandEnabled: function(aCommand, dummy) { @@ -2626,17 +2626,17 @@ var nsHLineCommand = var hLine; try { hLine = editor.getSelectedElement(tagName); } catch (e) {return;} if (hLine) { // We only open the dialog for an existing HRule - window.openDialog("chrome://editor/content/EdHLineProps.xul", "_blank", "chrome,close,titlebar,modal"); + window.openDialog("chrome://messenger/content/messengercompose/EdHLineProps.xul", "_blank", "chrome,close,titlebar,modal"); } else { try { hLine = editor.createElementWithDefaults(tagName); // We change the default attributes to those saved in the user prefs let align = Services.prefs.getIntPref("editor.hrule.align"); @@ -2680,70 +2680,70 @@ var nsLinkCommand = doCommandParams: function(aCommand, aParams, aRefCon) {}, doCommand: function(aCommand) { // If selected element is an image, launch that dialog instead // since last tab panel handles link around an image var element = GetObjectForProperties(); if (element && element.nodeName.toLowerCase() == "img") - window.openDialog("chrome://editor/content/EdImageProps.xul","_blank", "chrome,close,titlebar,modal", null, true); + window.openDialog("chrome://messenger/content/messengercompose/EdImageProps.xul", "_blank", "chrome,close,titlebar,modal", null, true); else - window.openDialog("chrome://editor/content/EdLinkProps.xul","_blank", "chrome,close,titlebar,modal"); + window.openDialog("chrome://messenger/content/messengercompose/EdLinkProps.xul", "_blank", "chrome,close,titlebar,modal"); } }; //----------------------------------------------------------------------------------- var nsAnchorCommand = { isCommandEnabled: function(aCommand, dummy) { return (IsDocumentEditable() && IsEditingRenderedHTML()); }, getCommandStateParams: function(aCommand, aParams, aRefCon) {}, doCommandParams: function(aCommand, aParams, aRefCon) {}, doCommand: function(aCommand) { - window.openDialog("chrome://editor/content/EdNamedAnchorProps.xul", "_blank", "chrome,close,titlebar,modal", ""); + window.openDialog("chrome://messenger/content/messengercompose/EdNamedAnchorProps.xul", "_blank", "chrome,close,titlebar,modal", ""); } }; //----------------------------------------------------------------------------------- var nsInsertHTMLWithDialogCommand = { isCommandEnabled: function(aCommand, dummy) { return (IsDocumentEditable() && IsEditingRenderedHTML()); }, getCommandStateParams: function(aCommand, aParams, aRefCon) {}, doCommandParams: function(aCommand, aParams, aRefCon) {}, doCommand: function(aCommand) { - window.openDialog("chrome://editor/content/EdInsSrc.xul","_blank", "chrome,close,titlebar,modal,resizable", ""); + window.openDialog("chrome://messenger/content/messengercompose/EdInsSrc.xul", "_blank", "chrome,close,titlebar,modal,resizable", ""); } }; //----------------------------------------------------------------------------------- var nsInsertMathWithDialogCommand = { isCommandEnabled: function(aCommand, dummy) { return (IsDocumentEditable() && IsEditingRenderedHTML()); }, getCommandStateParams: function(aCommand, aParams, aRefCon) {}, doCommandParams: function(aCommand, aParams, aRefCon) {}, doCommand: function(aCommand) { - window.openDialog("chrome://editor/content/EdInsertMath.xul", "_blank", "chrome,close,titlebar,modal,resizable", ""); + window.openDialog("chrome://messenger/content/messengercompose/EdInsertMath.xul", "_blank", "chrome,close,titlebar,modal,resizable", ""); } }; //----------------------------------------------------------------------------------- var nsInsertCharsCommand = { isCommandEnabled: function(aCommand, dummy) { @@ -2805,17 +2805,17 @@ var nsGridCommand = return (IsDocumentEditable() && IsEditingRenderedHTML()); }, getCommandStateParams: function(aCommand, aParams, aRefCon) {}, doCommandParams: function(aCommand, aParams, aRefCon) {}, doCommand: function(aCommand) { - window.openDialog("chrome://editor/content/EdSnapToGrid.xul","_blank", "chrome,close,titlebar,modal"); + window.openDialog("chrome://messenger/content/messengercompose/EdSnapToGrid.xul", "_blank", "chrome,close,titlebar,modal"); } }; //----------------------------------------------------------------------------------- var nsListPropertiesCommand = { isCommandEnabled: function(aCommand, dummy) @@ -2823,17 +2823,17 @@ var nsListPropertiesCommand = return (IsDocumentEditable() && IsEditingRenderedHTML()); }, getCommandStateParams: function(aCommand, aParams, aRefCon) {}, doCommandParams: function(aCommand, aParams, aRefCon) {}, doCommand: function(aCommand) { - window.openDialog("chrome://editor/content/EdListProps.xul","_blank", "chrome,close,titlebar,modal"); + window.openDialog("chrome://messenger/content/messengercompose/EdListProps.xul", "_blank", "chrome,close,titlebar,modal"); } }; //----------------------------------------------------------------------------------- var nsPagePropertiesCommand = { isCommandEnabled: function(aCommand, dummy) @@ -2842,17 +2842,17 @@ var nsPagePropertiesCommand = }, getCommandStateParams: function(aCommand, aParams, aRefCon) {}, doCommandParams: function(aCommand, aParams, aRefCon) {}, doCommand: function(aCommand) { var oldTitle = GetDocumentTitle(); - window.openDialog("chrome://editor/content/EdPageProps.xul","_blank", "chrome,close,titlebar,modal", ""); + window.openDialog("chrome://messenger/content/messengercompose/EdPageProps.xul", "_blank", "chrome,close,titlebar,modal", ""); // Update main window title and // recent menu data in prefs if doc title changed if (GetDocumentTitle() != oldTitle) UpdateWindowTitle(); } }; @@ -3048,17 +3048,17 @@ var nsSetSmiley = doCommand: function(aCommand) {} }; function doAdvancedProperties(element) { if (element) { - window.openDialog("chrome://editor/content/EdAdvancedEdit.xul", "_blank", "chrome,close,titlebar,modal,resizable=yes", "", element); + window.openDialog("chrome://messenger/content/messengercompose/EdAdvancedEdit.xul", "_blank", "chrome,close,titlebar,modal,resizable=yes", "", element); } } var nsAdvancedPropertiesCommand = { isCommandEnabled: function(aCommand, dummy) { return (IsDocumentEditable() && IsEditingRenderedHTML()); @@ -3085,17 +3085,17 @@ var nsColorPropertiesCommand = return (IsDocumentEditable() && IsEditingRenderedHTML()); }, getCommandStateParams: function(aCommand, aParams, aRefCon) {}, doCommandParams: function(aCommand, aParams, aRefCon) {}, doCommand: function(aCommand) { - window.openDialog("chrome://editor/content/EdColorProps.xul","_blank", "chrome,close,titlebar,modal", ""); + window.openDialog("chrome://messenger/content/messengercompose/EdColorProps.xul", "_blank", "chrome,close,titlebar,modal", ""); UpdateDefaultColors(); } }; //----------------------------------------------------------------------------------- var nsIncreaseFontCommand = { isCommandEnabled: function(aCommand, dummy) @@ -3873,13 +3873,13 @@ var nsConvertToTable = getCommandStateParams: function(aCommand, aParams, aRefCon) {}, doCommandParams: function(aCommand, aParams, aRefCon) {}, doCommand: function(aCommand) { if (this.isCommandEnabled()) { - window.openDialog("chrome://editor/content/EdConvertToTable.xul","_blank", "chrome,close,titlebar,modal") + window.openDialog("chrome://messenger/content/messengercompose/EdConvertToTable.xul", "_blank", "chrome,close,titlebar,modal") } } }; diff --git a/editor/ui/composer/content/EditorContent.css b/mail/components/compose/content/EditorContent.css copy from editor/ui/composer/content/EditorContent.css copy to mail/components/compose/content/EditorContent.css --- a/editor/ui/composer/content/EditorContent.css +++ b/mail/components/compose/content/EditorContent.css @@ -9,17 +9,17 @@ * place in EditorOverride.css, instead of here. */ @import url(chrome://communicator/skin/smileys.css); a[name] { min-height: 17px; margin-left: 2px; margin-top: 2px; padding-left: 20px; - background-image: url(chrome://editor/content/images/tag-anchor.gif); + background-image: url(chrome://messenger/content/messengercompose/images/tag-anchor.gif); background-repeat: no-repeat; background-position: top left; } /* Force border display for empty cells and tables with 0 border */ table { diff --git a/mail/components/compose/content/MsgComposeCommands.js b/mail/components/compose/content/MsgComposeCommands.js --- a/mail/components/compose/content/MsgComposeCommands.js +++ b/mail/components/compose/content/MsgComposeCommands.js @@ -819,17 +819,17 @@ var defaultController = { isEnabled: function() { return true; }, doCommand: function() { window.cancelSendMessage = false; var skipBlockQuotes = (window.document.documentElement.getAttribute("windowtype") == "msgcompose"); - window.openDialog("chrome://editor/content/EdSpellCheck.xul", "_blank", + window.openDialog("chrome://messenger/content/messengercompose/EdSpellCheck.xul", "_blank", "dialog,close,titlebar,modal,resizable", false, skipBlockQuotes, true); } }, cmd_fullZoomToggle: { isEnabled: function () { return true; @@ -2936,17 +2936,17 @@ function GenericSendMessage(msgType) // Do we need to check the spelling? if (DoSpellCheckBeforeSend()) { // We disable spellcheck for the following -subject line, attachment // pane, identity and addressing widget therefore we need to explicitly // focus on the mail body when we have to do a spellcheck. SetMsgBodyFrameFocus(); window.cancelSendMessage = false; - window.openDialog("chrome://editor/content/EdSpellCheck.xul", "_blank", + window.openDialog("chrome://messenger/content/messengercompose/EdSpellCheck.xul", "_blank", "dialog,close,titlebar,modal,resizable", true, true, false); if (window.cancelSendMessage) return; } // Strip trailing spaces and long consecutive WSP sequences from the // subject line to prevent getting only WSP chars on a folded line. diff --git a/editor/ui/dialogs/content/EdAEAttributes.js b/mail/components/compose/content/dialogs/EdAEAttributes.js copy from editor/ui/dialogs/content/EdAEAttributes.js copy to mail/components/compose/content/dialogs/EdAEAttributes.js diff --git a/editor/ui/dialogs/content/EdAECSSAttributes.js b/mail/components/compose/content/dialogs/EdAECSSAttributes.js copy from editor/ui/dialogs/content/EdAECSSAttributes.js copy to mail/components/compose/content/dialogs/EdAECSSAttributes.js diff --git a/editor/ui/dialogs/content/EdAEHTMLAttributes.js b/mail/components/compose/content/dialogs/EdAEHTMLAttributes.js copy from editor/ui/dialogs/content/EdAEHTMLAttributes.js copy to mail/components/compose/content/dialogs/EdAEHTMLAttributes.js diff --git a/editor/ui/dialogs/content/EdAEJSEAttributes.js b/mail/components/compose/content/dialogs/EdAEJSEAttributes.js copy from editor/ui/dialogs/content/EdAEJSEAttributes.js copy to mail/components/compose/content/dialogs/EdAEJSEAttributes.js diff --git a/editor/ui/dialogs/content/EdAdvancedEdit.js b/mail/components/compose/content/dialogs/EdAdvancedEdit.js copy from editor/ui/dialogs/content/EdAdvancedEdit.js copy to mail/components/compose/content/dialogs/EdAdvancedEdit.js diff --git a/editor/ui/dialogs/content/EdAdvancedEdit.xul b/mail/components/compose/content/dialogs/EdAdvancedEdit.xul copy from editor/ui/dialogs/content/EdAdvancedEdit.xul copy to mail/components/compose/content/dialogs/EdAdvancedEdit.xul --- a/editor/ui/dialogs/content/EdAdvancedEdit.xul +++ b/mail/components/compose/content/dialogs/EdAdvancedEdit.xul @@ -5,38 +5,38 @@ - + - + -