2018-10-23 13:38:03 +00:00
|
|
|
/**
|
|
|
|
* @copyright Copyright (c) 2018 Julius Härtl <jus@bitgrid.net>
|
|
|
|
* @copyright Copyright (c) 2018 John Molakvoæ <skjnldsv@protonmail.com>
|
|
|
|
*
|
|
|
|
* @author Julius Härtl <jus@bitgrid.net>
|
|
|
|
* @author John Molakvoæ <skjnldsv@protonmail.com>
|
|
|
|
*
|
|
|
|
* @license GNU AGPL version 3 or any later version
|
|
|
|
*
|
|
|
|
* This program is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU Affero General Public License as
|
|
|
|
* published by the Free Software Foundation, either version 3 of the
|
|
|
|
* License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU Affero General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Affero General Public License
|
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*
|
|
|
|
*/
|
2018-10-26 08:33:27 +00:00
|
|
|
import Vue from 'vue'
|
|
|
|
import Router from 'vue-router'
|
2018-10-23 13:38:03 +00:00
|
|
|
|
|
|
|
// Dynamic loading
|
2018-10-26 08:33:27 +00:00
|
|
|
const Timeline = () => import('./views/Timeline')
|
2019-01-11 09:50:58 +00:00
|
|
|
const Profile = () => import(/* webpackChunkName: "profile" */'./views/Profile')
|
|
|
|
const ProfileTimeline = () => import(/* webpackChunkName: "profile" */'./views/ProfileTimeline')
|
|
|
|
const ProfileFollowers = () => import(/* webpackChunkName: "profile" */'./views/ProfileFollowers')
|
2018-10-23 14:20:38 +00:00
|
|
|
|
2018-10-26 08:33:27 +00:00
|
|
|
Vue.use(Router)
|
2018-10-23 13:38:03 +00:00
|
|
|
|
|
|
|
export default new Router({
|
|
|
|
mode: 'history',
|
|
|
|
// if index.php is in the url AND we got this far, then it's working:
|
|
|
|
// let's keep using index.php in the url
|
|
|
|
base: OC.generateUrl(''),
|
|
|
|
linkActiveClass: 'active',
|
|
|
|
routes: [
|
|
|
|
{
|
|
|
|
path: '/:index(index.php/)?apps/social/',
|
2018-11-22 14:42:10 +00:00
|
|
|
redirect: { name: 'timeline' }
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: '/:index(index.php/)?apps/social/timeline/:type?',
|
2018-10-23 14:20:38 +00:00
|
|
|
components: {
|
2018-10-26 08:33:27 +00:00
|
|
|
default: Timeline
|
2018-10-23 14:20:38 +00:00
|
|
|
},
|
2018-10-23 13:38:03 +00:00
|
|
|
props: true,
|
|
|
|
name: 'timeline'
|
|
|
|
},
|
|
|
|
{
|
2018-12-19 08:50:59 +00:00
|
|
|
path: '/:index(index.php/)?apps/social/@:account',
|
2018-10-23 14:20:38 +00:00
|
|
|
components: {
|
2018-10-26 11:08:46 +00:00
|
|
|
default: Profile,
|
|
|
|
details: ProfileTimeline
|
2018-10-23 14:20:38 +00:00
|
|
|
},
|
2018-10-23 13:38:03 +00:00
|
|
|
props: true,
|
2018-10-23 14:20:38 +00:00
|
|
|
children: [
|
|
|
|
{
|
|
|
|
path: '',
|
2018-10-26 11:08:46 +00:00
|
|
|
name: 'profile',
|
2018-10-23 14:20:38 +00:00
|
|
|
components: {
|
2018-10-26 08:33:27 +00:00
|
|
|
details: ProfileTimeline
|
2018-10-23 14:20:38 +00:00
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: 'followers',
|
2018-10-26 11:08:46 +00:00
|
|
|
name: 'profile.followers',
|
2018-10-23 14:20:38 +00:00
|
|
|
components: {
|
2018-10-26 08:33:27 +00:00
|
|
|
details: ProfileFollowers
|
|
|
|
}
|
2018-10-23 14:20:38 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
path: 'following',
|
2018-10-26 11:08:46 +00:00
|
|
|
name: 'profile.following',
|
|
|
|
|
2018-10-23 14:20:38 +00:00
|
|
|
components: {
|
2018-10-26 08:33:27 +00:00
|
|
|
details: ProfileFollowers
|
|
|
|
}
|
2018-10-23 14:20:38 +00:00
|
|
|
}
|
|
|
|
]
|
2018-10-23 13:38:03 +00:00
|
|
|
}
|
|
|
|
]
|
2018-10-26 08:33:27 +00:00
|
|
|
})
|