Seite 2 von 2
Verfasst: 05.05.2006 21:35
von Master of Freaks
Wenn man bei markierten Textpassagen Smileys anwendet, werden diese immer noch am Ende des Textes eingefügt!
Nochmal: Diese Problem tritt bei Firefox auf, jedoch nicht mit IE!
Smiley im Firefox an Cursor-Position setzen
Verfasst: 06.05.2006 01:38
von Jürgen H.
Hallo,
templates/posting_body.tpl
Suche
Code: Alles auswählen
function emoticon(text) {
text = ' ' + text + ' ';
if (document.post.message.createTextRange && document.post.message.caretPos) {
var caretPos = document.post.message.caretPos;
caretPos.text = caretPos.text.charAt(caretPos.text.length - 1) == ' ' ? text + ' ' : text;
document.post.message.focus();
} else {
document.post.message.value += text;
document.post.message.focus();
}
}
und ersetze mit:
Code: Alles auswählen
function emoticon(text) {
var txtarea = document.post.message;
text = ' ' + text + ' ';
if (txtarea.createTextRange && txtarea.caretPos) {
var caretPos = txtarea.caretPos;
caretPos.text = caretPos.text.charAt(caretPos.text.length - 1) == ' ' ? caretPos.text + text + ' ' : caretPos.text + text;
txtarea.focus();
} else if (txtarea.selectionEnd) {
var ta = txtarea,
start_selection = Math.min(ta.selectionStart, ta.selectionEnd),
end_selection = Math.max(ta.selectionStart, ta.selectionEnd),
scrollTop = ta.scrollTop;
ta.value = ta.value.slice(0, start_selection) + text + ta.value.slice(end_selection);
ta.selectionStart = ta.selectionEnd = start_selection + text.length;
ta.focus();
ta.scrollTop = scrollTop;
} else {
txtarea.value += text;
txtarea.focus();
}
}
Quelle:
http://www.phpbb.com/phpBB/viewtopic.ph ... 68#1633568
Lg
Jürgen
Verfasst: 13.05.2006 12:05
von Master of Freaks
Jetzt geht mir die Geschichte mit den Smileys beim Minidiscforum schon wieder auf die Eier
Kennt denn wirklich keiner eine Lösung, vielleicht eine Überarbeitung des Antworten-Moduls
Bevor einer fragt, ich möchte nicht den IE nur für php-BB-Foren benutzen, da ich immer
nur mit dem Feuerfuchs arbeite

Verfasst: 13.05.2006 12:21
von S2B

Bau einfach den von mir verlinkten MOD ein.