Closed
Bug 180850
Opened 23 years ago
Closed 23 years ago
Bugzilla 'edit attachment as comment' doesn't work
Categories
(Camino Graveyard :: HTML Form Controls, defect)
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: bryner, Assigned: bryner)
Details
Attachments
(1 file)
|
37.52 KB,
patch
|
Details | Diff | Splinter Review |
Using build 20021118, if I try to do "edit attachment as comment" when viewing a
bugzilla attachment, nothing happens. This works fine in Mozilla.
Comment 1•23 years ago
|
||
Here's the JS:
function editAsComment()
{
// Get the content of the document as a string.
var viewFrame = document.getElementById('viewFrame');
var aSerializer = new XMLSerializer();
var contentDocument = viewFrame.contentDocument;
var theContent = aSerializer.serializeToString(contentDocument);
// If this is a plaintext document, remove cruft that Mozilla adds
// because it treats it as an HTML document with a big PRE section.
// http://bugzilla.mozilla.org/show_bug.cgi?id=86012
var contentType = 'text/plain';
if ( contentType == 'text/plain' )
{
theContent = theContent.replace( /^<html><head\/?><body><pre>/i , "" );
theContent = theContent.replace( /<\/pre><\/body><\/html>$/i , "" );
theContent = theContent.replace( /</gi , "<" );
theContent = theContent.replace( />/gi , ">" );
theContent = theContent.replace( /&/gi , "&" );
}
// Add mail-style quote indicators (>) to the beginning of each line.
// ".*\n" matches lines that end with a newline, while ".+" matches
// the rare situation in which the last line of a file does not end
// with a newline.
theContent = theContent.replace( /(.*\n|.+)/g , ">$1" );
hideElementById('viewFrame');
hideElementById('editButton');
hideElementById('smallCommentFrame');
showElementById('undoEditButton');
// Show the TEXTAREA that will contain the editable attachment
// and copy the content of the attachment into it.
showElementById('editFrame');
var editFrame = document.getElementById('editFrame');
editFrame.value = theContent;
editFrame.value += "\n\n";
}
Maybe the XMLSerializer is lacking?
| Assignee | ||
Comment 2•23 years ago
|
||
missing xmlextras.xpt. patch coming up.
| Assignee | ||
Comment 3•23 years ago
|
||
This looks like more than it is, because I edited the project with the Dec 2002
version of ProjectBuilder which adds fileEncoding attributes to every file in
the project (I've not seen anything to indicate that this isn't backwards
compatible). I also removed some extra stuff that snuck into the Bundle
Resources build phase.
| Assignee | ||
Updated•23 years ago
|
Attachment #110456 -
Flags: review?(sfraser)
Comment 4•23 years ago
|
||
Comment on attachment 110456 [details] [diff] [review]
patch
Looks good, and works with older dev tools.
Attachment #110456 -
Flags: review?(sfraser) → review+
| Assignee | ||
Comment 5•23 years ago
|
||
checked in.
Status: NEW → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•