I don't know if it's been mentioned yet, but the "quote highlighted text" button no longer works.
I looked into it, and that button just calls the javascript function
addquote()
, which doesn't appear to do anything relevant (it just gets the text), but it does call
insert_text()
.
insert_text() looks for a particular form named "quick_reply_form", which is fine, but within that form, it looks for an element named "message", which is now a textarea that's hidden (perhaps the content of a post is copied to that element before pushing to the server, but that's not relevant here). The actual editor is nested inside an iframe, which is kind of terrible but whatever.
If that function (starting at line 50 of
this file) is replaced with this version I slightly modified, it should start working again.
function insert_text(text, spaces, popup)
{
var textarea;
if (!popup)
{
//textarea = document.forms[form_name].elements[text_name];
textarea = document.forms[form_name].getElementsByTagName("iframe")[0].contentDocument.body;
}
else
{
textarea = opener.document.forms[form_name].elements[text_name];
}
if (spaces)
{
text = ' ' + text + ' ';
}
if (!isNaN(textarea.selectionStart))
{
var sel_start = textarea.selectionStart;
var sel_end = textarea.selectionEnd;
mozWrap(textarea, text, '');
textarea.selectionStart = sel_start + text.length;
textarea.selectionEnd = sel_end + text.length;
}
else if (textarea.createTextRange && textarea.caretPos)
{
if (baseHeight != textarea.caretPos.boundingHeight)
{
setTimeout(function() { textarea.focus(); }, 10);
storeCaret(textarea);
}
var caret_pos = textarea.caretPos;
caret_pos.text = caret_pos.text.charAt(caret_pos.text.length - 1) == ' ' ? caret_pos.text + text + ' ' : caret_pos.text + text;
}
else
{
if (popup) {
textarea.value = textarea.value + text;
} else {
textarea.append(text);
}
}
if (!popup)
{
//setTimeout(function() { textarea.focus(); }, 10);
}
}