diff --git a/svelte/src/file_viewer/AdHead.svelte b/svelte/src/file_viewer/AdHead.svelte
index 6da16f5..638618c 100644
--- a/svelte/src/file_viewer/AdHead.svelte
+++ b/svelte/src/file_viewer/AdHead.svelte
@@ -6,8 +6,8 @@ export const adaround_load = writable(false)
export const adaround_loaded = writable(false)
export const flyingsquare_load = writable(false)
export const flyingsquare_loaded = writable(false)
-
+
-
+
- You can embed pixeldrain's file viewer in your own web pages. We
- have created a special HTML code which renders a minimalistic
- version of the file viewer where the title bar is a bit thinner and
- the toolbar is collapsed by default.
+ If you have a website you can embed pixeldrain files in your own
+ webpages here.
- Unless it was uploaded using a pixeldrain Pro account the embedded
- file will also show advertisements.
+ The IFrame embed gives you a frame with a slightly more minimalistic
+ file viewer in it. The embedded file viewer has a fullscreen button and
+ the toolbar is collapsed by default. If you do not have a pixeldrain Pro
+ account the frame will also have advertisements in it.
-
Code
-
-
-
- content_copy
- {#if copy_status === "success"}
- Copied!
- {:else if copy_status === "error"}
- Error!
- {:else}
- Copy HTML
+
+ The hotlink embed option only works for single files uploaded with a Pro
+ account. You can use this to directly embed a video player, audio
+ player, photo element or a download button in your site. Make sure you
+ have bandwidth sharing enabled on your
+ subscription page or the embed will not
+ work.
+
+
+
+ code
+ IFrame
+
+ {#if file.id}
+
+ code
+ Hotlink
+
{/if}
-
-
- visibility Show example
-
+
+ Code
+
+ Put this code in your website to embed the file.
+
+
+
+
+
+ content_copy
+ {#if copy_status === "success"}
+ Copied!
+ {:else if copy_status === "error"}
+ Error!
+ {:else}
+ Copy HTML
+ {/if}
+
+
+ visibility Show example
+
+
Example
+
+
diff --git a/svelte/src/file_viewer/FilePreview.svelte b/svelte/src/file_viewer/FilePreview.svelte
index e0973e7..dc95a72 100644
--- a/svelte/src/file_viewer/FilePreview.svelte
+++ b/svelte/src/file_viewer/FilePreview.svelte
@@ -9,8 +9,9 @@ import PDF from "./viewers/PDF.svelte";
import Text from "./viewers/Text.svelte";
import File from "./viewers/File.svelte";
import Abuse from "./viewers/Abuse.svelte";
+import { file_type } from "./FileUtilities.svelte";
-let file_type = "loading"
+let viewer_type = "loading"
export let file = {
id: "",
name: "",
@@ -21,38 +22,14 @@ export let file = {
$: update_file(file.id)
const update_file = () => {
if (file.id === "") {
- file_type = "loading"
+ viewer_type = "loading"
+ return
+ }else if (file.abuse_type !== "") {
+ viewer_type = "abuse"
return
}
- if (file.abuse_type !== "") {
- file_type = "abuse"
- } else if (file.mime_type.startsWith("image")) {
- file_type = "image"
- } else if (
- file.mime_type.startsWith("video") ||
- file.mime_type === "application/matroska" ||
- file.mime_type === "application/x-matroska"
- ) {
- file_type = "video"
- } else if (
- file.mime_type.startsWith("audio") ||
- file.mime_type === "application/ogg" ||
- file.name.endsWith(".mp3")
- ) {
- file_type = "audio"
- } else if (
- file.mime_type === "application/pdf" ||
- file.mime_type === "application/x-pdf"
- ) {
- file_type = "pdf"
- } else if (
- file.mime_type.startsWith("text")
- ) {
- file_type = "text"
- } else {
- file_type = "file"
- }
+ viewer_type = file_type(file)
}
let dispatch = createEventDispatcher()
@@ -63,23 +40,23 @@ const prev = () => { dispatch("prev") }
- {#if file_type === "loading"}
+ {#if viewer_type === "loading"}
- {:else if file_type === "abuse"}
+ {:else if viewer_type === "abuse"}
- {:else if file_type === "image"}
+ {:else if viewer_type === "image"}
- {:else if file_type === "video"}
+ {:else if viewer_type === "video"}
- {:else if file_type === "audio"}
+ {:else if viewer_type === "audio"}
- {:else if file_type === "pdf"}
+ {:else if viewer_type === "pdf"}
- {:else if file_type === "text"}
+ {:else if viewer_type === "text"}
- {:else if file_type === "file"}
+ {:else if viewer_type === "file"}
{/if}
diff --git a/svelte/src/file_viewer/FileUtilities.svelte b/svelte/src/file_viewer/FileUtilities.svelte
new file mode 100644
index 0000000..6f7fd7a
--- /dev/null
+++ b/svelte/src/file_viewer/FileUtilities.svelte
@@ -0,0 +1,64 @@
+
diff --git a/svelte/src/file_viewer/FileViewer.svelte b/svelte/src/file_viewer/FileViewer.svelte
index a5437da..3f69363 100644
--- a/svelte/src/file_viewer/FileViewer.svelte
+++ b/svelte/src/file_viewer/FileViewer.svelte
@@ -1,42 +1,7 @@
-
-
-
- {#each files as file, index}
-
- {/each}
+
+
+ chevron_left
+
+
+ {#each files as file, index}
+
+ {/each}
+
+
+ chevron_right
+
diff --git a/svelte/src/file_viewer/ReportWindow.svelte b/svelte/src/file_viewer/ReportWindow.svelte
index 11c60b2..db07571 100644
--- a/svelte/src/file_viewer/ReportWindow.svelte
+++ b/svelte/src/file_viewer/ReportWindow.svelte
@@ -71,7 +71,7 @@ let submit = async e => {
}
-
+
If you think this file violates pixeldrain's
content policy you can
@@ -147,6 +147,11 @@ let submit = async e => {