2017-11-10 12:39:55 +01:00
|
|
|
{{define "file_viewer"}}
|
|
|
|
<!DOCTYPE html>
|
|
|
|
<html>
|
|
|
|
<head>
|
2017-12-12 23:33:41 +01:00
|
|
|
<title>{{.Title}}</title>
|
2017-11-10 12:39:55 +01:00
|
|
|
<meta charset="UTF-8"/>
|
|
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
|
2019-02-18 13:41:50 +01:00
|
|
|
{{template "user_style" .}}
|
2019-07-06 18:45:05 +02:00
|
|
|
<link rel="stylesheet" href="/res/style/viewer.css?v2"/>
|
|
|
|
<link rel="stylesheet" href="/res/style/layout.css?v2"/>
|
2017-11-10 12:39:55 +01:00
|
|
|
<link rel="shortcut icon" href="/res/img/tray32.png"/>
|
|
|
|
<link rel="icon" sizes="180x180" href="/res/img/pixeldrain.png"/>
|
|
|
|
<link rel="icon" sizes="256x256" href="/res/img/pixeldrain_big.png"/>
|
2019-07-06 19:58:47 +02:00
|
|
|
<meta name="theme-color" content="#75AD38"/>
|
2018-07-09 23:19:16 +02:00
|
|
|
|
2017-12-17 18:10:59 +01:00
|
|
|
<!-- <link rel="alternate" type="application/json+oembed" th:href="*{oEmbedHref}" th:title="*{ogTitle}" /> OEmbed will return soon -->
|
2018-07-09 23:19:16 +02:00
|
|
|
|
2017-11-10 12:39:55 +01:00
|
|
|
{{template "bgpattern"}}
|
2018-07-09 23:19:16 +02:00
|
|
|
|
2019-07-06 19:36:04 +02:00
|
|
|
{{.OGData}}
|
2018-09-11 21:35:44 +02:00
|
|
|
|
2019-03-27 23:57:53 +01:00
|
|
|
<script type="text/javascript">
|
|
|
|
var apiEndpoint = '{{.APIEndpoint}}';
|
|
|
|
var captchaKey = '{{.Other.CaptchaKey}}';
|
|
|
|
</script>
|
2017-11-10 12:39:55 +01:00
|
|
|
</head>
|
|
|
|
|
|
|
|
<body>
|
|
|
|
<div id="listNavigator">
|
|
|
|
<div id="listNavigatorItems"></div>
|
2018-01-07 21:42:19 +01:00
|
|
|
<div id="arrow-left" alt="Previous Item" onClick="ListNavigator.previousItem();"></div>
|
|
|
|
<div id="arrow-right" alt="Next Item" onClick="ListNavigator.nextItem();"></div>
|
2017-11-10 12:39:55 +01:00
|
|
|
</div>
|
2018-01-07 21:42:19 +01:00
|
|
|
<button id="button-expand-toolbar" onClick="Toolbar.toggle();">Show Toolbar</button>
|
2017-11-10 12:39:55 +01:00
|
|
|
<div id="toolbar">
|
|
|
|
<!-- Ugly workaround to get rid of the scrollbar in non-webkit browsers -->
|
|
|
|
<div>
|
|
|
|
<div>
|
2018-01-07 21:42:19 +01:00
|
|
|
<button class="toolbar_button button_full_width" onClick="Toolbar.toggle();">Hide Toolbar</button>
|
2017-11-10 12:39:55 +01:00
|
|
|
|
2019-03-26 20:53:19 +01:00
|
|
|
<div id="stat_views_label" class="toolbar_label">Views</div>
|
|
|
|
<div id="stat_views" style="text-align: center;">N/A</div>
|
|
|
|
<div id="stat_downloads_label" class="toolbar_label">Downloads</div>
|
|
|
|
<div id="stat_downloads" style="text-align: center;">N/A</div>
|
2017-11-10 12:39:55 +01:00
|
|
|
|
2019-05-13 20:33:31 +02:00
|
|
|
<a href="/" id="btnHome" class="toolbar_button button_full_width button">
|
2018-07-09 23:19:16 +02:00
|
|
|
<img src="/res/img/pixeldrain_small.png" alt="Back to the Home page"/>
|
|
|
|
<span>Home</span>
|
|
|
|
</a>
|
2018-01-07 21:42:19 +01:00
|
|
|
<button id="btnDownload" class="toolbar_button button_full_width" onClick="Toolbar.download();">
|
2017-11-10 12:39:55 +01:00
|
|
|
<img src="/res/img/floppy_small.png" alt="Download this file"/>
|
|
|
|
<span>Download</span>
|
|
|
|
</button>
|
2018-01-07 21:42:19 +01:00
|
|
|
<button id="btnCopy" class="toolbar_button button_full_width" onClick="Toolbar.copyUrl();">
|
2017-11-10 12:39:55 +01:00
|
|
|
<img src="/res/img/clipboard_small.png" alt="Copy file URL to clipboard"/>
|
|
|
|
<span>Copy</span>
|
|
|
|
</button>
|
2018-01-07 21:42:19 +01:00
|
|
|
<button id="btnShare" class="toolbar_button button_full_width" onClick="Sharebar.toggle();">
|
2017-11-10 12:39:55 +01:00
|
|
|
<img src="/res/img/share_small.png" alt="Share this file on social media"/>
|
|
|
|
<span>Share</span>
|
|
|
|
</button>
|
2018-01-07 21:42:19 +01:00
|
|
|
<button id="btnDetails" class="toolbar_button button_full_width" onClick="DetailsWindow.toggle();">
|
2017-11-10 12:39:55 +01:00
|
|
|
<img src="/res/img/info_small.png" alt="Help"/>
|
|
|
|
<span>Details</span>
|
|
|
|
</button>
|
2019-05-15 11:50:48 +02:00
|
|
|
{{template "advertisement" .}}
|
2017-11-10 12:39:55 +01:00
|
|
|
|
2019-02-20 22:46:35 +01:00
|
|
|
<!-- This frame will load the download URL when a download button is pressed -->
|
|
|
|
<iframe id="download_frame" style="display: none; width: 1px; height: 1px;"></iframe>
|
2017-11-10 12:39:55 +01:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
2018-07-09 23:19:16 +02:00
|
|
|
|
2017-11-10 12:39:55 +01:00
|
|
|
<div id="sharebar" class="sidebar">
|
|
|
|
Share on:<br/>
|
2019-07-16 22:07:10 +02:00
|
|
|
<button class="sharebar-button button_full_width" onClick="window.open('mailto:please@set.address?subject=File%20on%20PixelDrain&body=You%20can%20view%20it%20here%20' + window.location.href);">
|
|
|
|
<img src="/res/img/social_email.png" alt="Share on E-Mail" style="width:40px; height: 40px;"/>
|
|
|
|
<br/>E-Mail
|
|
|
|
</button>
|
2018-01-07 21:42:19 +01:00
|
|
|
<button class="sharebar-button button_full_width" onclick="window.open('https://www.reddit.com/submit?url=' + window.location.href);">
|
2017-11-10 12:39:55 +01:00
|
|
|
<img src="/res/img/social_reddit.png" alt="Share on Reddit" style="width:40px; height: 40px;"/>
|
|
|
|
<br/>Reddit
|
|
|
|
</button>
|
2018-01-07 21:42:19 +01:00
|
|
|
<button class="sharebar-button button_full_width" onClick="window.open('https://twitter.com/share?text=Check%20out%20this%20file%20on%20%23Pixeldrain&url=' + window.location.href);">
|
2017-11-10 12:39:55 +01:00
|
|
|
<img src="/res/img/social_twitter.png" alt="Share on Twitter" style="width:40px; height: 40px;"/>
|
|
|
|
<br/>Twitter
|
|
|
|
</button>
|
2019-07-16 22:07:10 +02:00
|
|
|
<button class="sharebar-button button_full_width" onClick="window.open('http://www.facebook.com/sharer.php?u=' + window.location.href);">
|
|
|
|
<img src="/res/img/social_facebook.png" alt="Share on Facebook" style="width:40px; height: 40px;"/>
|
|
|
|
<br/>Facebook
|
2017-11-10 12:39:55 +01:00
|
|
|
</button>
|
2018-01-07 21:42:19 +01:00
|
|
|
<button class="sharebar-button button_full_width" onClick="window.open('http://www.tumblr.com/share/link?url=' + window.location.href);">
|
2017-11-10 12:39:55 +01:00
|
|
|
<img src="/res/img/social_tumblr.png" alt="Share on Tumblr" style="width:40px; height: 40px;"/>
|
|
|
|
<br/>Tumblr
|
|
|
|
</button>
|
2019-07-16 22:07:10 +02:00
|
|
|
<button class="sharebar-button button_full_width" onClick="window.open('https://voat.co/submit?linkpost=true&url=' + window.location.href);">
|
|
|
|
<img src="/res/img/social_voat.png" alt="Share on Voat" style="width:40px; height: 40px;"/>
|
|
|
|
<br/>Voat
|
2017-11-10 12:39:55 +01:00
|
|
|
</button>
|
|
|
|
</div>
|
|
|
|
|
2019-07-06 18:41:16 +02:00
|
|
|
<div id="details_popup" class="popup details_popup border_bottom">
|
|
|
|
<div id="details_popup_title" class="highlight_light border_top border_bottom">
|
|
|
|
File Info
|
|
|
|
<button style="position: absolute; top: 3px; right: 3px;" class="button_red" onclick="DetailsWindow.toggle();">X</button>
|
|
|
|
</div>
|
2019-07-07 22:34:20 +02:00
|
|
|
<div class="content_area">
|
|
|
|
<span id="info_file_details"></span>
|
|
|
|
<span 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>
|
2019-07-07 12:18:26 +02:00
|
|
|
|
2019-07-07 22:34:20 +02:00
|
|
|
<h3>About</h3>
|
|
|
|
Pixeldrain is a file sharing platform.
|
|
|
|
<a href="/" target="_blank">Visit the home page for more information.</a>
|
2018-09-11 21:35:44 +02:00
|
|
|
|
2019-07-07 22:34:20 +02:00
|
|
|
<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)</td></tr>
|
|
|
|
<tr><td>s</td><td> = Download the file you are currently viewing</td></tr>
|
|
|
|
<tr><td colspan="2">List Shortcuts</td></tr>
|
|
|
|
<tr><td>a or ←</td><td> = View previous item in list</td></tr>
|
|
|
|
<tr><td>d or →</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>
|
2018-09-11 21:35:44 +02:00
|
|
|
|
2019-07-07 22:34:20 +02:00
|
|
|
<h3>Credits</h3>
|
|
|
|
All server side code written by
|
|
|
|
<a target="_blank" href="https://fornaxian.com/">Fornax (me)</a>.
|
|
|
|
<br/>
|
|
|
|
<br/>
|
|
|
|
Code syntax highlighting is by
|
|
|
|
<a target="_blank" href="https://github.com/google/code-prettify">Google Code-prettify</a>.
|
|
|
|
<br/>
|
|
|
|
<br/>
|
|
|
|
Thanks to the Mozilla team for their wonderful PDF viewer
|
|
|
|
<a target="_blank" href="https://github.com/mozilla/pdf.js">pdf.js</a>.
|
|
|
|
<br/>
|
|
|
|
</span>
|
|
|
|
</div>
|
2017-11-10 12:39:55 +01:00
|
|
|
</div>
|
2019-07-06 18:41:16 +02:00
|
|
|
<div id="captcha_popup" class="popup captcha_popup border_bottom">
|
2019-03-28 10:47:27 +01:00
|
|
|
<div id="captcha_popup_title" class="highlight_light border_top border_bottom"></div>
|
2019-07-16 22:07:10 +02:00
|
|
|
<div id="captcha_popup_content" class="content_area"></div>
|
2019-03-28 10:47:27 +01:00
|
|
|
<br/>
|
|
|
|
<div id="captcha_popup_captcha" style="text-align: center;"></div>
|
|
|
|
</div>
|
2018-07-09 23:19:16 +02:00
|
|
|
|
2017-11-10 12:39:55 +01:00
|
|
|
<div id="filepreview">
|
2018-10-10 23:05:49 +02:00
|
|
|
<img src="/res/img/misc/loadthink.gif" style="margin-top: 20%; width: 200px; height: 200px;" />
|
2017-11-10 12:39:55 +01:00
|
|
|
</div>
|
2018-07-09 23:19:16 +02:00
|
|
|
|
2019-07-07 01:03:44 +02:00
|
|
|
<script src="/res/misc/chartjs/Chart.min.js"></script>
|
2018-01-07 21:42:19 +01:00
|
|
|
<script src="/res/script/jquery.js"></script>
|
2017-11-10 12:39:55 +01:00
|
|
|
<script src="/res/script/Keyboard.js"></script>
|
2019-07-06 18:45:05 +02:00
|
|
|
<script src="/res/script/Toolbar.js?v1"></script>
|
|
|
|
<script src="/res/script/Viewer.js?v1"></script>
|
2017-11-10 12:39:55 +01:00
|
|
|
<script src="/res/script/ListNavigator.js"></script>
|
2018-07-09 23:19:16 +02:00
|
|
|
|
2017-11-10 12:39:55 +01:00
|
|
|
<script>
|
|
|
|
// This info gets filled in on the server side to prevent having to make an API call right after the page loads.
|
|
|
|
// Just to slice another few milliseconds from the load time :)
|
2019-02-19 23:10:04 +01:00
|
|
|
Viewer.init('{{.Other.Type}}', {{.Other.APIResponse}});
|
2017-11-10 12:39:55 +01:00
|
|
|
</script>
|
|
|
|
|
|
|
|
{{template "analytics"}}
|
|
|
|
</body>
|
|
|
|
</html>
|
2018-07-09 23:19:16 +02:00
|
|
|
{{end}}
|