Xonder: BB-ForumCode und Firefox

Beitrag lesen

Hallo

Hallo Christian.

Du kennst mich !?

@BB-Code

Wenn ich mir den z.b. YaBB-Code anschaue (funktioniert bei allen Browsern)

function storeCaret(text) {
if (text.createTextRange) text.caretPos = document.selection.createRange().duplicate();
}

function AddSelText(bbopen, bbclose) {
if (document.postmodify.message.caretPos) {
  document.postmodify.message.caretPos.text = bbopen + document.postmodify.message.caretPos.text + bbclose;
  document.postmodify.message.caretPos.select();
}
else if (document.postmodify.message.setSelectionRange) {
  var selectionStart = document.postmodify.message.selectionStart;
  var selectionEnd = document.postmodify.message.selectionEnd;
  var replaceString = bbopen + document.postmodify.message.value.substring(selectionStart, selectionEnd) + bbclose;
  document.postmodify.message.value = document.postmodify.message.value.substring(0, selectionStart) + replaceString + document.postmodify.message.value.substring(selectionEnd);
  document.postmodify.message.setSelectionRange(selectionStart + bbopen.length, selectionEnd + bbopen.length);
}
else document.postmodify.message.value += bbopen + bbclose;
document.postmodify.message.focus()
}

function AddText(text) {
AddSelText('', text);
}

.... frag ich mich ob man nicht meinen Code anpassen könnte .... nur ganz check ich das nicht :-(

Jedoch schon mal danke für die Lins .... werde mir diese man ansehen!

lg XTC