|
|
@ -12,11 +12,13 @@ import UserProfile from './components/user_profile/user_profile.vue'
|
|
|
|
import Settings from './components/settings/settings.vue'
|
|
|
|
import Settings from './components/settings/settings.vue'
|
|
|
|
import Registration from './components/registration/registration.vue'
|
|
|
|
import Registration from './components/registration/registration.vue'
|
|
|
|
import UserSettings from './components/user_settings/user_settings.vue'
|
|
|
|
import UserSettings from './components/user_settings/user_settings.vue'
|
|
|
|
|
|
|
|
import Chat from './components/chat/chat.vue'
|
|
|
|
|
|
|
|
|
|
|
|
import statusesModule from './modules/statuses.js'
|
|
|
|
import statusesModule from './modules/statuses.js'
|
|
|
|
import usersModule from './modules/users.js'
|
|
|
|
import usersModule from './modules/users.js'
|
|
|
|
import apiModule from './modules/api.js'
|
|
|
|
import apiModule from './modules/api.js'
|
|
|
|
import configModule from './modules/config.js'
|
|
|
|
import configModule from './modules/config.js'
|
|
|
|
|
|
|
|
import chatModule from './modules/chat.js'
|
|
|
|
|
|
|
|
|
|
|
|
import VueTimeago from 'vue-timeago'
|
|
|
|
import VueTimeago from 'vue-timeago'
|
|
|
|
import VueI18n from 'vue-i18n'
|
|
|
|
import VueI18n from 'vue-i18n'
|
|
|
@ -57,14 +59,35 @@ const store = new Vuex.Store({
|
|
|
|
statuses: statusesModule,
|
|
|
|
statuses: statusesModule,
|
|
|
|
users: usersModule,
|
|
|
|
users: usersModule,
|
|
|
|
api: apiModule,
|
|
|
|
api: apiModule,
|
|
|
|
config: configModule
|
|
|
|
config: configModule,
|
|
|
|
|
|
|
|
chat: chatModule
|
|
|
|
},
|
|
|
|
},
|
|
|
|
plugins: [createPersistedState(persistedStateOptions)],
|
|
|
|
plugins: [createPersistedState(persistedStateOptions)],
|
|
|
|
strict: process.env.NODE_ENV !== 'production'
|
|
|
|
strict: false // Socket modifies itself, let's ignore this for now.
|
|
|
|
|
|
|
|
// strict: process.env.NODE_ENV !== 'production'
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const i18n = new VueI18n({
|
|
|
|
|
|
|
|
locale: currentLocale,
|
|
|
|
|
|
|
|
fallbackLocale: 'en',
|
|
|
|
|
|
|
|
messages
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
window.fetch('/static/config.json')
|
|
|
|
|
|
|
|
.then((res) => res.json())
|
|
|
|
|
|
|
|
.then((data) => {
|
|
|
|
|
|
|
|
const {name, theme, background, logo, registrationOpen} = data
|
|
|
|
|
|
|
|
store.dispatch('setOption', { name: 'name', value: name })
|
|
|
|
|
|
|
|
store.dispatch('setOption', { name: 'theme', value: theme })
|
|
|
|
|
|
|
|
store.dispatch('setOption', { name: 'background', value: background })
|
|
|
|
|
|
|
|
store.dispatch('setOption', { name: 'logo', value: logo })
|
|
|
|
|
|
|
|
store.dispatch('setOption', { name: 'registrationOpen', value: registrationOpen })
|
|
|
|
|
|
|
|
if (data['chatDisabled']) {
|
|
|
|
|
|
|
|
store.dispatch('disableChat')
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
const routes = [
|
|
|
|
const routes = [
|
|
|
|
{ name: 'root', path: '/', redirect: '/main/all' },
|
|
|
|
{ name: 'root', path: '/', redirect: data['defaultPath'] || '/main/all' },
|
|
|
|
{ path: '/main/all', component: PublicAndExternalTimeline },
|
|
|
|
{ path: '/main/all', component: PublicAndExternalTimeline },
|
|
|
|
{ path: '/main/public', component: PublicTimeline },
|
|
|
|
{ path: '/main/public', component: PublicTimeline },
|
|
|
|
{ path: '/main/friends', component: FriendsTimeline },
|
|
|
|
{ path: '/main/friends', component: FriendsTimeline },
|
|
|
@ -74,7 +97,8 @@ const routes = [
|
|
|
|
{ name: 'mentions', path: '/:username/mentions', component: Mentions },
|
|
|
|
{ name: 'mentions', path: '/:username/mentions', component: Mentions },
|
|
|
|
{ name: 'settings', path: '/settings', component: Settings },
|
|
|
|
{ name: 'settings', path: '/settings', component: Settings },
|
|
|
|
{ name: 'registration', path: '/registration', component: Registration },
|
|
|
|
{ name: 'registration', path: '/registration', component: Registration },
|
|
|
|
{ name: 'user-settings', path: '/user-settings', component: UserSettings }
|
|
|
|
{ name: 'user-settings', path: '/user-settings', component: UserSettings },
|
|
|
|
|
|
|
|
{ name: 'chat', path: '/chat', component: Chat }
|
|
|
|
]
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
|
|
const router = new VueRouter({
|
|
|
|
const router = new VueRouter({
|
|
|
@ -88,12 +112,6 @@ const router = new VueRouter({
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
const i18n = new VueI18n({
|
|
|
|
|
|
|
|
locale: currentLocale,
|
|
|
|
|
|
|
|
fallbackLocale: 'en',
|
|
|
|
|
|
|
|
messages
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* eslint-disable no-new */
|
|
|
|
/* eslint-disable no-new */
|
|
|
|
new Vue({
|
|
|
|
new Vue({
|
|
|
|
router,
|
|
|
|
router,
|
|
|
@ -102,15 +120,6 @@ new Vue({
|
|
|
|
el: '#app',
|
|
|
|
el: '#app',
|
|
|
|
render: h => h(App)
|
|
|
|
render: h => h(App)
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
window.fetch('/static/config.json')
|
|
|
|
|
|
|
|
.then((res) => res.json())
|
|
|
|
|
|
|
|
.then(({name, theme, background, logo, registrationOpen}) => {
|
|
|
|
|
|
|
|
store.dispatch('setOption', { name: 'name', value: name })
|
|
|
|
|
|
|
|
store.dispatch('setOption', { name: 'theme', value: theme })
|
|
|
|
|
|
|
|
store.dispatch('setOption', { name: 'background', value: background })
|
|
|
|
|
|
|
|
store.dispatch('setOption', { name: 'logo', value: logo })
|
|
|
|
|
|
|
|
store.dispatch('setOption', { name: 'registrationOpen', value: registrationOpen })
|
|
|
|
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
window.fetch('/static/terms-of-service.html')
|
|
|
|
window.fetch('/static/terms-of-service.html')
|
|
|
@ -120,13 +129,19 @@ window.fetch('/static/terms-of-service.html')
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
window.fetch('/api/pleroma/emoji.json')
|
|
|
|
window.fetch('/api/pleroma/emoji.json')
|
|
|
|
.then((res) => res.json())
|
|
|
|
.then(
|
|
|
|
.then((values) => {
|
|
|
|
(res) => res.json()
|
|
|
|
|
|
|
|
.then(
|
|
|
|
|
|
|
|
(values) => {
|
|
|
|
const emoji = Object.keys(values).map((key) => {
|
|
|
|
const emoji = Object.keys(values).map((key) => {
|
|
|
|
return { shortcode: key, image_url: values[key] }
|
|
|
|
return { shortcode: key, image_url: values[key] }
|
|
|
|
})
|
|
|
|
})
|
|
|
|
store.dispatch('setOption', { name: 'customEmoji', value: emoji })
|
|
|
|
store.dispatch('setOption', { name: 'emoji', value: emoji })
|
|
|
|
})
|
|
|
|
},
|
|
|
|
|
|
|
|
(failure) => {}
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
(error) => console.log(error)
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
window.fetch('/static/emoji.json')
|
|
|
|
window.fetch('/static/emoji.json')
|
|
|
|
.then((res) => res.json())
|
|
|
|
.then((res) => res.json())
|
|
|
|