CODE
ed.onkeyup.add(function(ed, e) {
var _tempcontent = ed.getContent();
var _tempcontent_new =_tempcontent.replace(":)",'[ img ]images/emots/smile.gif[ /img ]');
if (_tempcontent_new != _tempcontent) {
var bm = ed.selection.getBookmark(2, true);
ed.setContent(_tempcontent_new);
ed.selection.moveToBookmark(bm);
}
}
var _tempcontent = ed.getContent();
var _tempcontent_new =_tempcontent.replace(":)",'[ img ]images/emots/smile.gif[ /img ]');
if (_tempcontent_new != _tempcontent) {
var bm = ed.selection.getBookmark(2, true);
ed.setContent(_tempcontent_new);
ed.selection.moveToBookmark(bm);
}
}
Mam taki problem, jak wpiszę ':)' to wstawia sie obrazek emotki, ale karetka jest przed emotką, a nie za. Dłubię juz to jakiś spory czas i nie mogę tego ogranąć. Dzieje sie tak na każdej przeglądarce. Jak to można rozwiazać?
TinyMCE + jQuery