use separate pd client

This commit is contained in:
2020-06-07 21:12:48 +02:00
parent 843eaf51f9
commit 1a53def1ef
32 changed files with 185 additions and 692 deletions

View File

@@ -0,0 +1,7 @@
<svg xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 160 126.66667" height="24" width="24" xml:space="preserve" version="1.1" id="svg2">
<g transform="matrix(1.3333333,0,0,-1.3333333,0,126.66667)" id="g10">
<g transform="scale(0.1)" id="g12">
<path id="path14" fill="#{{.Style.InputTextColor.RGB}}" style="fill-opacity:1;fill-rule:nonzero;stroke:none" d="m 1200,810 -47.46,0 C 1134.92,810 1110,784.582 1110,768.309 l 0,-589.809 c 0,-16.293 24.92,-38.5 42.54,-38.5 l 47.46,0 0,-140 -430,0 0,140 90,0 0,620 -4.41,0 L 645.422,0 482.707,0 275.25,760 270,760 270,140 360,140 360,0 0,0 0,140 46.0977,140 C 65.082,140 90,162.207 90,178.5 l 0,589.809 C 90,784.582 65.082,810 46.0977,810 L 0,810 l 0,140 450.164,0 147.797,-550 4.066,0 149.164,550 448.809,0 0,-140"/>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 823 B

View File

@@ -0,0 +1,6 @@
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 100 100">
<g fill="#{{.Style.InputTextColor.RGB}}" fill-rule="evenodd">
<path d="M64.1102,0.1004 C44.259,0.1004 28.1086,16.2486 28.1086,36.0986 C28.1086,55.8884 44.259,71.989 64.1102,71.989 C83.9,71.989 100,55.8884 100,36.0986 C100,16.2486 83.9,0.1004 64.1102,0.1004"/>
<polygon points=".012 95.988 17.59 95.988 17.59 .1 .012 .1"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 432 B

View File

@@ -48,6 +48,9 @@
.icon.small {
font-size: 16px;
}
a > svg {
vertical-align: middle;
}
/* Page rendering configuration */
html, body {

View File

@@ -216,6 +216,7 @@
top: 0;
width: 8em;
height: auto;
text-align: center;
}
.toolbar_button{

View File

@@ -22,7 +22,7 @@
<div class="spacer"></div>
<button id="btn_home">🏠</button> -->
<div class="spacer"></div>
<input class="breadcrumbs" type="text" value="/{{.Username}}"/>
<input class="breadcrumbs" type="text" value="/{{.User.Username}}"/>
<div class="spacer"></div>
<input id="input_search" class="input_search" type="text" placeholder="Search..."/>
<div class="spacer"></div>
@@ -51,10 +51,10 @@
let hashChange = () => {
if (window.location.hash === "#files") {
breadcrumbs.value = "/{{.Username}}/Files"
breadcrumbs.value = "/{{.User.Username}}/Files"
fm.getUserFiles()
} else if (window.location.hash === "#lists") {
breadcrumbs.value = "/{{.Username}}/Lists"
breadcrumbs.value = "/{{.User.Username}}/Lists"
fm.getUserLists()
} else {
alert("invalid file manager type")

View File

@@ -1,7 +1,7 @@
{{define "user_home"}}<!DOCTYPE html>
<html lang="en">
<head>
{{template "meta_tags" .Username}}
{{template "meta_tags" .User.Username}}
{{template "user_style" .}}
<script>var apiEndpoint = '{{.APIEndpoint}}';</script>
</head>
@@ -9,47 +9,57 @@
<body>
{{template "page_top" .}}
<h1>Welcome home, {{.Username}}!</h1>
<h1>Welcome home, {{.User.Username}}!</h1>
<div class="page_content"><div class="limit_width">
<h2>Account information</h2>
<ul>
<li>Username: {{.Username}}</li>
<li>E-mail address: {{.Email}}</li>
</ul>
<a href="/user/settings" class="button">Update account settings</a>
<h2>Your most recently uploaded files:</h2>
<div class="highlight_dark">
{{$files := .PixelAPI.UserFiles 0 15}}
{{range $files.Files}}<!--
--><a class="file_button" href="/u/{{.ID}}" target="_blank">
<img src="{{$.APIEndpoint}}/file/{{.ID}}/thumbnail?width=80&height=80" alt="{{.Name}}" />
<span class="file_button_title">{{.Name}}</span>
<br/>
{{.DateUpload.Format "2006-01-02 15:04:05"}}
</a><!--
-->{{end}}
<br/>
<a href="/user/files" class="button">...All my files</a>
<div class="page_content">
<div class="limit_width">
<h2>Account information</h2>
<ul>
<li>Username: {{.User.Username}}</li>
<li>E-mail address: {{.User.Email}}</li>
<li>
Supporter status:
{{if eq .User.Subscription ""}}
Not a pixeldrain supporter<br/>
<a href="https://www.patreon.com/pixeldrain">Learn how to support pixeldrain</a>.
{{else}}
{{if eq .User.Subscription "patreon_1"}}
Level 1 Patreon supporter. Benefits:
<ul>
<li>No ads when viewing files</li>
</ul>
{{else if eq .User.Subscription "patreon_2"}}
Level 2 Patreon supporter. Benefits:
<ul>
<li>No ads when viewing files</li>
<li>No ads on uploaded files</li>
<li>2-month file expiry (Not implemented yet)</li>
</ul>
{{else if eq .User.Subscription "patreon_3"}}
Level 3 Patreon supporter. Benefits:
<ul>
<li>No ads when viewing files</li>
<li>No ads on uploaded files</li>
<li>6-month file expiry (Not implemented yet)</li>
</ul>
{{else if eq .User.Subscription "patreon_4"}}
Level 4 Patreon supporter. Benefits:
<ul>
<li>No ads when viewing files</li>
<li>No ads on uploaded files</li>
<li>No file expiry (Not implemented yet)</li>
</ul>
{{end}}
{{end}}
</li>
</ul>
<a href="/user/settings" class="button button_highlight">Change account settings</a>
<h2>Navigation</h2>
<a href="/" class="button">Upload files</a>
<a href="/user/filemanager#files" class="button">My files</a>
<a href="/user/filemanager#lists" class="button">My lists</a>
</div>
<h2>Your most recently created lists:</h2>
<div class="highlight_dark">
{{$lists := .PixelAPI.UserLists 0 15}}
{{range $lists.Lists}}<!--
--><a class="file_button" href="/l/{{.ID}}" target="_blank">
<img src="{{$.APIEndpoint}}/list/{{.ID}}/thumbnail?width=80&height=80" alt="{{.Title}}" />
<span class="file_button_title">{{.Title}}</span>
({{.FileCount}} Files)
<br/>
{{.DateCreated.Format "2006-01-02 15:04:05"}}
</a><!--
-->{{end}}
<br/>
<a href="/user/lists" class="button">...All my lists</a>
</div>
<br/><br/>
</div></div>
</div>
{{template "page_bottom" .}}

View File

@@ -1,7 +1,7 @@
{{define "user_settings"}}<!DOCTYPE html>
<html lang="en">
<head>
{{template "meta_tags" .Username}}
{{template "meta_tags" .User.Username}}
{{template "user_style" .}}
<script>var apiEndpoint = '{{.APIEndpoint}}';</script>
</head>

View File

@@ -1,7 +1,7 @@
{{define "user_settings_vue_test"}}<!DOCTYPE html>
<html lang="en">
<head>
{{template "meta_tags" .Username}}
{{template "meta_tags" .User.Username}}
{{template "user_style" .}}
<script>var apiEndpoint = '{{.APIEndpoint}}';</script>
</head>

View File

@@ -9,7 +9,7 @@
{{$isAdmin := .PixelAPI.UserIsAdmin}}
{{template "page_top" .}}
<div class="page_content">
{{if $isAdmin.IsAdmin}}
{{if $isAdmin}}
<h3>Bandwidth and views</h3>
<div class="highlight_dark">
<button onclick="setData(7, 60);">Week</button>

View File

@@ -12,7 +12,7 @@
{{$success := .URLQuery.Get "success"}}
{{if eq $success "true"}}
{{if .Authenticated}}
Dear {{.Username}},
Dear {{.User.Username}},
<br/><br/>
Thank you for your donation. I really appreciate it!
<br/><br/>

View File

@@ -69,7 +69,26 @@
<i class="icon">edit</i>
<span><u>E</u>dit</span>
</button>
{{template "advertisement" .}}
<br/>
{{if .Other.ShowAds}}
<hr/>
<!-- <div id="brave_ref" style="text-align: center; padding: 2px;"> -->
{{if ne (isBrave .UserAgent) true}}
Use the Brave web browser for a faster and safer web!<br/>
<a href="https://brave.com/pix009" id="btnBrave" class="button toolbar_button button_full_width button_highlight">
<img src="{{template `brave_lion.png`}}" alt="Brave lion"/>
<span>Get Brave</span>
</a>
<br/>
or <a href="https://medium.com/pixeldrain/advertising-on-pixeldrain-a-more-honest-approach-d5e00e3f0c29">learn why pixeldrain supports Brave</a>
{{else}}
Thank you for using Brave! Please consider supporting pixeldrain with a tip
<img src="{{template `bat_logo_color.png`}}" style="height: 1em; width: 1em;" />
{{end}}
<!-- </div> -->
<br/>
{{end}}
<!-- 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>
@@ -99,6 +118,7 @@
</div>
</div>
{{if .Other.ShowAds}}
<div id="sponsors" class="sponsors">
{{if eq .Other.AdType 0}}
<!-- scrolling="no" is not allowed by the W3C, but overflow: hidden doesn't work in chrome, so I have no choice -->
@@ -114,6 +134,7 @@
</a>
{{end}}
</div>
{{end}}
</div>
<template id="tpl_details_popup">

View File

@@ -1,18 +0,0 @@
{{define "advertisement"}}
<br/><hr/>
<div id="brave_ref" style="text-align: center; padding: 2px;">
{{if ne (isBrave .UserAgent) true}}
Use the Brave web browser for a faster and safer web!<br/>
<a href="https://brave.com/pix009" id="btnBrave" class="button toolbar_button button_full_width button_highlight">
<img src="{{template `brave_lion.png`}}" alt="Brave lion"/>
<span>Get Brave</span>
</a>
<br/>
or <a href="https://medium.com/pixeldrain/advertising-on-pixeldrain-a-more-honest-approach-d5e00e3f0c29">learn why pixeldrain supports Brave</a>
{{else}}
Thank you for using Brave! Please consider supporting pixeldrain with a tip
<img src="{{template `bat_logo_color.png`}}" style="height: 1em; width: 1em;" />
{{end}}
</div>
<br/>
{{end}}

View File

@@ -3,7 +3,7 @@
<div id="page_navigation" class="page_navigation">
<a href="/">Home</a>
<hr />
{{if .Authenticated}}<a href="/user">{{.Username}}</a>
{{if .Authenticated}}<a href="/user">{{.User.Username}}</a>
<a href="/user/filemanager#files">My Files</a>
<a href="/user/filemanager#lists">My Lists</a>
<a href="/logout">Log out</a>
@@ -42,10 +42,17 @@
{{define "page_bottom"}}
<div class="highlight_dark">
Pixeldrain is a product by <a href="//fornaxian.com" target="_blank">Fornaxian Technologies</a> |
Twitter:&nbsp;<a href="https://twitter.com/Fornax96" target="_blank">@Fornax96</a>
Reddit:&nbsp;<a href="https://reddit.com/r/pixeldrain" target="_blank">/r/pixeldrain</a>
Medium:&nbsp;<a href="https://medium.com/pixeldrain" target="_blank">Pixeldrain</a>
<div style="display: inline-block; margin: 0 8px 0 8px;">
Pixeldrain is a product by <a href="//fornaxian.com" target="_blank">Fornaxian Technologies</a>
</div>
<div style="display: inline-block; margin: 0 8px 0 8px;">
(
<a href="https://www.patreon.com/pixeldrain" target="_blank">{{template `patreon.svg` .}} Patreon</a> |
<a href="https://twitter.com/Fornax96" target="_blank">{{template `twitter.svg` .}} Twitter</a> |
<a href="https://reddit.com/r/pixeldrain" target="_blank">{{template `reddit.svg` .}} Reddit</a> |
<a href="https://medium.com/pixeldrain" target="_blank">{{template `medium.svg` .}} Medium</a>
)
</div>
<br/>
<span class="small_footer_text" style="font-size: .75em; line-height: .75em;">
page rendered by {{.Hostname}}

View File

@@ -1,22 +0,0 @@
{{define "hide_refer"}}<!DOCTYPE html>
<html>
<head>
<title>You are being redirected</title>
<!-- <meta http-equiv="refresh" content="0; {{.}}" /> -->
<style>html, body {background-color: #000000;}</style>
</head>
<body>
You are being redirected.<br/>
<br/>
If it doesn't work. <a id="link" href="{{.}}">Click here</a>.
<script>
var a = document.getElementById("link");
if(!a.click) {
window.location = "{{.}}";
}
a.click();
</script>
</body>
</html>
{{end}}

View File

@@ -56,7 +56,6 @@
</a>
<br/><br/>
Tip: Save your file with extension '.md' to use markdown formatting<br/>
{{template "advertisement" .}}
</div>
<div class="textarea_container">
<textarea id="textarea" class="textarea" placeholder="Your text here..." autofocus="autofocus"></textarea>