Closed
Bug 63515
Opened 24 years ago
Closed 24 years ago
[RFE] allow editing of text/plain files
Categories
(Core :: DOM: Editor, enhancement, P3)
Core
DOM: Editor
Tracking
()
VERIFIED
FIXED
Future
People
(Reporter: timeless, Assigned: sfraser_bugs)
References
Details
Attachments
(1 file)
13.66 KB,
patch
|
Details | Diff | Splinter Review |
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>
Comment 1•24 years ago
|
||
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 → ---
Comment 3•24 years ago
|
||
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
Comment 4•24 years ago
|
||
No, please don't start making Mozilla a text editor. That way lies madness.
Assignee | ||
Updated•24 years ago
|
Priority: -- → P3
Assignee | ||
Comment 6•24 years ago
|
||
Assignee | ||
Comment 7•24 years ago
|
||
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.
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?
Assignee | ||
Comment 9•24 years ago
|
||
Fixes checked in.
Status: ASSIGNED → RESOLVED
Closed: 24 years ago → 24 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•