From 5ff9620ec274372e0378dbb0525d783e80b31756 Mon Sep 17 00:00:00 2001 From: Benjamin Kramer Date: Tue, 24 Mar 2009 19:44:29 +0100 Subject: [PATCH] HistoryView: Factor out email formatting The patches to show the committer's name depend on this. --- html/views/history/history.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/html/views/history/history.js b/html/views/history/history.js index f8d6f64..c7fb719 100644 --- a/html/views/history/history.js +++ b/html/views/history/history.js @@ -223,8 +223,11 @@ var enableFeatures = function() var loadExtendedCommit = function(commit) { - if (commit.author_email) - $("authorID").innerHTML = commit.author_name + " <" + commit.author_email + ">"; + var formatEmail = function(name, email) { + return email ? name + " <" + email + ">" : name; + } + + $("authorID").innerHTML = formatEmail(commit.author_name, commit.author_email); $("date").innerHTML = commit.author_date; $("message").innerHTML = commit.message.replace(/\n/g,"
");