Skip to content

Commit

Permalink
Added support for full rich text quick reply
Browse files Browse the repository at this point in the history
  • Loading branch information
Frenzie committed Apr 13, 2016
1 parent 69e48ec commit da60906
Showing 1 changed file with 15 additions and 8 deletions.
23 changes: 15 additions & 8 deletions quickQuote.js
Original file line number Diff line number Diff line change
Expand Up @@ -320,14 +320,21 @@ function initializeQuickQuote() {

//if( selectedText ){
//var textarea = rule.getDestination();
var textarea = document.querySelector('#postmodify').message;
var newText = (textarea.value?textarea.value+'\n':'') +
startTag+selectedText+endTag+'\n';
textarea.value = newText;
newText = textarea.value;//reading again, to get normalized white-space
textarea.setSelectionRange(newText.length,newText.length);
textarea.blur(); //needed for Webkit/Blink
textarea.focus();
if (oQuickReply.bIsFull) {
// full editor in quick reply
$editor_data[post_box_name].insert(startTag+selectedText+endTag);
}
else {
// just the textarea
var textarea = document.querySelector('#postmodify').message;
var newText = (textarea.value?textarea.value+'\n':'') +
startTag+selectedText+endTag+'\n';
textarea.value = newText;
newText = textarea.value;//reading again, to get normalized white-space
textarea.setSelectionRange(newText.length,newText.length);
textarea.blur(); //needed for Webkit/Blink
textarea.focus();
}
}
else{
this._warning.style.display='block';
Expand Down

0 comments on commit da60906

Please sign in to comment.