[3.0] Theme split (wave 4, part 8) — use the shared confirmation handler instead of inline onclick - #9393
Merged
Conversation
Four buttons ask for confirmation by hand, in two spellings:
onclick="return confirm('…');"
onclick="if (!confirm('…')) return false;"
script.js has carried a delegated .you_sure handler for this since long before
now, and most of the forum already uses it — the error log, the calendar, the
custom profile field editor. It also does something the inline calls do not: if
confirm() comes back false in under ten milliseconds it assumes the browser
suppressed the dialog and lets the action through, rather than silently doing
nothing.
Moves the last four over. The message travels in data-confirm, as elsewhere.
Signed-off-by: albertlast <mathiaspapealbert@hotmail.com>
This was referenced Aug 8, 2026
Closed
live627
approved these changes
Aug 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Part of the split of #7933, wave 4 part 8.
Four buttons still ask for confirmation with an inline handler, in two spellings:
script.jshas carried a delegated.you_surehandler for exactly this, and mostof the forum already uses it — the error log, the calendar, the custom profile
field editor, the mark-all-as-read button. This moves the last four over, with the
message in
data-confirmas everywhere else.The shared handler also does something the inline calls do not:
If
confirm()comes back false in under ten milliseconds it assumes the dialogwas suppressed by the browser and lets the action through, rather than the button
silently doing nothing. The inline versions have no such fallback.
PersonalMessage.template.phpPersonalMessage.template.phpManageLanguages.template.phpTesting
Dispatched a real click at each button with
window.confirmstubbed, and readevent.defaultPreventedafter the delegated handler had run:…sa=manrules;applyBoth come out with
class="button you_sure", the string indata-confirm, and noonclickleft.Worth noting how that had to be measured: a stub that returns instantly is treated
by the handler as a suppressed dialog and the click goes through anyway. My first
attempt therefore "showed" that declining did nothing. The stub has to take longer
than the ten millisecond threshold before the result means anything.
The language delete button I have not exercised — it only appears once a second
language is installed, and I have one. It is the same one-line swap as the three
above.
Issues References (Fixes|Related|Closes)
Related to #7933