Zitat von
admin
Würde eigentlich nur über Java funktionieren, aber dann auch nur über die Umwege eines Editors ...
Ganz hilfreich ist übrigens auch die Hybrid-Ansicht. Gerade in solchen verzweigten Threads wie diesem hier
Bei phpBB3 ist das über ein wenig Javascript gelöst:
HTML-Code:
/**
* Add quote text to message
*/
function addquote(post_id, username)
{
var message_name = 'message_' + post_id;
var theSelection = '';
var divarea = false;
if (document.all)
{
divarea = document.all[message_name];
}
else
{
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 == '' || typeof theSelection == 'undefined' || theSelection == null)
{
if (divarea.innerHTML)
{
theSelection = divarea.innerHTML.replace(/<br>/ig, '\n');
theSelection = theSelection.replace(/<br\/>/ig, '\n');
theSelection = theSelection.replace(/<\;/ig, '<');
theSelection = theSelection.replace(/>\;/ig, '>');
theSelection = theSelection.replace(/&\;/ig, '&');
}
else 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;
}