X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=js%2Facl.js;h=9a575729f642a149aa16ac29319540c91b8e2383;hb=59ae5633ec9080845a02de99665293655bd8b726;hp=054f5096026f96b222bcd9134807b1e8d0d67650;hpb=83cc56e71360c0e45f153576f8b5cbe45fd1786b;p=friendica.git diff --git a/js/acl.js b/js/acl.js index 054f509602..9a575729f6 100644 --- a/js/acl.js +++ b/js/acl.js @@ -47,7 +47,14 @@ ACL.prototype.remove_mention = function(id) { return; } var nick = this.data[id].nick; - var searchText = "@" + nick + "+" + id + " "; + var addr = this.data[id].addr; + + if (addr != "") { + var searchText = "!" + addr + " "; + } else { + var searchText = "!" + nick + "+" + id + " "; + } + var start = this.element.val().indexOf(searchText); if (start < 0) { return; @@ -61,7 +68,14 @@ ACL.prototype.add_mention = function(id) { return; } var nick = this.data[id].nick; - var searchText = "@" + nick + "+" + id + " "; + var addr = this.data[id].addr; + + if (addr != "") { + var searchText = "!" + addr + " "; + } else { + var searchText = "!" + nick + "+" + id + " "; + } + if (this.element.val().indexOf( searchText) >= 0 ) { return; } @@ -286,11 +300,16 @@ ACL.prototype.populate = function(data){ var height = Math.ceil(data.tot / this.nw) * 42; this.list_content.height(height); this.data = {}; - $(data.items).each(function(index, item){ - html = "
"+this.item_tpl+"
"; - html = html.format(item.photo, item.name, item.type, item.id, (item.forum=='1'?'forum':''), item.network, item.link); - if (item.uids!=undefined) this.group_uids[item.id] = item.uids; - + $(data.items).each(function(index, item) { + if (item.separator != undefined) { + html = "
"; + } else { + html = "
"+this.item_tpl+"
"; + html = html.format(item.photo, item.name, item.type, item.id, (item.forum=='1'?'forum':''), item.network, item.link); + if (item.uids != undefined) { + this.group_uids[item.id] = item.uids; + } + } this.list_content.append(html); this.data[item.id] = item; }.bind(this));