]> code.citadel.org Git - citadel.git/blob - webcit-ng/static/js/user_profile.js
Moved render_msg_author() into a different file
[citadel.git] / webcit-ng / static / js / user_profile.js
1 // Copyright (c) 2016-2022 by the citadel.org team
2 //
3 // This program is open source software.  Use, duplication, or
4 // disclosure are subject to the GNU General Public License v3.
5
6
7 // Display the author of a message.  This can be called from many different views.
8 // For messages originating locally, it renders the display name linked to their profile.
9 // For messages originating locally, it renders the display name and their email address.
10 function render_msg_author(msg) {
11         if (msg.locl) {
12                 return(
13                         "<span class=\"ctdl-username\" onClick=\"javascript:user_profile('" + msg.from + "');\">"
14                         + msg.from
15                         + "</span>"
16                 );
17         }
18         else {
19                 return("<span class=\"ctdl-username\">" + msg.from + " &lt;" + msg.rfca + "&gt;</span>");
20         }
21 }
22
23
24 // Display the user profile for a user
25 function user_profile(who) {
26         document.getElementById("ctdl-main").innerHTML = `user_profile(${who})`;
27 }