mirror of
https://github.com/9001/copyparty.git
synced 2025-08-17 17:12:13 -06:00
toast coloring
This commit is contained in:
parent
980c6fc810
commit
8cd84608a5
|
@ -48,12 +48,30 @@ body {
|
|||
padding: 1em 1.3em;
|
||||
border-width: .4em 0;
|
||||
transform: translateX(100%);
|
||||
transition: all .3s cubic-bezier(.2, 1.2, .5, 1);;
|
||||
transition: all .3s cubic-bezier(.2, 1.2, .5, 1);
|
||||
text-shadow: 1px 1px 0 #000;
|
||||
color: #fff;
|
||||
}
|
||||
#toast.vis {
|
||||
right: 1.3em;
|
||||
transform: unset;
|
||||
}
|
||||
#toast.inf {
|
||||
background: #07a;
|
||||
border-color: #0be;
|
||||
}
|
||||
#toast.ok {
|
||||
background: #4a0;
|
||||
border-color: #8e4;
|
||||
}
|
||||
#toast.warn {
|
||||
background: #a70;
|
||||
border-color: #fc0;
|
||||
}
|
||||
#toast.err {
|
||||
background: #b00;
|
||||
border-color: #f00;
|
||||
}
|
||||
#tt.b {
|
||||
padding: 0 2em;
|
||||
border-radius: .5em;
|
||||
|
@ -1009,11 +1027,13 @@ html.light {
|
|||
background: #eee;
|
||||
text-shadow: none;
|
||||
}
|
||||
html.light #tt,
|
||||
html.light #toast {
|
||||
html.light #tt {
|
||||
background: #fff;
|
||||
border-color: #888 #000 #777 #000;
|
||||
box-shadow: 0 .3em 1em rgba(0,0,0,0.4);
|
||||
}
|
||||
html.light #tt,
|
||||
html.light #toast {
|
||||
box-shadow: 0 .3em 1em rgba(0,0,0,0.4);
|
||||
}
|
||||
html.light #tt code {
|
||||
background: #060;
|
||||
|
|
|
@ -1523,11 +1523,11 @@ var fileman = (function () {
|
|||
vp = vps.shift();
|
||||
|
||||
if (!vp) {
|
||||
toast.show('delete OK', 2000);
|
||||
toast.ok(2000, 'delete OK');
|
||||
treectl.goto(get_evpath());
|
||||
return;
|
||||
}
|
||||
toast.show('deleting ' + (vps.length + 1) + ' items<br /><br />' + vp, 2000);
|
||||
toast.inf(2000, 'deleting ' + (vps.length + 1) + ' items<br /><br />' + vp);
|
||||
|
||||
xhr.open('GET', vp + '?delete', true);
|
||||
xhr.onreadystatechange = delete_cb;
|
||||
|
@ -1539,7 +1539,7 @@ var fileman = (function () {
|
|||
|
||||
if (this.status !== 200) {
|
||||
var msg = this.responseText;
|
||||
toast.show('delete failed:<br />' + msg, 2000);
|
||||
toast.err(2000, 'delete failed:<br />' + msg);
|
||||
return;
|
||||
}
|
||||
deleter();
|
||||
|
@ -1564,7 +1564,7 @@ var fileman = (function () {
|
|||
cl.add(inv ? 'c2' : 'c1');
|
||||
}
|
||||
|
||||
toast.show('cut ' + sel.length + ' items', 1000);
|
||||
toast.inf(1000, 'cut ' + sel.length + ' items');
|
||||
jwrite('fman_clip', vps);
|
||||
r.tx();
|
||||
};
|
||||
|
@ -1597,6 +1597,9 @@ var fileman = (function () {
|
|||
if (exists.length)
|
||||
alert('these ' + exists.length + ' items cannot be pasted here (names already exist):\n\n' + exists.join('\n'));
|
||||
|
||||
if (!req.length)
|
||||
return;
|
||||
|
||||
if (!confirm('paste these ' + req.length + ' items here?\n\n' + req.join('\n')))
|
||||
return;
|
||||
|
||||
|
@ -1605,11 +1608,11 @@ var fileman = (function () {
|
|||
vp = req.shift();
|
||||
|
||||
if (!vp) {
|
||||
toast.show('paste OK', 2000);
|
||||
toast.ok(2000, 'paste OK');
|
||||
treectl.goto(get_evpath());
|
||||
return;
|
||||
}
|
||||
toast.show('pasting ' + (req.length + 1) + ' items<br /><br />' + vp, 2000);
|
||||
toast.inf(2000, 'pasting ' + (req.length + 1) + ' items<br /><br />' + vp);
|
||||
|
||||
var dst = get_evpath() + vp.split('/').slice(-1)[0];
|
||||
|
||||
|
@ -1623,7 +1626,7 @@ var fileman = (function () {
|
|||
|
||||
if (this.status !== 200) {
|
||||
var msg = this.responseText;
|
||||
toast.show('paste failed:<br />' + msg, 2000);
|
||||
toast.err(2000, 'paste failed:<br />' + msg);
|
||||
return;
|
||||
}
|
||||
paster();
|
||||
|
|
|
@ -654,11 +654,24 @@ var toast = (function () {
|
|||
clmod(obj, 'vis');
|
||||
};
|
||||
|
||||
r.show = function (txt, ms) {
|
||||
r.show = function (cl, ms, txt) {
|
||||
clearTimeout(te);
|
||||
te = setTimeout(r.hide, ms);
|
||||
obj.innerHTML = txt;
|
||||
clmod(obj, 'vis', 1000);
|
||||
obj.className = cl + ' vis';
|
||||
};
|
||||
|
||||
r.ok = function (ms, txt) {
|
||||
r.show('ok', ms, txt);
|
||||
};
|
||||
r.inf = function (ms, txt) {
|
||||
r.show('inf', ms, txt);
|
||||
};
|
||||
r.warn = function (ms, txt) {
|
||||
r.show('warn', ms, txt);
|
||||
};
|
||||
r.err = function (ms, txt) {
|
||||
r.show('err', ms, txt);
|
||||
};
|
||||
|
||||
return r;
|
||||
|
|
Loading…
Reference in a new issue