message_media.html 4.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. <!-- Thumbnail -->
  2. <!-- Images, Gifs & Videos -->
  3. <span class="in-view-indicator" ng-if="ctrl.type !== 'location'" in-view="ctrl.thumbnailInView($inview)"></span>
  4. <div ng-if="ctrl.uploading">
  5. <!-- Loading indicator -->
  6. <div class="circle active center">
  7. <i class="material-icons md-24">file_upload</i>
  8. <div class="loading active"></div>
  9. </div>
  10. </div>
  11. <div ng-if="!ctrl.uploading">
  12. <div ng-if="ctrl.showThumbnail" class="thumbnail {{ ctrl.type }}" ng-click="ctrl.download()" ng-style="ctrl.thumbnailStyle">
  13. <!-- Loading indicator -->
  14. <div class="loading-wrapper" ng-class="{active: ctrl.downloading || ctrl.thumbnailDownloading}">
  15. <div class="loading"></div>
  16. <div class="loading-text" translate>messenger.DOWNLOADING</div>
  17. </div>
  18. <!-- Thumbnail overlays for videos and GIFs -->
  19. <div class="overlay video" ng-if="ctrl.type === 'video' && !ctrl.downloading">
  20. <i class="material-icons md-light">play_circle_outline</i>
  21. </div>
  22. <div class="overlay gif" ng-if="ctrl.type === 'file' && ctrl.message.file.type === 'image/gif' && !ctrl.downloading">
  23. <i class="material-icons md-light">play_circle_outline</i>
  24. </div>
  25. <!-- Thumbnails -->
  26. <img ng-if="ctrl.thumbnail !== null" ng-src="{{ctrl.thumbnail}}">
  27. <div ng-if="ctrl.message.thumbnail != undefined" class="thumbnail-loader">
  28. <img ng-src="{{ ctrl.message.thumbnail.preview | bufferToUrl: 'image/png' }}">
  29. </div>
  30. </div>
  31. <!-- Location -->
  32. <location ng-if="ctrl.type === 'location'" location="ctrl.location" ng-click="ctrl.openMapLink()"></location>
  33. <!-- Audio file -->
  34. <div class="file-message" ng-if="ctrl.type === 'audio'" ng-click="ctrl.download()">
  35. <!-- Loading indicator -->
  36. <div class="circle"
  37. ng-class="{active: !ctrl.downloading}"
  38. ng-if="!ctrl.downloaded">
  39. <i class="material-icons md-24">file_download</i>
  40. <div class="loading" ng-class="{active: ctrl.downloading}"></div>
  41. </div>
  42. <!-- Play Indicator -->
  43. <div class="circle" ng-click="ctrl.download()" ng-if="ctrl.downloaded">
  44. <i class="material-icons md-24">play_arrow</i>
  45. </div>
  46. <div class="info" translate>messageTypes.AUDIO_MESSAGE</div>
  47. </div>
  48. <!-- Anim GIF -->
  49. <div class="animgif" ng-if="ctrl.downloaded && ctrl.isAnimGif">
  50. <img ng-src="{{ ctrl.blobBuffer | bufferToUrl: 'image/gif'}}" />
  51. </div>
  52. <!-- Other file messages -->
  53. <div class="file-message" ng-if="ctrl.type === 'file' && !ctrl.isAnimGif" ng-click="ctrl.download()">
  54. <!-- Loading indicator -->
  55. <div class="circle"
  56. ng-class="{active: !ctrl.downloading}"
  57. ng-if="!ctrl.downloaded"
  58. ng-style="{'background-image': 'url({{ctrl.message.thumbnail.preview | bufferToUrl: 'image/png'}})' }">
  59. <i class="material-icons md-24">file_download</i>
  60. <div class="loading" ng-class="{active: ctrl.downloading}"></div>
  61. </div>
  62. <!-- File type indicator -->
  63. <div class="circle"
  64. ng-if="ctrl.downloaded && ctrl.message.thumbnail.preview !== undefined"
  65. ng-style="{'background-image': 'url({{ctrl.message.thumbnail.preview | bufferToUrl: 'image/png'}})' }">
  66. </div>
  67. <div class="circle"
  68. ng-if="ctrl.downloaded && ctrl.message.thumbnail.preview == undefined">
  69. <img ng-src="{{ ctrl.message.file.type | mimeTypeIcon }}"/>
  70. </div>
  71. <!-- File information -->
  72. <div class="info">
  73. <p>{{ctrl.message.file.name}}</p>
  74. <p>{{ctrl.message.file.type | mimeTypeLabel}}</p>
  75. <p>{{ctrl.message.file.size | fileSize}}</p>
  76. </div>
  77. </div>
  78. </div>
  79. <!-- Ballot -->
  80. <span ng-if="ctrl.type === 'ballot'"><em translate>messenger.BALLOT_MESSAGES_NOT_SUPPORTED</em></span> <!-- TODO -->
  81. <span ng-if="ctrl.type === 'unknown'"><em translate>messenger.UNKNOWN_MESSAGE_TYPE</em></span> <!-- TODO -->