diff --git a/supervisor/shared/web_workflow/web_workflow.c b/supervisor/shared/web_workflow/web_workflow.c index 28662fdbb7..70f5c572d6 100644 --- a/supervisor/shared/web_workflow/web_workflow.c +++ b/supervisor/shared/web_workflow/web_workflow.c @@ -500,7 +500,7 @@ static void _reply_directory_html(socketpool_socket_obj_t *socket, FF_DIR *dir, } _send_chunk(socket, "
"); - _send_chunk(socket, "
+🗀"); + _send_chunk(socket, "
+🗀 "); _send_chunk(socket, ""); _send_chunk(socket, ""); } diff --git a/tools/circuitpython.js b/tools/circuitpython.js index 7574799292..b92cdc40f1 100644 --- a/tools/circuitpython.js +++ b/tools/circuitpython.js @@ -1,5 +1,9 @@ console.log("Hello world"); +let new_directory_name = document.getElementById("name"); +let files = document.getElementById("files"); + + function mkdir(e) { console.log("mkdir"); console.log(e); @@ -7,19 +11,34 @@ function mkdir(e) { function upload(e) { console.log("upload"); - console.log(e); + console.log(files.files); } function del(e) { console.log("delete"); console.log(e); - if (confirm("Delete" + e.target.value + "?")) { + if (confirm("Delete " + e.target.value + " and all of its contents?")) { console.log("do it"); } } -document.getElementById("mkdir").onclick = mkdir; -document.getElementById("upload").onclick = upload; +let mkdir_button = document.getElementById("mkdir"); +mkdir_button.onclick = mkdir; + +let upload_button = document.getElementById("upload"); +upload_button.onclick = upload; + +upload_button.disabled = files.files.length == 0; + +files.onchange = () => { + upload_button.disabled = files.files.length == 0; +} + +mkdir_button.disabled = new_directory_name.value.length == 0; + +new_directory_name.oninput = () => { + mkdir_button.disabled = new_directory_name.value.length == 0; +} const collection = document.getElementsByClassName("delete"); for (let i = 0; i < collection.length; i++) {