From 10a21d3b8b093497a1121bf8fa289100b8cf8ac4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20P=C3=A9ters?= Date: Sat, 6 Aug 2022 21:22:25 +0200 Subject: [PATCH] js: remove suffixes used to indicate days off from issues pages (#68001) --- javascripts/theme.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/javascripts/theme.js b/javascripts/theme.js index c5ef22a..84f2cd3 100644 --- a/javascripts/theme.js +++ b/javascripts/theme.js @@ -131,6 +131,13 @@ function alter_new_issue_page() { }); } +function alter_issues_index_page() { + $('td.author a, td.assigned_to a').each(function(idx, elem) { + // remove suffixes used by people to indicate they're off. + $(elem).text($(elem).text().replace(/->.*/, '').replace(/→.*/, '').replace(/\(.*/, '').trim()); + }); +} + function alter_issue_show_page() { if ($('.attachments_fields').length) { var observer = new MutationObserver(function(mutations) { @@ -329,6 +336,9 @@ $(function() { if ($('body.controller-issues.action-show').length == 1) { alter_issue_show_page(); } + if ($('body.controller-issues.action-index').length == 1) { + alter_issues_index_page(); + } // custom features, enabled on user request