1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-31 14:00:31 +02:00

re-add and fix quoting from topic/post review

git-svn-id: file:///svn/phpbb/trunk@4832 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
Meik Sievertsen
2004-02-15 07:52:33 +00:00
parent 171706a343
commit 7dc62cc5ed
3 changed files with 55 additions and 55 deletions

View File

@@ -102,6 +102,59 @@ function attach_inline() {
insert_text('[attachment=' + document.forms[form_name].elements['attachments'].value + ']' + document.forms[form_name].elements['attachments'].options[document.forms[form_name].elements['attachments'].selectedIndex].text + '[/attachment]');
}
function addquote(post_id, username) {
var message_name = 'message_' + post_id;
var theSelection = '';
var divarea = false;
if (document.all)
{
eval("divarea = document.all." + message_name + ";");
}
else
{
eval("divarea = document.getElementById('" + message_name + "');");
}
// Get text selection - not only the post content :(
if (window.getSelection)
{
theSelection = window.getSelection().toString();
}
else if (document.getSelection)
{
theSelection = document.getSelection();
}
else if (document.selection)
{
theSelection = document.selection.createRange().text;
}
if (theSelection == '')
{
if (document.all)
{
theSelection = divarea.innerText;
}
else if (divarea.textContent)
{
theSelection = divarea.textContent;
}
else if (divarea.firstChild.nodeValue)
{
theSelection = divarea.firstChild.nodeValue;
}
}
if (theSelection)
{
insert_text('[quote="' + username + '"]' + theSelection + '[/quote]');
}
return;
}
function bbstyle(bbnumber) {
donotinsert = false;