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)

PowerPC
macOS
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: bryner, Assigned: bryner)

Details

Attachments

(1 file)

Using build 20021118, if I try to do "edit attachment as comment" when viewing a bugzilla attachment, nothing happens. This works fine in Mozilla.
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( /&lt;/gi , "<" ); theContent = theContent.replace( /&gt;/gi , ">" ); theContent = theContent.replace( /&amp;/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?
missing xmlextras.xpt. patch coming up.
Attached patch patchSplinter Review
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.
Attachment #110456 - Flags: review?(sfraser)
Comment on attachment 110456 [details] [diff] [review] patch Looks good, and works with older dev tools.
Attachment #110456 - Flags: review?(sfraser) → review+
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.

Attachment

General

Created:
Updated:
Size: