From d8b74761c6cefdd83360d3f2add0e9ccdc6064c7 Mon Sep 17 00:00:00 2001 From: Jonas Kohl Date: Sat, 14 Sep 2024 17:59:13 +0200 Subject: Even more changes (devel commit messages are useless) --- src/application/views/template_end.php | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) (limited to 'src/application/views/template_end.php') diff --git a/src/application/views/template_end.php b/src/application/views/template_end.php index 27fc3ba..7757780 100644 --- a/src/application/views/template_end.php +++ b/src/application/views/template_end.php @@ -3,7 +3,8 @@
- © + © . + Powered by Mystic Forum
@@ -23,6 +24,28 @@ $(function() { var date = new Date($(e).text()); $(e).text(date.toLocaleTimeString()); }); + + $("input[type=file]").each(function(i, e) { + var isMultiple = !!$(e).prop("multiple"); + var $input = $('').attr("placeholder", "No file" + (isMultiple ? "s" : "") + " selected"); + $(e).after($('
').append( + $input, + $('').append( + $('').text("Select file" + (isMultiple ? "s" : "") + "...").click(function() { + $(e).click(); + }) + ) + )).addClass("sr-only"); + $(e).on("change", function() { + var files = $(e)[0].files; + if (files.length < 1) + $input.val(""); + else if (files.length === 1) + $input.val(files[0].name); + else + $input.val(files.length + " files selected"); + }); + }) }); -- cgit v1.2.3