mirror of
https://github.com/9001/copyparty.git
synced 2025-08-18 01:22:13 -06:00
spa mkdir
This commit is contained in:
parent
f10d03c238
commit
3d4cbd7d10
|
@ -1561,6 +1561,9 @@ function play_linked() {
|
||||||
|
|
||||||
|
|
||||||
function sortfiles(nodes) {
|
function sortfiles(nodes) {
|
||||||
|
if (!nodes.length)
|
||||||
|
return nodes;
|
||||||
|
|
||||||
var sopts = jread('fsort', [["href", 1, ""]]);
|
var sopts = jread('fsort', [["href", 1, ""]]);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
@ -4078,6 +4081,59 @@ var msel = (function () {
|
||||||
})();
|
})();
|
||||||
|
|
||||||
|
|
||||||
|
(function () {
|
||||||
|
if (!window.FormData)
|
||||||
|
return;
|
||||||
|
|
||||||
|
var form = QS('#op_mkdir>form'),
|
||||||
|
tb = QS('#op_mkdir input[name="name"]'),
|
||||||
|
sf = mknod('div');
|
||||||
|
|
||||||
|
clmod(sf, 'msg', 1);
|
||||||
|
form.parentNode.appendChild(sf);
|
||||||
|
|
||||||
|
form.onsubmit = function (e) {
|
||||||
|
ev(e);
|
||||||
|
clmod(sf, 'vis', 1);
|
||||||
|
sf.textContent = 'creating "' + tb.value + '"...'
|
||||||
|
|
||||||
|
var fd = new FormData();
|
||||||
|
fd.append("act", "mkdir");
|
||||||
|
fd.append("name", tb.value);
|
||||||
|
|
||||||
|
var xhr = new XMLHttpRequest();
|
||||||
|
xhr.vp = get_evpath();
|
||||||
|
xhr.dn = tb.value;
|
||||||
|
xhr.open('POST', xhr.vp, true);
|
||||||
|
xhr.onreadystatechange = cb;
|
||||||
|
xhr.responseType = 'text';
|
||||||
|
xhr.send(fd);
|
||||||
|
|
||||||
|
return false;
|
||||||
|
};
|
||||||
|
|
||||||
|
function cb() {
|
||||||
|
if (this.readyState != XMLHttpRequest.DONE)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (this.vp !== get_evpath()) {
|
||||||
|
sf.textContent = 'aborted due to location change';
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.status !== 200) {
|
||||||
|
sf.textContent = 'error: ' + this.responseText;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
clmod(sf, 'vis');
|
||||||
|
sf.textContent = '';
|
||||||
|
tb.value = '';
|
||||||
|
treectl.goto(this.vp + uricom_enc(this.dn) + '/', true);
|
||||||
|
}
|
||||||
|
})();
|
||||||
|
|
||||||
|
|
||||||
function show_readme(md, url, depth) {
|
function show_readme(md, url, depth) {
|
||||||
if (!treectl.ireadme)
|
if (!treectl.ireadme)
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Reference in a new issue