闭社主体 forked from https://github.com/tootsuite/mastodon
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

158 lines
7.1 KiB

  1. import React from 'react';
  2. import Column from '../ui/components/column';
  3. import ColumnBackButtonSlim from '../../components/column_back_button_slim';
  4. import { defineMessages, injectIntl, FormattedMessage } from 'react-intl';
  5. import PropTypes from 'prop-types';
  6. import ImmutablePureComponent from 'react-immutable-pure-component';
  7. const messages = defineMessages({
  8. heading: { id: 'keyboard_shortcuts.heading', defaultMessage: 'Keyboard Shortcuts' },
  9. });
  10. export default @injectIntl
  11. class KeyboardShortcuts extends ImmutablePureComponent {
  12. static propTypes = {
  13. intl: PropTypes.object.isRequired,
  14. multiColumn: PropTypes.bool,
  15. };
  16. render () {
  17. const { intl, multiColumn } = this.props;
  18. return (
  19. <Column bindToDocument={!multiColumn} icon='question' heading={intl.formatMessage(messages.heading)}>
  20. <ColumnBackButtonSlim />
  21. <div className='keyboard-shortcuts scrollable optionally-scrollable'>
  22. <table>
  23. <thead>
  24. <tr>
  25. <th><FormattedMessage id='keyboard_shortcuts.hotkey' defaultMessage='Hotkey' /></th>
  26. <th><FormattedMessage id='keyboard_shortcuts.description' defaultMessage='Description' /></th>
  27. </tr>
  28. </thead>
  29. <tbody>
  30. <tr>
  31. <td><kbd>r</kbd></td>
  32. <td><FormattedMessage id='keyboard_shortcuts.reply' defaultMessage='to reply' /></td>
  33. </tr>
  34. <tr>
  35. <td><kbd>m</kbd></td>
  36. <td><FormattedMessage id='keyboard_shortcuts.mention' defaultMessage='to mention author' /></td>
  37. </tr>
  38. <tr>
  39. <td><kbd>p</kbd></td>
  40. <td><FormattedMessage id='keyboard_shortcuts.profile' defaultMessage="to open author's profile" /></td>
  41. </tr>
  42. <tr>
  43. <td><kbd>f</kbd></td>
  44. <td><FormattedMessage id='keyboard_shortcuts.favourite' defaultMessage='to favourite' /></td>
  45. </tr>
  46. <tr>
  47. <td><kbd>b</kbd></td>
  48. <td><FormattedMessage id='keyboard_shortcuts.boost' defaultMessage='to boost' /></td>
  49. </tr>
  50. <tr>
  51. <td><kbd>enter</kbd>, <kbd>o</kbd></td>
  52. <td><FormattedMessage id='keyboard_shortcuts.enter' defaultMessage='to open status' /></td>
  53. </tr>
  54. <tr>
  55. <td><kbd>x</kbd></td>
  56. <td><FormattedMessage id='keyboard_shortcuts.toggle_hidden' defaultMessage='to show/hide text behind CW' /></td>
  57. </tr>
  58. <tr>
  59. <td><kbd>h</kbd></td>
  60. <td><FormattedMessage id='keyboard_shortcuts.toggle_sensitivity' defaultMessage='to show/hide media' /></td>
  61. </tr>
  62. <tr>
  63. <td><kbd>up</kbd>, <kbd>k</kbd></td>
  64. <td><FormattedMessage id='keyboard_shortcuts.up' defaultMessage='to move up in the list' /></td>
  65. </tr>
  66. <tr>
  67. <td><kbd>down</kbd>, <kbd>j</kbd></td>
  68. <td><FormattedMessage id='keyboard_shortcuts.down' defaultMessage='to move down in the list' /></td>
  69. </tr>
  70. <tr>
  71. <td><kbd>1</kbd>-<kbd>9</kbd></td>
  72. <td><FormattedMessage id='keyboard_shortcuts.column' defaultMessage='to focus a status in one of the columns' /></td>
  73. </tr>
  74. <tr>
  75. <td><kbd>n</kbd></td>
  76. <td><FormattedMessage id='keyboard_shortcuts.compose' defaultMessage='to focus the compose textarea' /></td>
  77. </tr>
  78. <tr>
  79. <td><kbd>alt</kbd>+<kbd>n</kbd></td>
  80. <td><FormattedMessage id='keyboard_shortcuts.toot' defaultMessage='to start a brand new toot' /></td>
  81. </tr>
  82. <tr>
  83. <td><kbd>backspace</kbd></td>
  84. <td><FormattedMessage id='keyboard_shortcuts.back' defaultMessage='to navigate back' /></td>
  85. </tr>
  86. <tr>
  87. <td><kbd>s</kbd></td>
  88. <td><FormattedMessage id='keyboard_shortcuts.search' defaultMessage='to focus search' /></td>
  89. </tr>
  90. <tr>
  91. <td><kbd>esc</kbd></td>
  92. <td><FormattedMessage id='keyboard_shortcuts.unfocus' defaultMessage='to un-focus compose textarea/search' /></td>
  93. </tr>
  94. <tr>
  95. <td><kbd>g</kbd>+<kbd>h</kbd></td>
  96. <td><FormattedMessage id='keyboard_shortcuts.home' defaultMessage='to open home timeline' /></td>
  97. </tr>
  98. <tr>
  99. <td><kbd>g</kbd>+<kbd>n</kbd></td>
  100. <td><FormattedMessage id='keyboard_shortcuts.notifications' defaultMessage='to open notifications column' /></td>
  101. </tr>
  102. <tr>
  103. <td><kbd>g</kbd>+<kbd>l</kbd></td>
  104. <td><FormattedMessage id='keyboard_shortcuts.local' defaultMessage='to open local timeline' /></td>
  105. </tr>
  106. <tr>
  107. <td><kbd>g</kbd>+<kbd>t</kbd></td>
  108. <td><FormattedMessage id='keyboard_shortcuts.federated' defaultMessage='to open federated timeline' /></td>
  109. </tr>
  110. <tr>
  111. <td><kbd>g</kbd>+<kbd>d</kbd></td>
  112. <td><FormattedMessage id='keyboard_shortcuts.direct' defaultMessage='to open direct messages column' /></td>
  113. </tr>
  114. <tr>
  115. <td><kbd>g</kbd>+<kbd>s</kbd></td>
  116. <td><FormattedMessage id='keyboard_shortcuts.start' defaultMessage='to open "get started" column' /></td>
  117. </tr>
  118. <tr>
  119. <td><kbd>g</kbd>+<kbd>f</kbd></td>
  120. <td><FormattedMessage id='keyboard_shortcuts.favourites' defaultMessage='to open favourites list' /></td>
  121. </tr>
  122. <tr>
  123. <td><kbd>g</kbd>+<kbd>p</kbd></td>
  124. <td><FormattedMessage id='keyboard_shortcuts.pinned' defaultMessage='to open pinned toots list' /></td>
  125. </tr>
  126. <tr>
  127. <td><kbd>g</kbd>+<kbd>u</kbd></td>
  128. <td><FormattedMessage id='keyboard_shortcuts.my_profile' defaultMessage='to open your profile' /></td>
  129. </tr>
  130. <tr>
  131. <td><kbd>g</kbd>+<kbd>b</kbd></td>
  132. <td><FormattedMessage id='keyboard_shortcuts.blocked' defaultMessage='to open blocked users list' /></td>
  133. </tr>
  134. <tr>
  135. <td><kbd>g</kbd>+<kbd>m</kbd></td>
  136. <td><FormattedMessage id='keyboard_shortcuts.muted' defaultMessage='to open muted users list' /></td>
  137. </tr>
  138. <tr>
  139. <td><kbd>g</kbd>+<kbd>r</kbd></td>
  140. <td><FormattedMessage id='keyboard_shortcuts.requests' defaultMessage='to open follow requests list' /></td>
  141. </tr>
  142. <tr>
  143. <td><kbd>?</kbd></td>
  144. <td><FormattedMessage id='keyboard_shortcuts.legend' defaultMessage='to display this legend' /></td>
  145. </tr>
  146. </tbody>
  147. </table>
  148. </div>
  149. </Column>
  150. );
  151. }
  152. }