aboutsummaryrefslogtreecommitdiffstats
path: root/loggedin.js
diff options
context:
space:
mode:
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');