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


  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 SizeSetting, { defaultHorizontalUnits } from '../helpers/size_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. thirdColumnModeOptions: ['none', 'notifications', 'postform'].map(mode => ({
  41. key: mode,
  42. value: mode,
  43. label: this.$t(`settings.third_column_mode_${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. 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. SizeSetting,
  65. InterfaceLanguageSwitcher,
  66. ScopeSelector,
  67. ProfileSettingIndicator
  68. },
  69. computed: {
  70. horizontalUnits () {
  71. return defaultHorizontalUnits
  72. },
  73. postFormats () {
  74. return this.$store.state.instance.postFormats || []
  75. },
  76. postContentOptions () {
  77. return this.postFormats.map(format => ({
  78. key: format,
  79. value: format,
  80. label: this.$t(`post_status.content_type["${format}"]`)
  81. }))
  82. },
  83. columns () {
  84. const mode = this.$store.getters.mergedConfig.thirdColumnMode
  85. const notif = mode === 'none' ? [] : ['notifs']
  86. if (this.$store.getters.mergedConfig.sidebarRight || mode === 'postform') {
  87. return [...notif, 'content', 'sidebar']
  88. } else {
  89. return ['sidebar', 'content', ...notif]
  90. }
  91. },
  92. instanceSpecificPanelPresent () { return this.$store.state.instance.showInstanceSpecificPanel },
  93. instanceWallpaperUsed () {
  94. return this.$store.state.instance.background &&
  95. !this.$store.state.users.currentUser.background_image
  96. },
  97. instanceShoutboxPresent () { return this.$store.state.instance.shoutAvailable },
  98. language: {
  99. get: function () { return this.$store.getters.mergedConfig.interfaceLanguage },
  100. set: function (val) {
  101. this.$store.dispatch('setOption', { name: 'interfaceLanguage', value: val })
  102. }
  103. },
  104. ...SharedComputedObject()
  105. },
  106. methods: {
  107. changeDefaultScope (value) {
  108. this.$store.dispatch('setProfileOption', { name: 'defaultScope', value })
  109. }
  110. }
  111. }
  112. export default GeneralTab