-function ACL(backend_url, preset){
+function ACL(backend_url, preset, automention){
that = this;
that.url = backend_url;
+ that.automention = automention;
that.kp_timer = null;
/*events*/
that.showall.click(that.on_showall);
- $(".acl-button-show").live('click', that.on_button_show);
- $(".acl-button-hide").live('click', that.on_button_hide);
+ $(document).on("click", ".acl-button-show", that.on_button_show);
+ $(document).on("click", ".acl-button-hide", that.on_button_hide);
$("#acl-search").keypress(that.on_search);
$("#acl-wrapper").parents("form").submit(that.on_submit);
}
ACL.prototype.remove_mention = function(id) {
+ if (!that.automention) return;
var nick = that.data[id].nick;
var searchText = "@"+nick+"+"+id+" ";
if (tinyMCE.activeEditor===null) {
}
ACL.prototype.add_mention = function(id) {
+ if (!that.automention) return;
var nick = that.data[id].nick;
var searchText = "@"+nick+"+"+id+" ";
if (tinyMCE.activeEditor===null) {
that.element.val( searchText + that.element.val() );
} else {
if ( tinyMCE.activeEditor.getContent({format : 'raw'}).search(searchText) >= 0 ) return;
- tinyMCE.activeEditor.dom.add(tinyMCE.activeEditor.getBody(), 'span', {}, searchText);
+ tinyMCE.activeEditor.dom.add(tinyMCE.activeEditor.getBody(), 'dummy', {}, searchText);
}
}