2022-04-10 22:21:45 +00:00
|
|
|
{% include "header.html" %}
|
2022-07-31 18:41:19 +00:00
|
|
|
<div style="float: left">
|
2022-10-12 15:13:21 +00:00
|
|
|
<a style="margin-right: 0.5rem" href="{{ args.public_path }}/raw/{{pasta.id_as_animals()}}">Raw Text Content</a>
|
2022-07-31 18:41:19 +00:00
|
|
|
{% if pasta.file.is_some() %}
|
|
|
|
<a style="margin-right: 0.5rem; margin-left: 0.5rem"
|
2022-10-12 15:13:21 +00:00
|
|
|
href="{{ args.public_path }}/file/{{pasta.id_as_animals()}}/{{pasta.file.as_ref().unwrap().name()}}">
|
2022-07-31 20:31:35 +00:00
|
|
|
Attached file'{{pasta.file.as_ref().unwrap().name()}}' [{{pasta.file.as_ref().unwrap().size}}]
|
|
|
|
</a>
|
2022-07-31 18:41:19 +00:00
|
|
|
{%- endif %}
|
|
|
|
{% if pasta.editable %}
|
2022-10-27 11:12:11 +00:00
|
|
|
<a style="margin-right: 0.5rem; margin-left: 0.5rem"
|
|
|
|
href="{{ args.public_path }}/edit/{{pasta.id_as_animals()}}">Edit</a>
|
2022-07-31 18:41:19 +00:00
|
|
|
{%- endif %}
|
2022-10-27 11:12:11 +00:00
|
|
|
<a style="margin-right: 0.5rem; margin-left: 0.5rem"
|
|
|
|
href="{{ args.public_path }}/remove/{{pasta.id_as_animals()}}">Remove</a>
|
2022-07-31 18:41:19 +00:00
|
|
|
</div>
|
|
|
|
<div style="float: right">
|
2022-10-12 15:13:21 +00:00
|
|
|
<a href="{{ args.public_path }}/pasta/{{pasta.id_as_animals()}}"><i>{{pasta.id_as_animals()}}</i></a>
|
2022-10-27 11:12:11 +00:00
|
|
|
<button id="copy-button" class="copy-button">
|
|
|
|
Copy
|
|
|
|
</button>
|
2022-07-31 18:41:19 +00:00
|
|
|
</div>
|
|
|
|
<br>
|
2022-10-01 05:37:26 +00:00
|
|
|
<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>
|
2022-07-31 18:41:19 +00:00
|
|
|
</div>
|
2022-10-01 05:37:26 +00:00
|
|
|
|
|
|
|
<script>
|
2022-10-22 18:12:15 +00:00
|
|
|
const btn = document.getElementById("copy-button")
|
2022-10-02 04:50:05 +00:00
|
|
|
const content = `{{ pasta.content_escaped() }}`
|
2022-10-01 05:37:26 +00:00
|
|
|
|
|
|
|
btn.addEventListener("click", () => {
|
|
|
|
navigator.clipboard.writeText(content)
|
2022-10-22 18:12:15 +00:00
|
|
|
btn.innerHTML = "Copied"
|
|
|
|
setTimeout(() => {
|
|
|
|
btn.innerHTML = "Copy"
|
|
|
|
}, 1000)
|
2022-10-01 05:37:26 +00:00
|
|
|
})
|
|
|
|
|
|
|
|
</script>
|
|
|
|
|
2022-06-03 16:24:34 +00:00
|
|
|
<style>
|
2022-10-27 11:12:11 +00:00
|
|
|
code-line {
|
|
|
|
counter-increment: listing;
|
|
|
|
text-align: right;
|
|
|
|
float: left;
|
|
|
|
clear: left;
|
|
|
|
}
|
2022-06-03 16:24:34 +00:00
|
|
|
|
2022-10-27 11:12:11 +00:00
|
|
|
code-line::before {
|
|
|
|
content: counter(listing);
|
|
|
|
display: inline-block;
|
|
|
|
float: left;
|
|
|
|
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;
|
|
|
|
}
|
2022-06-03 16:24:34 +00:00
|
|
|
|
2022-10-27 11:12:11 +00:00
|
|
|
#code {
|
|
|
|
min-height: 2rem;
|
|
|
|
}
|
2022-10-01 05:37:26 +00:00
|
|
|
|
2022-10-27 11:12:11 +00:00
|
|
|
.code-container {
|
|
|
|
position: relative;
|
|
|
|
}
|
2022-10-02 04:50:05 +00:00
|
|
|
|
2022-10-27 11:12:11 +00:00
|
|
|
.hidden {
|
|
|
|
display: none;
|
|
|
|
}
|
2022-10-01 05:37:26 +00:00
|
|
|
|
2022-10-27 11:12:11 +00:00
|
|
|
.copy-button {
|
|
|
|
font-size: small;
|
|
|
|
background-color: var(--links);
|
|
|
|
color: var(--background-body);
|
|
|
|
margin-right: 0.5rem;
|
|
|
|
margin-left: 0.5rem;
|
|
|
|
padding: 4px;
|
|
|
|
width: 4rem;
|
|
|
|
}
|
2022-06-03 16:24:34 +00:00
|
|
|
</style>
|
2022-05-02 15:53:10 +00:00
|
|
|
|
2022-10-27 11:12:11 +00:00
|
|
|
{% include "footer.html" %}
|