Closed Bug 63515 Opened 24 years ago Closed 23 years ago

[RFE] allow editing of text/plain files

Categories

(Core :: DOM: Editor, enhancement, P3)

enhancement

Tracking

()

VERIFIED FIXED
Future

People

(Reporter: timeless, Assigned: sfraser_bugs)

References

Details

Attachments

(1 file)

Currently editing text/javascript and html framesets is impossible. However, composer is used by mozmail to edit emails, so it shouldn't be hard for us to edit plain text documents. Loading a frameset in composer results in a complete load and then an error dialog which closes the composer window. We should allow user override for this nonsense. I often want to edit source a text/javascript file. Or a text/html framed file [we can edit pages which have iframes, but we can't edit pages which use framesets]. <!-- timeless dialog markup, please manually parse. --> <dialog> <title>This page is not text/html</title> <p>The url you are editing %url is of type %mimetype which Composer does not know how to handle. What would you like to do? Edit it as <optionlist> <option>text/plain</option> <option>text/html</option> ... </optionlist>. If you do not wish to edit this file, you may click cancel. <submit value="OK"><submit value="CANCEL"><submit value="HELP"> </dialog> Another dialog for framesets would be nice: <!-- timeless dialog markup, please manually parse. --> <dialog> <title>This document includes a frameset</title> <p>The url you are editing %url includes a frameset which Composer does not know how to handle. What would you like to do? Edit the <optionlist type=radio> <option>framed content</option> <option>noframe inline content</option> </optionlist>. If you do not wish to edit this file, you may click cancel. <submit value="OK"><submit value="CANCEL"><submit value="HELP"> </dialog>
this is a dup of: 14156 (edit framesets) 29162 (edit single frame like in 4.x) *** This bug has been marked as a duplicate of 14156 ***
Status: NEW → RESOLVED
Closed: 24 years ago
Resolution: --- → DUPLICATE
bug 29162 is unrelated. This is not really a dupe of bug 14156 either because I want to be able to edit javascript or text files.
Status: RESOLVED → REOPENED
Resolution: DUPLICATE → ---
you referenced framesets in your initial description -- so, framesets are not a request in this bug then. Tracking of frames editing will remain with bugs 14146 and 29162 (which by the way is related to frame editing). This bug will track just one issue, editing plaintext, if you want to open another bug to reflect a request for editing javascript, then please do so. Simon, like the frameset editing bugs, this one will need to be tracked the same way, assigning to you for future consideration
Assignee: beppe → sfraser
Status: REOPENED → NEW
Summary: [RFE] Dialog to select how to edit a url [esp for text/plain] → [RFE] allow editing of text/plain files
Target Milestone: --- → Future
No, please don't start making Mozilla a text editor. That way lies madness.
See also bug 47640.
Priority: -- → P3
Blocks: 23943
I realized that enabling editor to edit text files should not be all that hard. With the supplied patch, editor tracks the MIME type of the document being edited, and treats various document types as text: const char* const gSupportedTextTypes[] = { + "text/plain", + "text/css", + "text/xml", + "text/xsl", + "text/rdf", + "text/javascript", // obsolete type + "application/x-javascript", + "application/vnd.mozilla.xul+xml", + "text/xul", // obsolete type + NULL // IMPORTANT! Null must be at end +}; Files with these MIME types will thus be opened and edited as if they are text/ plain. To make saving work, I had to change some JS that assumes that editor is always saving text/html, by having the JS ask the editorShell for the MIME type of the document. There are two issues remaining after these changes: 1. The composer UI needs to adapt to editing plain text files (lots of commands should be disabled). Bug 81120 filed. 2. The file picker on save needs to consult the MIME info service to get the appropriate file extension for saving, rather than hardcoding ".html", ".txt". Bug 81121 filed.
Status: NEW → ASSIGNED
Depends on: 81120, 81121
Blocks: 47640
Rather than hardcoding the list of MIME types that get treated as plain text, can't we externalize this (e.g., in a .properties file or in prefs)? I'd also like to be able to edit .properties and .dtd files. What happens with documents opened with "file:" URLs?
Fixes checked in.
Status: ASSIGNED → RESOLVED
Closed: 24 years ago23 years ago
Resolution: --- → FIXED
verified on 8-21 build
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: