From fd3f484eaf94b0a590b7722e3db608c5254e4785 Mon Sep 17 00:00:00 2001 From: Toby Zerner Date: Tue, 27 Jun 2017 14:01:19 +0930 Subject: [PATCH] WIP: move some things around --- js/forum/src/ForumApplication.tsx | 122 +++++++++--------- .../{utils => controls}/DiscussionControls.ts | 0 .../src/{utils => controls}/PostControls.ts | 0 .../src/{utils => controls}/UserControls.ts | 0 js/forum/src/initializers/components.ts | 16 --- js/forum/src/initializers/routes.ts | 64 --------- js/forum/src/routes.ts | 67 ++++++++-- js/forum/src/utils/History.ts | 115 ----------------- js/lib/Application.tsx | 10 +- js/lib/DocumentTitle.tsx | 3 + .../avatar.tsx => components/Avatar.tsx} | 0 .../{helpers/icon.tsx => components/Icon.tsx} | 0 js/lib/{helpers => components}/fullTime.tsx | 0 .../humanTimeElement.tsx} | 0 js/lib/{helpers => components}/userOnline.tsx | 0 js/lib/{helpers => components}/username.tsx | 0 js/lib/initializers/store.tsx | 26 ---- js/lib/{helpers => utils}/highlight.tsx | 0 js/lib/{helpers => utils}/listItems.tsx | 0 js/lib/utils/mixin.tsx | 20 --- js/lib/{helpers => utils}/punctuateSeries.tsx | 0 .../updateHumanTimes.tsx} | 0 22 files changed, 124 insertions(+), 319 deletions(-) rename js/forum/src/{utils => controls}/DiscussionControls.ts (100%) rename js/forum/src/{utils => controls}/PostControls.ts (100%) rename js/forum/src/{utils => controls}/UserControls.ts (100%) delete mode 100644 js/forum/src/initializers/components.ts delete mode 100644 js/forum/src/initializers/routes.ts delete mode 100644 js/forum/src/utils/History.ts create mode 100644 js/lib/DocumentTitle.tsx rename js/lib/{helpers/avatar.tsx => components/Avatar.tsx} (100%) rename js/lib/{helpers/icon.tsx => components/Icon.tsx} (100%) rename js/lib/{helpers => components}/fullTime.tsx (100%) rename js/lib/{helpers/humanTime.tsx => components/humanTimeElement.tsx} (100%) rename js/lib/{helpers => components}/userOnline.tsx (100%) rename js/lib/{helpers => components}/username.tsx (100%) delete mode 100644 js/lib/initializers/store.tsx rename js/lib/{helpers => utils}/highlight.tsx (100%) rename js/lib/{helpers => utils}/listItems.tsx (100%) delete mode 100644 js/lib/utils/mixin.tsx rename js/lib/{helpers => utils}/punctuateSeries.tsx (100%) rename js/lib/{initializers/humanTime.tsx => utils/updateHumanTimes.tsx} (100%) diff --git a/js/forum/src/ForumApplication.tsx b/js/forum/src/ForumApplication.tsx index eb2ae89cc..c01489ace 100644 --- a/js/forum/src/ForumApplication.tsx +++ b/js/forum/src/ForumApplication.tsx @@ -1,9 +1,15 @@ -import * as m from 'mithril'; import Application from './lib/Application'; import routes from './routes'; -import Nav from './components/Nav'; +import Search from './components/Search'; export default class ForumApplication extends Application { + /** + * The page's search component instance. + * + * @type {SearchBox} + */ + search = new Search(); + /** * A map of notification types to their components. * @@ -18,23 +24,10 @@ export default class ForumApplication extends Application { */ postComponents = {}; - /** - * The page's search component instance. - * - * @type {SearchBox} - */ - search = new Search(); + //app.postComponents.comment = CommentPost; + //app.postComponents.discussionRenamed = DiscussionRenamedPost; - /** - * @inheritdoc - */ - mount() { - m.route.prefix('#'); - - super.mount(); - - m.mount(document.getElementById('nav'),