- function onFormLoaded() {
- if (
- // Reverts may involve use (undo) links; stash as they review the diff.
- // Since the form has a pre-filled summary, stash the edit immediately.
- mw.util.getParamValue( 'undo' ) !== null ||
- // Pressing "show changes" and "preview" also signify that the user will
- // probably save the page soon
- $.inArray( $form.find( '#mw-edit-mode' ).val(), [ 'preview', 'diff' ] ) > -1
- ) {
- checkStash();
- }
- }
-
- // We don't attempt to stash new section edits because in such cases the parser output
- // varies on the edit summary (since it determines the new section's name).
- if ( $form.find( 'input[name=wpSection]' ).val() === 'new' ) {
- return;
- }
-