aboutsummaryrefslogtreecommitdiffstats
path: root/loggedin.js
diff options
context:
space:
mode:
authorAlex Vitkov <alexvitkov98@gmail.com>2021-02-12 19:52:12 +0200
committerAlex Vitkov <alexvitkov98@gmail.com>2021-02-12 20:06:48 +0200
commit50cf7ff4affac08521d0ef78dad0f10eb9e9b8f8 (patch)
tree9c9a7d682701553099c7ff28fc79cce68d2010a0 /loggedin.js
parentfd807f7df9ab0b3021e071eb0ff4be6e252938a8 (diff)
downloadfileup-50cf7ff4affac08521d0ef78dad0f10eb9e9b8f8.tar.gz
New Folder frontend
Diffstat (limited to 'loggedin.js')
-rw-r--r--loggedin.js17
1 files changed, 17 insertions, 0 deletions
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');