X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=js%2Facl.js;h=487ffafc770032578f1437bd84db44e9b39c77c8;hb=275f7b26604af74aa57f7a4a758735e6bc2ab928;hp=76c2f4c19579d57010cb81d726b1469c7831af26;hpb=53dc1ce31fd5cf19211b000f4eccfc73d7ba4a42;p=friendica.git diff --git a/js/acl.js b/js/acl.js index 76c2f4c195..487ffafc77 100644 --- a/js/acl.js +++ b/js/acl.js @@ -1,7 +1,8 @@ -function ACL(backend_url, preset){ +function ACL(backend_url, preset, automention){ that = this; that.url = backend_url; + that.automention = automention; that.kp_timer = null; @@ -21,8 +22,8 @@ function ACL(backend_url, preset){ /*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); @@ -35,6 +36,7 @@ function ACL(backend_url, preset){ } ACL.prototype.remove_mention = function(id) { + if (!that.automention) return; var nick = that.data[id].nick; var searchText = "@"+nick+"+"+id+" "; if (tinyMCE.activeEditor===null) { @@ -52,6 +54,7 @@ ACL.prototype.remove_mention = function(id) { } ACL.prototype.add_mention = function(id) { + if (!that.automention) return; var nick = that.data[id].nick; var searchText = "@"+nick+"+"+id+" "; if (tinyMCE.activeEditor===null) { @@ -59,7 +62,7 @@ ACL.prototype.add_mention = function(id) { 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); } }