From ec3d467f15a683b305ac165c3eba6683628dcb25 Mon Sep 17 00:00:00 2001 From: silverwind Date: Sun, 24 Mar 2024 19:23:38 +0100 Subject: Migrate `gt-hidden` to `tw-hidden` (#30046) We have to define this one in helpers.css because tailwind only generates a single class but certain things rely on this being double-class. Command ran: ```sh perl -p -i -e 's#gt-hidden#tw-hidden#g' web_src/js/**/* templates/**/* models/**/* web_src/css/**/* --------- Co-authored-by: wxiaoguang --- web_src/js/features/comp/LabelEdit.js | 6 +++--- web_src/js/features/notification.js | 6 +++--- web_src/js/features/repo-diff.js | 8 ++++---- web_src/js/features/repo-graph.js | 12 ++++++------ web_src/js/features/repo-issue-content.js | 4 ++-- web_src/js/features/repo-issue.js | 28 ++++++++++++++-------------- web_src/js/features/repo-legacy.js | 18 +++++++++--------- web_src/js/markup/mermaid.js | 4 ++-- web_src/js/svg.js | 2 +- web_src/js/utils/dom.js | 8 ++++---- 10 files changed, 48 insertions(+), 48 deletions(-) (limited to 'web_src/js') diff --git a/web_src/js/features/comp/LabelEdit.js b/web_src/js/features/comp/LabelEdit.js index 44fc9d9b6b..c5992fa355 100644 --- a/web_src/js/features/comp/LabelEdit.js +++ b/web_src/js/features/comp/LabelEdit.js @@ -15,14 +15,14 @@ function updateExclusiveLabelEdit(form) { $exclusiveField.removeClass('muted'); $exclusiveField.removeAttr('aria-disabled'); if ($exclusiveCheckbox[0].checked && $exclusiveCheckbox.data('exclusive-warn')) { - $exclusiveWarning.removeClass('gt-hidden'); + $exclusiveWarning.removeClass('tw-hidden'); } else { - $exclusiveWarning.addClass('gt-hidden'); + $exclusiveWarning.addClass('tw-hidden'); } } else { $exclusiveField.addClass('muted'); $exclusiveField.attr('aria-disabled', 'true'); - $exclusiveWarning.addClass('gt-hidden'); + $exclusiveWarning.addClass('tw-hidden'); } } diff --git a/web_src/js/features/notification.js b/web_src/js/features/notification.js index 90e19b683b..d9f6e50202 100644 --- a/web_src/js/features/notification.js +++ b/web_src/js/features/notification.js @@ -35,7 +35,7 @@ async function receiveUpdateCount(event) { const data = JSON.parse(event.data); for (const count of document.querySelectorAll('.notification_count')) { - count.classList.toggle('gt-hidden', data.Count === 0); + count.classList.toggle('tw-hidden', data.Count === 0); count.textContent = `${data.Count}`; } await updateNotificationTable(); @@ -179,9 +179,9 @@ async function updateNotificationCount() { const $notificationCount = $('.notification_count'); if (data.new === 0) { - $notificationCount.addClass('gt-hidden'); + $notificationCount.addClass('tw-hidden'); } else { - $notificationCount.removeClass('gt-hidden'); + $notificationCount.removeClass('tw-hidden'); } $notificationCount.text(`${data.new}`); diff --git a/web_src/js/features/repo-diff.js b/web_src/js/features/repo-diff.js index 262ce2abff..4c8b411c64 100644 --- a/web_src/js/features/repo-diff.js +++ b/web_src/js/features/repo-diff.js @@ -42,8 +42,8 @@ function initRepoDiffFileViewToggle() { $this.addClass('active'); const $target = $($this.data('toggle-selector')); - $target.parent().children().addClass('gt-hidden'); - $target.removeClass('gt-hidden'); + $target.parent().children().addClass('tw-hidden'); + $target.removeClass('tw-hidden'); }); } @@ -118,7 +118,7 @@ export function initRepoDiffConversationNav() { // Previous/Next code review conversation $(document).on('click', '.previous-conversation', (e) => { const $conversation = $(e.currentTarget).closest('.comment-code-cloud'); - const $conversations = $('.comment-code-cloud:not(.gt-hidden)'); + const $conversations = $('.comment-code-cloud:not(.tw-hidden)'); const index = $conversations.index($conversation); const previousIndex = index > 0 ? index - 1 : $conversations.length - 1; const $previousConversation = $conversations.eq(previousIndex); @@ -127,7 +127,7 @@ export function initRepoDiffConversationNav() { }); $(document).on('click', '.next-conversation', (e) => { const $conversation = $(e.currentTarget).closest('.comment-code-cloud'); - const $conversations = $('.comment-code-cloud:not(.gt-hidden)'); + const $conversations = $('.comment-code-cloud:not(.tw-hidden)'); const index = $conversations.index($conversation); const nextIndex = index < $conversations.length - 1 ? index + 1 : 0; const $nextConversation = $conversations.eq(nextIndex); diff --git a/web_src/js/features/repo-graph.js b/web_src/js/features/repo-graph.js index f2c0d78f34..a5b61bff54 100644 --- a/web_src/js/features/repo-graph.js +++ b/web_src/js/features/repo-graph.js @@ -57,9 +57,9 @@ export function initRepoGraphGit() { ajaxUrl.searchParams.set('div-only', 'true'); window.history.replaceState({}, '', queryString ? `?${queryString}` : window.location.pathname); $('#pagination').empty(); - $('#rel-container').addClass('gt-hidden'); - $('#rev-container').addClass('gt-hidden'); - $('#loading-indicator').removeClass('gt-hidden'); + $('#rel-container').addClass('tw-hidden'); + $('#rev-container').addClass('tw-hidden'); + $('#loading-indicator').removeClass('tw-hidden'); (async () => { const response = await GET(String(ajaxUrl)); const html = await response.text(); @@ -67,9 +67,9 @@ export function initRepoGraphGit() { $('#pagination').html($div.find('#pagination').html()); $('#rel-container').html($div.find('#rel-container').html()); $('#rev-container').html($div.find('#rev-container').html()); - $('#loading-indicator').addClass('gt-hidden'); - $('#rel-container').removeClass('gt-hidden'); - $('#rev-container').removeClass('gt-hidden'); + $('#loading-indicator').addClass('tw-hidden'); + $('#rel-container').removeClass('tw-hidden'); + $('#rev-container').removeClass('tw-hidden'); })(); }; const dropdownSelected = params.getAll('branch'); diff --git a/web_src/js/features/repo-issue-content.js b/web_src/js/features/repo-issue-content.js index 9d51ab6b8d..3c4efe0447 100644 --- a/web_src/js/features/repo-issue-content.js +++ b/web_src/js/features/repo-issue-content.js @@ -18,7 +18,7 @@ function showContentHistoryDetail(issueBaseUrl, commentId, historyId, itemTitleH ${svg('octicon-x', 16, 'close icon inside')}
${itemTitleHtml}
-