I have put together a small ajax enhancement for sending quotes directly to the comment box if the comment box is on the same page as the quote link. This also means you can quote multiple posts in one go by just clicking on different comments' quote links.
It requires a tiny patch to quote.module to set up the ajax callback, and a javascript function which attaches the required functionality to any link marked with a class of "quote" that is contained within a comment. I have the javascript in a utility file that I load for my site via my page template, but it could be added as an include file with this module if the maintainer wants to add this patch to the codebase.
/* Instant copying of comment quotes to comment textarea */
var instaQuotes = function() {
if (!$('textarea#edit-comment').get(0)) return;
$('.comment a.quote').click( function() {
// Extract comment id from link
var cid = ///comment//reply///d+//(/d+)/.exec(this.href)[1];
// Scroll down to comment form
window.location.hash = '#comment-form';
// Get comment via ajax then append to new comment textarea
$.get('/quote/comment/' + cid, null, function(data) {
var quote = data.split(':::', 2);
var textarea = $('textarea#edit-comment').get(0);
textarea.value += ('[quote=' + quote[0] + ']' + quote[1] + '[/quote]/n/n');
textarea.scrollTop = textarea.scrollHeight; // scrolls to bottom of textarea
});
return false;
});
}
if (Drupal.jsEnabled) {
$(instaQuotes);
}
It uses ajax because it is the easiest way to get a clean copy of the comment. I tried to extract it from the html source at first so no server interaction would be required but it became an ugly mess of code to replace P and BR tags with line-break characters and stripping of other html tags. This way is better as it preserves all original formatting within the quotes.
Caveat: I have upgraded jQuery from drupal's default to the latest (1.2.3?), but there is nothing too fancy in there so it should still work with the older jQuery shipping with drupal.