-
-
Notifications
You must be signed in to change notification settings - Fork 6.2k
add 'select/deselect all' buttons for custom events in webhooks #35980
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -80,6 +80,16 @@ | |
| </div> | ||
|
|
||
| <div class="events fields ui grid {{if not .Webhook.ChooseEvents}}tw-hidden{{end}}"> | ||
| <div class="fourteen wide column"> | ||
| <div class="field"> | ||
| <button type="button" class="ui tiny button" id="event-select-all"> | ||
| {{ctx.Locale.Tr "repo.settings.event_button_select_all"}} | ||
| </button> | ||
| <button type="button" class="ui tiny button" id="event-deselect-all"> | ||
| {{ctx.Locale.Tr "repo.settings.event_button_deselect_all"}} | ||
| </button> | ||
| </div> | ||
| </div> | ||
| <!-- Repository Events --> | ||
| <div class="fourteen wide column"> | ||
| <label>{{ctx.Locale.Tr "repo.settings.event_header_repository"}}</label> | ||
|
|
@@ -354,3 +364,20 @@ | |
| >{{ctx.Locale.Tr "repo.settings.delete_webhook"}}</a> | ||
| {{end}} | ||
| </div> | ||
|
|
||
| <script> | ||
| (function () { | ||
| const section = document.querySelector('.events.fields.ui.grid'); | ||
| if (!section) return; | ||
| const all = section.querySelectorAll('input[type="checkbox"]'); | ||
| document.getElementById('event-select-all')?.addEventListener('click', () => { | ||
| all.forEach(i => { i.checked = true; }); | ||
| }); | ||
| document.getElementById('event-deselect-all')?.addEventListener('click', () => { | ||
| all.forEach(i => { i.checked = false; }); | ||
| }); | ||
| })(); | ||
| </script> | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Isn't it better to place this code to |
||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please move it to line 97. It's more logical for it to be after the "Repository Events" header.