diff options
Diffstat (limited to 'web/react')
-rw-r--r-- | web/react/components/center_panel.jsx | 4 | ||||
-rw-r--r-- | web/react/components/create_post.jsx | 2 | ||||
-rw-r--r-- | web/react/components/edit_post_modal.jsx | 2 | ||||
-rw-r--r-- | web/react/components/post_info.jsx | 4 | ||||
-rw-r--r-- | web/react/components/posts_view.jsx | 4 | ||||
-rw-r--r-- | web/react/components/posts_view_container.jsx (renamed from web/react/components/post_list_container.jsx) | 26 | ||||
-rw-r--r-- | web/react/components/rhs_thread.jsx | 10 | ||||
-rw-r--r-- | web/react/components/sidebar_right.jsx | 2 | ||||
-rw-r--r-- | web/react/components/time_since.jsx (renamed from web/react/components/updating_time_since_counter.jsx) | 6 | ||||
-rw-r--r-- | web/react/stores/post_store.jsx | 46 | ||||
-rw-r--r-- | web/react/utils/constants.jsx | 2 |
11 files changed, 54 insertions, 54 deletions
diff --git a/web/react/components/center_panel.jsx b/web/react/components/center_panel.jsx index 7cb55898f..b871fe81a 100644 --- a/web/react/components/center_panel.jsx +++ b/web/react/components/center_panel.jsx @@ -2,7 +2,7 @@ // See License.txt for license information. var CreatePost = require('../components/create_post.jsx'); -var PostListContainer = require('../components/post_list_container.jsx'); +var PostsViewContainer = require('../components/posts_view_container.jsx'); var ChannelHeader = require('../components/channel_header.jsx'); var Navbar = require('../components/navbar.jsx'); var FileUploadOverlay = require('../components/file_upload_overlay.jsx'); @@ -32,7 +32,7 @@ export default class CenterPanel extends React.Component { <ChannelHeader /> </div> <div id='post-list'> - <PostListContainer /> + <PostsViewContainer /> </div> <div className='post-create__container' diff --git a/web/react/components/create_post.jsx b/web/react/components/create_post.jsx index eb702bf7c..7c601af4b 100644 --- a/web/react/components/create_post.jsx +++ b/web/react/components/create_post.jsx @@ -176,7 +176,7 @@ export default class CreatePost extends React.Component { PostStore.storePendingPost(post); PostStore.storeDraft(channel.id, null); - PostStore.jumpPostListBottom(); + PostStore.jumpPostsViewToBottom(); this.setState({messageText: '', submitting: false, postError: null, previews: [], serverError: null}); Client.createPost(post, channel, diff --git a/web/react/components/edit_post_modal.jsx b/web/react/components/edit_post_modal.jsx index 2abb3f151..ef32baa7d 100644 --- a/web/react/components/edit_post_modal.jsx +++ b/web/react/components/edit_post_modal.jsx @@ -120,7 +120,7 @@ export default class EditPostModal extends React.Component { PreferenceStore.addChangeListener(this.onPreferenceChange); } componentWillUnmount() { - PostStore.removeEditPostListener(this.handleEditPostEvent); + PostStore.removeEditPostListner(this.handleEditPostEvent); PreferenceStore.removeChangeListener(this.onPreferenceChange); } render() { diff --git a/web/react/components/post_info.jsx b/web/react/components/post_info.jsx index 202b043ce..a01d842e5 100644 --- a/web/react/components/post_info.jsx +++ b/web/react/components/post_info.jsx @@ -3,7 +3,7 @@ var UserStore = require('../stores/user_store.jsx'); var utils = require('../utils/utils.jsx'); -var UpdatingTimeSinceCounter = require('./updating_time_since_counter.jsx'); +var TimeSince = require('./time_since.jsx'); var Constants = require('../utils/constants.jsx'); @@ -146,7 +146,7 @@ export default class PostInfo extends React.Component { return ( <ul className='post-header post-info'> <li className='post-header-col'> - <UpdatingTimeSinceCounter + <TimeSince eventTime={post.create_at} /> </li> diff --git a/web/react/components/posts_view.jsx b/web/react/components/posts_view.jsx index 57e7abd35..5cefb4885 100644 --- a/web/react/components/posts_view.jsx +++ b/web/react/components/posts_view.jsx @@ -47,7 +47,7 @@ export default class PostsView extends React.Component { // --- -------- - this.props.postListScrolled(this.isAtBottom()); + this.props.postViewScrolled(this.isAtBottom()); this.prevScrollHeight = this.refs.postlist.scrollHeight; } loadMorePostsTop() { @@ -293,7 +293,7 @@ PostsView.propTypes = { postList: React.PropTypes.object, scrollPost: React.PropTypes.string, scrollType: React.PropTypes.number, - postListScrolled: React.PropTypes.func.isRequired, + postViewScrolled: React.PropTypes.func.isRequired, loadMorePostsTopClicked: React.PropTypes.func.isRequired, numPostsToDisplay: React.PropTypes.number, introText: React.PropTypes.element, diff --git a/web/react/components/post_list_container.jsx b/web/react/components/posts_view_container.jsx index 90468ab66..9eda2a158 100644 --- a/web/react/components/post_list_container.jsx +++ b/web/react/components/posts_view_container.jsx @@ -14,18 +14,18 @@ const LoadingScreen = require('./loading_screen.jsx'); import {createChannelIntroMessage} from '../utils/channel_intro_mssages.jsx'; -export default class PostListContainer extends React.Component { +export default class PostsViewContainer extends React.Component { constructor() { super(); this.onChannelChange = this.onChannelChange.bind(this); this.onChannelLeave = this.onChannelLeave.bind(this); this.onPostsChange = this.onPostsChange.bind(this); - this.handlePostListScroll = this.handlePostListScroll.bind(this); + this.handlePostsViewScroll = this.handlePostsViewScroll.bind(this); this.loadMorePostsTop = this.loadMorePostsTop.bind(this); this.postsLoaded = this.postsLoaded.bind(this); this.postsLoadedFailure = this.postsLoadedFailure.bind(this); - this.handlePostListJumpRequest = this.handlePostListJumpRequest.bind(this); + this.handlePostsViewJumpRequest = this.handlePostsViewJumpRequest.bind(this); const currentChannelId = ChannelStore.getCurrentId(); const state = { @@ -53,26 +53,26 @@ export default class PostListContainer extends React.Component { ChannelStore.addChangeListener(this.onChannelChange); ChannelStore.addLeaveListener(this.onChannelLeave); PostStore.addChangeListener(this.onPostsChange); - PostStore.addPostListJumpListener(this.handlePostListJumpRequest); + PostStore.addPostsViewJumpListener(this.handlePostsViewJumpRequest); } componentWillUnmount() { ChannelStore.removeChangeListener(this.onChannelChange); ChannelStore.removeLeaveListener(this.onChannelLeave); PostStore.removeChangeListener(this.onPostsChange); - PostStore.removePostListJumpListener(this.handlePostListJumpRequest); + PostStore.removePostsViewJumpListener(this.handlePostsViewJumpRequest); } - handlePostListJumpRequest(type, post) { + handlePostsViewJumpRequest(type, post) { switch (type) { - case Constants.PostListJumpTypes.BOTTOM: + case Constants.PostsViewJumpTypes.BOTTOM: this.setState({scrollType: PostsView.SCROLL_TYPE_BOTTOM}); break; - case Constants.PostListJumpTypes.POST: + case Constants.PostsViewJumpTypes.POST: this.setState({ scrollType: PostsView.SCROLL_TYPE_POST, scrollPost: post }); break; - case Constants.PostListJumpTypes.SIDEBAR_OPEN: + case Constants.PostsViewJumpTypes.SIDEBAR_OPEN: this.setState({scrollType: PostsView.SIDEBAR_OPEN}); break; } @@ -121,9 +121,9 @@ export default class PostListContainer extends React.Component { onPostsChange() { const channels = this.state.channels; const postLists = Object.assign({}, this.state.postLists); - const newPostList = this.getChannelPosts(channels[this.state.currentChannelIndex]); + const newPostsView = this.getChannelPosts(channels[this.state.currentChannelIndex]); - postLists[this.state.currentChannelIndex] = newPostList; + postLists[this.state.currentChannelIndex] = newPostsView; this.setState({postLists}); } getChannelPosts(id) { @@ -210,7 +210,7 @@ export default class PostListContainer extends React.Component { postsLoadedFailure(err) { AsyncClient.dispatchError(err, 'getPosts'); } - handlePostListScroll(atBottom) { + handlePostsViewScroll(atBottom) { if (atBottom) { this.setState({scrollType: PostsView.SCROLL_TYPE_BOTTOM}); } else { @@ -240,7 +240,7 @@ export default class PostListContainer extends React.Component { postList={postLists[i]} scrollType={this.state.scrollType} scrollPost={this.state.scrollPost} - postListScrolled={this.handlePostListScroll} + postViewScrolled={this.handlePostsViewScroll} loadMorePostsTopClicked={this.loadMorePostsTop} numPostsToDisplay={this.state.numPostsToDisplay} introText={channel ? createChannelIntroMessage(channel) : null} diff --git a/web/react/components/rhs_thread.jsx b/web/react/components/rhs_thread.jsx index bcdec2870..fe57bed28 100644 --- a/web/react/components/rhs_thread.jsx +++ b/web/react/components/rhs_thread.jsx @@ -34,12 +34,12 @@ export default class RhsThread extends React.Component { } var channelId = postList.posts[postList.order[0]].channel_id; - var pendingPostList = PostStore.getPendingPosts(channelId); + var pendingPostsList = PostStore.getPendingPosts(channelId); - if (pendingPostList) { - for (var pid in pendingPostList.posts) { - if (pendingPostList.posts.hasOwnProperty(pid)) { - postList.posts[pid] = pendingPostList.posts[pid]; + if (pendingPostsList) { + for (var pid in pendingPostsList.posts) { + if (pendingPostsList.posts.hasOwnProperty(pid)) { + postList.posts[pid] = pendingPostsList.posts[pid]; } } } diff --git a/web/react/components/sidebar_right.jsx b/web/react/components/sidebar_right.jsx index 020db6d88..e2ef60959 100644 --- a/web/react/components/sidebar_right.jsx +++ b/web/react/components/sidebar_right.jsx @@ -34,7 +34,7 @@ export default class SidebarRight extends React.Component { PostStore.removeSelectedPostChangeListener(this.onSelectedChange); } componentWillUpdate() { - PostStore.jumpPostListSidebarOpen(); + PostStore.jumpPostsViewSidebarOpen(); } doStrangeThings() { // We should have a better way to do this stuff diff --git a/web/react/components/updating_time_since_counter.jsx b/web/react/components/time_since.jsx index d06ffb842..c37739b9c 100644 --- a/web/react/components/updating_time_since_counter.jsx +++ b/web/react/components/time_since.jsx @@ -6,7 +6,7 @@ var Utils = require('../utils/utils.jsx'); var Tooltip = ReactBootstrap.Tooltip; var OverlayTrigger = ReactBootstrap.OverlayTrigger; -export default class UpdatingTimeSinceCounter extends React.Component { +export default class TimeSince extends React.Component { constructor(props) { super(props); } @@ -41,10 +41,10 @@ export default class UpdatingTimeSinceCounter extends React.Component { ); } } -UpdatingTimeSinceCounter.defaultProps = { +TimeSince.defaultProps = { eventTime: 0 }; -UpdatingTimeSinceCounter.propTypes = { +TimeSince.propTypes = { eventTime: React.PropTypes.number.isRequired }; diff --git a/web/react/stores/post_store.jsx b/web/react/stores/post_store.jsx index 19b200ac8..0fe253310 100644 --- a/web/react/stores/post_store.jsx +++ b/web/react/stores/post_store.jsx @@ -14,7 +14,7 @@ var ActionTypes = Constants.ActionTypes; var CHANGE_EVENT = 'change'; var SELECTED_POST_CHANGE_EVENT = 'selected_post_change'; var EDIT_POST_EVENT = 'edit_post'; -var POST_LIST_JUMP_EVENT = 'post_list_jump'; +var POSTS_VIEW_JUMP_EVENT = 'post_list_jump'; class PostStoreClass extends EventEmitter { constructor() { @@ -30,11 +30,11 @@ class PostStoreClass extends EventEmitter { this.emitEditPost = this.emitEditPost.bind(this); this.addEditPostListener = this.addEditPostListener.bind(this); - this.removeEditPostListener = this.removeEditPostListener.bind(this); + this.removeEditPostListener = this.removeEditPostListner.bind(this); - this.emitPostListJump = this.emitPostListJump.bind(this); - this.addPostListJumpListener = this.addPostListJumpListener.bind(this); - this.removePostListJumpListener = this.removePostListJumpListener.bind(this); + this.emitPostsViewJump = this.emitPostsViewJump.bind(this); + this.addPostsViewJumpListener = this.addPostsViewJumpListener.bind(this); + this.removePostsViewJumpListener = this.removePostsViewJumpListener.bind(this); this.getCurrentPosts = this.getCurrentPosts.bind(this); this.storePosts = this.storePosts.bind(this); @@ -101,32 +101,32 @@ class PostStoreClass extends EventEmitter { this.on(EDIT_POST_EVENT, callback); } - removeEditPostListener(callback) { + removeEditPostListner(callback) { this.removeListener(EDIT_POST_EVENT, callback); } - emitPostListJump(type, post) { - this.emit(POST_LIST_JUMP_EVENT, type, post); + emitPostsViewJump(type, post) { + this.emit(POSTS_VIEW_JUMP_EVENT, type, post); } - addPostListJumpListener(callback) { - this.on(POST_LIST_JUMP_EVENT, callback); + addPostsViewJumpListener(callback) { + this.on(POSTS_VIEW_JUMP_EVENT, callback); } - removePostListJumpListener(callback) { - this.removeListener(POST_LIST_JUMP_EVENT, callback); + removePostsViewJumpListener(callback) { + this.removeListener(POSTS_VIEW_JUMP_EVENT, callback); } - jumpPostListBottom() { - this.emitPostListJump(Constants.PostListJumpTypes.BOTTOM, null); + jumpPostsViewToBottom() { + this.emitPostsViewJump(Constants.PostsViewJumpTypes.BOTTOM, null); } - jumpPostListToPost(post) { - this.emitPostListJump(Constants.PostListJumpTypes.POST, post); + jumpPostsViewToPost(post) { + this.emitPostsViewJump(Constants.PostsViewJumpTypes.POST, post); } - jumpPostListSidebarOpen() { - this.emitPostListJump(Constants.PostListJumpTypes.SIDEBAR_OPEN, null); + jumpPostsViewSidebarOpen() { + this.emitPostsViewJump(Constants.PostsViewJumpTypes.SIDEBAR_OPEN, null); } getCurrentPosts() { @@ -137,16 +137,16 @@ class PostStoreClass extends EventEmitter { } return null; } - storePosts(channelId, newPostList) { - if (isPostListNull(newPostList)) { + storePosts(channelId, newPostsView) { + if (isPostListNull(newPostsView)) { return; } var postList = makePostListNonNull(this.getPosts(channelId)); - for (const pid in newPostList.posts) { - if (newPostList.posts.hasOwnProperty(pid)) { - const np = newPostList.posts[pid]; + for (const pid in newPostsView.posts) { + if (newPostsView.posts.hasOwnProperty(pid)) { + const np = newPostsView.posts[pid]; if (np.delete_at === 0) { postList.posts[pid] = np; if (postList.order.indexOf(pid) === -1) { diff --git a/web/react/utils/constants.jsx b/web/react/utils/constants.jsx index c97e4d982..8884d1d10 100644 --- a/web/react/utils/constants.jsx +++ b/web/react/utils/constants.jsx @@ -351,7 +351,7 @@ module.exports = { java: 'Java', ini: 'ini' }, - PostListJumpTypes: { + PostsViewJumpTypes: { BOTTOM: 1, POST: 2, SIDEBAR_OPEN: 3 |