From ed98a186817c8131cced721712fafe65707c7510 Mon Sep 17 00:00:00 2001 From: Toby Zerner Date: Mon, 18 May 2015 18:50:58 +0930 Subject: [PATCH] Rename JS sub-components so that descriptors are before the noun, not after --- extensions/sticky/js/bootstrap.js | 8 ++++---- ...on-stickied.js => discussion-stickied-notification.js} | 2 +- ...discussion-stickied.js => discussion-stickied-post.js} | 4 ++-- extensions/sticky/less/sticky.less | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) rename extensions/sticky/js/src/components/{notification-discussion-stickied.js => discussion-stickied-notification.js} (86%) rename extensions/sticky/js/src/components/{post-discussion-stickied.js => discussion-stickied-post.js} (55%) diff --git a/extensions/sticky/js/bootstrap.js b/extensions/sticky/js/bootstrap.js index 62ea0b89e..c95d9cc4f 100644 --- a/extensions/sticky/js/bootstrap.js +++ b/extensions/sticky/js/bootstrap.js @@ -9,14 +9,14 @@ import SettingsPage from 'flarum/components/settings-page'; import icon from 'flarum/helpers/icon'; import app from 'flarum/app'; -import PostDiscussionStickied from 'sticky/components/post-discussion-stickied'; -import NotificationDiscussionStickied from 'sticky/components/notification-discussion-stickied'; +import DiscussionStickiedPost from 'sticky/components/discussion-stickied-post'; +import DiscussionStickiedNotification from 'sticky/components/discussion-stickied-notification'; app.initializers.add('sticky', function() { // Register components. - app.postComponentRegistry['discussionStickied'] = PostDiscussionStickied; - app.notificationComponentRegistry['discussionStickied'] = NotificationDiscussionStickied; + app.postComponentRegistry['discussionStickied'] = DiscussionStickiedPost; + app.notificationComponentRegistry['discussionStickied'] = DiscussionStickiedNotification; Discussion.prototype.isSticky = Model.prop('isSticky'); Discussion.prototype.canSticky = Model.prop('canSticky'); diff --git a/extensions/sticky/js/src/components/notification-discussion-stickied.js b/extensions/sticky/js/src/components/discussion-stickied-notification.js similarity index 86% rename from extensions/sticky/js/src/components/notification-discussion-stickied.js rename to extensions/sticky/js/src/components/discussion-stickied-notification.js index 08e04fc89..81f636e19 100644 --- a/extensions/sticky/js/src/components/notification-discussion-stickied.js +++ b/extensions/sticky/js/src/components/discussion-stickied-notification.js @@ -1,7 +1,7 @@ import Notification from 'flarum/components/notification'; import username from 'flarum/helpers/username'; -export default class NotificationDiscussionStickied extends Notification { +export default class DiscussionStickiedNotification extends Notification { view() { var notification = this.props.notification; diff --git a/extensions/sticky/js/src/components/post-discussion-stickied.js b/extensions/sticky/js/src/components/discussion-stickied-post.js similarity index 55% rename from extensions/sticky/js/src/components/post-discussion-stickied.js rename to extensions/sticky/js/src/components/discussion-stickied-post.js index beb75e70f..3d8e786a4 100644 --- a/extensions/sticky/js/src/components/post-discussion-stickied.js +++ b/extensions/sticky/js/src/components/discussion-stickied-post.js @@ -1,6 +1,6 @@ -import PostActivity from 'flarum/components/post-activity'; +import EventPost from 'flarum/components/event-post'; -export default class PostDiscussionStickied extends PostActivity { +export default class DiscussionStickiedPost extends EventPost { view() { var post = this.props.post; diff --git a/extensions/sticky/less/sticky.less b/extensions/sticky/less/sticky.less index 5cebfbfb4..c3b5edb29 100644 --- a/extensions/sticky/less/sticky.less +++ b/extensions/sticky/less/sticky.less @@ -1,7 +1,7 @@ .badge-sticky { background: #d13e32; } -.post-discussion-stickied { +.discussion-stickied-post { & .post-icon, & .post-activity-info, & .post-activity-info a { color: #d13e32; }