diff options
author | ThibG <thib@sitedethib.com> | 2019-05-30 14:07:45 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-05-30 14:07:45 +0200 |
commit | 8ce2a0887540e66fce5b7b52df12126b05cd740f (patch) | |
tree | 62d7297066efca26f7f00040001374f3c4e2164f /app/javascript | |
parent | 6c0428b7d8bb9a0f5f4ccb68697276d99cf036d8 (diff) | |
parent | 06036081a0759b0b5635afa6e6f5d6ed49233add (diff) |
Merge pull request #1076 from ThibG/glitch-soc/merge-upstream
Merge upstream changes
Diffstat (limited to 'app/javascript')
-rw-r--r-- | app/javascript/mastodon/components/status.js | 13 | ||||
-rw-r--r-- | app/javascript/mastodon/features/status/index.js | 5 | ||||
-rw-r--r-- | app/javascript/mastodon/features/ui/components/navigation_panel.js | 4 | ||||
-rw-r--r-- | app/javascript/mastodon/locales/co.json | 2 | ||||
-rw-r--r-- | app/javascript/mastodon/locales/cs.json | 1 | ||||
-rw-r--r-- | app/javascript/mastodon/locales/defaultMessages.json | 139 | ||||
-rw-r--r-- | app/javascript/mastodon/locales/en.json | 2 | ||||
-rw-r--r-- | app/javascript/mastodon/locales/ja.json | 2 | ||||
-rw-r--r-- | app/javascript/styles/mastodon/components.scss | 1 |
9 files changed, 121 insertions, 48 deletions
diff --git a/app/javascript/mastodon/components/status.js b/app/javascript/mastodon/components/status.js index 28738105a..6e944dc9e 100644 --- a/app/javascript/mastodon/components/status.js +++ b/app/javascript/mastodon/components/status.js @@ -18,7 +18,6 @@ import classNames from 'classnames'; import Icon from 'mastodon/components/icon'; import PollContainer from 'mastodon/containers/poll_container'; import { displayMedia } from '../initial_state'; -import { is } from 'immutable'; // We use the component (and not the container) since we do not want // to use the progress bar to show download progress @@ -101,6 +100,7 @@ class Status extends ImmutablePureComponent { state = { showMedia: defaultMediaVisibility(this.props.status), + statusId: undefined, }; // Track height changes we know about to compensate scrolling @@ -116,9 +116,14 @@ class Status extends ImmutablePureComponent { } } - componentWillReceiveProps (nextProps) { - if (!is(nextProps.status, this.props.status) && nextProps.status) { - this.setState({ showMedia: defaultMediaVisibility(nextProps.status) }); + static getDerivedStateFromProps(nextProps, prevState) { + if (nextProps.status && nextProps.status.get('id') !== prevState.statusId) { + return { + showMedia: defaultMediaVisibility(nextProps.status), + statusId: nextProps.status.get('id'), + }; + } else { + return null; } } diff --git a/app/javascript/mastodon/features/status/index.js b/app/javascript/mastodon/features/status/index.js index d8c4c50dc..981eb9d58 100644 --- a/app/javascript/mastodon/features/status/index.js +++ b/app/javascript/mastodon/features/status/index.js @@ -132,6 +132,7 @@ class Status extends ImmutablePureComponent { state = { fullscreen: false, showMedia: defaultMediaVisibility(this.props.status), + loadedStatusId: undefined, }; componentWillMount () { @@ -148,8 +149,8 @@ class Status extends ImmutablePureComponent { this.props.dispatch(fetchStatus(nextProps.params.statusId)); } - if (!Immutable.is(nextProps.status, this.props.status) && nextProps.status) { - this.setState({ showMedia: defaultMediaVisibility(nextProps.status) }); + if (nextProps.status && nextProps.status.get('id') !== this.state.loadedStatusId) { + this.setState({ showMedia: defaultMediaVisibility(nextProps.status), loadedStatusId: nextProps.status.get('id') }); } } diff --git a/app/javascript/mastodon/features/ui/components/navigation_panel.js b/app/javascript/mastodon/features/ui/components/navigation_panel.js index 1fd28c63a..613be7391 100644 --- a/app/javascript/mastodon/features/ui/components/navigation_panel.js +++ b/app/javascript/mastodon/features/ui/components/navigation_panel.js @@ -21,8 +21,8 @@ const NavigationPanel = () => ( <hr /> - <a className='column-link column-link--transparent' href='/settings/preferences' target='_blank'><Icon className='column-link__icon' id='cog' fixedWidth /><FormattedMessage id='navigation_bar.preferences' defaultMessage='Preferences' /></a> - <a className='column-link column-link--transparent' href='/relationships' target='_blank'><Icon className='column-link__icon' id='address-book-o' fixedWidth /><FormattedMessage id='navigation_bar.follows_and_followers' defaultMessage='Follows and followers' /></a> + <a className='column-link column-link--transparent' href='/settings/preferences'><Icon className='column-link__icon' id='cog' fixedWidth /><FormattedMessage id='navigation_bar.preferences' defaultMessage='Preferences' /></a> + <a className='column-link column-link--transparent' href='/relationships'><Icon className='column-link__icon' id='address-book-o' fixedWidth /><FormattedMessage id='navigation_bar.follows_and_followers' defaultMessage='Follows and followers' /></a> </div> ); diff --git a/app/javascript/mastodon/locales/co.json b/app/javascript/mastodon/locales/co.json index 335706af7..8321d7e7e 100644 --- a/app/javascript/mastodon/locales/co.json +++ b/app/javascript/mastodon/locales/co.json @@ -204,6 +204,7 @@ "keyboard_shortcuts.search": "fucalizà nant'à l'area di circata", "keyboard_shortcuts.start": "per apre a culonna \"per principià\"", "keyboard_shortcuts.toggle_hidden": "vede/piattà u testu daretu à l'avertimentu CW", + "keyboard_shortcuts.toggle_sensitivity": "vede/piattà i media", "keyboard_shortcuts.toot": "scrive un novu statutu", "keyboard_shortcuts.unfocus": "ùn fucalizà più l'area di testu", "keyboard_shortcuts.up": "cullà indè a lista", @@ -236,6 +237,7 @@ "navigation_bar.favourites": "Favuriti", "navigation_bar.filters": "Parolle silenzate", "navigation_bar.follow_requests": "Dumande d'abbunamentu", + "navigation_bar.follows_and_followers": "Abbunati è abbunamenti", "navigation_bar.info": "À prupositu di u servore", "navigation_bar.keyboard_shortcuts": "Accorte cù a tastera", "navigation_bar.lists": "Liste", diff --git a/app/javascript/mastodon/locales/cs.json b/app/javascript/mastodon/locales/cs.json index 695f22382..5dd977374 100644 --- a/app/javascript/mastodon/locales/cs.json +++ b/app/javascript/mastodon/locales/cs.json @@ -236,6 +236,7 @@ "navigation_bar.favourites": "Oblíbené", "navigation_bar.filters": "Skrytá slova", "navigation_bar.follow_requests": "Požadavky o sledování", + "navigation_bar.follows_and_followers": "Sledovaní a sledující", "navigation_bar.info": "O tomto serveru", "navigation_bar.keyboard_shortcuts": "Klávesové zkratky", "navigation_bar.lists": "Seznamy", diff --git a/app/javascript/mastodon/locales/defaultMessages.json b/app/javascript/mastodon/locales/defaultMessages.json index 73a9c4e92..70b314769 100644 --- a/app/javascript/mastodon/locales/defaultMessages.json +++ b/app/javascript/mastodon/locales/defaultMessages.json @@ -1356,46 +1356,6 @@ { "defaultMessage": "Profile directory", "id": "getting_started.directory" - }, - { - "defaultMessage": "Invite people", - "id": "getting_started.invite" - }, - { - "defaultMessage": "Hotkeys", - "id": "navigation_bar.keyboard_shortcuts" - }, - { - "defaultMessage": "Security", - "id": "getting_started.security" - }, - { - "defaultMessage": "About this server", - "id": "navigation_bar.info" - }, - { - "defaultMessage": "Mobile apps", - "id": "navigation_bar.apps" - }, - { - "defaultMessage": "Terms of service", - "id": "getting_started.terms" - }, - { - "defaultMessage": "Developers", - "id": "getting_started.developers" - }, - { - "defaultMessage": "Documentation", - "id": "getting_started.documentation" - }, - { - "defaultMessage": "Logout", - "id": "navigation_bar.logout" - }, - { - "defaultMessage": "Mastodon is open source software. You can contribute or report issues on GitHub at {github}.", - "id": "getting_started.open_source_notice" } ], "path": "app/javascript/mastodon/features/getting_started/index.json" @@ -1600,6 +1560,10 @@ "id": "keyboard_shortcuts.toggle_hidden" }, { + "defaultMessage": "to show/hide media", + "id": "keyboard_shortcuts.toggle_sensitivity" + }, + { "defaultMessage": "to move up in the list", "id": "keyboard_shortcuts.up" }, @@ -2256,6 +2220,60 @@ { "descriptors": [ { + "defaultMessage": "Follow requests", + "id": "navigation_bar.follow_requests" + } + ], + "path": "app/javascript/mastodon/features/ui/components/follow_requests_nav_link.json" + }, + { + "descriptors": [ + { + "defaultMessage": "Invite people", + "id": "getting_started.invite" + }, + { + "defaultMessage": "Hotkeys", + "id": "navigation_bar.keyboard_shortcuts" + }, + { + "defaultMessage": "Security", + "id": "getting_started.security" + }, + { + "defaultMessage": "About this server", + "id": "navigation_bar.info" + }, + { + "defaultMessage": "Mobile apps", + "id": "navigation_bar.apps" + }, + { + "defaultMessage": "Terms of service", + "id": "getting_started.terms" + }, + { + "defaultMessage": "Developers", + "id": "getting_started.developers" + }, + { + "defaultMessage": "Documentation", + "id": "getting_started.documentation" + }, + { + "defaultMessage": "Logout", + "id": "navigation_bar.logout" + }, + { + "defaultMessage": "Mastodon is open source software. You can contribute or report issues on GitHub at {github}.", + "id": "getting_started.open_source_notice" + } + ], + "path": "app/javascript/mastodon/features/ui/components/link_footer.json" + }, + { + "descriptors": [ + { "defaultMessage": "Close", "id": "lightbox.close" }, @@ -2298,6 +2316,47 @@ { "descriptors": [ { + "defaultMessage": "Home", + "id": "tabs_bar.home" + }, + { + "defaultMessage": "Notifications", + "id": "tabs_bar.notifications" + }, + { + "defaultMessage": "Local", + "id": "tabs_bar.local_timeline" + }, + { + "defaultMessage": "Federated", + "id": "tabs_bar.federated_timeline" + }, + { + "defaultMessage": "Direct messages", + "id": "navigation_bar.direct" + }, + { + "defaultMessage": "Favourites", + "id": "navigation_bar.favourites" + }, + { + "defaultMessage": "Lists", + "id": "navigation_bar.lists" + }, + { + "defaultMessage": "Preferences", + "id": "navigation_bar.preferences" + }, + { + "defaultMessage": "Follows and followers", + "id": "navigation_bar.follows_and_followers" + } + ], + "path": "app/javascript/mastodon/features/ui/components/navigation_panel.json" + }, + { + "descriptors": [ + { "defaultMessage": "Close", "id": "lightbox.close" }, diff --git a/app/javascript/mastodon/locales/en.json b/app/javascript/mastodon/locales/en.json index b1eb814fc..92d1af784 100644 --- a/app/javascript/mastodon/locales/en.json +++ b/app/javascript/mastodon/locales/en.json @@ -208,6 +208,7 @@ "keyboard_shortcuts.search": "to focus search", "keyboard_shortcuts.start": "to open \"get started\" column", "keyboard_shortcuts.toggle_hidden": "to show/hide text behind CW", + "keyboard_shortcuts.toggle_sensitivity": "to show/hide media", "keyboard_shortcuts.toot": "to start a brand new toot", "keyboard_shortcuts.unfocus": "to un-focus compose textarea/search", "keyboard_shortcuts.up": "to move up in the list", @@ -240,6 +241,7 @@ "navigation_bar.favourites": "Favourites", "navigation_bar.filters": "Muted words", "navigation_bar.follow_requests": "Follow requests", + "navigation_bar.follows_and_followers": "Follows and followers", "navigation_bar.info": "About this server", "navigation_bar.keyboard_shortcuts": "Hotkeys", "navigation_bar.lists": "Lists", diff --git a/app/javascript/mastodon/locales/ja.json b/app/javascript/mastodon/locales/ja.json index 509d0c2e8..fb4a814c8 100644 --- a/app/javascript/mastodon/locales/ja.json +++ b/app/javascript/mastodon/locales/ja.json @@ -208,6 +208,7 @@ "keyboard_shortcuts.search": "検索欄に移動", "keyboard_shortcuts.start": "\"スタート\" カラムを開く", "keyboard_shortcuts.toggle_hidden": "CWで隠れた文を見る/隠す", + "keyboard_shortcuts.toggle_sensitivity": "非表示のメディアを見る/隠す", "keyboard_shortcuts.toot": "新規トゥート", "keyboard_shortcuts.unfocus": "トゥート入力欄・検索欄から離れる", "keyboard_shortcuts.up": "カラム内一つ上に移動", @@ -240,6 +241,7 @@ "navigation_bar.favourites": "お気に入り", "navigation_bar.filters": "フィルター設定", "navigation_bar.follow_requests": "フォローリクエスト", + "navigation_bar.follows_and_followers": "フォロー・フォロワー", "navigation_bar.info": "このサーバーについて", "navigation_bar.keyboard_shortcuts": "ホットキー", "navigation_bar.lists": "リスト", diff --git a/app/javascript/styles/mastodon/components.scss b/app/javascript/styles/mastodon/components.scss index 6b8b89a03..959b601e6 100644 --- a/app/javascript/styles/mastodon/components.scss +++ b/app/javascript/styles/mastodon/components.scss @@ -1976,6 +1976,7 @@ a.account__display-name { .columns-area--mobile { flex-direction: column; width: 100%; + height: 100%; margin: 0 auto; .column, |