Skip to content

refactor: replace jquery.are-you-sure with first-party code - #39233

Open
silverwind wants to merge 6 commits into
go-gitea:mainfrom
silverwind:vanilla-are-you-sure
Open

refactor: replace jquery.are-you-sure with first-party code#39233
silverwind wants to merge 6 commits into
go-gitea:mainfrom
silverwind:vanilla-are-you-sure

Conversation

@silverwind

@silverwind silverwind commented Sep 4, 2026

Copy link
Copy Markdown
Member

Replaces the vendored jQuery are-you-sure plugin with a first-party code. The ignore-dirty and ays-ignore template contracts are kept, the unused plugin options and jQuery events are dropped.

  1. Events are handled per form, so EasyMDE typing now arms the leave prompt.
  2. Disabled fields compare by real value, fixing a false prompt on the admin user form.
  3. ays-ignore also covers descendants, the file editor uses it on its commit form.
  4. Select fields compare the selected option set.
  5. <button> elements are untracked, the Chrome double-prompt hack is gone.

The vendored plugin was a @ts-nocheck jQuery fork and the last jQuery
consumer outside Fomantic. The replacement keeps the ignore-dirty and
ays-ignore template contracts, tracks fields per form with delegated
listeners and drops the unused plugin options and jQuery events. The
editor marks its commit form wrapper ignored instead of initializing
the tracker twice on the same form.

Assisted-by: Claude Code:claude-fable-5-1
@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Sep 4, 2026
@silverwind silverwind changed the title refactor: replace jquery.are-you-sure with a vanilla form dirty tracker refactor: replace jquery.are-you-sure with first-party code Sep 4, 2026
@github-actions github-actions Bot added topic/code-linting type/refactoring Existing code has been cleaned up. There should be no new functionality. labels Sep 4, 2026
Assisted-by: Claude Code:claude-fable-5-1
Assisted-by: Claude Code:claude-fable-5-1
Assisted-by: Claude Code:claude-fable-5-1
Assisted-by: Claude Code:claude-fable-5-1
@GiteaBot GiteaBot added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Sep 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lgtm/need 1 This PR needs approval from one additional maintainer to be merged. topic/code-linting type/refactoring Existing code has been cleaned up. There should be no new functionality.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants