Merge branch 'proper-attachments' into shigusegubu
* proper-attachments: better attachments in uploading (grid layout) better handling of unknown files, better upload display better compact attachments merged in compact notifs and improved upon it gallery in post status form! gallery now supports flash, fixes for flash component. refactored media modal refactored attachments and gallery. All attachments now are in gallery. Use proper setting name Use cleaner instance config check for shoutbox setting Make locale language cleaner Don't shorten shoutbox to SB Fix lint error Update CHANGELOG.md New option: Hide shoutbox compact notifs
This commit is contained in:
commit
08ce9ba30b
20 changed files with 640 additions and 534 deletions
|
|
@ -1,4 +1,5 @@
|
|||
import fileTypeService from '../services/file_type/file_type.service.js'
|
||||
const supportedTypes = new Set(['image', 'video', 'audio', 'flash'])
|
||||
|
||||
const mediaViewer = {
|
||||
state: {
|
||||
|
|
@ -10,7 +11,7 @@ const mediaViewer = {
|
|||
setMedia (state, media) {
|
||||
state.media = media
|
||||
},
|
||||
setCurrent (state, index) {
|
||||
setCurrentMedia (state, index) {
|
||||
state.activated = true
|
||||
state.currentIndex = index
|
||||
},
|
||||
|
|
@ -22,13 +23,13 @@ const mediaViewer = {
|
|||
setMedia ({ commit }, attachments) {
|
||||
const media = attachments.filter(attachment => {
|
||||
const type = fileTypeService.fileType(attachment.mimetype)
|
||||
return type === 'image' || type === 'video' || type === 'audio'
|
||||
return supportedTypes.has(type)
|
||||
})
|
||||
commit('setMedia', media)
|
||||
},
|
||||
setCurrent ({ commit, state }, current) {
|
||||
setCurrentMedia ({ commit, state }, current) {
|
||||
const index = state.media.indexOf(current)
|
||||
commit('setCurrent', index || 0)
|
||||
commit('setCurrentMedia', index || 0)
|
||||
},
|
||||
closeMediaViewer ({ commit }) {
|
||||
commit('close')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue