-ACL.prototype.add_mention = function(nick) {
- // 'editor' is defined in jot-header.tpl : false=plaintext, true:tinyMCE
- if (editor==false) {
- if ( that.element.val().search( '@'+nick) >= 0 ) return;
- that.element.val( "@"+nick+" " + that.element.val() );
+ACL.prototype.add_mention = function(id) {
+ var nick = that.data[id].nick;
+ var searchText = "@"+nick+"+"+id+" ";
+ if (tinyMCE.activeEditor===null) {
+ if ( that.element.val().indexOf( searchText) >= 0 ) return;
+ that.element.val( searchText + that.element.val() );