2018-09-10 04:21:23 +10:00
|
|
|
import { set } from 'vue'
|
2018-09-18 01:54:08 +10:00
|
|
|
import StyleSetter from '../services/style_setter/style_setter.js'
|
2018-09-10 04:21:23 +10:00
|
|
|
|
|
|
|
const defaultState = {
|
2018-09-10 04:51:40 +10:00
|
|
|
// Stuff from static/config.json and apiConfig
|
2018-09-10 04:21:23 +10:00
|
|
|
name: 'Pleroma FE',
|
|
|
|
registrationOpen: true,
|
|
|
|
textlimit: 5000,
|
|
|
|
server: 'http://localhost:4040/',
|
|
|
|
theme: 'pleroma-dark',
|
2018-09-18 01:54:08 +10:00
|
|
|
background: '/static/aurora_borealis.jpg',
|
2018-09-10 04:21:23 +10:00
|
|
|
logo: '/static/logo.png',
|
|
|
|
logoMask: true,
|
|
|
|
logoMargin: '.2em',
|
|
|
|
redirectRootNoLogin: '/main/all',
|
|
|
|
redirectRootLogin: '/main/friends',
|
|
|
|
showInstanceSpecificPanel: false,
|
|
|
|
scopeOptionsEnabled: true,
|
|
|
|
formattingOptionsEnabled: false,
|
2018-12-03 14:47:35 +11:00
|
|
|
alwaysShowSubjectInput: true,
|
2018-09-10 04:21:23 +10:00
|
|
|
collapseMessageWithSubject: false,
|
2018-10-17 00:09:29 +11:00
|
|
|
hidePostStats: false,
|
|
|
|
hideUserStats: false,
|
2018-09-10 04:21:23 +10:00
|
|
|
disableChat: false,
|
2018-09-25 22:16:26 +10:00
|
|
|
scopeCopy: true,
|
2018-09-25 21:47:02 +10:00
|
|
|
subjectLineBehavior: 'email',
|
2018-11-08 02:56:12 +11:00
|
|
|
loginMethod: 'password',
|
2018-09-10 04:51:40 +10:00
|
|
|
|
2018-09-10 04:21:23 +10:00
|
|
|
// Nasty stuff
|
|
|
|
pleromaBackend: true,
|
2018-09-10 04:51:40 +10:00
|
|
|
emoji: [],
|
2018-09-10 04:21:23 +10:00
|
|
|
customEmoji: [],
|
2018-09-10 04:51:40 +10:00
|
|
|
|
|
|
|
// Feature-set, apparently, not everything here is reported...
|
|
|
|
mediaProxyAvailable: false,
|
|
|
|
chatAvailable: false,
|
|
|
|
gopherAvailable: false,
|
|
|
|
suggestionsEnabled: false,
|
|
|
|
suggestionsWeb: '',
|
|
|
|
|
2018-09-10 04:21:23 +10:00
|
|
|
// Html stuff
|
|
|
|
instanceSpecificPanelContent: '',
|
|
|
|
tos: ''
|
|
|
|
}
|
|
|
|
|
|
|
|
const instance = {
|
|
|
|
state: defaultState,
|
|
|
|
mutations: {
|
|
|
|
setInstanceOption (state, { name, value }) {
|
2018-09-18 01:54:08 +10:00
|
|
|
if (typeof value !== 'undefined') {
|
|
|
|
set(state, name, value)
|
|
|
|
}
|
2018-09-10 04:21:23 +10:00
|
|
|
}
|
|
|
|
},
|
|
|
|
actions: {
|
|
|
|
setInstanceOption ({ commit, dispatch }, { name, value }) {
|
|
|
|
commit('setInstanceOption', {name, value})
|
|
|
|
switch (name) {
|
|
|
|
case 'name':
|
|
|
|
dispatch('setPageTitle')
|
|
|
|
break
|
2018-09-18 01:54:08 +10:00
|
|
|
case 'theme':
|
|
|
|
StyleSetter.setPreset(value, commit)
|
2018-09-10 04:21:23 +10:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export default instance
|