logo

pleroma-fe

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

font_control.js (1251B)


  1. import Select from '../select/select.vue'
  2. import Checkbox from 'src/components/checkbox/checkbox.vue'
  3. import Popover from 'src/components/popover/popover.vue'
  4. import { library } from '@fortawesome/fontawesome-svg-core'
  5. import {
  6. faExclamationTriangle,
  7. faKeyboard,
  8. faFont
  9. } from '@fortawesome/free-solid-svg-icons'
  10. library.add(
  11. faExclamationTriangle,
  12. faKeyboard,
  13. faFont
  14. )
  15. export default {
  16. components: {
  17. Select,
  18. Checkbox,
  19. Popover
  20. },
  21. props: [
  22. 'name', 'label', 'modelValue', 'fallback', 'options', 'no-inherit'
  23. ],
  24. mounted () {
  25. this.$store.dispatch('queryLocalFonts')
  26. },
  27. emits: ['update:modelValue'],
  28. data () {
  29. return {
  30. manualEntry: false,
  31. availableOptions: [
  32. this.noInherit ? '' : 'inherit',
  33. 'serif',
  34. 'sans-serif',
  35. 'monospace',
  36. ...(this.options || [])
  37. ].filter(_ => _)
  38. }
  39. },
  40. methods: {
  41. toggleManualEntry () {
  42. this.manualEntry = !this.manualEntry
  43. }
  44. },
  45. computed: {
  46. present () {
  47. return typeof this.modelValue !== 'undefined'
  48. },
  49. localFontsList () {
  50. return this.$store.state.interface.localFonts
  51. },
  52. localFontsSize () {
  53. return this.$store.state.interface.localFonts?.length
  54. }
  55. }
  56. }