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 (3717B)


  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. absoluteTime12hOptions: ['24h', '12h'].map(mode => ({
  31. key: mode,
  32. value: mode,
  33. label: this.$t(`settings.absolute_time_format_12h_${mode}`)
  34. })),
  35. conversationOtherRepliesButtonOptions: ['below', 'inside'].map(mode => ({
  36. key: mode,
  37. value: mode,
  38. label: this.$t(`settings.conversation_other_replies_button_${mode}`)
  39. })),
  40. mentionLinkDisplayOptions: ['short', 'full_for_remote', 'full'].map(mode => ({
  41. key: mode,
  42. value: mode,
  43. label: this.$t(`settings.mention_link_display_${mode}`)
  44. })),
  45. userPopoverAvatarActionOptions: ['close', 'zoom', 'open'].map(mode => ({
  46. key: mode,
  47. value: mode,
  48. label: this.$t(`settings.user_popover_avatar_action_${mode}`)
  49. })),
  50. unsavedPostActionOptions: ['save', 'discard', 'confirm'].map(mode => ({
  51. key: mode,
  52. value: mode,
  53. label: this.$t(`settings.unsaved_post_action_${mode}`)
  54. })),
  55. loopSilentAvailable:
  56. // Firefox
  57. Object.getOwnPropertyDescriptor(HTMLVideoElement.prototype, 'mozHasAudio') ||
  58. // Chrome-likes
  59. Object.getOwnPropertyDescriptor(HTMLMediaElement.prototype, 'webkitAudioDecodedByteCount') ||
  60. // Future spec, still not supported in Nightly 63 as of 08/2018
  61. Object.getOwnPropertyDescriptor(HTMLMediaElement.prototype, 'audioTracks')
  62. }
  63. },
  64. components: {
  65. BooleanSetting,
  66. ChoiceSetting,
  67. IntegerSetting,
  68. FloatSetting,
  69. UnitSetting,
  70. InterfaceLanguageSwitcher,
  71. ScopeSelector,
  72. ProfileSettingIndicator
  73. },
  74. computed: {
  75. postFormats () {
  76. return this.$store.state.instance.postFormats || []
  77. },
  78. postContentOptions () {
  79. return this.postFormats.map(format => ({
  80. key: format,
  81. value: format,
  82. label: this.$t(`post_status.content_type["${format}"]`)
  83. }))
  84. },
  85. language: {
  86. get: function () { return this.$store.getters.mergedConfig.interfaceLanguage },
  87. set: function (val) {
  88. this.$store.dispatch('setOption', { name: 'interfaceLanguage', value: val })
  89. }
  90. },
  91. instanceShoutboxPresent () { return this.$store.state.instance.shoutAvailable },
  92. instanceSpecificPanelPresent () { return this.$store.state.instance.showInstanceSpecificPanel },
  93. ...SharedComputedObject()
  94. },
  95. methods: {
  96. changeDefaultScope (value) {
  97. this.$store.dispatch('setProfileOption', { name: 'defaultScope', value })
  98. }
  99. }
  100. }
  101. export default GeneralTab