Merge branch 'main' into transparency

This commit is contained in:
tastytea 2021-03-22 19:00:55 +01:00
commit bedfbce3a4
1 changed files with 54 additions and 9 deletions

View File

@ -31,7 +31,7 @@
{
padding: 0;
}
input[type=file]
input[type=file], input[list=list_tags], input[type=url]
{
margin-left: 10ch;
}
@ -236,21 +236,20 @@
don't want trust to be necessary to use this list.
</p>
<form method="post" action="/add" enctype="multipart/form-data">
<form method="post" action="/add" enctype="multipart/form-data" id="form_add">
<label for="instance">Instance:</label>
<input type="text" id="instance" name="instance" placeholder="example.com" required>
<span class="hint">(Without the “https://)</span>
<br>
<label for="tags">Tags:</label>
<input type="text" id="tags" name="tags" placeholder="tag1,tag2" autocomplete="on" required>
<!-- <input type="button" id="add_tag" value="" disabled> -->
<label for="tags">Tags:</label><span class="hint">(One tag per field or comma separated)</span><br>
<input type="text" list="list_tags" id="tags" name="tags[]" required>
<input type="button" id="add_tag" value="" title="Add tag" onclick="javascript:add_input_tag();">
<br>
<label for="receipts">Receipts:</label>
<input type="url" id="receipts" name="receipts"
placeholder="https://example.com/@user/1234567890,https://example.com/about/more" required>
<!-- <input type="button" id="add_receipt" value="" disabled> -->
<label for="receipts">Receipts:</label><span class="hint">(One receipt per field or comma separated)</span><br>
<input type="url" id="receipts" name="receipts[]" required>
<input type="button" id="add_receipt" value="" title="Add receipt" onclick="javascript:add_input_receipt();">
<br>
<label for="screenshot1">Screenshots:</label><span class="hint">(optional)</span>
@ -299,5 +298,51 @@
<a href="https://schlomp.space/FediBlock">Sourcecode</a> licensed under the
<a href="https://www.gnu.org/licenses/agpl-3.0.html">AGPL-3.0-only</a>.
</p>
<script>
function add_input_tag()
{
const input_text = document.createElement("input");
input_text.setAttribute("type", "text");
input_text.setAttribute("list", "list_tags");
input_text.setAttribute("name", "tags[]");
const form = document.getElementById("form_add");
const btn = document.getElementById("add_tag");
form.insertBefore(document.createElement("br"), btn);
form.insertBefore(input_text, btn);
input_text.focus();
}
function add_input_receipt()
{
const input_text = document.createElement("input");
input_text.setAttribute("type", "url");
input_text.setAttribute("name", "receipts[]");
const form = document.getElementById("form_add");
const btn = document.getElementById("add_receipt");
form.insertBefore(document.createElement("br"), btn);
form.insertBefore(input_text, btn);
input_text.focus();
}
</script>
<datalist id="list_tags">
<?php
if ($file = fopen("tags.lst", "r"))
{
while(!feof($file))
{
$tag = rtrim(fgets($file));
if ($tag != "")
{
printf("<option value=\"%s\">\n", $tag);
}
}
fclose($file);
}
?>
</datalist>
</body>
</html>