Add asynchronous functions to the templates to reduce page load times.

Asynchronous functions for CSS and JS.
This commit is contained in:
ZeroDot1 2019-02-23 19:37:56 +01:00
parent 3af05dcc20
commit 06d50df10e
7 changed files with 124 additions and 109 deletions

View File

@ -1,16 +1,19 @@
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head>
<title>OnionShare: 403 Forbidden</title> <head>
<link href="/static/img/favicon.ico" rel="icon" type="image/x-icon" /> <title>OnionShare: 403 Forbidden</title>
<link href="/static/css/style.css" rel="stylesheet" type="text/css" /> <link href="/static/img/favicon.ico" rel="icon" type="image/x-icon" />
</head> <link rel="stylesheet" rel="subresource" type="text/css" href="/static/css/style.css" media="none" onload="if(media!='all')media='all'">
<body> </head>
<div class="info-wrapper">
<div class="info"> <body>
<p><img class="logo" src="/static/img/logo_large.png" title="OnionShare"></p> <div class="info-wrapper">
<p class="info-header">You are not allowed to perform that action at this time.</p> <div class="info">
</div> <p><img class="logo" src="/static/img/logo_large.png" title="OnionShare"></p>
</div> <p class="info-header">You are not allowed to perform that action at this time.</p>
</body> </div>
</div>
</body>
</html> </html>

View File

@ -1,16 +1,19 @@
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head>
<title>OnionShare: 404 Not Found</title> <head>
<link href="/static/img/favicon.ico" rel="icon" type="image/x-icon" /> <title>OnionShare: 404 Not Found</title>
<link href="/static/css/style.css" rel="stylesheet" type="text/css" /> <link href="/static/img/favicon.ico" rel="icon" type="image/x-icon">
</head> <link rel="stylesheet" rel="subresource" type="text/css" href="/static/css/style.css" media="none" onload="if(media!='all')media='all'">
<body> </head>
<div class="info-wrapper">
<div class="info"> <body>
<p><img class="logo" src="/static/img/logo_large.png" title="OnionShare"></p> <div class="info-wrapper">
<p class="info-header">404 Not Found</p> <div class="info">
</div> <p><img class="logo" src="/static/img/logo_large.png" title="OnionShare"></p>
</div> <p class="info-header">404 Not Found</p>
</body> </div>
</div>
</body>
</html> </html>

View File

@ -1,10 +1,13 @@
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head>
<title>OnionShare</title> <head>
<link href="/static/img/favicon.ico" rel="icon" type="image/x-icon" /> <title>OnionShare</title>
</head> <link href="/static/img/favicon.ico" rel="icon" type="image/x-icon" />
<body> </head>
<p>OnionShare download in progress</p>
</body> <body>
<p>OnionShare download in progress</p>
</body>
</html> </html>

View File

@ -2,8 +2,8 @@
<html> <html>
<head> <head>
<title>OnionShare</title> <title>OnionShare</title>
<link href="/static/img/favicon.ico" rel="icon" type="image/x-icon" /> <link href="/static/img/favicon.ico" rel="icon" type="image/x-icon">
<link href="/static/css/style.css" rel="stylesheet" type="text/css" /> <link rel="stylesheet" rel="subresource" type="text/css" href="/static/css/style.css" media="none" onload="if(media!='all')media='all'">
</head> </head>
<body> <body>
@ -49,10 +49,10 @@
to Standard or to Standard or
<a target="_blank" href="/noscript-xss-instructions">turn off your Tor Browser's NoScript XSS setting</a>.</p> <a target="_blank" href="/noscript-xss-instructions">turn off your Tor Browser's NoScript XSS setting</a>.</p>
</div> </div>
<script src="/static/js/receive-noscript.js"></script> <script async src="/static/js/receive-noscript.js" charset="utf-8"></script>
</div> </div>
<script src="/static/js/jquery-3.3.1.min.js"></script> <script src="/static/js/jquery-3.3.1.min.js" charset="utf-8"></script>
<script src="/static/js/receive.js"></script> <script async src="/static/js/receive.js" charset="utf-8"></script>
</body> </body>
</html> </html>

View File

@ -2,8 +2,8 @@
<html> <html>
<head> <head>
<title>OnionShare</title> <title>OnionShare</title>
<link href="/static/img/favicon.ico" rel="icon" type="image/x-icon" /> <link href="/static/img/favicon.ico" rel="icon" type="image/x-icon">
<link href="/static/css/style.css" rel="stylesheet" type="text/css" /> <link rel="stylesheet" rel="subresource" type="text/css" href="/static/css/style.css" media="none" onload="if(media!='all')media='all'">
</head> </head>
<body> <body>

View File

@ -1,56 +1,59 @@
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head>
<title>OnionShare</title>
<link href="/static/img/favicon.ico" rel="icon" type="image/x-icon" />
<link href="/static/css/style.css" rel="stylesheet" type="text/css" />
<meta name="onionshare-filename" content="{{ filename }}">
<meta name="onionshare-filesize" content="{{ filesize }}">
</head>
<body>
<header class="clearfix"> <head>
<div class="right"> <title>OnionShare</title>
<ul> <link href="/static/img/favicon.ico" rel="icon" type="image/x-icon">
<li>Total size: <strong>{{ filesize_human }}</strong> {% if is_zipped %} (compressed){% endif %}</li> <link rel="stylesheet" rel="subresource" type="text/css" href="/static/css/style.css" media="none" onload="if(media!='all')media='all'">
{% if slug %} <meta name="onionshare-filename" content="{{ filename }}">
<li><a class="button" href='/{{ slug }}/download'>Download Files</a></li> <meta name="onionshare-filesize" content="{{ filesize }}">
{% else %} </head>
<li><a class="button" href='/download'>Download Files</a></li>
{% endif %} <body>
</ul>
</div> <header class="clearfix">
<img class="logo" src="/static/img/logo.png" title="OnionShare"> <div class="right">
<h1>OnionShare</h1> <ul>
</header> <li>Total size: <strong>{{ filesize_human }}</strong> {% if is_zipped %} (compressed){% endif %}</li>
{% if slug %}
<li><a class="button" href='/{{ slug }}/download'>Download Files</a></li>
{% else %}
<li><a class="button" href='/download'>Download Files</a></li>
{% endif %}
</ul>
</div>
<img class="logo" src="/static/img/logo.png" title="OnionShare">
<h1>OnionShare</h1>
</header>
<table class="file-list" id="file-list">
<tr>
<th id="filename-header">Filename</th>
<th id="size-header">Size</th>
<th></th>
</tr>
{% for info in file_info.dirs %}
<tr>
<td>
<img width="30" height="30" title="" alt="" src="/static/img/web_folder.png" />
{{ info.basename }}
</td>
<td>{{ info.size_human }}</td>
<td></td>
</tr>
{% endfor %}
{% for info in file_info.files %}
<tr>
<td>
<img width="30" height="30" title="" alt="" src="/static/img/web_file.png" />
{{ info.basename }}
</td>
<td>{{ info.size_human }}</td>
<td></td>
</tr>
{% endfor %}
</table>
<script async src="/static/js/send.js" charset="utf-8"></script>
</body>
<table class="file-list" id="file-list">
<tr>
<th id="filename-header">Filename</th>
<th id="size-header">Size</th>
<th></th>
</tr>
{% for info in file_info.dirs %}
<tr>
<td>
<img width="30" height="30" title="" alt="" src="/static/img/web_folder.png" />
{{ info.basename }}
</td>
<td>{{ info.size_human }}</td>
<td></td>
</tr>
{% endfor %}
{% for info in file_info.files %}
<tr>
<td>
<img width="30" height="30" title="" alt="" src="/static/img/web_file.png" />
{{ info.basename }}
</td>
<td>{{ info.size_human }}</td>
<td></td>
</tr>
{% endfor %}
</table>
<script src="/static/js/send.js"></script>
</body>
</html> </html>

View File

@ -1,22 +1,25 @@
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head>
<title>OnionShare is closed</title>
<link href="/static/img/favicon.ico" rel="icon" type="image/x-icon" />
<link href="/static/css/style.css" rel="stylesheet" type="text/css" />
</head>
<body>
<header class="clearfix">
<img class="logo" src="/static/img/logo.png" title="OnionShare">
<h1>OnionShare</h1>
</header>
<div class="info-wrapper"> <head>
<div class="info"> <title>OnionShare is closed</title>
<p><img class="logo" src="/static/img/logo_large.png" title="OnionShare"></p> <link href="/static/img/favicon.ico" rel="icon" type="image/x-icon">
<p class="info-header">Thank you for using OnionShare</p> <link rel="stylesheet" rel="subresource" type="text/css" href="/static/css/style.css" media="none" onload="if(media!='all')media='all'">
<p class="info-description">You may now close this window.</p> </head>
</div>
</div> <body>
</body> <header class="clearfix">
<img class="logo" src="/static/img/logo.png" title="OnionShare">
<h1>OnionShare</h1>
</header>
<div class="info-wrapper">
<div class="info">
<p><img class="logo" src="/static/img/logo_large.png" title="OnionShare"></p>
<p class="info-header">Thank you for using OnionShare</p>
<p class="info-description">You may now close this window.</p>
</div>
</div>
</body>
</html> </html>