logo

pleroma-fe

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

media_upload.vue (1008B)


  1. <template>
  2. <button
  3. class="media-upload"
  4. :class="[normalButton ? 'button-default btn' : 'button-unstyled', { disabled }]"
  5. :title="$t('tool_tip.media_upload')"
  6. @click="onClick"
  7. >
  8. <FAIcon
  9. v-if="uploading"
  10. class="progress-icon"
  11. icon="circle-notch"
  12. spin
  13. />
  14. <FAIcon
  15. v-if="!uploading"
  16. class="new-icon"
  17. icon="upload"
  18. />
  19. <template v-if="normalButton">
  20. {{ ' ' }}
  21. {{ uploading ? $t('general.loading') : $t('tool_tip.media_upload') }}
  22. </template>
  23. <input
  24. v-if="uploadReady"
  25. ref="input"
  26. class="hidden-input-file"
  27. :disabled="disabled"
  28. type="file"
  29. multiple="true"
  30. :accept="acceptTypes"
  31. @change="change"
  32. >
  33. </button>
  34. </template>
  35. <script src="./media_upload.js"></script>
  36. <style lang="scss">
  37. .media-upload {
  38. .hidden-input-file {
  39. display: none;
  40. }
  41. }
  42. label.media-upload {
  43. cursor: pointer; // We use <label> for interactivity... i wonder if it's fine
  44. }
  45. </style>