From 50cf7ff4affac08521d0ef78dad0f10eb9e9b8f8 Mon Sep 17 00:00:00 2001 From: Alex Vitkov Date: Fri, 12 Feb 2021 19:52:12 +0200 Subject: New Folder frontend --- loggedin.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'loggedin.js') diff --git a/loggedin.js b/loggedin.js index 5f1f2d4..01c8226 100644 --- a/loggedin.js +++ b/loggedin.js @@ -146,6 +146,23 @@ function rename_file(filename) { xhr.send(data); } +function new_folder() { + var dirname = prompt(`Directory name`, "New Folder"); + if (!dirname) + return; + + var data = new FormData(); + data.append('parent_directory', get_path()); + data.append('dirname', dirname); + + var xhr = new XMLHttpRequest(); + xhr.open('POST', '/php/mkdir.php', true); + xhr.onload = function () { + load_dir(); + }; + xhr.send(data); +} + function add_file_visuals(name, is_directory, mimetype) { var fileDiv = document.createElement('div'); -- cgit v1.2.3