mirror of
https://github.com/9001/copyparty.git
synced 2025-08-18 01:22:13 -06:00
only tooltip the ellipsed thumbnails
This commit is contained in:
parent
eb16306cde
commit
b21a99fd62
|
@ -881,13 +881,13 @@ html.light #ghead {
|
||||||
position: relative;
|
position: relative;
|
||||||
top: 0;
|
top: 0;
|
||||||
}
|
}
|
||||||
@media (max-width: 40em) {
|
#ghsep {
|
||||||
#ghead>span {
|
|
||||||
white-space: pre;
|
white-space: pre;
|
||||||
|
}
|
||||||
|
#ghead>.sep {
|
||||||
margin: 1em 0 0 .3em;
|
margin: 1em 0 0 .3em;
|
||||||
display: inline-block
|
display: inline-block
|
||||||
}
|
}
|
||||||
}
|
|
||||||
#ggrid {
|
#ggrid {
|
||||||
padding-top: .5em;
|
padding-top: .5em;
|
||||||
}
|
}
|
||||||
|
|
|
@ -2157,7 +2157,8 @@ var thegrid = (function () {
|
||||||
'<a href="#" class="btn" z="-1.2" tt="Hotkey: shift-A">–</a> ' +
|
'<a href="#" class="btn" z="-1.2" tt="Hotkey: shift-A">–</a> ' +
|
||||||
'<a href="#" class="btn" z="1.2" tt="Hotkey: shift-D">+</a> chop: ' +
|
'<a href="#" class="btn" z="1.2" tt="Hotkey: shift-D">+</a> chop: ' +
|
||||||
'<a href="#" class="btn" l="-1" tt="truncate filenames more (show less)">–</a> ' +
|
'<a href="#" class="btn" l="-1" tt="truncate filenames more (show less)">–</a> ' +
|
||||||
'<a href="#" class="btn" l="1" tt="truncate filenames less (show more)">+</a> <span>sort by: ' +
|
'<a href="#" class="btn" l="1" tt="truncate filenames less (show more)">+</a> ' +
|
||||||
|
'<span id="ghsep">sort by: ' +
|
||||||
'<a href="#" s="href">name</a>, ' +
|
'<a href="#" s="href">name</a>, ' +
|
||||||
'<a href="#" s="sz">size</a>, ' +
|
'<a href="#" s="sz">size</a>, ' +
|
||||||
'<a href="#" s="ts">date</a>, ' +
|
'<a href="#" s="ts">date</a>, ' +
|
||||||
|
@ -2192,11 +2193,11 @@ var thegrid = (function () {
|
||||||
loadgrid();
|
loadgrid();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
lfiles.style.display = '';
|
ungrid();
|
||||||
gfiles.style.display = 'none';
|
|
||||||
}
|
}
|
||||||
pbar.onresize();
|
pbar.onresize();
|
||||||
vbar.onresize();
|
vbar.onresize();
|
||||||
|
r.onresize();
|
||||||
};
|
};
|
||||||
|
|
||||||
var btnclick = function (e) {
|
var btnclick = function (e) {
|
||||||
|
@ -2234,14 +2235,14 @@ var thegrid = (function () {
|
||||||
|
|
||||||
r.setvis = function (vis) {
|
r.setvis = function (vis) {
|
||||||
(r.en ? gfiles : lfiles).style.display = vis ? '' : 'none';
|
(r.en ? gfiles : lfiles).style.display = vis ? '' : 'none';
|
||||||
}
|
};
|
||||||
|
|
||||||
r.setdirty = function () {
|
r.setdirty = function () {
|
||||||
r.dirty = true;
|
r.dirty = true;
|
||||||
if (r.en) {
|
if (r.en) {
|
||||||
loadgrid();
|
loadgrid();
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
function setln(v) {
|
function setln(v) {
|
||||||
if (v) {
|
if (v) {
|
||||||
|
@ -2249,6 +2250,7 @@ var thegrid = (function () {
|
||||||
if (r.ln < 1) r.ln = 1;
|
if (r.ln < 1) r.ln = 1;
|
||||||
if (r.ln > 7) r.ln = v < 0 ? 7 : 99;
|
if (r.ln > 7) r.ln = v < 0 ? 7 : 99;
|
||||||
swrite('gridln', r.ln);
|
swrite('gridln', r.ln);
|
||||||
|
setTimeout(r.tippen, 20);
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
document.documentElement.style.setProperty('--grid-ln', r.ln);
|
document.documentElement.style.setProperty('--grid-ln', r.ln);
|
||||||
|
@ -2261,6 +2263,7 @@ var thegrid = (function () {
|
||||||
if (v !== undefined) {
|
if (v !== undefined) {
|
||||||
r.sz = clamp(v, 4, 40);
|
r.sz = clamp(v, 4, 40);
|
||||||
swrite('gridsz', r.sz);
|
swrite('gridsz', r.sz);
|
||||||
|
setTimeout(r.tippen, 20);
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
document.documentElement.style.setProperty('--grid-sz', r.sz + 'em');
|
document.documentElement.style.setProperty('--grid-sz', r.sz + 'em');
|
||||||
|
@ -2319,7 +2322,7 @@ var thegrid = (function () {
|
||||||
|
|
||||||
for (var a = 0, aa = ths.length; a < aa; a++) {
|
for (var a = 0, aa = ths.length; a < aa; a++) {
|
||||||
var tr = ebi(ths[a].getAttribute('ref')).closest('tr'),
|
var tr = ebi(ths[a].getAttribute('ref')).closest('tr'),
|
||||||
cl = tr.getAttribute('class');
|
cl = tr.getAttribute('class') || '';
|
||||||
|
|
||||||
if (ths[a].getAttribute('href').endsWith('/'))
|
if (ths[a].getAttribute('href').endsWith('/'))
|
||||||
cl += ' dir';
|
cl += ' dir';
|
||||||
|
@ -2331,6 +2334,50 @@ var thegrid = (function () {
|
||||||
uns.onclick = function () {
|
uns.onclick = function () {
|
||||||
ebi('unsearch').click();
|
ebi('unsearch').click();
|
||||||
};
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
r.tippen = function () {
|
||||||
|
// var cs = window.getComputedStyle(el), fs = parseFloat(cs.lineHeight); console.log('%.2f %.2f', (el.offsetHeight - parseFloat(cs.paddingTop))/fs, (el.scrollHeight - parseFloat(cs.paddingTop))/fs);
|
||||||
|
var els = QSA('#ggrid>a>span'),
|
||||||
|
aa = els.length;
|
||||||
|
|
||||||
|
if (!aa)
|
||||||
|
return;
|
||||||
|
|
||||||
|
var cs = window.getComputedStyle(els[0]),
|
||||||
|
fs = parseFloat(cs.lineHeight),
|
||||||
|
pad = parseFloat(cs.paddingTop),
|
||||||
|
pels = [],
|
||||||
|
todo = [];
|
||||||
|
|
||||||
|
for (var a = 0; a < aa; a++) {
|
||||||
|
var vis = Math.round((els[a].offsetHeight - pad) / fs),
|
||||||
|
all = Math.round((els[a].scrollHeight - pad) / fs),
|
||||||
|
par = els[a].parentNode;
|
||||||
|
|
||||||
|
pels.push(par);
|
||||||
|
todo.push(vis < all ? par.getAttribute('ttt') : null);
|
||||||
|
}
|
||||||
|
|
||||||
|
for (var a = 0; a < todo.length; a++) {
|
||||||
|
if (todo[a])
|
||||||
|
pels[a].setAttribute('tt', todo[a]);
|
||||||
|
else
|
||||||
|
pels[a].removeAttribute('tt');
|
||||||
|
}
|
||||||
|
|
||||||
|
tt.att(ebi('ggrid'));
|
||||||
|
};
|
||||||
|
|
||||||
|
r.onresize = function () {
|
||||||
|
var el = ebi('ghsep');
|
||||||
|
clmod(el, 'sep', el.offsetLeft < 64);
|
||||||
|
};
|
||||||
|
|
||||||
|
function ungrid() {
|
||||||
|
lfiles.style.display = '';
|
||||||
|
gfiles.style.display = 'none';
|
||||||
|
window.removeEventListener('resize', r.onresize);
|
||||||
}
|
}
|
||||||
|
|
||||||
function loadgrid() {
|
function loadgrid() {
|
||||||
|
@ -2339,6 +2386,7 @@ var thegrid = (function () {
|
||||||
|
|
||||||
lfiles.style.display = 'none';
|
lfiles.style.display = 'none';
|
||||||
gfiles.style.display = 'block';
|
gfiles.style.display = 'block';
|
||||||
|
window.addEventListener('resize', r.onresize);
|
||||||
|
|
||||||
if (!r.dirty)
|
if (!r.dirty)
|
||||||
return r.loadsel();
|
return r.loadsel();
|
||||||
|
@ -2382,7 +2430,7 @@ var thegrid = (function () {
|
||||||
}
|
}
|
||||||
|
|
||||||
html.push('<a href="' + href + '" ref="' + ref +
|
html.push('<a href="' + href + '" ref="' + ref +
|
||||||
'"' + ac + ' tt="' + esc(name) + '"><img src="' +
|
'"' + ac + ' ttt="' + esc(name) + '"><img src="' +
|
||||||
ihref + '" /><span' + ac + '>' + ao.innerHTML + '</span></a>');
|
ihref + '" /><span' + ac + '>' + ao.innerHTML + '</span></a>');
|
||||||
}
|
}
|
||||||
ebi('ggrid').innerHTML = html.join('\n');
|
ebi('ggrid').innerHTML = html.join('\n');
|
||||||
|
@ -2391,10 +2439,10 @@ var thegrid = (function () {
|
||||||
for (var a = 0, aa = ths.length; a < aa; a++)
|
for (var a = 0, aa = ths.length; a < aa; a++)
|
||||||
ths[a].onclick = gclick;
|
ths[a].onclick = gclick;
|
||||||
|
|
||||||
tt.att(ebi('ggrid'));
|
|
||||||
r.dirty = false;
|
r.dirty = false;
|
||||||
r.bagit();
|
r.bagit();
|
||||||
r.loadsel();
|
r.loadsel();
|
||||||
|
setTimeout(r.tippen, 20);
|
||||||
}
|
}
|
||||||
|
|
||||||
r.bagit = function () {
|
r.bagit = function () {
|
||||||
|
@ -2925,6 +2973,7 @@ var treectl = (function () {
|
||||||
window.addEventListener('scroll', onscroll);
|
window.addEventListener('scroll', onscroll);
|
||||||
window.addEventListener('resize', onresize);
|
window.addEventListener('resize', onresize);
|
||||||
onresize();
|
onresize();
|
||||||
|
thegrid.onresize();
|
||||||
};
|
};
|
||||||
|
|
||||||
treectl.detree = function (e) {
|
treectl.detree = function (e) {
|
||||||
|
@ -2943,6 +2992,7 @@ var treectl = (function () {
|
||||||
ebi('wrap').style.marginLeft = '0';
|
ebi('wrap').style.marginLeft = '0';
|
||||||
window.removeEventListener('resize', onresize);
|
window.removeEventListener('resize', onresize);
|
||||||
window.removeEventListener('scroll', onscroll);
|
window.removeEventListener('scroll', onscroll);
|
||||||
|
thegrid.onresize();
|
||||||
}
|
}
|
||||||
|
|
||||||
function onscroll() {
|
function onscroll() {
|
||||||
|
|
Loading…
Reference in a new issue