-
-
Notifications
You must be signed in to change notification settings - Fork 470
core&ui: add contest private files #1053
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
Changes from 7 commits
bde6d49
b49ff5b
ce73fea
bf97bfc
98c14a9
8a10881
5a302e0
a39a74a
00e44bc
1515ba3
a2624ec
c2c154a
e93bbcc
f817a67
329616e
0f59126
ddbce82
4e145c5
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 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,25 @@ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| import $ from 'jquery'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| import { NamedPage } from 'vj/misc/Page'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| function handleReplyOrBroadcast(ev) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| const title = $(ev.currentTarget).data('title'); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| const did = $(ev.currentTarget).data('did'); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| $('#reply_or_broadcast .section_title').text(title); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| $('#reply_or_broadcast [name="did"]').val(did ?? ''); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| const $item = $(`#clarification_${did} .media`); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if ($item.length) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| $('#reply_or_broadcast .form__item_subject').hide(); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| $('#reply_or_broadcast .clarification-container').empty().append($item.clone()); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| $('#reply_or_broadcast .form__item_subject').show(); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| $('#reply_or_broadcast .clarification-container').empty(); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+4
to
+18
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. Sanitize or validate Line 10 constructs a selector using an unsanitized Consider applying this defensive pattern: function handleReplyOrBroadcast(ev) {
const title = $(ev.currentTarget).data('title');
const did = $(ev.currentTarget).data('did');
$('#reply_or_broadcast .section_title').text(title);
$('#reply_or_broadcast [name="did"]').val(did ?? '');
- const $item = $(`#clarification_${did} .media`);
+ const $item = did ? $(`#clarification_${CSS.escape(did)} .media`) : $();
if ($item.length) {📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| const page = new NamedPage('contest_clarification', () => { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| $(document).on('click', '[name="broadcast"]', handleReplyOrBroadcast); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| $(document).on('click', '[name="reply"]', handleReplyOrBroadcast); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| export default page; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Uh oh!
There was an error while loading. Please reload this page.