logo

pleroma-fe

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

general_tab.js (3538B)


  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. unsavedPostActionOptions: ['save', 'discard', 'confirm'].map(mode => ({
  46. key: mode,
  47. value: mode,
  48. label: this.$t(`settings.unsaved_post_action_${mode}`)
  49. })),
  50. loopSilentAvailable:
  51. // Firefox
  52. Object.getOwnPropertyDescriptor(HTMLVideoElement.prototype, 'mozHasAudio') ||
  53. // Chrome-likes
  54. Object.getOwnPropertyDescriptor(HTMLMediaElement.prototype, 'webkitAudioDecodedByteCount') ||
  55. // Future spec, still not supported in Nightly 63 as of 08/2018
  56. Object.getOwnPropertyDescriptor(HTMLMediaElement.prototype, 'audioTracks')
  57. }
  58. },
  59. components: {
  60. BooleanSetting,
  61. ChoiceSetting,
  62. IntegerSetting,
  63. FloatSetting,
  64. UnitSetting,
  65. InterfaceLanguageSwitcher,
  66. ScopeSelector,
  67. ProfileSettingIndicator
  68. },
  69. computed: {
  70. postFormats () {
  71. return this.$store.state.instance.postFormats || []
  72. },
  73. postContentOptions () {
  74. return this.postFormats.map(format => ({
  75. key: format,
  76. value: format,
  77. label: this.$t(`post_status.content_type["${format}"]`)
  78. }))
  79. },
  80. language: {
  81. get: function () { return this.$store.getters.mergedConfig.interfaceLanguage },
  82. set: function (val) {
  83. this.$store.dispatch('setOption', { name: 'interfaceLanguage', value: val })
  84. }
  85. },
  86. instanceShoutboxPresent () { return this.$store.state.instance.shoutAvailable },
  87. instanceSpecificPanelPresent () { return this.$store.state.instance.showInstanceSpecificPanel },
  88. ...SharedComputedObject()
  89. },
  90. methods: {
  91. changeDefaultScope (value) {
  92. this.$store.dispatch('setProfileOption', { name: 'defaultScope', value })
  93. }
  94. }
  95. }
  96. export default GeneralTab