client/router: introduce own router

I'm tired of page.js lack of documentation around finer quirks, and
being forced to read its crap code. Refactored into classes, removed
unused cruft.
This commit is contained in:
rr-
2016-06-12 20:11:43 +02:00
parent 4295e1c827
commit 76882b59ef
19 changed files with 415 additions and 94 deletions

View File

@ -1,7 +1,7 @@
'use strict';
const api = require('../api.js');
const page = require('page');
const router = require('../router.js');
const misc = require('../util/misc.js');
const topNavController = require('../controllers/top_nav_controller.js');
const pageController = require('../controllers/page_controller.js');
@ -10,7 +10,7 @@ const EmptyView = require('../views/empty_view.js');
class CommentsController {
registerRoutes() {
page('/comments/:query?',
router.enter('/comments/:query?',
(ctx, next) => { misc.parseSearchQueryRoute(ctx, next); },
(ctx, next) => { this._listCommentsRoute(ctx); });
this._commentsPageView = new CommentsPageView();