mirror of
https://github.com/TheAnachronism/docspell.git
synced 2025-06-22 02:18:26 +00:00
Replace viewerjs with pdfjs viewer
The pdfjs distribution contains a standalone viewer already.
This commit is contained in:
@ -133,7 +133,8 @@ object AttachmentRoutes {
|
||||
// this route exists to provide a stable url
|
||||
// it redirects currently to viewerjs
|
||||
val attachUrl = s"/api/v1/sec/attachment/${id.id}"
|
||||
val path = s"/app/assets${Webjars.viewerjs}/index.html#$attachUrl"
|
||||
val path =
|
||||
s"/app/assets${Webjars.pdfjsdistviewermin}/build/minified/web/viewer.html?file=$attachUrl"
|
||||
SeeOther(Location(Uri(path = Uri.Path.unsafeFromString(path))))
|
||||
|
||||
case GET -> Root / Ident(id) / "meta" =>
|
||||
|
@ -45,7 +45,8 @@ object ShareAttachmentRoutes {
|
||||
// this route exists to provide a stable url
|
||||
// it redirects currently to viewerjs
|
||||
val attachUrl = s"/api/v1/share/attachment/${id.id}"
|
||||
val path = s"/app/assets${Webjars.viewerjs}/index.html#$attachUrl"
|
||||
val path =
|
||||
s"/app/assets${Webjars.pdfjsdistviewermin}/build/minified/web/viewer.html?file=$attachUrl"
|
||||
SeeOther(Location(Uri(path = Uri.Path.unsafeFromString(path))))
|
||||
|
||||
case req @ GET -> Root / Ident(id) / "preview" =>
|
||||
|
Reference in New Issue
Block a user