diff options
| author | scarlett <nia@netbsd.org> | 2018-10-16 14:09:29 +0100 |
|---|---|---|
| committer | scarlett <nia@netbsd.org> | 2018-10-16 14:09:29 +0100 |
| commit | 4cc1ed6171b7fc0e8dc793fbb80e0a63cf83ec40 (patch) | |
| tree | a740845efd742f1a9f1b1a1f0543d996fcb923c2 /src/modules/instance.js | |
| parent | 145929207ef9204066b03ab104284168a054b5f0 (diff) | |
| parent | f554edc054fcb6e0508ed5da7dc9edf1a85d2305 (diff) | |
Merge branch 'develop' of git.pleroma.social:pleroma/pleroma-fe into hide-statistics
Diffstat (limited to 'src/modules/instance.js')
| -rw-r--r-- | src/modules/instance.js | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/src/modules/instance.js b/src/modules/instance.js new file mode 100644 index 00000000..d61ca842 --- /dev/null +++ b/src/modules/instance.js @@ -0,0 +1,65 @@ +import { set } from 'vue' +import StyleSetter from '../services/style_setter/style_setter.js' + +const defaultState = { + // Stuff from static/config.json and apiConfig + name: 'Pleroma FE', + registrationOpen: true, + textlimit: 5000, + server: 'http://localhost:4040/', + theme: 'pleroma-dark', + background: '/static/aurora_borealis.jpg', + logo: '/static/logo.png', + logoMask: true, + logoMargin: '.2em', + redirectRootNoLogin: '/main/all', + redirectRootLogin: '/main/friends', + showInstanceSpecificPanel: false, + scopeOptionsEnabled: true, + formattingOptionsEnabled: false, + collapseMessageWithSubject: false, + hidePostStats: false, + hideUserStats: false, + disableChat: false, + + // Nasty stuff + pleromaBackend: true, + emoji: [], + customEmoji: [], + + // Feature-set, apparently, not everything here is reported... + mediaProxyAvailable: false, + chatAvailable: false, + gopherAvailable: false, + suggestionsEnabled: false, + suggestionsWeb: '', + + // Html stuff + instanceSpecificPanelContent: '', + tos: '' +} + +const instance = { + state: defaultState, + mutations: { + setInstanceOption (state, { name, value }) { + if (typeof value !== 'undefined') { + set(state, name, value) + } + } + }, + actions: { + setInstanceOption ({ commit, dispatch }, { name, value }) { + commit('setInstanceOption', {name, value}) + switch (name) { + case 'name': + dispatch('setPageTitle') + break + case 'theme': + StyleSetter.setPreset(value, commit) + } + } + } +} + +export default instance |
