X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=js%2Facl.js;h=9a575729f642a149aa16ac29319540c91b8e2383;hb=59ae5633ec9080845a02de99665293655bd8b726;hp=4924ac12895b9273b8a62123e4da71a5b56067f1;hpb=0b5ef73d4a1459ce76e0eed65d9825f2807120af;p=friendica.git diff --git a/js/acl.js b/js/acl.js index 4924ac1289..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,11 +68,18 @@ 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; } - this.element.val(searchText + this.element.val()); + this.element.val(searchText + this.element.val()).trigger('change'); } ACL.prototype.on_submit = function(){ @@ -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));