mirror of
https://github.com/bellingcat/ukraine-timemap.git
synced 2026-06-11 21:08:36 +03:00
enables inline PDFs for sources
This commit is contained in:
@@ -153,17 +153,24 @@ export function selectTypeFromPath (path) {
|
||||
return { type, path }
|
||||
}
|
||||
|
||||
export function selectTypeFromPathWithPoster (path, poster) {
|
||||
export function typeForPath (path) {
|
||||
let type
|
||||
path = path.trim()
|
||||
switch (true) {
|
||||
case /\.(png|jpg)$/.test(path):
|
||||
case /\.((png)|(jpg))$/.test(path):
|
||||
type = 'Image'; break
|
||||
case /\.(mp4)$/.test(path):
|
||||
type = 'Video'; break
|
||||
case /\.(md)$/.test(path):
|
||||
type = 'Text'; break
|
||||
case /\.(pdf)$/.test(path):
|
||||
type = 'Document'; break
|
||||
default:
|
||||
type = 'Unknown'; break
|
||||
}
|
||||
return { type, path, poster }
|
||||
return type
|
||||
}
|
||||
|
||||
export function selectTypeFromPathWithPoster (path, poster) {
|
||||
return { type: typeForPath(path), path, poster }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user