More styling fixes, and fix the file not found page
This commit is contained in:
@@ -215,7 +215,7 @@ var DetailsWindow = {
|
||||
$("#info_file_details").html(
|
||||
"<table>"
|
||||
+ "<tr><td>Name<td><td>" + escapeHTML(data.name) + "</td></tr>"
|
||||
+ "<tr><td>Url<td><td><a href=\"/u/" + data.id + "\">/u/" + data.id + "</a></td></tr>"
|
||||
+ "<tr><td>URL<td><td><a href=\"/u/" + data.id + "\">/u/" + data.id + "</a></td></tr>"
|
||||
+ "<tr><td>Mime Type<td><td>" + escapeHTML(data.mime_type) + "</td></tr>"
|
||||
+ "<tr><td>ID<td><td>" + data.id + "</td></tr>"
|
||||
+ "<tr><td>Size<td><td class=\"bytecounter\">" + data.size + "</td></tr>"
|
||||
|
@@ -254,15 +254,13 @@ pre{
|
||||
}
|
||||
|
||||
.big_button{
|
||||
height: 1.3em;
|
||||
width: 40%;
|
||||
min-width: 200px;
|
||||
max-width: 400px;
|
||||
margin: 10px !important;
|
||||
border-radius: 5px;
|
||||
font-size: 1.9em;
|
||||
font-size: 1.8em;
|
||||
font-weight: normal;
|
||||
line-height: 8px;
|
||||
}
|
||||
|
||||
.progress_bar{
|
||||
@@ -347,13 +345,13 @@ select{
|
||||
border: none;
|
||||
margin: 3px;
|
||||
background: linear-gradient(var(--input_color), var(--input_color_dark));
|
||||
padding: 6px 8px 6px 8px;
|
||||
padding: .4em .5em .4em .5em;
|
||||
box-shadow: 2px 2px 6px -3px var(--shadow_color);
|
||||
font-weight: bold;
|
||||
font-size: 0.85em;
|
||||
font-size: 0.9em;
|
||||
line-height: 1em;
|
||||
overflow: hidden;
|
||||
line-height: 1;
|
||||
text-decoration: none;
|
||||
font-family: inherit;
|
||||
color: #bfbfbf; /* Fallback */
|
||||
color: var(--input_text_color);
|
||||
outline: 0;
|
||||
@@ -386,7 +384,7 @@ input[type="color"]:active,
|
||||
select:active{
|
||||
background: linear-gradient(var(--input_color_dark), var(--input_color));
|
||||
box-shadow: inset 4px 4px 8px var(--shadow_color);
|
||||
padding: 10px 4px 2px 12px; /* Exactly 4px offset compared to the inactive padding to give a depth effect */
|
||||
padding: .6em .3em .2em .7em; /* Exactly .2em offset compared to the inactive padding to give a depth effect */
|
||||
}
|
||||
.button_full_width {width: calc(100% - 6px);}
|
||||
.button_highlight {background: linear-gradient(var(--highlight_color), var(--highlight_color_dark)) !important; color: var(--highlight_text_color) !important;}
|
||||
|
@@ -7,6 +7,7 @@ body{
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
/* Viewer container */
|
||||
.file_viewer {
|
||||
position: absolute;
|
||||
display: flex;
|
||||
@@ -17,6 +18,8 @@ body{
|
||||
left: 0;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
/* Headerbar (row 1) */
|
||||
.file_viewer > .highlight_headerbar {
|
||||
flex-grow: 0;
|
||||
flex-shrink: 0;
|
||||
@@ -25,20 +28,15 @@ body{
|
||||
text-align: left;
|
||||
padding: 0.2em;
|
||||
}
|
||||
.file_viewer > .highlight_headerbar > .button_group {
|
||||
|
||||
/* Headerbar components */
|
||||
.file_viewer > .highlight_headerbar > * {
|
||||
flex-grow: 0;
|
||||
flex-shrink: 0;
|
||||
margin-left: .4em;
|
||||
margin-right: .4em;
|
||||
display: inline-flex;
|
||||
}
|
||||
.file_viewer > .highlight_headerbar > .button_toggle_toolbar {
|
||||
flex-grow: 0;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
.file_viewer > .highlight_headerbar > .button_home {
|
||||
flex-grow: 0;
|
||||
flex-shrink: 0;
|
||||
margin-right: .5em;
|
||||
}
|
||||
.file_viewer > .highlight_headerbar > .file_viewer_headerbar_title {
|
||||
flex-grow: 1;
|
||||
flex-shrink: 1;
|
||||
@@ -47,11 +45,8 @@ body{
|
||||
line-height: 2em;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
.file_viewer > .highlight_headerbar > .button_close_file_viewer {
|
||||
flex-grow: 0;
|
||||
flex-shrink: 0;
|
||||
margin-left: .5em;
|
||||
}
|
||||
|
||||
/* List Navigator (row 2) */
|
||||
.file_viewer > .list_navigator {
|
||||
flex-grow: 0;
|
||||
flex-shrink: 0;
|
||||
@@ -71,6 +66,8 @@ body{
|
||||
height: 40px !important;
|
||||
width: 250px !important;
|
||||
}
|
||||
|
||||
/* File preview area (row 3) */
|
||||
.file_viewer > .file_viewer_window {
|
||||
flex-grow: 1;
|
||||
flex-shrink: 1;
|
||||
|
@@ -6,18 +6,22 @@
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id='body' class="body">
|
||||
<div id="body" class="body">
|
||||
{{template "menu" .}}
|
||||
<br/>
|
||||
|
||||
<h1>This page does not exist!</h1>
|
||||
If you came here by a link from this very same website you can tell
|
||||
me about it on <a href="https://twitter.com/Fornax96">twitter</a>.
|
||||
<br/><br/>
|
||||
<p>
|
||||
If you came here by a link from this very same website you can
|
||||
tell me about it on
|
||||
<a href="https://twitter.com/Fornax96">twitter</a>.
|
||||
</p>
|
||||
<p>
|
||||
Either way, there's nothing to see here, so you'll have to
|
||||
<a href='/'>head over to the home page</a>.
|
||||
<br/>
|
||||
<br/>
|
||||
</p>
|
||||
<p>
|
||||
Bye!
|
||||
</p>
|
||||
{{template "footer"}}
|
||||
</div>
|
||||
{{template "analytics"}}
|
||||
|
@@ -1,7 +1,7 @@
|
||||
{{define "500"}}<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
{{template "meta_tags" "Internal Server Error"}}
|
||||
{{template "meta_tags" "500, Internal Server Error"}}
|
||||
{{template "user_style" .}}
|
||||
</head>
|
||||
|
||||
@@ -10,15 +10,15 @@
|
||||
{{template "menu" .}}
|
||||
<br/>
|
||||
<h1>You broke pixeldrain</h1>
|
||||
<p>
|
||||
Great job.
|
||||
<br/><br/>
|
||||
But not to worry, the engineering team has been pulled out of bed to
|
||||
have a look at the issue. You can try again in a few minutes (maybe
|
||||
hours, who knows?), or go back to the <a href='/'>home page</a> and
|
||||
start over.
|
||||
<br/>
|
||||
<br/>
|
||||
Bye!
|
||||
</p>
|
||||
<p>
|
||||
Just kidding, something went wrong on the pixeldrain server and
|
||||
it's my fault. I'll soon be notified of the problem and will
|
||||
take a look at it. You can try again in a few minutes (or
|
||||
hours), or go back to the <a href='/'>home page</a> and start over.
|
||||
</p>
|
||||
{{template "footer"}}
|
||||
</div>
|
||||
{{template "analytics"}}
|
||||
|
@@ -1,19 +1,61 @@
|
||||
{{define "file_not_found"}}<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
{{template "meta_tags" "File Not Found"}}
|
||||
{{template "meta_tags" "404, File Not Found"}}
|
||||
{{template "user_style" .}}
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<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!
|
||||
<div id="body" class="body">
|
||||
{{template "menu" .}}
|
||||
<br/>
|
||||
<h1>404, File Not Found!</h1>
|
||||
<p>
|
||||
This file does not exist, or it has been removed. Possible
|
||||
reasons for this are:
|
||||
</p>
|
||||
<ul>
|
||||
<li>The file has not been viewed for 100 days and has expired</li>
|
||||
<li>Something went wrong on the pixeldrain servers causing the file to be temporarily unavailable</li>
|
||||
<li>The file voilated copyright laws and has received a takedown request</li>
|
||||
<li>The content was deemed illegal in some country and censorship was requested by a government organisation</li>
|
||||
</ul>
|
||||
<p>
|
||||
I'm sorry for the inconvenience.
|
||||
</p>
|
||||
|
||||
{{template "footer"}}
|
||||
</div>
|
||||
{{template "analytics"}}
|
||||
</body>
|
||||
</html>
|
||||
{{end}}
|
||||
{{define "list_not_found"}}<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
{{template "meta_tags" "404, List Not Found"}}
|
||||
{{template "user_style" .}}
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="body" class="body">
|
||||
{{template "menu" .}}
|
||||
<br/>
|
||||
<h1>404, List Not Found!</h1>
|
||||
<p>
|
||||
This list does not exist, or it has been removed. Possible
|
||||
reasons for this are:
|
||||
</p>
|
||||
<ul>
|
||||
<li>All files in this list have not been viewed for 100 days and have expired</li>
|
||||
<li>Something went wrong on the pixeldrain servers causing the list to be temporarily unavailable</li>
|
||||
<li>The files in the list voilated copyright laws and have received a takedown request</li>
|
||||
<li>The files in the list were deemed illegal in some country and censorship was requested by a government organisation</li>
|
||||
</ul>
|
||||
<p>
|
||||
I'm sorry for the inconvenience.
|
||||
</p>
|
||||
|
||||
{{template "footer"}}
|
||||
</div>
|
||||
{{template "analytics"}}
|
||||
|
@@ -52,7 +52,7 @@
|
||||
</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>
|
||||
<span><u>C</u>opy Link</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"/>
|
||||
@@ -60,7 +60,7 @@
|
||||
</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>
|
||||
<span>Deta<u>i</u>ls</span>
|
||||
</button>
|
||||
{{template "advertisement" .}}
|
||||
|
||||
|
@@ -92,6 +92,7 @@
|
||||
your address bar. If you don't have Brave browser yet you
|
||||
can download it here:
|
||||
<a class="button button_highlight" href="https://brave.com/pix009" target="_blank">Install Brave</a>.
|
||||
<button class="button_highlight">Install Brave</button>.
|
||||
Installing and using Brave with this referral link also
|
||||
counts as a 5$ donation.
|
||||
</li>
|
||||
|
@@ -42,12 +42,14 @@ func (wc *WebController) serveFileViewer(w http.ResponseWriter, r *http.Request,
|
||||
finfo = append(finfo, inf)
|
||||
}
|
||||
|
||||
templateData := wc.newTemplateData(w, r)
|
||||
|
||||
if len(finfo) == 0 {
|
||||
wc.serveNotFound(w, r)
|
||||
w.WriteHeader(http.StatusNotFound)
|
||||
wc.templates.Get().ExecuteTemplate(w, "file_not_found", templateData)
|
||||
return
|
||||
}
|
||||
|
||||
templateData := wc.newTemplateData(w, r)
|
||||
templateData.OGData = metadataFromFile(*finfo[0])
|
||||
var err error
|
||||
if list {
|
||||
@@ -58,7 +60,7 @@ func (wc *WebController) serveFileViewer(w http.ResponseWriter, r *http.Request,
|
||||
APIResponse: map[string]interface{}{
|
||||
"data": finfo,
|
||||
"date_created": "now",
|
||||
"title": "Concatenation of files",
|
||||
"title": "Multiple files",
|
||||
"date_lastview": "now",
|
||||
"views": 0,
|
||||
},
|
||||
|
@@ -14,15 +14,17 @@ import (
|
||||
func (wc *WebController) serveListViewer(w http.ResponseWriter, r *http.Request, p httprouter.Params) {
|
||||
var api = pixelapi.New(wc.conf.APIURLInternal, "")
|
||||
var list, err = api.GetList(p.ByName("id"))
|
||||
var templateData = wc.newTemplateData(w, r)
|
||||
if err != nil {
|
||||
if err, ok := err.(pixelapi.Error); ok && err.ReqError {
|
||||
log.Error("API request error occurred: %s", err.Value)
|
||||
|
||||
}
|
||||
wc.serveNotFound(w, r)
|
||||
w.WriteHeader(http.StatusNotFound)
|
||||
wc.templates.Get().ExecuteTemplate(w, "list_not_found", templateData)
|
||||
return
|
||||
}
|
||||
|
||||
var templateData = wc.newTemplateData(w, r)
|
||||
templateData.Title = fmt.Sprintf("%s ~ Pixeldrain list", list.Title)
|
||||
templateData.OGData = metadataFromList(*list)
|
||||
templateData.Other = viewerData{
|
||||
|
Reference in New Issue
Block a user