diff --git a/frontend/src/aspects/readit.ts b/frontend/src/aspects/readit.ts index 37b30fa1..2bd94cd1 100644 --- a/frontend/src/aspects/readit.ts +++ b/frontend/src/aspects/readit.ts @@ -7,7 +7,7 @@ import feedbackView from '../global/feedback-view'; import uploadSourceForm from '../global/upload-source-form'; import categoryStyles from '../global/category-styles'; import user from '../global/user'; -import directionRouter from '../global/direction-router'; +import mainRouter from '../global/main-router'; import userFsm from '../global/user-fsm'; import { ensureSources } from '../global/sources'; import explorerView from '../global/explorer-view'; @@ -24,12 +24,12 @@ history.once('route', () => { uploadSourceForm.setHeight(availableHeight); }); -directionRouter.on('route:arrive', () => { +mainRouter.on('route:arrive', () => { userFsm.handle('arrive'); }); -directionRouter.on('route:upload', () => userFsm.handle('upload')); -directionRouter.on('route:explore', () => userFsm.handle('explore')); -directionRouter.on('route:leave', () => userFsm.handle('leave')); +mainRouter.on('route:upload', () => userFsm.handle('upload')); +mainRouter.on('route:explore', () => userFsm.handle('explore')); +mainRouter.on('route:leave', () => userFsm.handle('leave')); userFsm.on('enter:arriving', () => welcomeView.render().$el.appendTo('#main')); userFsm.on('exit:arriving', () => welcomeView.$el.detach()); diff --git a/frontend/src/aspects/registration.ts b/frontend/src/aspects/registration.ts index 8b256d71..f471357f 100644 --- a/frontend/src/aspects/registration.ts +++ b/frontend/src/aspects/registration.ts @@ -1,12 +1,12 @@ import registrationForm from '../global/registration-view'; import confirmRegistrationView from '../global/confirm-registration-view'; import user from '../global/user'; -import directionRouter from '../global/direction-router'; +import mainRouter from '../global/main-router'; import authFsm from '../global/authentication-fsm'; import userFsm from '../global/user-fsm'; -directionRouter.on('route:register', () => authFsm.handle('register')); -directionRouter.on('route:confirm-registration', (key) => { +mainRouter.on('route:register', () => authFsm.handle('register')); +mainRouter.on('route:confirm-registration', (key) => { confirmRegistrationView.processKey(key); userFsm.handle('confirm'); }); diff --git a/frontend/src/global/direction-router.ts b/frontend/src/global/direction-router.ts deleted file mode 100644 index 60b8ad74..00000000 --- a/frontend/src/global/direction-router.ts +++ /dev/null @@ -1,3 +0,0 @@ -import DirectionRouter from '../navigation/direction-router'; - -export default new DirectionRouter(); diff --git a/frontend/src/global/main-router.ts b/frontend/src/global/main-router.ts new file mode 100644 index 00000000..88698533 --- /dev/null +++ b/frontend/src/global/main-router.ts @@ -0,0 +1,3 @@ +import MainRouter from '../navigation/main-router'; + +export default new MainRouter(); diff --git a/frontend/src/navigation/direction-router.ts b/frontend/src/navigation/main-router.ts similarity index 77% rename from frontend/src/navigation/direction-router.ts rename to frontend/src/navigation/main-router.ts index 05063eed..35ba1591 100644 --- a/frontend/src/navigation/direction-router.ts +++ b/frontend/src/navigation/main-router.ts @@ -2,9 +2,9 @@ import { extend } from 'lodash'; import Router from '../core/router'; -export default class DirectionRouter extends Router {} +export default class MainRouter extends Router {} -extend(DirectionRouter.prototype, { +extend(MainRouter.prototype, { routes: { '(arrive)': 'arrive', 'leave': 'leave',