From a0c3df96f3eb9bca83ac379e46c8b61dbac66ac8 Mon Sep 17 00:00:00 2001 From: tastytea Date: Thu, 21 Jan 2021 06:37:55 +0100 Subject: [PATCH 1/4] Auto-complete tags. Read tags from tags.lst and offer them as auto-completions. Use one text field per tag and use a button to add new fields. --- index.php | 41 ++++++++++++++++++++++++++++++++++++----- 1 file changed, 36 insertions(+), 5 deletions(-) diff --git a/index.php b/index.php index 8075803..afbc3f0 100644 --- a/index.php +++ b/index.php @@ -31,7 +31,7 @@ { padding: 0; } - input[type=file] + input[type=file], input[list=list_tags] { margin-left: 10ch; } @@ -198,15 +198,15 @@ don't want trust to be necessary to use this list.

-
+ (Without the “https://”)
- - - + (One tag per field or comma separated)
+ +
@@ -261,5 +261,36 @@ Sourcecode licensed under the AGPL-3.0-only.

+ + + + + \n", $tag); + } + } + fclose($file); + ?> + From fd1690d45c7b59b5c5de6dd8382541bf4bb10a27 Mon Sep 17 00:00:00 2001 From: tastytea Date: Thu, 21 Jan 2021 06:49:33 +0100 Subject: [PATCH 2/4] Use one field per receipt. Add fields with button. --- index.php | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/index.php b/index.php index afbc3f0..3931567 100644 --- a/index.php +++ b/index.php @@ -31,7 +31,7 @@ { padding: 0; } - input[type=file], input[list=list_tags] + input[type=file], input[list=list_tags], input[type=url] { margin-left: 10ch; } @@ -209,10 +209,9 @@
- - - + (One receipt per field or comma separated)
+ +
(optional) @@ -276,6 +275,19 @@ 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(); + } From 55ea37eb9b76b36d7a5105898c49086fcbd5a4ba Mon Sep 17 00:00:00 2001 From: tastytea Date: Thu, 21 Jan 2021 21:36:55 +0100 Subject: [PATCH 3/4] Add titles to buttons. The titles will show up as tool tips and I guess screen readers make use of them. --- index.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.php b/index.php index 3931567..bcf3043 100644 --- a/index.php +++ b/index.php @@ -206,12 +206,12 @@ (One tag per field or comma separated)
- +
(One receipt per field or comma separated)
- +
(optional) From 353a16847f0a8d6e9e7730842da1b808ace94238 Mon Sep 17 00:00:00 2001 From: tastytea Date: Thu, 21 Jan 2021 22:20:54 +0100 Subject: [PATCH 4/4] Don't die if file tags.lst doesn't exist. die() cuts the document at the position of the error. We just return an empty datalist. --- index.php | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/index.php b/index.php index bcf3043..367a523 100644 --- a/index.php +++ b/index.php @@ -292,16 +292,18 @@ \n", $tag); + $tag = rtrim(fgets($file)); + if ($tag != "") + { + printf("