Some optimizations. Improve font loading and embed global.css directly

This commit is contained in:
Wim Brand
2019-02-18 13:37:41 +01:00
parent 92ae4d0d6b
commit 287b5af6fb
23 changed files with 50 additions and 17 deletions

View File

@@ -5,6 +5,10 @@
function uploadText() {
var text = $("#textarea").val();
if(!text.endsWith("\n")){
text += "\n";
}
var blob = new Blob([text], {type: "text/plain"});
startFileUpload(blob);

View File

@@ -13,13 +13,27 @@
font-family: 'Ubuntu';
font-style: normal;
font-weight: 400;
src: local('Ubuntu Regular'), local('Ubuntu-Regular'), local('Ubuntu'), url(/res/misc/Ubuntu-R.ttf) format('truetype');
font-display: auto;
src:
local('Ubuntu'),
local('Ubuntu Regular'),
local('Ubuntu, Regular'),
local('Ubuntu-Regular'),
url(/res/misc/Ubuntu-R.ttf) format('truetype');
}
@font-face {
font-family: 'Lato';
font-style: normal;
font-weight: 100;
src: local('Lato Hairline'), local('Lato-Hairline'), url(/res/misc/Lato-Hairline.ttf) format('truetype');
font-display: auto;
src:
local('Lato Thin'),
local('Lato, Thin'),
local('Lato-Thin'),
local('Lato Hairline'),
local('Lato, Hairline'),
local('Lato-Hairline'),
url(/res/misc/Lato-Hairline.ttf) format('truetype');
}
/* Page rendering configuration */

View File

@@ -2,6 +2,7 @@
<html>
<head>
{{template "meta_tags" "Not Found"}}
{{template "user_style" .}}
</head>
<body>

View File

@@ -2,6 +2,7 @@
<html>
<head>
{{template "meta_tags" "Internal Server Error"}}
{{template "user_style" .}}
</head>
<body>

View File

@@ -2,6 +2,7 @@
<html>
<head>
{{template "meta_tags" "File Manager"}}
{{template "user_style" .}}
<script type="text/javascript">var apiEndpoint = '{{.APIEndpoint}}';</script>
<style>
.file_manager {

View File

@@ -3,6 +3,7 @@
<html>
<head>
{{template "meta_tags" "Login"}}
{{template "user_style" .}}
<script type="text/javascript">var apiEndpoint = '{{.APIEndpoint}}';</script>
</head>
<body>

View File

@@ -2,6 +2,7 @@
<html>
<head>
{{template "meta_tags" "Logging out..."}}
{{template "user_style" .}}
</head>
<body>
<div id='body' class="body">

View File

@@ -2,6 +2,7 @@
<html>
<head>
{{template "meta_tags" "Register"}}
{{template "user_style" .}}
<script type="text/javascript">var apiEndpoint = '{{.APIEndpoint}}';</script>
<script src='https://www.google.com/recaptcha/api.js'></script>
</head>

View File

@@ -2,6 +2,7 @@
<html>
<head>
{{template "meta_tags" "Files"}}
{{template "user_style" .}}
<script type="text/javascript">var apiEndpoint = '{{.APIEndpoint}}';</script>
</head>

View File

@@ -2,6 +2,7 @@
<html>
<head>
{{template "meta_tags" .Username}}
{{template "user_style" .}}
<script type="text/javascript">var apiEndpoint = '{{.APIEndpoint}}';</script>
</head>

View File

@@ -2,6 +2,7 @@
<html>
<head>
{{template "meta_tags" "Lists"}}
{{template "user_style" .}}
<script type="text/javascript">var apiEndpoint = '{{.APIEndpoint}}';</script>
</head>

View File

@@ -2,6 +2,7 @@
<html>
<head>
{{template "meta_tags" .Username}}
{{template "user_style" .}}
<script type="text/javascript">var apiEndpoint = '{{.APIEndpoint}}';</script>
</head>

View File

@@ -2,6 +2,7 @@
<html>
<head>
{{template "meta_tags" "API Documentation"}}
{{template "user_style" .}}
<style>
.api_doc_details{
border-top: 1px solid;

View File

@@ -2,6 +2,7 @@
<html>
<head>
{{template "meta_tags" "File Not Found"}}
{{template "user_style" .}}
</head>
<body>
<div id="body">

View File

@@ -5,7 +5,9 @@
<title>{{.Title}}</title>
<meta charset="UTF-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<link rel="stylesheet" href="/global.css"/>
<style>
{{.UserStyle}}
</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"/>

View File

@@ -2,7 +2,6 @@
<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 rel="shortcut icon" href="/res/img/tray32.png"/>
<meta name="theme-color" content="#9FCF6C"/>

View File

@@ -0,0 +1,5 @@
{{define "user_style"}}
<style>
{{.UserStyle}}
</style>
{{end}}

View File

@@ -2,6 +2,7 @@
<html>
<head>
{{template "meta_tags" "Upload History"}}
{{template "user_style" .}}
<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"/>

View File

@@ -3,6 +3,7 @@
<html>
<head>
{{template "meta_tags" "Free file sharing service"}}
{{template "user_style" .}}
<script src="/res/script/jquery-2.1.4.min.js"></script>
<script type="text/javascript">var apiEndpoint = '{{.APIEndpoint}}';</script>
</head>

View File

@@ -3,6 +3,7 @@
<html>
<head>
{{template "meta_tags" "Text Upload"}}
{{template "user_style" .}}
<link rel="stylesheet" href="/res/style/viewer.css"/>
<script src="/res/script/jquery-2.1.4.min.js"></script>
<style>