From fbbd9c79514a71285c9915fb97e5086ad2ee894f Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Thu, 24 Dec 2015 11:38:14 +0530 Subject: [PATCH] [minor] fix, ignore admin an guest for mention and highlight in comment --- frappe/public/js/frappe/form/footer/timeline.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/frappe/public/js/frappe/form/footer/timeline.js b/frappe/public/js/frappe/form/footer/timeline.js index e0ab13f400..3482d445ac 100644 --- a/frappe/public/js/frappe/form/footer/timeline.js +++ b/frappe/public/js/frappe/form/footer/timeline.js @@ -162,6 +162,11 @@ frappe.ui.form.Comments = Class.extend({ c.comment_html = c.comment; c.comment_html = frappe.utils.strip_whitespace(c.comment_html); } + + // bold @mentions + if(c.comment_type==="Comment") { + c.comment_html = c.comment_html.replace(/(^|\W)(@\w+)/g, "$1$2"); + } } }, set_icon_and_color: function(c) { @@ -335,8 +340,10 @@ frappe.ui.form.Comments = Class.extend({ var username_user_map = {}; for (var name in frappe.boot.user_info) { - var _user = frappe.boot.user_info[name]; - username_user_map[_user.username] = _user; + if(name !== "Administrator" && name !== "Guest") { + var _user = frappe.boot.user_info[name]; + username_user_map[_user.username] = _user; + } } this.mention_input = this.wrapper.find(".mention-input");