Skip to content

Display status.php Query Content#937

Merged
boomzero merged 9 commits intodevfrom
display-status-query-content
Mar 15, 2026
Merged

Display status.php Query Content#937
boomzero merged 9 commits intodevfrom
display-status-query-content

Conversation

@def-WA2025
Copy link
Member

@def-WA2025 def-WA2025 commented Mar 15, 2026

What does this PR aim to accomplish?

Display status.php query content.

How does this PR accomplish the above?

Get URL parameters and fill them into the query form.


By submitting this pull request, I confirm the following:

  1. I have read and understood the contributor's guide, as well as this entire template. I understand which branch to base my commits and Pull Requests against.
  2. I have commented on my proposed changes within the code.
  3. I have tested my changes.
  4. I am willing to help maintain this change if there are issues with it later.
  5. It is compatible with the GNU General Public License v3.0
  6. I have squashed any insignificant commits. (git rebase)
  7. I have checked that another pull request for this purpose does not exist.
  8. I have considered and confirmed that this submission will be valuable to others.
  9. I accept that this submission may not be used, and the pull request can be closed at the will of the maintainer.
  10. I give this submission freely and claim no ownership to its content.
  11. I have verified that my changes work correctly in both the new UI and the old/classic UI.

  • I have read the above and my PR is ready for review. Check this box to confirm

Summary by Sourcery

Prefill the status query form from URL parameters in the new bootstrap UI and correct a user-facing submission message.

New Features:

  • Populate the status.php query form fields from URL query parameters in the new bootstrap-enabled status page.

Bug Fixes:

  • Fix a typo in the contest-ended submission message text shown to users.

Summary by cubic

Prefills the status.php query form from URL parameters in the NewBootstrap UI so shared links open with the same filters. Adds numeric range checks, fixes XSS and special-value filling issues, removes stray logs, and updates to 3.3.3.

  • New Features

    • On status.php with NewBootstrap, read problem_id, language, and jresult from the URL, validate ranges, and set the form fields.
  • Bug Fixes

    • Fixed an XSS on the status page and removed irrelevant console logs.
    • Fixed cases where certain special query values wouldn’t populate; corrected the contest-ended submission message ("向题目", not "像题目").

Written for commit ac13113. Summary will update on new commits.

@sourcery-ai
Copy link

sourcery-ai bot commented Mar 15, 2026

Reviewer's Guide

Populates the status.php search form in the NewBootstrap UI from URL query parameters, fixes a small Chinese typo in a contest submission message, and applies minor whitespace/formatting cleanups in the image enlarger feature.

Sequence diagram for populating status.php query form from URL parameters

sequenceDiagram
    actor User
    participant Browser
    participant XMOJScript
    participant StatusPHP_DOM

    User->>Browser: Open status.php URL with query parameters
    Browser->>XMOJScript: Load and execute main
    XMOJScript->>StatusPHP_DOM: Detect NewBootstrap UI
    XMOJScript->>Browser: Read window.location.href
    XMOJScript->>XMOJScript: Parse problem_id, language, jresult from URL
    XMOJScript->>StatusPHP_DOM: Replace simform outerHTML with new form
    XMOJScript->>StatusPHP_DOM: Set input problem_id value to CurrentProblemId
    XMOJScript->>StatusPHP_DOM: Set select language value to CurrentLanguage
    XMOJScript->>StatusPHP_DOM: Set select jresult value to CurrentJresult
    User->>StatusPHP_DOM: View prefilled search form
    User->>StatusPHP_DOM: Submit query form if desired
Loading

File-Level Changes

Change Details Files
Populate status.php query form fields from URL parameters in the NewBootstrap UI.
  • Parse problem_id, language, and jresult from window.location.href using a regex loop.
  • Inject these values into the reconstructed #simform markup: set problem_id input value and remove default selected attributes on the -1 options.
  • After injecting the form, programmatically set the language and jresult values to the parsed parameters.
XMOJ.user.js
Correct a typo in the contest-ended submission message and log.
  • Change the Chinese text from '正在尝试像题目' to '正在尝试向题目' in both the user-facing error message and console.log output when a contest has ended.
XMOJ.user.js
Normalize whitespace in the image enlarger styles and logic.
  • Adjust spacing and blank lines in CSS rules for the image modal and toolbar.
  • Tidy up spacing around comments and event-handler blocks for the image modal implementation.
  • Ensure consistent trailing newline at the end of the script.
XMOJ.user.js

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@hendragon-bot hendragon-bot bot added the user-script This issue or pull request is related to the main user script label Mar 15, 2026
sourcery-ai[bot]

This comment was marked as resolved.

sourcery-ai[bot]

This comment was marked as resolved.

cubic-dev-ai[bot]

This comment was marked as resolved.

Signed-off-by: zsTree <wa2025666@gmail.com>
sourcery-ai[bot]

This comment was marked as resolved.

cubic-dev-ai[bot]

This comment was marked as resolved.

Signed-off-by: zsTree <wa2025666@gmail.com>
cubic-dev-ai[bot]

This comment was marked as resolved.

def-WA2025 and others added 2 commits March 15, 2026 11:38
Signed-off-by: zsTree <wa2025666@gmail.com>
cubic-dev-ai[bot]

This comment was marked as resolved.

@boomzero
Copy link
Member

Ooh Someone finally decided to fix #38 !
What a pity I was planning a fix in #3800

Signed-off-by: zsTree <wa2025666@gmail.com>
Copy link
Member

@boomzero boomzero left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

通常情况下, 我们认为 XMOJ 上的非用户提供内容是可行的, 所以可以忽略 AI 的 XXS

btw accept member invite to this org pls

Nice work!

@boomzero boomzero linked an issue Mar 15, 2026 that may be closed by this pull request
2 tasks
Copy link
Member Author

@def-WA2025 def-WA2025 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tks

cubic-dev-ai[bot]

This comment was marked as resolved.

@boomzero boomzero merged commit 75f1752 into dev Mar 15, 2026
6 of 7 checks passed
@boomzero boomzero deleted the display-status-query-content branch March 15, 2026 05:02
@def-WA2025
Copy link
Member Author

哦,终于有人决定修复#38了
真可惜,我原本计划在 #3800 中修复这个问题。

()

@def-WA2025
Copy link
Member Author

btw accept member invite to this org pls

@boomzero Done

@langningchen
Copy link
Member

Good job!

@XMOJ-Script-dev XMOJ-Script-dev deleted a comment from def-WA2025 Mar 15, 2026
@PythonSmall-Q
Copy link
Member

@def-WA2025 别忘了把自己设置为public

@boomzero script里面要不做一个开发组成员的badge?

@boomzero
Copy link
Member

没事可以给他admin

@def-WA2025
Copy link
Member Author

@PythonSmall-Q ?什么Public

@PythonSmall-Q
Copy link
Member

在GitHub团队内display

@def-WA2025
Copy link
Member Author

这样吗

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/L user-script This issue or pull request is related to the main user script

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature Request] 状态页面搜索后显示搜索关键词

4 participants