mirror of
https://github.com/9001/copyparty.git
synced 2025-08-18 09:22:31 -06:00
spa msg
This commit is contained in:
parent
3d4cbd7d10
commit
2fd99f807d
|
@ -4095,7 +4095,7 @@ var msel = (function () {
|
||||||
form.onsubmit = function (e) {
|
form.onsubmit = function (e) {
|
||||||
ev(e);
|
ev(e);
|
||||||
clmod(sf, 'vis', 1);
|
clmod(sf, 'vis', 1);
|
||||||
sf.textContent = 'creating "' + tb.value + '"...'
|
sf.textContent = 'creating "' + tb.value + '"...';
|
||||||
|
|
||||||
var fd = new FormData();
|
var fd = new FormData();
|
||||||
fd.append("act", "mkdir");
|
fd.append("act", "mkdir");
|
||||||
|
@ -4126,14 +4126,61 @@ var msel = (function () {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
tb.value = '';
|
||||||
clmod(sf, 'vis');
|
clmod(sf, 'vis');
|
||||||
sf.textContent = '';
|
sf.textContent = '';
|
||||||
tb.value = '';
|
|
||||||
treectl.goto(this.vp + uricom_enc(this.dn) + '/', true);
|
treectl.goto(this.vp + uricom_enc(this.dn) + '/', true);
|
||||||
}
|
}
|
||||||
})();
|
})();
|
||||||
|
|
||||||
|
|
||||||
|
(function () {
|
||||||
|
var form = QS('#op_msg>form'),
|
||||||
|
tb = QS('#op_msg input[name="msg"]'),
|
||||||
|
sf = mknod('div');
|
||||||
|
|
||||||
|
clmod(sf, 'msg', 1);
|
||||||
|
form.parentNode.appendChild(sf);
|
||||||
|
|
||||||
|
form.onsubmit = function (e) {
|
||||||
|
ev(e);
|
||||||
|
clmod(sf, 'vis', 1);
|
||||||
|
sf.textContent = 'sending...';
|
||||||
|
|
||||||
|
var xhr = new XMLHttpRequest(),
|
||||||
|
ct = 'application/x-www-form-urlencoded;charset=UTF-8';
|
||||||
|
|
||||||
|
xhr.msg = tb.value;
|
||||||
|
xhr.open('POST', get_evpath(), true);
|
||||||
|
xhr.responseType = 'text';
|
||||||
|
xhr.onreadystatechange = cb;
|
||||||
|
xhr.setRequestHeader('Content-Type', ct);
|
||||||
|
if (xhr.overrideMimeType)
|
||||||
|
xhr.overrideMimeType('Content-Type', ct);
|
||||||
|
|
||||||
|
xhr.send('msg=' + uricom_enc(xhr.msg));
|
||||||
|
return false;
|
||||||
|
};
|
||||||
|
|
||||||
|
function cb() {
|
||||||
|
if (this.readyState != XMLHttpRequest.DONE)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (this.status !== 200) {
|
||||||
|
sf.textContent = 'error: ' + this.responseText;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
tb.value = '';
|
||||||
|
clmod(sf, 'vis');
|
||||||
|
sf.textContent = 'sent: "' + this.msg + '"';
|
||||||
|
setTimeout(function () {
|
||||||
|
treectl.goto(get_evpath());
|
||||||
|
}, 100);
|
||||||
|
}
|
||||||
|
})();
|
||||||
|
|
||||||
|
|
||||||
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