editor-modal-editorselect.vue 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. <template lang='pug'>
  2. v-dialog(v-model='isShown', persistent, max-width='700')
  3. v-card.radius-7(color='blue darken-3', dark)
  4. v-card-text.text-center.py-4
  5. .subtitle-1.white--text {{$t('editor:select.title')}}
  6. v-container(grid-list-lg, fluid)
  7. v-layout(row, wrap, justify-center)
  8. v-flex(xs4)
  9. v-card.radius-7.grey(
  10. hover
  11. light
  12. ripple
  13. disabled
  14. )
  15. v-card-text.text-center(@click='selectEditor("api")')
  16. img(src='/svg/icon-rest-api.svg', alt='API', style='width: 36px;')
  17. .body-2.mt-2.grey--text.text--darken-2 API Docs
  18. .caption.grey--text.text--darken-1 REST / GraphQL
  19. v-flex(xs4)
  20. v-card.radius-7.grey(
  21. hover
  22. light
  23. ripple
  24. disabled
  25. )
  26. v-card-text.text-center(@click='selectEditor("code")')
  27. img(src='/svg/icon-source-code.svg', alt='Code', style='width: 36px;')
  28. .body-2.mt-2.grey--text.text--darken-2 Code
  29. .caption.grey--text.text--darken-1 Raw HTML
  30. v-flex(xs4)
  31. v-card.radius-7(
  32. hover
  33. light
  34. ripple
  35. )
  36. v-card-text.text-center(@click='selectEditor("markdown")')
  37. img(src='/svg/icon-markdown.svg', alt='Markdown', style='width: 36px;')
  38. .primary--text.body-2.mt-2 Markdown
  39. .caption.grey--text Default
  40. v-flex(xs4)
  41. v-card.radius-7.grey(
  42. hover
  43. light
  44. ripple
  45. disabled
  46. )
  47. v-card-text.text-center(@click='selectEditor("tabular")')
  48. img(src='/svg/icon-table.svg', alt='Tabular', style='width: 36px;')
  49. .body-2.grey--text.mt-2.text--darken-2 Tabular
  50. .caption.grey--text.text--darken-1 Excel-like
  51. //- v-flex(xs4)
  52. //- v-card.radius-7.grey(
  53. //- hover
  54. //- light
  55. //- ripple
  56. //- disabled
  57. //- )
  58. //- v-card-text.text-center(@click='selectEditor("wysiwyg")')
  59. //- img(src='/svg/icon-open-in-browser.svg', alt='Visual Builder', style='width: 36px;')
  60. //- .body-2.mt-2.grey--text.text--darken-2 Visual Builder
  61. //- .caption.grey--text.text--darken-1 Drag-n-drop
  62. v-flex(xs4)
  63. v-card.radius-7(
  64. hover
  65. light
  66. ripple
  67. )
  68. v-card-text.text-center(@click='selectEditor("ckeditor")')
  69. img(src='/svg/icon-open-in-browser.svg', alt='Visual Editor', style='width: 36px;')
  70. .body-2.mt-2.primary--text Visual Editor
  71. .caption.grey--text Rich-text WYSIWYG
  72. v-flex(xs4)
  73. v-card.radius-7.grey(
  74. hover
  75. light
  76. ripple
  77. disabled
  78. )
  79. v-card-text.text-center(@click='selectEditor("wikitext")')
  80. img(src='/svg/icon-news.svg', alt='WikiText', style='width: 36px;')
  81. .body-2.grey--text.mt-2.text--darken-2 WikiText
  82. .caption.grey--text.text--darken-1 MediaWiki Format
  83. .caption.blue--text.text--lighten-2 {{$t('editor:select.cannotChange')}}
  84. </template>
  85. <script>
  86. import _ from 'lodash'
  87. import { sync } from 'vuex-pathify'
  88. export default {
  89. props: {
  90. value: {
  91. type: Boolean,
  92. default: false
  93. }
  94. },
  95. data() {
  96. return { }
  97. },
  98. computed: {
  99. isShown: {
  100. get() { return this.value },
  101. set(val) { this.$emit('input', val) }
  102. },
  103. currentEditor: sync('editor/editor')
  104. },
  105. methods: {
  106. selectEditor(name) {
  107. this.currentEditor = `editor${_.startCase(name)}`
  108. this.isShown = false
  109. }
  110. }
  111. }
  112. </script>
  113. <style lang='scss'>
  114. </style>