move meta tags to template, begin of user portal

This commit is contained in:
2018-06-25 23:05:18 +02:00
parent 24b74a1b60
commit 12d2560133
20 changed files with 136 additions and 423 deletions

View File

@@ -26,7 +26,7 @@ var UploadProgressBar = /** @class */ (function () {
this.uploadDiv.setAttribute('style', 'background: #111');
this.uploadDiv.setAttribute('href', '/u/' + id);
this.uploadDiv.setAttribute("target", "_blank");
this.uploadDivJQ.html('<img src="/api/file/' + id + '/thumbnail" alt="' + this.file.name + '"/>'
this.uploadDivJQ.html('<img src="' + apiEndpoint + '/file/' + id + '/thumbnail" alt="' + this.file.name + '"/>'
+ this.file.name + '<br/>'
+ '<span style="color: var(--highlight_color);">' + window.location.hostname + '/u/' + id + '</span>');
};
@@ -161,7 +161,7 @@ var UploadWorker = /** @class */ (function () {
var that = this; // jquery changes the definiton of "this"
$.ajax({
type: 'POST',
url: "/api/file",
url: apiEndpoint + "/file",
data: formData,
timeout: 7200000,
cache: false,

View File

@@ -1,6 +1,3 @@
/* global API_URL */
var uploads;
$(document).ready(function () {
@@ -17,7 +14,7 @@ $(document).ready(function () {
$.ajax({
type: "GET",
dataType: "json",
url: APIURL + "/file/" + id + "/info",
url: apiEndpoint + "/file/" + id + "/info",
async: true,
success: function(data) {
historyAddItem(data);
@@ -45,19 +42,21 @@ function historyAddItem(json) {
+ "</div>";
$("#uploadedFiles").append($(uploadItem).hide().fadeIn(400));
return;
}
var date = new Date(json.date_upload * 1000);
var date = new Date(json.date_upload);
var uploadItem = '<a href="/u/'+ json.id +'" target="_blank" class="file_button">'
+ '<img src="'+ APIURL + json.thumbnail_href + '"'
+ '<img src="'+ apiEndpoint + json.thumbnail_href + '"'
+ "alt=\"" + json.file_name + "\" />"
+ '<span style="color: var(--highlight_color);">'+json.file_name+'</span>'
+ "<br/>"
+ date.getFullYear() + "-" + (date.getMonth() + 1) + "-" + date.getDate()
+ date.getFullYear() + "-"
+ ("00" + (date.getMonth() + 1)).slice(-2) + "-"
+ ("00" + date.getDate()).slice(-2)
+ "</a>";
$("#uploadedFiles").append($(uploadItem).hide().fadeIn(400));
}
}

View File

@@ -1,3 +1,4 @@
declare var apiEndpoint: string;
var uploader: UploadManager|null = null;
var finishedUploads: Array<string> = new Array()
var totalUploads: number = 0
@@ -29,7 +30,7 @@ class UploadProgressBar implements FileUpload {
public onProgress(progress: number){
this.uploadDiv.innerText = "Uploading... " + Math.round(progress*1000)/10 + "%\n" + this.file.name
this.uploadDiv.setAttribute(
'style',
'style',
'background: linear-gradient('
+'to right, '
+'#111 0%, '
@@ -44,7 +45,7 @@ class UploadProgressBar implements FileUpload {
this.uploadDiv.setAttribute('href', '/u/'+id)
this.uploadDiv.setAttribute("target", "_blank");
this.uploadDivJQ.html(
'<img src="/api/file/'+id+'/thumbnail" alt="'+this.file.name+'"/>'
'<img src="'+apiEndpoint+'/file/'+id+'/thumbnail" alt="'+this.file.name+'"/>'
+ this.file.name+'<br/>'
+ '<span style="color: var(--highlight_color);">'+window.location.hostname+'/u/'+id+'</span>'
)
@@ -82,7 +83,7 @@ $("#select_file_button").click(function(){$("#file_input_field").click()})
$("#file_input_field").change(function(evt){
handleUploads((<HTMLInputElement>evt.target).files)
// This resets the file input field
// http://stackoverflow.com/questions/1043957/clearing-input-type-file-using-jquery
$('#file_name').html("")
@@ -109,4 +110,4 @@ document.addEventListener('drop', function(e: DragEvent){
handleUploads(e.dataTransfer.files)
}
})
})

View File

@@ -1,3 +1,5 @@
declare var apiEndpoint: string;
interface FileUpload {
file: Blob
name: string
@@ -56,7 +58,7 @@ class UploadWorker {
console.debug("No files left in queue")
return // Stop the thread
}
this.uploading = true
this.tries = 0
this.upload(<FileUpload>file)
@@ -73,7 +75,7 @@ class UploadWorker {
$.ajax({
type: 'POST',
url: "/api/file",
url: apiEndpoint+"/file",
data: formData,
timeout: 7200000, // 2 hours
cache: false,
@@ -117,13 +119,13 @@ class UploadWorker {
private setHistoryCookie(id: string){
var uc = Cookie.read("pduploads")
// First upload in this browser
if (uc === null) {
Cookie.write("pduploads", id + ".", undefined)
return
}
if (uc.length > 2000){
// Cookie is becoming too long, drop the oldest two files
uc = uc.substring(
@@ -132,7 +134,7 @@ class UploadWorker {
uc.indexOf(".") + 1
)
}
Cookie.write("pduploads", uc + id + ".", undefined)
}
}
}

View File

@@ -0,0 +1,20 @@
{{define "file_manager"}}<!DOCTYPE html>
<html>
<head>
{{template "meta_tags" "File Manager"}}
<script type="text/javascript">var apiEndpoint = '{{.APIEndpoint}}';</script>
</head>
<body>
{{template "menu" .}}
<div class="highlight_dark border_bottom">
These files were uploaded while logged in to your pixeldrain account,
<a href="/history">click here</a> to view files uploaded anonymously
in this browser.
</div>
{{template "analytics"}}
</body>
</html>
{{end}}

View File

@@ -1,75 +0,0 @@
<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
<title>File Browser ~ PixelDrain</title>
<meta charset="UTF-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<link rel="stylesheet" href="/res/style/home.css"/>
<link rel="stylesheet" href="/res/style/season.css"/>
<link rel="stylesheet" href="/res/style/history.css"/>
<link rel="stylesheet" href="/res/style/menu.css"/>
<link href='https://fonts.googleapis.com/css?family=Ubuntu' rel='stylesheet' type='text/css'/>
<link href="https://fonts.googleapis.com/css?family=Lato:100" rel="stylesheet" type="text/css"/>
<link rel="shortcut icon" href="/res/img/tray32.png"/>
<meta name="theme-color" content="#9FCF6C"/>
<link rel="icon" sizes="180x180" href="/res/img/pixeldrain.png"/>
<link rel="icon" sizes="256x256" href="/res/img/pixeldrain_big.png"/>
<style th:include="fragments :: background-pattern" th:inline="text"></style>
<meta name="description" content="PixelDrain is a free file sharing service, you
can upload any file and you will be given a shareable link right away.
PixelDrain also supports previews for images, videos, audio, PDFs and much more.
Uncensored, unmonitored and unmoderated."/>
</head>
<body>
<div id='body' class="body">
<div th:replace="fragments :: menu"></div>
<br/>
<div style="margin-left: 0; margin-right: 0; text-align: center; font-size: 22px;">
<a th:href="'/account/files?pageid=' + ${pageid - 1}">Previous</a>
&nbsp;&nbsp;&#60;--&nbsp;&nbsp;<span th:text="${pageid}">0</span>&nbsp;&nbsp;--&#62;&nbsp;&nbsp;
<a th:href="'/account/files?pageid=' + ${pageid + 1}">Nextious</a>
</div>
<div id="uploadedFiles" class="uploadedFiles">
<div class="uploadItem" th:each="file,interation : ${files}">
<a th:href="'/u/' + ${file.getId()}" th:inline="text" target="_blank">
<img th:src="'/api/thumbnail/' + ${file.getId()}" th:alt="${file.getFileName()}" class="uploadItemImage"/>
</a>
<a th:href="'/u/' + ${file.getId()}" th:inline="text" target="_blank" class="uploadItemText">
[[${file.getFileName()}]]
<br/>
<span th:text="${file.getDateUpload().toString()}"></span>
</a>
</div>
</div>
<div style="margin-left: 0; margin-right: 0; text-align: center; font-size: 22px;">
<a th:href="'/account/files?pageid=' + ${pageid - 1}">Previous</a>
&nbsp;&nbsp;&#60;--&nbsp;&nbsp;<span th:text="${pageid}">0</span>&nbsp;&nbsp;--&#62;&nbsp;&nbsp;
<a th:href="'/account/files?pageid=' + ${pageid + 1}">Nextious</a>
</div>
</div>
<!-- Google Analytics Tracking Code -->
<script>
(function (i, s, o, g, r, a, m) {
i['GoogleAnalyticsObject'] = r;
i[r] = i[r] || function () {
(i[r].q = i[r].q || []).push(arguments)
}, i[r].l = 1 * new Date();
a = s.createElement(o),
m = s.getElementsByTagName(o)[0];
a.async = 1;
a.src = g;
m.parentNode.insertBefore(a, m)
})(window, document, 'script', '//www.google-analytics.com/analytics.js', 'ga');
ga('create', 'UA-24463738-4', 'auto');
ga('send', 'pageview');
</script>
</body>
</html>

View File

@@ -2,34 +2,9 @@
<!DOCTYPE html>
<html>
<head>
<title>Login ~ PixelDrain</title>
<meta charset="UTF-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<link rel="stylesheet" href="/global.css"/>
<link rel="stylesheet" href="/res/style/layout.css"/>
<link href='https://fonts.googleapis.com/css?family=Ubuntu' rel='stylesheet' type='text/css'/>
<link href="https://fonts.googleapis.com/css?family=Lato:100" rel="stylesheet" type="text/css"/>
<link rel="shortcut icon" href="/res/img/tray32.png"/>
<meta name="theme-color" content="#9FCF6C"/>
<link rel="icon" sizes="180x180" href="/res/img/pixeldrain.png"/>
<link rel="icon" sizes="256x256" href="/res/img/pixeldrain_big.png"/>
{{template "bgpattern"}}
<meta name="description" content="PixelDrain is a free file sharing service, you
can upload any file and you will be given a shareable link right away.
PixelDrain also supports previews for images, videos, audio, PDFs and much more.
Uncensored, unmonitored and unmoderated."/>
<meta property="og:type" content="website" />
<meta property="og:title" content="Login ~ PixelDrain" />
<meta property="og:site_name" content="PixelDrain" />
<meta property="og:description" content="Instant file and screenshot sharing." />
<meta property="og:url" content="http://pixeldra.in/" />
<meta property="og:image" content="/res/img/pixeldrain_big.png" />
<meta property="og:image:type" content="image/png" />
{{template "meta_tags" "Login"}}
<script type="text/javascript">var apiEndpoint = '{{.APIEndpoint}}';</script>
</head>
<body>
<div id='body' class="body">
{{template "menu" .}}

View File

@@ -1,30 +1,7 @@
{{define "logout"}}<!DOCTYPE html>
<html>
<head>
<title>Logging out... ~ Pixeldrain</title>
<meta charset="UTF-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<link rel="stylesheet" href="/global.css"/>
<link rel="stylesheet" href="/res/style/layout.css"/>
<link href='https://fonts.googleapis.com/css?family=Ubuntu' rel='stylesheet' type='text/css'/>
<link href="https://fonts.googleapis.com/css?family=Lato:100" rel="stylesheet" type="text/css"/>
<link rel="shortcut icon" href="/res/img/tray32.png"/>
<meta name="theme-color" content="#9FCF6C"/>
<link rel="icon" sizes="180x180" href="/res/img/pixeldrain.png"/>
<link rel="icon" sizes="256x256" href="/res/img/pixeldrain_big.png"/>
{{template "bgpattern"}}
<meta name="description" content="PixelDrain is a free file sharing service, you
can upload any file and you will be given a shareable link right away.
PixelDrain also supports previews for images, videos, audio, PDFs and much more.
Uncensored, unmonitored and unmoderated."/>
<meta property="og:type" content="website" />
<meta property="og:title" content="Logging out... ~ Pixeldrain" />
<meta property="og:site_name" content="Pixeldrain" />
<meta property="og:description" content="Instant file and screenshot sharing." />
<meta property="og:url" content="http://pixeldra.in/" />
<meta property="og:image" content="/res/img/pixeldrain_big.png" />
<meta property="og:image:type" content="image/png" />
{{template "meta_tags" "Logging out..."}}
</head>
<body>
<div id='body' class="body">
@@ -39,15 +16,15 @@
<p>
We need you to confirm your action here so we can be sure that
you really requested a logout. If we didn't do this, anyone (or
any website) would be able to send you to the page
pixeldrain.com/logout and you would automatically get logged
out of Pixeldrain, which would be very annoying.
any website) would be able to send you to this page and you
would automatically get logged out of Pixeldrain, which would be
very annoying.
</p>
<p>
To prevent this from happening we're verifying that you actually
want to log out by making you submit this form. Because this
want to log out by making you click this button. Because this
logout button triggers a different request type than normal
page vitis we can confirm that you really want to log out.
page visit we can confirm that you really want to log out.
</p>
{{template "footer"}}

View File

@@ -1,34 +1,7 @@
{{define "register"}}
<!DOCTYPE html>
{{define "register"}}<!DOCTYPE html>
<html>
<head>
<title>Register ~ PixelDrain</title>
<meta charset="UTF-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<meta name="theme-color" content="#82C13E"/>
<meta name="description" content="PixelDrain is a free file sharing service, you
can upload any file and you will be given a shareable link right away.
PixelDrain also supports previews for images, videos, audio, PDFs and much more.
Uncensored, unmonitored and unmoderated."/>
<meta property="og:type" content="website" />
<meta property="og:title" content="Register ~ PixelDrain" />
<meta property="og:site_name" content="PixelDrain" />
<meta property="og:description" content="Instant file and screenshot sharing." />
<meta property="og:url" content="http://pixeldra.in/" />
<meta property="og:image" content="/res/img/pixeldrain_big.png" />
<meta property="og:image:type" content="image/png" />
<link rel="stylesheet" href="/global.css"/>
<link rel="stylesheet" href="/res/style/layout.css"/>
<link href='https://fonts.googleapis.com/css?family=Ubuntu' rel='stylesheet' type='text/css'/>
<link href="https://fonts.googleapis.com/css?family=Lato:100" rel="stylesheet" type="text/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"/>
<script src="https://www.google.com/recaptcha/api.js"></script>
{{template "bgpattern"}}
{{template "meta_tags" "Register"}}
<script type="text/javascript">var apiEndpoint = '{{.APIEndpoint}}';</script>
</head>

View File

@@ -1,99 +1,18 @@
<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
{{define "user_home"}}<!DOCTYPE html>
<html>
<head>
<title>File Overview ~ PixelDrain</title>
<meta charset="UTF-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<link rel="stylesheet" href="/res/style/home.css"/>
<link rel="stylesheet" href="/res/style/season.css"/>
<link rel="stylesheet" href="/res/style/global.css"/>
<link rel="stylesheet" href="/res/style/history.css"/>
<link rel="stylesheet" href="/res/style/menu.css"/>
<link href='https://fonts.googleapis.com/css?family=Ubuntu' rel='stylesheet' type='text/css'/>
<link href="https://fonts.googleapis.com/css?family=Lato:100" rel="stylesheet" type="text/css"/>
<link rel="shortcut icon" href="/res/img/tray32.png"/>
<meta name="theme-color" content="#9FCF6C"/>
<link rel="icon" sizes="180x180" href="/res/img/pixeldrain.png"/>
<link rel="icon" sizes="256x256" href="/res/img/pixeldrain_big.png"/>
<style th:include="fragments :: background-pattern" th:inline="text"></style>
<meta name="description" content="PixelDrain is a free file sharing service, you
can upload any file and you will be given a shareable link right away.
PixelDrain also supports previews for images, videos, audio, PDFs and much more.
Uncensored, unmonitored and unmoderated."/>
{{template "meta_tags" .Username}}
<script type="text/javascript">var apiEndpoint = '{{.APIEndpoint}}';</script>
</head>
<body>
<div id='body' class="body">
<div th:replace="fragments :: menu"></div>
<br/>
Logged in as <span th:text="${user.getUsername()}"></span>. <a href="/logout">Log out</a>.
<br/><br/>
Bandwidth used past 24 hours:<br/>
<div id="bandwidth-progress-bar" class="progress-bar">
<span th:text="${bandwidth_used} + ' / ' + ${bandwidth_available}"></span>
<div id="bandwidth-progress" th:style="'width: ' + ${bandwidth_percentage} + '%;'">
<span th:text="${bandwidth_used} + ' / ' + ${bandwidth_available}"></span>
</div>
</div>
<br/>
Total size of your files: <span th:text="${account_total_size}"></span>.
<br/><br/>
Your 20 most recently uploaded files:
<div id="uploadedFiles" class="uploadedFiles">
<div class="uploadItem" th:each="file,interation : ${files}">
<a th:href="'/u/' + ${file.getId()}" th:inline="text" target="_blank">
<img th:src="'/api/thumbnail/' + ${file.getId()}" th:alt="${file.getFileName()}" class="uploadItemImage"/>
</a>
<a th:href="'/u/' + ${file.getId()}" th:inline="text" target="_blank" class="uploadItemText">
[[${file.getFileName()}]]
<br/>
<span th:text="${file.getDateUpload().toString()}"></span>
</a>
</div>
</div>
<br/>
<div style="margin-left: 0; margin-right: 0; text-align: center; font-size: 20px;">
<a href="/account/files">Click here to view all your files</a>
</div>
<br/>
Your 20 most recently created lists:
<div id="uploadedFiles" class="uploadedFiles">
<div class="uploadItem" th:each="list,interation : ${lists}" th:inline="text">
<a th:href="'/l/' + ${list.getId()}" target="_blank">
<img th:src="'/api/thumbnail/' + ${list_db.getListItem(list.getId(), 0).getFileId()}" alt="" class="uploadItemImage"/>
</a>
<a th:href="'/l/' + ${list.getId()}" target="_blank" class="uploadItemText">
[[${list.getTitle()}]]
<br/>
<span th:text="${list.getSize()} + ' Items'"></span>
<br/>
<span th:text="${list.getDateCreated().toString()}"></span>
</a>
</div>
</div>
<div style="margin-left: 0; margin-right: 0; text-align: center; font-size: 20px;">
<a href="/account/lists">Click here to view all your lists</a>
</div>
{{template "menu" .}}
<h1>Welcome home, {{.Username}}!</h1>
{{template "footer"}}
</div>
<!-- Google Analytics Tracking Code -->
<script>
(function (i, s, o, g, r, a, m) {
i['GoogleAnalyticsObject'] = r;
i[r] = i[r] || function () {
(i[r].q = i[r].q || []).push(arguments)
}, i[r].l = 1 * new Date();
a = s.createElement(o),
m = s.getElementsByTagName(o)[0];
a.async = 1;
a.src = g;
m.parentNode.insertBefore(a, m)
})(window, document, 'script', '//www.google-analytics.com/analytics.js', 'ga');
ga('create', 'UA-24463738-4', 'auto');
ga('send', 'pageview');
</script>
{{template "analytics"}}
</body>
</html>
{{end}}

View File

@@ -1,33 +1,7 @@
{{define "apidoc"}}
<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
{{define "apidoc"}}<!DOCTYPE html>
<html>
<head>
<title>PixelDrain ~ API Documentation</title>
<meta charset="UTF-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<link rel="stylesheet" href="/global.css"/>
<link rel="stylesheet" href="/res/style/layout.css"/>
<link rel="stylesheet" href="/res/style/apidoc.css"/>
<link href='http://fonts.googleapis.com/css?family=Ubuntu' rel='stylesheet' type='text/css'/>
<link href="https://fonts.googleapis.com/css?family=Lato:100" rel="stylesheet" type="text/css"/>
<link rel="shortcut icon" href="/res/img/tray32.png"/>
<meta name="theme-color" content="#9FCF6C"/>
<link rel="icon" sizes="180x180" href="/res/img/pixeldrain.png"/>
<link rel="icon" sizes="256x256" href="/res/img/pixeldrain_big.png"/>
{{template "bgpattern"}}
<meta name="description" content="PixelDrain is a free file sharing service, you
can upload any file and you will be given a shareable link right away.
PixelDrain also supports previews for images, videos, audio, PDFs and much more.
Uncensored, unmonitored and unmoderated."/>
<meta property="og:type" content="website" />
<meta property="og:title" content="API Documentation ~ PixelDrain" />
<meta property="og:site_name" content="PixelDrain" />
<meta property="og:description" content="Instant file and screenshot sharing." />
<meta property="og:url" content="http://pixeldra.in/" />
<meta property="og:image" content="/res/img/pixeldrain_big.png" />
<meta property="og:image:type" content="image/png" />
{{template "meta_tags" "API Documentation"}}
</head>
<body>

View File

@@ -1,39 +1,17 @@
{{define "error"}}
<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
{{define "error"}}<!DOCTYPE html>
<html>
<head>
<title>PixelDrain ~ Error</title>
<meta charset="UTF-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<link rel="stylesheet" href="/global.css"/>
<link rel="stylesheet" href="/res/style/layout.css"/>
<link href='https://fonts.googleapis.com/css?family=Ubuntu' rel='stylesheet' type='text/css'/>
<link href="https://fonts.googleapis.com/css?family=Lato:100" rel="stylesheet" type="text/css"/>
<link rel="shortcut icon" href="/res/img/tray32.png"/>
<meta name="theme-color" content="#9FCF6C"/>
<link rel="icon" sizes="180x180" href="/res/img/pixeldrain.png"/>
<link rel="icon" sizes="256x256" href="/res/img/pixeldrain_big.png"/>
{{template "bgpattern"}}
<meta name="description" content="PixelDrain is a free file sharing service, you can upload any file and you will be given a shareable link right away. PixelDrain also supports previews for images, videos, audio, PDFs and much more. Uncensored, unmonitored and unmoderated."/>
<meta property="og:type" content="website" />
<meta property="og:title" content="PixelDrain ~ Error" />
<meta property="og:site_name" content="PixelDrain" />
<meta property="og:description" content="Instant file and screenshot sharing." />
<meta property="og:url" content="http://pixeldra.in/" />
<meta property="og:image" content="/res/img/pixeldrain_big.png" />
<meta property="og:image:type" content="image/png" />
{{template "meta_tags" "Error"}}
</head>
<body>
<div id='body' class="body">
{{template "menu" .}}
<br/>
<h1>Some Error occured</h1>
<h1>Some Error occurred</h1>
Either you made a mistake, or I made a mistake.
<br/><br/>
Anyway, there's nothing to see here, so you'll have to <a href='/'>head over to the index page</a>.
Either way, there's nothing to see here, so you'll have to <a href='/'>head over to the home page</a>.
<br/>
<br/>
Bye!

View File

@@ -1,27 +1,21 @@
{{define "file_not_found"}}
<!DOCTYPE html>
{{define "file_not_found"}}<!DOCTYPE html>
<html>
<head>
<title>File not found ~ PixelDrain</title>
<meta charset="UTF-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<link rel="stylesheet" href="/res/style/viewer.css"/>
<link href='https://fonts.googleapis.com/css?family=Ubuntu' rel='stylesheet' type='text/css'/>
<link rel="shortcut icon" href="/res/img/tray32.png"/>
<meta name="theme-color" content="#9FCF6C"/>
<link rel="icon" sizes="180x180" href="res/img/pixeldrain.png"/>
<link rel="icon" sizes="256x256" href="res/img/pixeldrain_big.png"/>
{{template "meta_tags" "File Not Found"}}
</head>
<body>
<h1>File not Found</h1>
I'm sorry, but this file does not exist!<br/>
It may have expired, or taken down by the owner.<br/>
You can <a href='/'>Visit the homepage to upload your own files</a>.
<br/><br/>
It was fun having you, bye for now!
<div id="body">
{{template "menu"}}
<h1>File not Found</h1>
I'm sorry, but this file does not exist!<br/>
It may have expired, or taken down by the owner.<br/>
You can <a href='/'>Visit the homepage to upload your own files</a>.
<br/><br/>
It was fun having you, bye for now!
<br/>
{{template "footer"}}
</div>
{{template "analytics"}}
</body>
</html>
{{end}}
{{end}}

View File

@@ -1,9 +1,10 @@
{{define "menu"}}
<div id="navigation" class="highlight_light border_top border_bottom navigation">
<a href="/">Home</a>
<a href="/history">My&nbsp;Files</a>
<a href="{{if .Authenticated}}/files{{else}}/history{{end}}">My&nbsp;Files</a>
<a href="/api">API</a>
{{if .Authenticated}}<a href="/user">{{.Username}}</a>{{else}}
{{if .Authenticated}}<a href="/user">{{.Username}}</a>
<a href="/logout" style="vertical-align: 0.6em; font-size: 0.9em; padding: 1px;">(Log out)</a>{{else}}
<a href="/login">Login</a>
<a href="/register">Register</a>
{{end}}

View File

@@ -0,0 +1,26 @@
{{define "meta_tags"}}
<title>{{.}} ~ PixelDrain</title>
<meta charset="UTF-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<link rel="stylesheet" href="/global.css"/>
<link rel="stylesheet" href="/res/style/layout.css"/>
<link href='https://fonts.googleapis.com/css?family=Ubuntu' rel='stylesheet' type='text/css'/>
<link href="https://fonts.googleapis.com/css?family=Lato:100" rel="stylesheet" type="text/css"/>
<link rel="shortcut icon" href="/res/img/tray32.png"/>
<meta name="theme-color" content="#9FCF6C"/>
<link rel="icon" sizes="180x180" href="/res/img/pixeldrain.png"/>
<link rel="icon" sizes="256x256" href="/res/img/pixeldrain_big.png"/>
{{template "bgpattern"}}
<meta name="description" content="PixelDrain is a free file sharing service, you
can upload any file and you will be given a shareable link right away.
PixelDrain also supports previews for images, videos, audio, PDFs and much more.
Uncensored, unmonitored and unmoderated."/>
<meta property="og:type" content="website" />
<meta property="og:title" content="{{.}} ~ PixelDrain" />
<meta property="og:site_name" content="PixelDrain" />
<meta property="og:description" content="Instant file and screenshot sharing." />
<meta property="og:url" content="http://pixeldra.in/" />
<meta property="og:image" content="/res/img/pixeldrain_big.png" />
<meta property="og:image:type" content="image/png" />
{{end}}

View File

@@ -1,39 +1,13 @@
{{define "history-cookies"}}<!DOCTYPE html>
{{define "history_cookies"}}<!DOCTYPE html>
<html>
<head>
<title>Upload History ~ PixelDrain</title>
<meta charset="UTF-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<link rel="stylesheet" href="/global.css"/>
<link rel="stylesheet" href="/res/style/layout.css"/>
<link href='https://fonts.googleapis.com/css?family=Ubuntu' rel='stylesheet' type='text/css'/>
<link href="https://fonts.googleapis.com/css?family=Lato:100" rel="stylesheet" type="text/css"/>
<link rel="shortcut icon" href="/res/img/tray32.png"/>
<meta name="theme-color" content="#9FCF6C"/>
<link rel="icon" sizes="180x180" href="/res/img/pixeldrain.png"/>
<link rel="icon" sizes="256x256" href="/res/img/pixeldrain_big.png"/>
{{template "bgpattern"}}
{{template "meta_tags" "Upload History"}}
<script src="res/script/jquery.js"></script>
<script src="res/script/jquery-cookie.js"></script>
<link rel="stylesheet" href="https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/themes/smoothness/jquery-ui.css"/>
<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/jquery-ui.min.js"></script>
<script>var APIURL = "{{apiUrl}}";</script>
<meta name="description" content="PixelDrain is a free file sharing service, you
can upload any file and you will be given a shareable link right away.
PixelDrain also supports previews for images, videos, audio, PDFs and much more.
Uncensored, unmonitored and unmoderated."/>
<meta property="og:type" content="website" />
<meta property="og:title" content="File Upload History ~ PixelDrain" />
<meta property="og:site_name" content="PixelDrain" />
<meta property="og:description" content="Instant file and screenshot sharing." />
<meta property="og:url" content="http://pixeldra.in/" />
<meta property="og:image" content="/res/img/pixeldrain_big.png" />
<meta property="og:image:type" content="image/png" />
<script type="text/javascript">var apiEndpoint = '{{.APIEndpoint}}';</script>
</head>
<body>
<div id='body' class="body">
{{template "menu" .}}

View File

@@ -2,33 +2,9 @@
<!DOCTYPE html>
<html>
<head>
<title>PixelDrain ~ Free file sharing service</title>
<meta charset="UTF-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<link rel="stylesheet" href="/global.css"/>
<link rel="stylesheet" href="/res/style/layout.css"/>
<link href='https://fonts.googleapis.com/css?family=Ubuntu' rel='stylesheet' type='text/css'/>
<link href="https://fonts.googleapis.com/css?family=Lato:100" rel="stylesheet" type="text/css"/>
<link rel="shortcut icon" href="/res/img/tray32.png"/>
<meta name="theme-color" content="#9FCF6C"/>
<link rel="icon" sizes="180x180" href="/res/img/pixeldrain.png"/>
<link rel="icon" sizes="256x256" href="/res/img/pixeldrain_big.png"/>
{{template "bgpattern"}}
{{template "meta_tags" "Free file sharing service"}}
<script src="/res/script/jquery-2.1.4.min.js"></script>
<meta name="description" content="PixelDrain is a free file sharing service, you
can upload any file and you will be given a shareable link right away.
PixelDrain also supports previews for images, videos, audio, PDFs and much more.
Uncensored, unmonitored and unmoderated."/>
<meta property="og:type" content="website" />
<meta property="og:title" content="Home ~ PixelDrain" />
<meta property="og:site_name" content="PixelDrain" />
<meta property="og:description" content="Instant file and screenshot sharing." />
<meta property="og:url" content="http://pixeldra.in/" />
<meta property="og:image" content="/res/img/pixeldrain_big.png" />
<meta property="og:image:type" content="image/png" />
<script type="text/javascript">var apiEndpoint = '{{.APIEndpoint}}';</script>
</head>
<body>