' +
'
' +
- '
' +
+ svg +
(isdir || ext == 'unk' || ext.startsWith('/') ? '' :
'
' + ext + '') +
@@ -7370,10 +7390,10 @@ var search_ui = (function () {
var ms = ebi('moresearch');
if(e){
window.scrollTo(0, 0);
- ms.innerHTML = '▴';
+ ms.innerHTML = '
▲';
}
else{
- ms.innerHTML = '▾';
+ ms.innerHTML = '
▼';
}
}
ebi('moresearch').onclick = function () {
@@ -8138,6 +8158,7 @@ var treectl = (function () {
if (!entreed || r.hidden){
if(ebi('tree').style.width == '0px')
ebi('tree').style.display = 'none';
+ ebi('reszbar').style.left = '2px';
setcvar('--nav-sz', 0);
return;
}
@@ -9090,7 +9111,7 @@ function apply_perms(res) {
else{
ebi('blogout').style.display = 'none';
ebi('acc_name').innerHTML = L.login;
- ebi('acc_pfp').innerHTML = fun_tgl ? '👤' : 'acc';
+ ebi('acc_pfp').innerHTML = fun_tgl && EMOJI ? '👤' : 'acc';
}
clmod(ebi('acc_pfp'), 'placeholder', acct == '*');
@@ -9177,7 +9198,8 @@ function apply_perms(res) {
ebi('reloc_up').innerHTML = up2k_lgcy ? '
▲' : '
▼';
clmod(ebi('up2k'), 'unmodal', up2k_lgcy);
}
- clmod(ebi('opa_mkd'), 'vis', up_only);
+ if(EMOJI)
+ clmod(ebi('opa_mkd'), 'vis', up_only);
}
function wait_set_fsearch(){
@@ -11168,7 +11190,7 @@ function reload_browser() {
o = mknod('a');
o.setAttribute('href', link2);
- o.textContent = uricom_dec(parts[a]) || (fun_tgl ? '🏠' : 'home');
+ o.textContent = uricom_dec(parts[a]) || (fun_tgl && EMOJI ? '🏠' : 'home');
ebi('path').appendChild(o);
ebi('path').appendChild(mknod('i'));
drag.mktarget(o);
diff --git a/copyparty/web/util.js b/copyparty/web/util.js
index 45cb7137..acc49cca 100644
--- a/copyparty/web/util.js
+++ b/copyparty/web/util.js
@@ -20,6 +20,13 @@ if (window.CGV)
Object.assign(window, window.CGV);
+function supportsEmoji() {
+ var ctx = document.createElement('canvas').getContext('2d');
+ ctx.canvas.width = ctx.canvas.height = 1;
+ ctx.fillText('🎉', -4, 4);
+ return ctx.getImageData(0, 0, 1, 1).data[3] > 0; // Checks if pixels were drawn
+}
+
var wah = '',
STG = null,
NOAC = 'autocorrect="off" autocapitalize="off"',
@@ -35,6 +42,7 @@ var wah = '',
VCHROME = CHROME ? 1 : 0,
UA = '' + navigator.userAgent,
IE = !!document.documentMode,
+ EMOJI = supportsEmoji(),
FIREFOX = ('netscape' in window) && / rv:/.test(UA),
IPHONE = TOUCH && /iPhone|iPad|iPod/i.test(UA),
LINUX = /Linux/.test(UA),
@@ -1823,7 +1831,7 @@ var toast = (function () {
setcvar('--tmstep', Math.floor(sec * 20));
html += '
';
}
- obj.innerHTML = html + '
✕' + lf2br(txt) + '
';
+ obj.innerHTML = html + '
×' + lf2br(txt) + '
';
obj.className = cl;
sec += obj.offsetWidth;
obj.className += ' vis';