logo

pleroma-fe

My custom branche(s) on git.pleroma.social/pleroma/pleroma-fe git clone https://hacktivis.me/git/pleroma-fe.git

general_tab.js (3160B)


  1. import BooleanSetting from '../helpers/boolean_setting.vue'
  2. import ChoiceSetting from '../helpers/choice_setting.vue'
  3. import ScopeSelector from 'src/components/scope_selector/scope_selector.vue'
  4. import IntegerSetting from '../helpers/integer_setting.vue'
  5. import FloatSetting from '../helpers/float_setting.vue'
  6. import UnitSetting from '../helpers/unit_setting.vue'
  7. import InterfaceLanguageSwitcher from 'src/components/interface_language_switcher/interface_language_switcher.vue'
  8. import SharedComputedObject from '../helpers/shared_computed_object.js'
  9. import ProfileSettingIndicator from '../helpers/profile_setting_indicator.vue'
  10. import { library } from '@fortawesome/fontawesome-svg-core'
  11. import {
  12. faGlobe
  13. } from '@fortawesome/free-solid-svg-icons'
  14. library.add(
  15. faGlobe
  16. )
  17. const GeneralTab = {
  18. data () {
  19. return {
  20. subjectLineOptions: ['email', 'noop', 'masto'].map(mode => ({
  21. key: mode,
  22. value: mode,
  23. label: this.$t(`settings.subject_line_${mode === 'masto' ? 'mastodon' : mode}`)
  24. })),
  25. conversationDisplayOptions: ['tree', 'linear'].map(mode => ({
  26. key: mode,
  27. value: mode,
  28. label: this.$t(`settings.conversation_display_${mode}`)
  29. })),
  30. conversationOtherRepliesButtonOptions: ['below', 'inside'].map(mode => ({
  31. key: mode,
  32. value: mode,
  33. label: this.$t(`settings.conversation_other_replies_button_${mode}`)
  34. })),
  35. mentionLinkDisplayOptions: ['short', 'full_for_remote', 'full'].map(mode => ({
  36. key: mode,
  37. value: mode,
  38. label: this.$t(`settings.mention_link_display_${mode}`)
  39. })),
  40. userPopoverAvatarActionOptions: ['close', 'zoom', 'open'].map(mode => ({
  41. key: mode,
  42. value: mode,
  43. label: this.$t(`settings.user_popover_avatar_action_${mode}`)
  44. })),
  45. loopSilentAvailable:
  46. // Firefox
  47. Object.getOwnPropertyDescriptor(HTMLVideoElement.prototype, 'mozHasAudio') ||
  48. // Chrome-likes
  49. Object.getOwnPropertyDescriptor(HTMLMediaElement.prototype, 'webkitAudioDecodedByteCount') ||
  50. // Future spec, still not supported in Nightly 63 as of 08/2018
  51. Object.getOwnPropertyDescriptor(HTMLMediaElement.prototype, 'audioTracks')
  52. }
  53. },
  54. components: {
  55. BooleanSetting,
  56. ChoiceSetting,
  57. IntegerSetting,
  58. FloatSetting,
  59. UnitSetting,
  60. InterfaceLanguageSwitcher,
  61. ScopeSelector,
  62. ProfileSettingIndicator
  63. },
  64. computed: {
  65. postFormats () {
  66. return this.$store.state.instance.postFormats || []
  67. },
  68. postContentOptions () {
  69. return this.postFormats.map(format => ({
  70. key: format,
  71. value: format,
  72. label: this.$t(`post_status.content_type["${format}"]`)
  73. }))
  74. },
  75. language: {
  76. get: function () { return this.$store.getters.mergedConfig.interfaceLanguage },
  77. set: function (val) {
  78. this.$store.dispatch('setOption', { name: 'interfaceLanguage', value: val })
  79. }
  80. },
  81. ...SharedComputedObject()
  82. },
  83. methods: {
  84. changeDefaultScope (value) {
  85. this.$store.dispatch('setProfileOption', { name: 'defaultScope', value })
  86. }
  87. }
  88. }
  89. export default GeneralTab