diff options
| author | julian laplace <julescarbon@gmail.com> | 2022-10-26 17:05:14 +0200 |
|---|---|---|
| committer | julian laplace <julescarbon@gmail.com> | 2022-10-26 17:05:14 +0200 |
| commit | dd72ab05da17309fd5ee6005cdc1fae686b5fa9e (patch) | |
| tree | 9edc695fffa73a85d94e571f44c7d4c97de71654 /public/assets/js/lib/router.js | |
| parent | 3de2a5872fd0481568e918a1ea798b3f75ace610 (diff) | |
filter by keyword, thread, or username
Diffstat (limited to 'public/assets/js/lib/router.js')
| -rw-r--r-- | public/assets/js/lib/router.js | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/public/assets/js/lib/router.js b/public/assets/js/lib/router.js index bedf0b9..848c813 100644 --- a/public/assets/js/lib/router.js +++ b/public/assets/js/lib/router.js @@ -6,6 +6,12 @@ var SiteRouter = Router.extend({ "/index/:keyword": "index", "/index": "index", "/stream": "stream", + "/stream/thread": "stream", + "/stream/thread/:id": "streamThread", + "/stream/keyword": "streamKeyword", + "/stream/keyword/:keyword": "streamKeyword", + "/stream/profile": "streamProfile", + "/stream/profile/:username": "streamItem", "/login": "login", "/logout": "logout", "/signup": "signup", @@ -39,9 +45,19 @@ var SiteRouter = Router.extend({ app.view.load(keyword); }, - stream: function (keyword) { + stream: function (target) { app.view = new StreamView(); - app.view.load(keyword); + app.view.load(target || {}); + }, + + streamKeyword: function (keyword) { + this.stream({ keyword: keyword }); + }, + streamThread: function (thread) { + this.stream({ thread: parseInt(thread) }); + }, + streamProfile: function (username) { + this.stream({ username: username }); }, login: function () { |
