+ this.get(0,100);
+}
+
+ACL.prototype.remove_mention = function(id) {
+ if (!this.automention) return;
+ var nick = this.data[id].nick;
+ var searchText = "@"+nick+"+"+id+" ";
+ if (tinyMCE.activeEditor===null) {
+ start = this.element.val().indexOf(searchText);
+ if ( start<0) return;
+ end = start+searchText.length;
+ this.element.setSelection(start,end).replaceSelectedText('').collapseSelection(false);
+ } else {
+ start = tinyMCE.activeEditor.getContent({format : 'raw'}).search( searchText );
+ if ( start<0 ) return;
+ txt = tinyMCE.activeEditor.getContent();
+ newtxt = txt.replace(searchText, '');
+ tinyMCE.activeEditor.setContent(newtxt);
+ }
+}
+
+ACL.prototype.add_mention = function(id) {
+ if (!this.automention) return;
+ var nick = this.data[id].nick;
+ var searchText = "@"+nick+"+"+id+" ";
+ if (tinyMCE.activeEditor===null) {
+ if ( this.element.val().indexOf( searchText) >= 0 ) return;
+ this.element.val( searchText + this.element.val() );
+ } else {
+ if ( tinyMCE.activeEditor.getContent({format : 'raw'}).search(searchText) >= 0 ) return;
+ tinyMCE.activeEditor.dom.add(tinyMCE.activeEditor.getBody(), 'dummy', {}, searchText);
+ }