added PDF opener
This commit is contained in:
parent
c83094266b
commit
db3a257ecd
@ -13,7 +13,7 @@ export default function getComponentForShare(contentType: string, filename: stri
|
||||
}
|
||||
|
||||
if (contentType.startsWith("application/pdf")) {
|
||||
return import("./opener/Default.svelte");
|
||||
return import("./opener/PDF.svelte");
|
||||
}
|
||||
|
||||
if (contentType.startsWith("text/")) {
|
||||
@ -25,7 +25,7 @@ export default function getComponentForShare(contentType: string, filename: stri
|
||||
case "application/ld+json":
|
||||
case "application/xhtml+xml":
|
||||
case "application/xml":
|
||||
return import("./opener/Default.svelte");
|
||||
return import("./opener/Text.svelte");
|
||||
case "application/ogg":
|
||||
return import("./opener/Default.svelte");
|
||||
}
|
||||
@ -56,13 +56,13 @@ export default function getComponentForShare(contentType: string, filename: stri
|
||||
case "flac":
|
||||
return import("./opener/Default.svelte");
|
||||
case "pdf":
|
||||
return import("./opener/Default.svelte");
|
||||
return import("./opener/PDF.svelte");
|
||||
case "txt":
|
||||
case "md":
|
||||
case "markdown":
|
||||
return import("./opener/Default.svelte");
|
||||
}
|
||||
|
||||
return import("./opener/Text.svelte");
|
||||
return import("./opener/Default.svelte");
|
||||
|
||||
}
|
||||
|
14
web/opener/PDF.svelte
Normal file
14
web/opener/PDF.svelte
Normal file
@ -0,0 +1,14 @@
|
||||
<script lang="ts">
|
||||
export let contentType: string;
|
||||
export let filename: string;
|
||||
export let slug: string;
|
||||
</script>
|
||||
|
||||
<iframe src="/s/{slug}.pdf" title="{filename}" frameborder="0"></iframe>
|
||||
|
||||
<style>
|
||||
iframe{
|
||||
min-width: 100%;
|
||||
height: 90vh;
|
||||
}
|
||||
</style>
|
Loading…
Reference in New Issue
Block a user