2198cbdff9
- improved support for serving static resources from the binary, now supporting images - added new logo - changed save button - fixed footer attribution text, it is not true anymore that MicroBin is made by myself - replaced footer GitHub link with microbin.eu link
127 lines
No EOL
3.4 KiB
HTML
127 lines
No EOL
3.4 KiB
HTML
{% include "header.html" %}
|
|
<div style="float: left">
|
|
{% if pasta.content != "No Text Content" %}
|
|
<button id="copy-text-button" class="copy-text-button" style="margin-right: 0.5rem">
|
|
Copy Text
|
|
</button>
|
|
<a style="margin-right: 1rem" href="{{ args.public_path }}/raw/{{pasta.id_as_animals()}}">Raw Text
|
|
Content</a>
|
|
{%- endif %}
|
|
{% if args.qr && args.public_path.to_string() != "" %}
|
|
<a style="margin-right: 1rem" href="{{ args.public_path }}/qr/{{pasta.id_as_animals()}}">QR</a>
|
|
{%- endif %}
|
|
{% if pasta.editable %}
|
|
<a style="margin-right: 1rem" href="{{ args.public_path }}/edit/{{pasta.id_as_animals()}}">Edit</a>
|
|
{%- endif %}
|
|
<a style="margin-right: 1rem" href="{{ args.public_path }}/remove/{{pasta.id_as_animals()}}">Remove</a>
|
|
</div>
|
|
<div style="float: right">
|
|
<a style="margin-right: 0.5rem"
|
|
href="{{ args.public_path }}/pasta/{{pasta.id_as_animals()}}"><i>{{pasta.id_as_animals()}}</i></a>
|
|
{% if args.public_path.to_string() != "" %}
|
|
<button id="copy-url-button" class="copy-url-button" style="margin-right: 0">
|
|
Copy URL
|
|
</button>
|
|
{%- endif %}
|
|
</div>
|
|
{% if pasta.file.is_some() %}
|
|
<br>
|
|
<br>
|
|
<a href="{{ args.public_path }}/file/{{pasta.id_as_animals()}}/{{pasta.file.as_ref().unwrap().name()}}" download>
|
|
Download attached file: '{{pasta.file.as_ref().unwrap().name()}}' [{{pasta.file.as_ref().unwrap().size}}]
|
|
</a>
|
|
{%- endif %}
|
|
<br>
|
|
<br>
|
|
{% if pasta.content != "No Text Content" %}
|
|
<div class="code-container">
|
|
<div style="clear: both;">
|
|
{% if args.highlightsyntax %}
|
|
<pre><code id="code">{{pasta.content_syntax_highlighted()}}</code></pre>
|
|
{%- else %}
|
|
<pre><code id="code">{{pasta.content_not_highlighted()}}</code></pre>
|
|
{%- endif %}
|
|
</div>
|
|
</div>
|
|
{%- endif %}
|
|
<div>
|
|
{% if pasta.read_count == 1 %}
|
|
<p style="font-size: small">Read {{pasta.read_count}} time, last {{pasta.last_read_time_ago_as_string()}}</p>
|
|
{%- else %}
|
|
<p style="font-size: small">Read {{pasta.read_count}} times, last {{pasta.last_read_time_ago_as_string()}}</p>
|
|
{%- endif %}
|
|
|
|
</div>
|
|
|
|
<br>
|
|
|
|
|
|
<script>
|
|
const copyURLBtn = document.getElementById("copy-url-button")
|
|
const copyTextBtn = document.getElementById("copy-text-button")
|
|
const content = `{{ pasta.content_escaped() }}`
|
|
const url = `{{ args.public_path }}/pasta/{{pasta.id_as_animals()}}`
|
|
|
|
copyURLBtn.addEventListener("click", () => {
|
|
navigator.clipboard.writeText(url)
|
|
copyURLBtn.innerHTML = "Copied"
|
|
setTimeout(() => {
|
|
copyURLBtn.innerHTML = "Copy URL"
|
|
}, 1000)
|
|
})
|
|
|
|
copyTextBtn.addEventListener("click", () => {
|
|
navigator.clipboard.writeText(content)
|
|
copyTextBtn.innerHTML = "Copied"
|
|
setTimeout(() => {
|
|
copyTextBtn.innerHTML = "Copy Text"
|
|
}, 1000)
|
|
})
|
|
|
|
</script>
|
|
|
|
<style>
|
|
code-line {
|
|
counter-increment: listing;
|
|
text-align: right;
|
|
float: left;
|
|
clear: left;
|
|
}
|
|
|
|
code-line::before {
|
|
content: counter(listing);
|
|
display: inline-block;
|
|
padding-left: auto;
|
|
margin-left: auto;
|
|
text-align: left;
|
|
width: 1.6rem;
|
|
border-right: 1px solid lightgrey;
|
|
color: grey;
|
|
margin-right: 0.4rem;
|
|
-webkit-user-select: none;
|
|
-moz-user-select: none;
|
|
-ms-user-select: none;
|
|
user-select: none;
|
|
}
|
|
|
|
#code {
|
|
min-height: 2rem;
|
|
}
|
|
|
|
.code-container {
|
|
position: relative;
|
|
}
|
|
|
|
.hidden {
|
|
display: none;
|
|
}
|
|
|
|
.copy-text-button,
|
|
.copy-url-button {
|
|
font-size: small;
|
|
padding: 4px;
|
|
width: 6rem;
|
|
}
|
|
</style>
|
|
|
|
{% include "footer.html" %} |