add option to delete files

This commit is contained in:
2020-02-18 14:57:27 +01:00
parent 408e3f7e52
commit 449c69b12d
20 changed files with 524 additions and 212 deletions

View File

@@ -13,7 +13,7 @@
<style>
{{template `viewer.css`}}
{{template `layout.css`}}
{{template `modal.css`}}
</style>
{{.OGData}}
@@ -22,7 +22,7 @@
<body>
<div id="file_viewer" class="file_viewer">
<div id="file_viewer_headerbar" class="highlight_1 file_viewer_headerbar">
<button id="btn_toggle_toolbar" class="button_toggle_toolbar"></button>
<button id="btn_toggle_toolbar" class="button_toggle_toolbar"><i class="icon small">menu</i></button>
<a href="/" id="button_home" class="button button_home">
{{template `pixeldrain.svg` .}}
</a>
@@ -30,7 +30,9 @@
<div id="file_viewer_list_title"></div>
<div id="file_viewer_file_title">{{.Title}}</div>
</div>
<button id="button_close_file_viewer" class="button_close_file_viewer button_red" onclick="window.close();">{{template `close.svg` .}}</button>
<button id="button_close_file_viewer" class="button_close_file_viewer button_red" onclick="window.close();">
<i class="icon small">close</i>
</button>
</div>
<div id="list_navigator" class="list_navigator"></div>
<div id="file_viewer_window" class="file_viewer_window">
@@ -43,29 +45,33 @@
<div id="stat_size" style="text-align: center;">N/A</div>
<button id="btn_download" class="toolbar_button button_full_width">
{{template `save.svg` .}}
<i class="icon">save</i>
<span>Download</span>
</button>
<button id="btn_download_list" class="toolbar_button button_full_width" style="display: none">
{{template `save.svg` .}}
<button id="btn_download_list" class="toolbar_button button_full_width" style="display: none;">
<i class="icon">save</i>
<span>DL all files</span>
</button>
<button id="btn_copy" class="toolbar_button button_full_width">
{{template `copy.svg` .}}
<i class="icon">content_copy</i>
<span><u>C</u>opy Link</span>
</button>
<button id="btn_share" class="toolbar_button button_full_width">
{{template `share.svg` .}}
<i class="icon">share</i>
<span>Share</span>
</button>
<button id="btn_shuffle" class="toolbar_button button_full_width" style="display: none">
{{template `shuffle.svg` .}}
<button id="btn_shuffle" class="toolbar_button button_full_width" style="display: none;">
<i class="icon">shuffle</i>
<span>Shuffle &#x2610;</span>
</button>
<button id="btn_details" class="toolbar_button button_full_width">
{{template `help.svg` .}}
<i class="icon">help</i>
<span>Deta<u>i</u>ls</span>
</button>
<button id="btn_edit" class="toolbar_button button_full_width" style="display: none;">
<i class="icon">edit</i>
<span><u>E</u>dit</span>
</button>
{{template "advertisement" .}}
<a href="https://twitter.com/SiaTechHQ/status/1228050383685201921">
@@ -99,52 +105,61 @@
<div class="center" style="width: 100px; height: 100px;">{{template "spinner.svg" .}}</div>
</div>
</div>
<!-- Popup windows, hidden by default -->
<div id="details_popup" class="popup details_popup">
<div id="details_popup_title" class="highlight_1">
File Info
<button id="btn_close_details" style="position: absolute; top: 3px; right: 3px;" class="button_red">{{template `close.svg` .}}</button>
</div>
<div class="content_area">
<div id="info_file_details"></div>
<div id="info_about">
<h3>Downloads and views</h3>
<div id="chart_container" class="chart-container" style="position: relative; width: 100%; height: auto;">
<canvas id="bandwidth_chart"></canvas>
</div>
<p style="text-align: center">
Chart rendered by the amazing <a href="https://www.chartjs.org/" target="_blank">Chart.js</a>.
</p>
<h3>About</h3>
Pixeldrain is a file sharing platform.
<a href="/" target="_blank">Visit the home page for more information.</a>
<h3>Keyboard Controls</h3>
<table>
<tr><td colspan="2">File Shortcuts</td></tr>
<tr><td>c</td><td> = Copy URL of this page</td></tr>
<tr><td>i</td><td> = Toggle details window (this window) (<b><u>i</u></b>nfo)</td></tr>
<tr><td>s</td><td> = Download the file you are currently viewing (<b><u>s</u></b>ave)</td></tr>
<tr><td>q</td><td> = Close the window (<b><u>q</u></b>uit)</td></tr>
<tr><td colspan="2">List Shortcuts</td></tr>
<tr><td>a or &#8592;</td><td> = View previous item in list</td></tr>
<tr><td>d or &#8594;</td><td> = View next item in list</td></tr>
<tr><td>r</td><td> = Toggle shuffle (<b><u>r</u></b>andom)</td></tr>
<tr><td>SHIFT + s</td><td> = Download all the files in the list as a zip archive</td></tr>
</table>
</div>
</div>
</div>
<div id="captcha_popup" class="popup captcha_popup">
<div id="captcha_popup_title" class="highlight_1"></div>
<div id="captcha_popup_content" class="content_area"></div>
<br/>
<div id="captcha_popup_captcha" style="text-align: center;"></div>
</div>
</div>
<template id="tpl_details_popup">
<table class="info_file_details" style="min-width: 100%;"></table>
<div class="info_about">
<h3>Downloads and views</h3>
<div class="chart-container" style="position: relative; width: 100%; height: auto;">
<canvas id="bandwidth_chart"></canvas>
</div>
<p style="text-align: center">
Chart rendered by the amazing <a href="https://www.chartjs.org/" target="_blank">Chart.js</a>.
</p>
<h3>About</h3>
Pixeldrain is a file sharing platform.
<a href="/" target="_blank">Visit the home page for more information.</a>
<h3>Keyboard Controls</h3>
<table style="max-width: 100%;">
<tr><td colspan="2">File Shortcuts</td></tr>
<tr><td>c</td><td> = Copy URL of this page</td></tr>
<tr><td>i</td><td> = Toggle details window (this window) (<b><u>i</u></b>nfo)</td></tr>
<tr><td>s</td><td> = Download the file you are currently viewing (<b><u>s</u></b>ave)</td></tr>
<tr><td>q</td><td> = Close the window (<b><u>q</u></b>uit)</td></tr>
<tr><td colspan="2">List Shortcuts</td></tr>
<tr><td>a or &#8592;</td><td> = View previous item in list</td></tr>
<tr><td>d or &#8594;</td><td> = View next item in list</td></tr>
<tr><td>r</td><td> = Toggle shuffle (<b><u>r</u></b>andom)</td></tr>
<tr><td>SHIFT + s</td><td> = Download all the files in the list as a zip archive</td></tr>
</table>
</div>
</template>
<template id="tpl_edit_file">
<h3>Delete file</h3>
<p>
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.
</p>
<div style="text-align: center;">
<button class="button_red btn_delete_file">
<i class="icon small">delete</i> Delete this file
</button>
</div>
</template>
<template id="tpl_captcha_popup">
<div class="captcha_text"></div>
<br/>
<div class="captcha_popup_captcha" style="text-align: center;"></div>
</template>
<script src="/res/script/Chart.min.js"></script>
<script>
'use strict';
@@ -152,7 +167,9 @@
let captchaKey = '{{.Other.CaptchaKey}}';
{{template `util.js`}}
{{template `Modal.js`}}
{{template `Toolbar.js`}}
{{template `EditWindow.js`}}
{{template `DetailsWindow.js`}}
{{template `ListNavigator.js`}}
{{template `Viewer.js`}}