From 3c928856025713f858f89b032b267d7db8ffea6c Mon Sep 17 00:00:00 2001 From: Wim Brand Date: Mon, 1 Nov 2021 17:15:23 +0100 Subject: [PATCH] Finish most of the new file viewer --- res/template/file_viewer_svelte.html | 1 + res/template/home.html | 4 +- svelte/src/file_viewer/AdLeaderboard.svelte | 150 +++++++++ svelte/src/file_viewer/AdSkyscraper.svelte | 117 +++++++ svelte/src/file_viewer/EditWindow.svelte | 89 +++++ svelte/src/file_viewer/EmbedWindow.svelte | 75 +++++ svelte/src/file_viewer/FileStats.svelte | 99 ++++++ svelte/src/file_viewer/FileViewer.svelte | 353 +++++++++++--------- svelte/src/file_viewer/IntroPopup.svelte | 78 +++++ svelte/src/file_viewer/ReportWindow.svelte | 163 +++++++++ svelte/src/home_page/HomePage.svelte | 3 +- 11 files changed, 975 insertions(+), 157 deletions(-) create mode 100644 svelte/src/file_viewer/AdLeaderboard.svelte create mode 100644 svelte/src/file_viewer/AdSkyscraper.svelte create mode 100644 svelte/src/file_viewer/EditWindow.svelte create mode 100644 svelte/src/file_viewer/EmbedWindow.svelte create mode 100644 svelte/src/file_viewer/FileStats.svelte create mode 100644 svelte/src/file_viewer/IntroPopup.svelte create mode 100644 svelte/src/file_viewer/ReportWindow.svelte diff --git a/res/template/file_viewer_svelte.html b/res/template/file_viewer_svelte.html index 4b8fc65..bc1039f 100644 --- a/res/template/file_viewer_svelte.html +++ b/res/template/file_viewer_svelte.html @@ -25,6 +25,7 @@ diff --git a/res/template/home.html b/res/template/home.html index 0175356..955430f 100644 --- a/res/template/home.html +++ b/res/template/home.html @@ -88,8 +88,8 @@ window.api_endpoint = '{{.APIEndpoint}}'; window.user = {{.User}}; - - + + {{template "page_top" .}} diff --git a/svelte/src/file_viewer/AdLeaderboard.svelte b/svelte/src/file_viewer/AdLeaderboard.svelte new file mode 100644 index 0000000..ab104d7 --- /dev/null +++ b/svelte/src/file_viewer/AdLeaderboard.svelte @@ -0,0 +1,150 @@ + + + + + + {#if ad_type === "ads.plus"} + + {/if} + + +
+ {#if ad_type === "publisherrest_1"} +
+ + shopping_cart + Click here for online shopping discounts! + shopping_cart + +
+ {:else if ad_type === "publisherrest_2"} +
+ + shopping_cart + Check our online shopping discounts! + shopping_cart + +
+ {:else if ad_type === "publisherrest_3"} +
+ + shopping_cart + Free coupon codes for online shopping! + shopping_cart + +
+ {:else if ad_type === "brave"} + + {:else if ad_type === "ads.plus"} + + + + {:else if ad_type === "pixfuture"} + + + + + {/if} +
+ + diff --git a/svelte/src/file_viewer/AdSkyscraper.svelte b/svelte/src/file_viewer/AdSkyscraper.svelte new file mode 100644 index 0000000..58bf262 --- /dev/null +++ b/svelte/src/file_viewer/AdSkyscraper.svelte @@ -0,0 +1,117 @@ + + + + {#if ad_type === "ads.plus"} + + {/if} + + +{#if visible} +
+ +
+ {#if ad_type === "a-ads"} + + {:else if ad_type === "ads.plus"} + +
+ {:else if ad_type === "pixfuture"} + +
+ + + {/if} +
+
+{/if} + + diff --git a/svelte/src/file_viewer/EditWindow.svelte b/svelte/src/file_viewer/EditWindow.svelte new file mode 100644 index 0000000..9c2234f --- /dev/null +++ b/svelte/src/file_viewer/EditWindow.svelte @@ -0,0 +1,89 @@ + + +
+ {#if result_text !== ""} +
+ {result_text} +
+ {/if} + +

Rename

+
+ + +
+

Delete

+

+ When you delete a file it cannot be recovered. + Nobody will be able to download it and the link will + stop working. The file will also disappear from any + lists it's contained in. +

+
+ +
+
+ + diff --git a/svelte/src/file_viewer/EmbedWindow.svelte b/svelte/src/file_viewer/EmbedWindow.svelte new file mode 100644 index 0000000..01c5fc3 --- /dev/null +++ b/svelte/src/file_viewer/EmbedWindow.svelte @@ -0,0 +1,75 @@ + + +
+

+ 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. +

+

+ Unless it was uploaded using a pixeldrain Pro account the embedded + file will also show advertisements. +

+

Code

+ +
+ + +

Example

+
+
diff --git a/svelte/src/file_viewer/FileStats.svelte b/svelte/src/file_viewer/FileStats.svelte new file mode 100644 index 0000000..9668b78 --- /dev/null +++ b/svelte/src/file_viewer/FileStats.svelte @@ -0,0 +1,99 @@ + + +
+ {#if error_msg !== ""} + {error_msg} + {:else} +
Views
+
{formatThousands(views)}
+
Downloads
+
{formatThousands(downloads)}
+
Size
+
{formatDataVolume(size, 3)}
+ {/if} +
+ + diff --git a/svelte/src/file_viewer/FileViewer.svelte b/svelte/src/file_viewer/FileViewer.svelte index 20be2cd..7cec361 100644 --- a/svelte/src/file_viewer/FileViewer.svelte +++ b/svelte/src/file_viewer/FileViewer.svelte @@ -1,12 +1,18 @@ + +{#if visible} +
+

Upload your own files here!

+

+ On pixeldrain you can share your files with large or small + groups of people. The sky is the limit! +

+ +
+{/if} + + diff --git a/svelte/src/file_viewer/ReportWindow.svelte b/svelte/src/file_viewer/ReportWindow.svelte new file mode 100644 index 0000000..11c60b2 --- /dev/null +++ b/svelte/src/file_viewer/ReportWindow.svelte @@ -0,0 +1,163 @@ + + +
+

+ If you think this file violates pixeldrain's + content policy you can + report it for moderation with this form. You cannot report + copyright abuse with this form, send a formal DMCA notification + to the + abuse e-mail address + instead. +

+
+

Abuse type

+

+ Which type of abuse is shown in this file? Pick the most + appropriate one. +

+ + + + + + {#if list.id !== ""} +

Report multiple files?

+ + + {/if} + +

Send

+ {#if loading} +
+ +
+ {/if} + + {#each results as result} +
+ {result.text} +
+ {/each} +

+ Abuse reports are manually reviewed. Normally this shouldn't + take more than 24 hours. During busy periods it can take + longer. +

+
+ +
+
+
+ + diff --git a/svelte/src/home_page/HomePage.svelte b/svelte/src/home_page/HomePage.svelte index bd81eb2..ee0aee2 100644 --- a/svelte/src/home_page/HomePage.svelte +++ b/svelte/src/home_page/HomePage.svelte @@ -400,7 +400,8 @@ const keydown = (e) => { on:beforeunload={leave_confirmation} />
- {#if window.user.username !== ""} + + {#if window.user.username !== "" && window.user.storage_space_used/window.user.subscription.storage_space > 0.5}