188 lines
8.3 KiB
HTML
188 lines
8.3 KiB
HTML
{{define "file_viewer"}}
|
|
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<title>{{.Title}}</title>
|
|
<meta charset="UTF-8"/>
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
|
|
{{template "user_style" .}}
|
|
<link rel="stylesheet" href="/res/style/viewer.css"/>
|
|
<link rel="stylesheet" href="/res/style/layout.css"/>
|
|
<link rel="stylesheet" href="/res/style/listview.css"/>
|
|
<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"/>
|
|
|
|
<!-- <link rel="alternate" type="application/json+oembed" th:href="*{oEmbedHref}" th:title="*{ogTitle}" /> OEmbed will return soon -->
|
|
|
|
{{template "bgpattern"}}
|
|
|
|
<meta name="theme-color" content="#202020"/>
|
|
<meta name="twitter:image" content="{{.OGData.Image}}" />
|
|
<meta property="og:title" content="{{.OGData.Title}}" />
|
|
<meta property="og:type" content="{{.OGData.Type}}" />
|
|
<meta property="og:site_name" content="{{.OGData.SiteName}}" />
|
|
<meta property="og:description" content="{{.OGData.Description}}" />
|
|
<meta property="description" content="{{.OGData.Description}}" />
|
|
<meta property="og:url" content="{{.OGData.URL}}" />
|
|
<meta property="og:image" content="{{.OGData.Image}}" />
|
|
<meta property="og:image:url" content="{{.OGData.Image}}" />
|
|
<meta property="article:author" content="Fornax96" />
|
|
<link rel="image_src" href="{{.OGData.Image}}" />
|
|
|
|
<script type="text/javascript">var apiEndpoint = '{{.APIEndpoint}}';</script>
|
|
</head>
|
|
|
|
<body>
|
|
<div id="listNavigator">
|
|
<div id="listNavigatorItems"></div>
|
|
<div id="arrow-left" alt="Previous Item" onClick="ListNavigator.previousItem();"></div>
|
|
<div id="arrow-right" alt="Next Item" onClick="ListNavigator.nextItem();"></div>
|
|
</div>
|
|
<button id="button-expand-toolbar" onClick="Toolbar.toggle();">Show Toolbar</button>
|
|
<div id="toolbar">
|
|
<!-- Ugly workaround to get rid of the scrollbar in non-webkit browsers -->
|
|
<div>
|
|
<div>
|
|
<button class="toolbar_button button_full_width" onClick="Toolbar.toggle();">Hide Toolbar</button>
|
|
|
|
<div id="views" style="text-align: center;">Views: No</div>
|
|
|
|
<a href="/" id="btnHome" class="button toolbar_button button_full_width">
|
|
<img src="/res/img/pixeldrain_small.png" alt="Back to the Home page"/>
|
|
<span>Home</span>
|
|
</a>
|
|
|
|
<button id="btnDownload" class="toolbar_button button_full_width" onClick="Toolbar.download();">
|
|
<img src="/res/img/floppy_small.png" alt="Download this file"/>
|
|
<span>Download</span>
|
|
</button>
|
|
|
|
<button id="btnCopy" class="toolbar_button button_full_width" onClick="Toolbar.copyUrl();">
|
|
<img src="/res/img/clipboard_small.png" alt="Copy file URL to clipboard"/>
|
|
<span>Copy</span>
|
|
</button>
|
|
|
|
<button id="btnShare" class="toolbar_button button_full_width" onClick="Sharebar.toggle();">
|
|
<img src="/res/img/share_small.png" alt="Share this file on social media"/>
|
|
<span>Share</span>
|
|
</button>
|
|
|
|
<button id="btnDetails" class="toolbar_button button_full_width" onClick="DetailsWindow.toggle();">
|
|
<img src="/res/img/info_small.png" alt="Help"/>
|
|
<span>Details</span>
|
|
</button>
|
|
|
|
<iframe id='sponsors' data-aa='73974'
|
|
src='//ad.a-ads.com/73974?size=120x600&background_color=000000&text_color=eeeeee&title_color=eeeeee&link_color=9fcf6c&link_hover_color=d2ffa1&title_hover_color=d2ffa1'
|
|
scrolling='no' allowtransparency='true' seamless="seamless">
|
|
</iframe>
|
|
|
|
<iframe id="frmDownload">
|
|
</iframe>
|
|
<textarea id="copy-text"></textarea>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="sharebar" class="sidebar">
|
|
Share on:<br/>
|
|
<button class="sharebar-button button_full_width" onclick="window.open('https://www.reddit.com/submit?url=' + window.location.href);">
|
|
<img src="/res/img/social_reddit.png" alt="Share on Reddit" style="width:40px; height: 40px;"/>
|
|
<br/>Reddit
|
|
</button>
|
|
<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
|
|
</button>
|
|
<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
|
|
</button>
|
|
<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);">
|
|
<img src="/res/img/social_twitter.png" alt="Share on Twitter" style="width:40px; height: 40px;"/>
|
|
<br/>Twitter
|
|
</button>
|
|
<button class="sharebar-button button_full_width" onClick="window.open('https://plus.google.com/share?url=' + window.location.href);">
|
|
<img src="/res/img/social_googleplus.png" alt="Share on Google Plus" style="width:40px; height: 40px;"/>
|
|
<br/>Google+
|
|
</button>
|
|
<button class="sharebar-button button_full_width" onClick="window.open('http://www.tumblr.com/share/link?url=' + window.location.href);">
|
|
<img src="/res/img/social_tumblr.png" alt="Share on Tumblr" style="width:40px; height: 40px;"/>
|
|
<br/>Tumblr
|
|
</button>
|
|
<button class="sharebar-button button_full_width" onClick="window.open('http://www.stumbleupon.com/submit?url=' + window.location.href);">
|
|
<img src="/res/img/social_stumbleupon.png" alt="Share on StumbleUpon" style="width:40px; height: 40px;"/>
|
|
<br/>StumbleUpon
|
|
</button>
|
|
<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>
|
|
</div>
|
|
|
|
<div id="info_popup" class="full_popup">
|
|
<img
|
|
alt="Close"
|
|
src="/res/img/cross.png"
|
|
style="position: absolute; top: 5px; right: 5px; width: 40px; height: 40px; cursor: pointer;"
|
|
onclick="DetailsWindow.toggle();"
|
|
/>
|
|
<h3>File Info</h3>
|
|
<span id="info_file_details"></span>
|
|
<span id="info_about">
|
|
<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)</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>
|
|
|
|
<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>
|
|
|
|
<div id="filepreview">
|
|
<img src="/res/img/misc/loadthink.gif" style="margin-top: 20%; width: 200px; height: 200px;" />
|
|
</div>
|
|
|
|
<script src="/res/script/jquery.js"></script>
|
|
<script src="/res/script/Keyboard.js"></script>
|
|
<script src="/res/script/Toolbar.js"></script>
|
|
<script src="/res/script/Sharebar.js"></script>
|
|
<script src="/res/script/DetailsWindow.js"></script>
|
|
<script src="/res/script/Viewer.js"></script>
|
|
<script src="/res/script/ListNavigator.js"></script>
|
|
|
|
<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 :)
|
|
Viewer.init('{{.Type}}', {{.APIResponse}});
|
|
</script>
|
|
|
|
{{template "analytics"}}
|
|
</body>
|
|
</html>
|
|
{{end}}
|