Rename JS sub-components so that descriptors are before the noun, not after

This commit is contained in:
Toby Zerner 2015-05-18 18:50:54 +09:30
parent 0b95fc7f81
commit 6bfecec9f2
7 changed files with 14 additions and 14 deletions

View File

@ -4,8 +4,8 @@ import postMentionPreviews from 'mentions/post-mention-previews';
import mentionedByList from 'mentions/mentioned-by-list';
import postReplyAction from 'mentions/post-reply-action';
import composerAutocomplete from 'mentions/composer-autocomplete';
import NotificationPostMentioned from 'mentions/components/notification-post-mentioned';
import NotificationUserMentioned from 'mentions/components/notification-user-mentioned';
import PostMentionedNotification from 'mentions/components/post-mentioned-notification';
import UserMentionedNotification from 'mentions/components/user-mentioned-notification';
app.initializers.add('mentions', function() {
// For every mention of a post inside a post's content, set up a hover handler
@ -24,6 +24,6 @@ app.initializers.add('mentions', function() {
// posts or users that the user could mention.
composerAutocomplete();
app.notificationComponentRegistry['postMentioned'] = NotificationPostMentioned;
app.notificationComponentRegistry['userMentioned'] = NotificationUserMentioned;
app.notificationComponentRegistry['postMentioned'] = PostMentionedNotification;
app.notificationComponentRegistry['userMentioned'] = UserMentionedNotification;
});

View File

@ -1,7 +1,7 @@
import Notification from 'flarum/components/notification';
import username from 'flarum/helpers/username';
export default class NotificationPostMentioned extends Notification {
export default class PostMentionedNotification extends Notification {
view() {
var notification = this.props.notification;
var post = notification.subject();

View File

@ -1,7 +1,7 @@
import Notification from 'flarum/components/notification';
import username from 'flarum/helpers/username';
export default class NotificationUserMentioned extends Notification {
export default class UserMentionedNotification extends Notification {
view() {
var notification = this.props.notification;
var post = notification.subject();

View File

@ -1,7 +1,7 @@
import { extend } from 'flarum/extension-utils';
import ComposerBody from 'flarum/components/composer-body';
import ComposerReply from 'flarum/components/composer-reply';
import ComposerEdit from 'flarum/components/composer-edit';
import ReplyComposer from 'flarum/components/reply-composer';
import EditComposer from 'flarum/components/edit-composer';
import avatar from 'flarum/helpers/avatar';
import username from 'flarum/helpers/username';

View File

@ -2,7 +2,7 @@ import { extend } from 'flarum/extension-utils';
import Model from 'flarum/model';
import Post from 'flarum/models/post';
import DiscussionPage from 'flarum/components/discussion-page';
import PostComment from 'flarum/components/post-comment';
import CommentPost from 'flarum/components/comment-post';
import PostPreview from 'flarum/components/post-preview';
import punctuate from 'flarum/helpers/punctuate';
import username from 'flarum/helpers/username';
@ -14,7 +14,7 @@ export default function mentionedByList() {
params.include.push('posts.mentionedBy', 'posts.mentionedBy.user');
});
extend(PostComment.prototype, 'footerItems', function(items) {
extend(CommentPost.prototype, 'footerItems', function(items) {
var replies = this.props.post.mentionedBy();
if (replies && replies.length) {

View File

@ -1,10 +1,10 @@
import { extend } from 'flarum/extension-utils';
import PostComment from 'flarum/components/post-comment';
import CommentPost from 'flarum/components/comment-post';
import PostPreview from 'flarum/components/post-preview';
import LoadingIndicator from 'flarum/components/loading-indicator';
export default function postMentionPreviews() {
extend(PostComment.prototype, 'config', function() {
extend(CommentPost.prototype, 'config', function() {
var contentHtml = this.props.post.contentHtml();
if (contentHtml === this.oldPostContentHtml) return;
this.oldPostContentHtml = contentHtml;

View File

@ -1,9 +1,9 @@
import { extend } from 'flarum/extension-utils';
import ActionButton from 'flarum/components/action-button';
import PostComment from 'flarum/components/post-comment';
import CommentPost from 'flarum/components/comment-post';
export default function() {
extend(PostComment.prototype, 'actionItems', function(items) {
extend(CommentPost.prototype, 'actionItems', function(items) {
var post = this.props.post;
if (post.isHidden()) return;