2020-09-30 22:43:07 +00:00
|
|
|
import BooleanSetting from '../helpers/boolean_setting.vue'
|
2021-03-11 14:55:14 +00:00
|
|
|
import ChoiceSetting from '../helpers/choice_setting.vue'
|
2022-02-22 21:31:40 +00:00
|
|
|
import ScopeSelector from 'src/components/scope_selector/scope_selector.vue'
|
2022-03-08 01:02:53 +00:00
|
|
|
import IntegerSetting from '../helpers/integer_setting.vue'
|
2020-05-10 03:46:06 +00:00
|
|
|
import InterfaceLanguageSwitcher from 'src/components/interface_language_switcher/interface_language_switcher.vue'
|
|
|
|
|
2020-06-06 21:15:10 +00:00
|
|
|
import SharedComputedObject from '../helpers/shared_computed_object.js'
|
2022-02-22 21:31:40 +00:00
|
|
|
import ServerSideIndicator from '../helpers/server_side_indicator.vue'
|
2020-10-20 18:03:46 +00:00
|
|
|
import { library } from '@fortawesome/fontawesome-svg-core'
|
|
|
|
import {
|
2022-10-06 15:59:16 +00:00
|
|
|
faGlobe, faSync
|
2020-10-20 18:03:46 +00:00
|
|
|
} from '@fortawesome/free-solid-svg-icons'
|
|
|
|
|
|
|
|
library.add(
|
2022-10-06 15:59:16 +00:00
|
|
|
faGlobe,
|
|
|
|
faSync
|
2020-10-20 18:03:46 +00:00
|
|
|
)
|
2020-05-10 03:46:06 +00:00
|
|
|
|
|
|
|
const GeneralTab = {
|
|
|
|
data () {
|
|
|
|
return {
|
2021-03-11 14:55:14 +00:00
|
|
|
subjectLineOptions: ['email', 'noop', 'masto'].map(mode => ({
|
|
|
|
key: mode,
|
|
|
|
value: mode,
|
|
|
|
label: this.$t(`settings.subject_line_${mode === 'masto' ? 'mastodon' : mode}`)
|
|
|
|
})),
|
2022-03-06 18:57:48 +00:00
|
|
|
conversationDisplayOptions: ['tree', 'linear'].map(mode => ({
|
2021-08-07 00:18:27 +00:00
|
|
|
key: mode,
|
|
|
|
value: mode,
|
|
|
|
label: this.$t(`settings.conversation_display_${mode}`)
|
|
|
|
})),
|
2021-09-05 20:35:47 +00:00
|
|
|
conversationOtherRepliesButtonOptions: ['below', 'inside'].map(mode => ({
|
|
|
|
key: mode,
|
|
|
|
value: mode,
|
|
|
|
label: this.$t(`settings.conversation_other_replies_button_${mode}`)
|
|
|
|
})),
|
2022-01-10 06:16:33 +00:00
|
|
|
mentionLinkDisplayOptions: ['short', 'full_for_remote', 'full'].map(mode => ({
|
|
|
|
key: mode,
|
|
|
|
value: mode,
|
|
|
|
label: this.$t(`settings.mention_link_display_${mode}`)
|
|
|
|
})),
|
2022-04-12 18:18:06 +00:00
|
|
|
thirdColumnModeOptions: ['none', 'notifications', 'postform'].map(mode => ({
|
|
|
|
key: mode,
|
|
|
|
value: mode,
|
2022-04-12 19:01:04 +00:00
|
|
|
label: this.$t(`settings.third_column_mode_${mode}`)
|
2022-04-12 18:18:06 +00:00
|
|
|
})),
|
2022-09-05 17:02:16 +00:00
|
|
|
userProfileDefaultTabOptions: ['statuses', 'replies'].map(tab => ({
|
|
|
|
key: tab,
|
|
|
|
value: tab,
|
|
|
|
label: this.$t(`user_card.${tab}`)
|
|
|
|
})),
|
2022-10-06 15:59:16 +00:00
|
|
|
profilesExpanded: false,
|
|
|
|
newProfileName: '',
|
2020-05-10 03:46:06 +00:00
|
|
|
loopSilentAvailable:
|
|
|
|
// Firefox
|
|
|
|
Object.getOwnPropertyDescriptor(HTMLVideoElement.prototype, 'mozHasAudio') ||
|
|
|
|
// Chrome-likes
|
|
|
|
Object.getOwnPropertyDescriptor(HTMLMediaElement.prototype, 'webkitAudioDecodedByteCount') ||
|
|
|
|
// Future spec, still not supported in Nightly 63 as of 08/2018
|
2020-05-25 00:43:55 +00:00
|
|
|
Object.getOwnPropertyDescriptor(HTMLMediaElement.prototype, 'audioTracks')
|
2022-08-29 21:16:59 +00:00
|
|
|
|
2020-05-10 03:46:06 +00:00
|
|
|
}
|
|
|
|
},
|
|
|
|
components: {
|
2020-09-30 22:43:07 +00:00
|
|
|
BooleanSetting,
|
2021-03-11 14:55:14 +00:00
|
|
|
ChoiceSetting,
|
2022-03-08 01:02:53 +00:00
|
|
|
IntegerSetting,
|
2022-02-22 21:31:40 +00:00
|
|
|
InterfaceLanguageSwitcher,
|
|
|
|
ScopeSelector,
|
2022-02-28 16:23:32 +00:00
|
|
|
ServerSideIndicator
|
2020-05-10 03:46:06 +00:00
|
|
|
},
|
|
|
|
computed: {
|
|
|
|
postFormats () {
|
|
|
|
return this.$store.state.instance.postFormats || []
|
|
|
|
},
|
2021-03-11 14:55:14 +00:00
|
|
|
postContentOptions () {
|
|
|
|
return this.postFormats.map(format => ({
|
|
|
|
key: format,
|
|
|
|
value: format,
|
|
|
|
label: this.$t(`post_status.content_type["${format}"]`)
|
|
|
|
}))
|
|
|
|
},
|
2020-05-10 03:46:06 +00:00
|
|
|
instanceSpecificPanelPresent () { return this.$store.state.instance.showInstanceSpecificPanel },
|
2020-12-16 16:25:07 +00:00
|
|
|
instanceWallpaperUsed () {
|
|
|
|
return this.$store.state.instance.background &&
|
|
|
|
!this.$store.state.users.currentUser.background_image
|
|
|
|
},
|
2022-05-22 16:40:59 +00:00
|
|
|
language: {
|
|
|
|
get: function () { return this.$store.getters.mergedConfig.interfaceLanguage },
|
|
|
|
set: function (val) {
|
|
|
|
this.$store.dispatch('setOption', { name: 'interfaceLanguage', value: val })
|
|
|
|
}
|
|
|
|
},
|
2022-10-06 15:59:16 +00:00
|
|
|
settingsProfiles () {
|
|
|
|
return (this.$store.state.instance.settingsProfiles || [])
|
|
|
|
},
|
|
|
|
settingsProfile: {
|
|
|
|
get: function () { return this.$store.getters.mergedConfig.profile },
|
|
|
|
set: function (val) {
|
|
|
|
this.$store.dispatch('setOption', { name: 'profile', value: val })
|
|
|
|
this.$store.dispatch('getSettingsProfile')
|
|
|
|
}
|
|
|
|
},
|
|
|
|
settingsVersion () {
|
|
|
|
return this.$store.getters.mergedConfig.profileVersion
|
|
|
|
},
|
2022-08-30 13:37:36 +00:00
|
|
|
translationLanguages () {
|
2022-11-08 12:25:47 +00:00
|
|
|
const langs = this.$store.state.instance.supportedTranslationLanguages || { source: [] }
|
|
|
|
return langs.source.map(lang => ({ key: lang.code, value: lang.code, label: lang.name }))
|
2022-08-30 13:37:36 +00:00
|
|
|
},
|
2022-08-29 21:16:59 +00:00
|
|
|
translationLanguage: {
|
|
|
|
get: function () { return this.$store.getters.mergedConfig.translationLanguage },
|
|
|
|
set: function (val) {
|
|
|
|
this.$store.dispatch('setOption', { name: 'translationLanguage', value: val })
|
|
|
|
}
|
|
|
|
},
|
2020-05-10 03:46:06 +00:00
|
|
|
...SharedComputedObject()
|
2022-02-22 21:31:40 +00:00
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
changeDefaultScope (value) {
|
|
|
|
this.$store.dispatch('setServerSideOption', { name: 'defaultScope', value })
|
2022-08-29 21:16:59 +00:00
|
|
|
},
|
|
|
|
setTranslationLanguage (value) {
|
|
|
|
this.$store.dispatch('setOption', { name: 'translationLanguage', value })
|
2022-10-06 15:59:16 +00:00
|
|
|
},
|
|
|
|
toggleExpandedSettings () {
|
|
|
|
this.profilesExpanded = !this.profilesExpanded
|
|
|
|
},
|
|
|
|
loadSettingsProfile (name) {
|
|
|
|
this.$store.commit('setOption', { name: 'profile', value: name })
|
|
|
|
this.$store.dispatch('getSettingsProfile', true)
|
|
|
|
},
|
|
|
|
createSettingsProfile () {
|
|
|
|
this.$store.dispatch('setOption', { name: 'profile', value: this.newProfileName })
|
|
|
|
this.$store.dispatch('setOption', { name: 'profileVersion', value: 1 })
|
|
|
|
this.$store.dispatch('syncSettings')
|
|
|
|
this.newProfileName = ''
|
|
|
|
},
|
|
|
|
forceSync () {
|
|
|
|
this.$store.dispatch('getSettingsProfile')
|
|
|
|
},
|
|
|
|
refreshProfiles () {
|
|
|
|
this.$store.dispatch('listSettingsProfiles')
|
|
|
|
},
|
|
|
|
deleteSettingsProfile (name) {
|
|
|
|
if (confirm(this.$t('settings.settings_profile_delete_confirm'))) {
|
|
|
|
this.$store.dispatch('deleteSettingsProfile', name)
|
|
|
|
}
|
2022-02-22 21:31:40 +00:00
|
|
|
}
|
2020-05-10 03:46:06 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export default GeneralTab
|