mirror of
https://github.com/9001/copyparty.git
synced 2025-11-04 22:03:21 +00:00
Compare commits
11 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
02910b0020 | ||
|
|
23b8901c9c | ||
|
|
99f6ed0cd7 | ||
|
|
890c310880 | ||
|
|
0194eeb31f | ||
|
|
f9be4c62b1 | ||
|
|
027e8c18f1 | ||
|
|
4a3bb35a95 | ||
|
|
4bfb0d4494 | ||
|
|
7e0ef03a1e | ||
|
|
f7dbd95a54 |
@@ -1,8 +1,8 @@
|
|||||||
# coding: utf-8
|
# coding: utf-8
|
||||||
|
|
||||||
VERSION = (0, 11, 42)
|
VERSION = (0, 11, 45)
|
||||||
CODENAME = "the grid"
|
CODENAME = "the grid"
|
||||||
BUILD_DT = (2021, 7, 18)
|
BUILD_DT = (2021, 7, 20)
|
||||||
|
|
||||||
S_VERSION = ".".join(map(str, VERSION))
|
S_VERSION = ".".join(map(str, VERSION))
|
||||||
S_BUILD_DT = "{0:04d}-{1:02d}-{2:02d}".format(*BUILD_DT)
|
S_BUILD_DT = "{0:04d}-{1:02d}-{2:02d}".format(*BUILD_DT)
|
||||||
|
|||||||
@@ -1653,6 +1653,7 @@ class HttpCli(object):
|
|||||||
"files": [],
|
"files": [],
|
||||||
"taglist": [],
|
"taglist": [],
|
||||||
"srvinf": srv_info,
|
"srvinf": srv_info,
|
||||||
|
"acct": self.uname,
|
||||||
"perms": perms,
|
"perms": perms,
|
||||||
"logues": logues,
|
"logues": logues,
|
||||||
}
|
}
|
||||||
@@ -1660,6 +1661,7 @@ class HttpCli(object):
|
|||||||
"vdir": quotep(self.vpath),
|
"vdir": quotep(self.vpath),
|
||||||
"vpnodes": vpnodes,
|
"vpnodes": vpnodes,
|
||||||
"files": [],
|
"files": [],
|
||||||
|
"acct": self.uname,
|
||||||
"perms": json.dumps(perms),
|
"perms": json.dumps(perms),
|
||||||
"taglist": [],
|
"taglist": [],
|
||||||
"tag_order": [],
|
"tag_order": [],
|
||||||
|
|||||||
@@ -211,15 +211,39 @@ a, #files tbody div a:last-child {
|
|||||||
margin: .8em 0;
|
margin: .8em 0;
|
||||||
}
|
}
|
||||||
#srv_info {
|
#srv_info {
|
||||||
opacity: .5;
|
color: #a73;
|
||||||
font-size: .8em;
|
background: #333;
|
||||||
color: #fc5;
|
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: .5em;
|
font-size: .8em;
|
||||||
|
top: .5em;
|
||||||
left: 2em;
|
left: 2em;
|
||||||
|
padding-right: .5em;
|
||||||
}
|
}
|
||||||
#srv_info span {
|
#srv_info span {
|
||||||
color: #fff;
|
color: #aaa;
|
||||||
|
}
|
||||||
|
#acc_info {
|
||||||
|
position: absolute;
|
||||||
|
font-size: .81em;
|
||||||
|
top: .5em;
|
||||||
|
right: 2em;
|
||||||
|
color: #999;
|
||||||
|
}
|
||||||
|
#acc_info span:before {
|
||||||
|
color: #f4c;
|
||||||
|
border-bottom: 1px solid rgba(255,68,204,0.6);
|
||||||
|
margin-right: .6em;
|
||||||
|
}
|
||||||
|
html.read #acc_info span:before {
|
||||||
|
content: 'Read-Only access';
|
||||||
|
}
|
||||||
|
html.write #acc_info span:before {
|
||||||
|
content: 'Write-Only access';
|
||||||
|
}
|
||||||
|
html.read.write #acc_info span:before {
|
||||||
|
content: 'Read-Write access';
|
||||||
|
color: #999;
|
||||||
|
border: none;
|
||||||
}
|
}
|
||||||
#files tbody a.play {
|
#files tbody a.play {
|
||||||
color: #e70;
|
color: #e70;
|
||||||
@@ -1001,10 +1025,14 @@ html.light .tgl.btn.on {
|
|||||||
}
|
}
|
||||||
html.light #srv_info {
|
html.light #srv_info {
|
||||||
color: #c83;
|
color: #c83;
|
||||||
|
background: #eee;
|
||||||
|
}
|
||||||
|
html.light #srv_info,
|
||||||
|
html.light #acc_info {
|
||||||
text-shadow: 1px 1px 0 #fff;
|
text-shadow: 1px 1px 0 #fff;
|
||||||
}
|
}
|
||||||
html.light #srv_info span {
|
html.light #srv_info span {
|
||||||
color: #000;
|
color: #777;
|
||||||
}
|
}
|
||||||
html.light #treeul a+a {
|
html.light #treeul a+a {
|
||||||
background: inherit;
|
background: inherit;
|
||||||
|
|||||||
@@ -121,7 +121,8 @@
|
|||||||
<div id="widget"></div>
|
<div id="widget"></div>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
var perms = {{ perms }},
|
var acct = "{{ acct }}",
|
||||||
|
perms = {{ perms }},
|
||||||
tag_order_cfg = {{ tag_order }},
|
tag_order_cfg = {{ tag_order }},
|
||||||
have_up2k_idx = {{ have_up2k_idx|tojson }},
|
have_up2k_idx = {{ have_up2k_idx|tojson }},
|
||||||
have_tags_idx = {{ have_tags_idx|tojson }},
|
have_tags_idx = {{ have_tags_idx|tojson }},
|
||||||
|
|||||||
@@ -1146,7 +1146,7 @@ var audio_eq = (function () {
|
|||||||
v = parseFloat(vs);
|
v = parseFloat(vs);
|
||||||
|
|
||||||
if (isNaN(v) || v + '' != vs)
|
if (isNaN(v) || v + '' != vs)
|
||||||
throw 42;
|
throw new Error('inval band');
|
||||||
|
|
||||||
if (isNaN(band))
|
if (isNaN(band))
|
||||||
r.amp = Math.round((v + step * 0.2) * 100) / 100;
|
r.amp = Math.round((v + step * 0.2) * 100) / 100;
|
||||||
@@ -1452,6 +1452,13 @@ function play_linked() {
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
(function () {
|
||||||
|
var d = mknod('div');
|
||||||
|
d.setAttribute('id', 'acc_info');
|
||||||
|
document.body.insertBefore(d, ebi('ops'));
|
||||||
|
})();
|
||||||
|
|
||||||
|
|
||||||
var thegrid = (function () {
|
var thegrid = (function () {
|
||||||
var lfiles = ebi('files'),
|
var lfiles = ebi('files'),
|
||||||
gfiles = mknod('div');
|
gfiles = mknod('div');
|
||||||
@@ -1714,12 +1721,13 @@ var thegrid = (function () {
|
|||||||
|
|
||||||
|
|
||||||
function tree_scrollto() {
|
function tree_scrollto() {
|
||||||
var act = QS('#treeul a.hl');
|
var act = QS('#treeul a.hl'),
|
||||||
if (!act)
|
ul = act ? act.offsetParent : null;
|
||||||
|
|
||||||
|
if (!ul)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
var ctr = ebi('tree'),
|
var ctr = ebi('tree'),
|
||||||
ul = act.offsetParent,
|
|
||||||
em = parseFloat(getComputedStyle(act).fontSize),
|
em = parseFloat(getComputedStyle(act).fontSize),
|
||||||
top = act.offsetTop + ul.offsetTop,
|
top = act.offsetTop + ul.offsetTop,
|
||||||
min = top - 11 * em,
|
min = top - 11 * em,
|
||||||
@@ -2306,7 +2314,12 @@ var treectl = (function () {
|
|||||||
var fun = treectl.dir_cb;
|
var fun = treectl.dir_cb;
|
||||||
if (fun) {
|
if (fun) {
|
||||||
treectl.dir_cb = null;
|
treectl.dir_cb = null;
|
||||||
fun();
|
try {
|
||||||
|
fun();
|
||||||
|
}
|
||||||
|
catch (ex) {
|
||||||
|
console.log("dir_cb failed", ex);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2428,6 +2441,7 @@ var treectl = (function () {
|
|||||||
if (this.hpush)
|
if (this.hpush)
|
||||||
hist_push(this.top);
|
hist_push(this.top);
|
||||||
|
|
||||||
|
acct = res.acct;
|
||||||
apply_perms(res.perms);
|
apply_perms(res.perms);
|
||||||
despin('#files');
|
despin('#files');
|
||||||
despin('#gfiles');
|
despin('#gfiles');
|
||||||
@@ -2544,6 +2558,10 @@ function despin(sel) {
|
|||||||
function apply_perms(newperms) {
|
function apply_perms(newperms) {
|
||||||
perms = newperms || [];
|
perms = newperms || [];
|
||||||
|
|
||||||
|
ebi('acc_info').innerHTML = '<span>' + (acct != '*' ?
|
||||||
|
'<a href="?pw=x">Logout ' + acct + '</a>' :
|
||||||
|
'<a href="?h">Login</a>') + '</span>';
|
||||||
|
|
||||||
var o = QSA('#ops>a[data-perm], #u2footfoot');
|
var o = QSA('#ops>a[data-perm], #u2footfoot');
|
||||||
for (var a = 0; a < o.length; a++) {
|
for (var a = 0; a < o.length; a++) {
|
||||||
var display = '';
|
var display = '';
|
||||||
@@ -2567,12 +2585,10 @@ function apply_perms(newperms) {
|
|||||||
de = document.documentElement,
|
de = document.documentElement,
|
||||||
tds = QSA('#u2conf td');
|
tds = QSA('#u2conf td');
|
||||||
|
|
||||||
/* good idea maybe
|
|
||||||
clmod(de, "read", have_read);
|
clmod(de, "read", have_read);
|
||||||
clmod(de, "write", have_write);
|
clmod(de, "write", have_write);
|
||||||
clmod(de, "nread", !have_read);
|
clmod(de, "nread", !have_read);
|
||||||
clmod(de, "nwrite", !have_write);
|
clmod(de, "nwrite", !have_write);
|
||||||
*/
|
|
||||||
|
|
||||||
for (var a = 0; a < tds.length; a++) {
|
for (var a = 0; a < tds.length; a++) {
|
||||||
tds[a].style.display =
|
tds[a].style.display =
|
||||||
@@ -2954,7 +2970,7 @@ var arcfmt = (function () {
|
|||||||
|
|
||||||
var ofs = href.lastIndexOf('?');
|
var ofs = href.lastIndexOf('?');
|
||||||
if (ofs < 0)
|
if (ofs < 0)
|
||||||
throw 'missing arg in url';
|
throw new Error('missing arg in url');
|
||||||
|
|
||||||
o.setAttribute("href", href.slice(0, ofs + 1) + arg);
|
o.setAttribute("href", href.slice(0, ofs + 1) + arg);
|
||||||
o.textContent = fmt.split('_')[0];
|
o.textContent = fmt.split('_')[0];
|
||||||
|
|||||||
@@ -176,7 +176,7 @@ function md_plug_err(ex, js) {
|
|||||||
var lns = js.split('\n');
|
var lns = js.split('\n');
|
||||||
if (ln < lns.length) {
|
if (ln < lns.length) {
|
||||||
o = mknod('span');
|
o = mknod('span');
|
||||||
o.style.cssText = 'color:#ac2;font-size:.9em;font-family:scp;display:block';
|
o.style.cssText = "color:#ac2;font-size:.9em;font-family:'scp',monospace,monospace;display:block";
|
||||||
o.textContent = lns[ln - 1];
|
o.textContent = lns[ln - 1];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -290,8 +290,7 @@ function U2pvis(act, btns) {
|
|||||||
if (this.is_act(this.tab[a].in))
|
if (this.is_act(this.tab[a].in))
|
||||||
console.log("tab %d/%d = sz %s", a, aa, this.tab[a].bt);
|
console.log("tab %d/%d = sz %s", a, aa, this.tab[a].bt);
|
||||||
|
|
||||||
console.log("a");
|
throw new Error('see console');
|
||||||
throw 42;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
obj.innerHTML = fo.hp;
|
obj.innerHTML = fo.hp;
|
||||||
@@ -304,15 +303,8 @@ function U2pvis(act, btns) {
|
|||||||
oldcat = fo.in,
|
oldcat = fo.in,
|
||||||
bz_act = this.act == "bz";
|
bz_act = this.act == "bz";
|
||||||
|
|
||||||
if (oldcat == newcat) {
|
if (oldcat == newcat)
|
||||||
throw 42;
|
return;
|
||||||
}
|
|
||||||
|
|
||||||
//console.log("oldcat %s %d, newcat %s %d, head=%d, tail=%d, file=%d, act.old=%s, act.new=%s, bz_act=%s",
|
|
||||||
// oldcat, this.ctr[oldcat],
|
|
||||||
// newcat, this.ctr[newcat],
|
|
||||||
// this.head, this.tail, nfile,
|
|
||||||
// this.is_act(oldcat), this.is_act(newcat), bz_act);
|
|
||||||
|
|
||||||
fo.in = newcat;
|
fo.in = newcat;
|
||||||
this.ctr[oldcat]--;
|
this.ctr[oldcat]--;
|
||||||
@@ -468,6 +460,15 @@ function U2pvis(act, btns) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function fsearch_explain(e) {
|
||||||
|
ev(e);
|
||||||
|
if (!has(perms, 'write'))
|
||||||
|
return alert('your access to this folder is Read-Only\n\n' + (acct == '*' ? 'you are currently not logged in' : 'you are currently logged in as ' + acct));
|
||||||
|
|
||||||
|
alert('you are currently in file-search mode\n\nswitch to upload-mode by clicking the green magnifying glass (next to the big yellow search button), and then refresh\n\nsorry');
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
function up2k_init(subtle) {
|
function up2k_init(subtle) {
|
||||||
// show modal message
|
// show modal message
|
||||||
function showmodal(msg) {
|
function showmodal(msg) {
|
||||||
@@ -495,8 +496,9 @@ function up2k_init(subtle) {
|
|||||||
shame = 'your browser is impressively ancient';
|
shame = 'your browser is impressively ancient';
|
||||||
|
|
||||||
// upload ui hidden by default, clicking the header shows it
|
// upload ui hidden by default, clicking the header shows it
|
||||||
|
var got_deps = false;
|
||||||
function init_deps() {
|
function init_deps() {
|
||||||
if (!subtle && !window.asmCrypto) {
|
if (!got_deps && !subtle && !window.asmCrypto) {
|
||||||
var fn = 'sha512.' + sha_js + '.js';
|
var fn = 'sha512.' + sha_js + '.js';
|
||||||
showmodal('<h1>loading ' + fn + '</h1><h2>since ' + shame + '</h2><h4>thanks chrome</h4>');
|
showmodal('<h1>loading ' + fn + '</h1><h2>since ' + shame + '</h2><h4>thanks chrome</h4>');
|
||||||
import_js('/.cpr/deps/' + fn, unmodal);
|
import_js('/.cpr/deps/' + fn, unmodal);
|
||||||
@@ -507,6 +509,7 @@ function up2k_init(subtle) {
|
|||||||
ebi('u2foot').innerHTML = 'seems like ' + shame + ' so do that if you want more performance <span style="color:#' +
|
ebi('u2foot').innerHTML = 'seems like ' + shame + ' so do that if you want more performance <span style="color:#' +
|
||||||
(sha_js == 'ac' ? 'c84">(expecting 20' : '8a5">(but dont worry too much, expect 100') + ' MiB/s)</span>';
|
(sha_js == 'ac' ? 'c84">(expecting 20' : '8a5">(but dont worry too much, expect 100') + ' MiB/s)</span>';
|
||||||
}
|
}
|
||||||
|
got_deps = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// show uploader if the user only has write-access
|
// show uploader if the user only has write-access
|
||||||
@@ -1298,8 +1301,8 @@ function up2k_init(subtle) {
|
|||||||
smsg = '';
|
smsg = '';
|
||||||
|
|
||||||
if (!response || !response.hits || !response.hits.length) {
|
if (!response || !response.hits || !response.hits.length) {
|
||||||
msg = 'not found on server';
|
|
||||||
smsg = '404';
|
smsg = '404';
|
||||||
|
msg = 'not found on server <a href="#" onclick="fsearch_explain()" class="fsearch_explain">(explain)</a>';
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
smsg = 'found';
|
smsg = 'found';
|
||||||
|
|||||||
@@ -257,6 +257,11 @@ html.light #u2foot .warn span {
|
|||||||
float: right;
|
float: right;
|
||||||
margin-bottom: -.3em;
|
margin-bottom: -.3em;
|
||||||
}
|
}
|
||||||
|
.fsearch_explain {
|
||||||
|
padding-left: .7em;
|
||||||
|
font-size: 1.1em;
|
||||||
|
line-height: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -7,7 +7,8 @@ if (!window['console'])
|
|||||||
|
|
||||||
|
|
||||||
var is_touch = 'ontouchstart' in window,
|
var is_touch = 'ontouchstart' in window,
|
||||||
ANDROID = /(android)/i.test(navigator.userAgent);
|
IPHONE = /iPhone|iPad|iPod/i.test(navigator.userAgent),
|
||||||
|
ANDROID = /android/i.test(navigator.userAgent);
|
||||||
|
|
||||||
|
|
||||||
// error handler for mobile devices
|
// error handler for mobile devices
|
||||||
@@ -30,17 +31,21 @@ function vis_exh(msg, url, lineNo, columnNo, error) {
|
|||||||
var html = ['<h1>you hit a bug!</h1><p style="font-size:1.3em;margin:0">try to <a href="#" onclick="localStorage.clear();location.reload();" style="text-decoration:underline;color:#fc0">reset copyparty settings</a> if you are stuck here</p><p>please send me a screenshot arigathanks gozaimuch: <code>ed/irc.rizon.net</code> or <code>ed#2644</code><br /> (and if you can, press F12 and include the "Console" tab in the screenshot too)</p><p>',
|
var html = ['<h1>you hit a bug!</h1><p style="font-size:1.3em;margin:0">try to <a href="#" onclick="localStorage.clear();location.reload();" style="text-decoration:underline;color:#fc0">reset copyparty settings</a> if you are stuck here</p><p>please send me a screenshot arigathanks gozaimuch: <code>ed/irc.rizon.net</code> or <code>ed#2644</code><br /> (and if you can, press F12 and include the "Console" tab in the screenshot too)</p><p>',
|
||||||
esc(url + ' @' + lineNo + ':' + columnNo), '<br />' + esc(String(msg)) + '</p>'];
|
esc(url + ' @' + lineNo + ':' + columnNo), '<br />' + esc(String(msg)) + '</p>'];
|
||||||
|
|
||||||
if (error) {
|
try {
|
||||||
var find = ['desc', 'stack', 'trace'];
|
if (error) {
|
||||||
for (var a = 0; a < find.length; a++)
|
var find = ['desc', 'stack', 'trace'];
|
||||||
if (String(error[find[a]]) !== 'undefined')
|
for (var a = 0; a < find.length; a++)
|
||||||
html.push('<h3>' + find[a] + '</h3>' +
|
if (String(error[find[a]]) !== 'undefined')
|
||||||
esc(String(error[find[a]])).replace(/\n/g, '<br />\n'));
|
html.push('<h3>' + find[a] + '</h3>' +
|
||||||
|
esc(String(error[find[a]])).replace(/\n/g, '<br />\n'));
|
||||||
|
}
|
||||||
|
html.push('<h3>localStore</h3>' + esc(JSON.stringify(localStorage)));
|
||||||
}
|
}
|
||||||
|
catch (e) { }
|
||||||
document.body.innerHTML = html.join('\n');
|
document.body.innerHTML = html.join('\n');
|
||||||
|
|
||||||
var s = mknod('style');
|
var s = mknod('style');
|
||||||
s.innerHTML = 'body{background:#333;color:#ddd;font-family:sans-serif;font-size:0.8em;padding:0 1em 1em 1em} h1{margin:.5em 1em 0 0;padding:0} h3{border-top:1px solid #999;margin:0} code{color:#bf7;background:#222;padding:.1em;margin:.2em;font-size:1.1em;font-family:monospace,monospace} *{line-height:1.5em}';
|
s.innerHTML = 'body{background:#333;color:#ddd;font-family:sans-serif;font-size:0.8em;padding:0 1em 1em 1em} h1{margin:.5em 1em 0 0;padding:0} h3{border-top:1px solid #999;margin:1em 0 0 0} code{color:#bf7;background:#222;padding:.1em;margin:.2em;font-size:1.1em;font-family:monospace,monospace} *{line-height:1.5em}';
|
||||||
document.head.appendChild(s);
|
document.head.appendChild(s);
|
||||||
|
|
||||||
throw 'fatal_err';
|
throw 'fatal_err';
|
||||||
@@ -547,12 +552,25 @@ var tt = (function () {
|
|||||||
clmod(r.tt, 'show', 1);
|
clmod(r.tt, 'show', 1);
|
||||||
};
|
};
|
||||||
|
|
||||||
r.hide = function () {
|
r.hide = function (e) {
|
||||||
|
ev(e);
|
||||||
clmod(r.tt, 'show');
|
clmod(r.tt, 'show');
|
||||||
if (r.el)
|
if (r.el)
|
||||||
r.el.removeEventListener('mouseleave', r.hide);
|
r.el.removeEventListener('mouseleave', r.hide);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if (is_touch && IPHONE) {
|
||||||
|
var f1 = r.show,
|
||||||
|
f2 = r.hide;
|
||||||
|
|
||||||
|
r.show = function () {
|
||||||
|
setTimeout(f1.bind(this), 301);
|
||||||
|
};
|
||||||
|
r.hide = function () {
|
||||||
|
setTimeout(f2.bind(this), 301);
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
r.tt.onclick = r.hide;
|
r.tt.onclick = r.hide;
|
||||||
|
|
||||||
r.att = function (ctr) {
|
r.att = function (ctr) {
|
||||||
|
|||||||
@@ -166,7 +166,10 @@ dbg.asyncStore.pendingBreakpoints = {}
|
|||||||
about:config >> devtools.debugger.prefs-schema-version = -1
|
about:config >> devtools.debugger.prefs-schema-version = -1
|
||||||
|
|
||||||
# determine server version
|
# determine server version
|
||||||
git pull; git reset --hard origin/HEAD && git log --format=format:"%H %ai %d" --decorate=full > ../revs && cat ../{util,browser}.js >../vr && cat ../revs | while read -r rev extra; do (git reset --hard $rev >/dev/null 2>/dev/null && dsz=$(cat copyparty/web/{util,browser}.js >../vg 2>/dev/null && diff -wNarU0 ../{vg,vr} | wc -c) && printf '%s %6s %s\n' "$rev" $dsz "$extra") </dev/null; done
|
git pull; git reset --hard origin/HEAD && git log --format=format:"%H %ai %d" --decorate=full > ../revs && cat ../{util,browser,up2k}.js >../vr && cat ../revs | while read -r rev extra; do (git reset --hard $rev >/dev/null 2>/dev/null && dsz=$(cat copyparty/web/{util,browser,up2k}.js >../vg 2>/dev/null && diff -wNarU0 ../{vg,vr} | wc -c) && printf '%s %6s %s\n' "$rev" $dsz "$extra") </dev/null; done
|
||||||
|
|
||||||
|
# download all sfx versions
|
||||||
|
curl https://api.github.com/repos/9001/copyparty/releases?per_page=100 | jq -r '.[] | .tag_name + " " + .name' | while read v t; do fn="copyparty $v $t.py"; [ -e $fn ] || curl https://github.com/9001/copyparty/releases/download/$v/copyparty-sfx.py -Lo "$fn"; done
|
||||||
|
|
||||||
|
|
||||||
##
|
##
|
||||||
|
|||||||
@@ -20,6 +20,11 @@ echo
|
|||||||
#
|
#
|
||||||
# `no-cm` saves ~90k by removing easymde/codemirror
|
# `no-cm` saves ~90k by removing easymde/codemirror
|
||||||
# (the fancy markdown editor)
|
# (the fancy markdown editor)
|
||||||
|
#
|
||||||
|
# `no-fnt` saves ~9k by removing the source-code-pro font
|
||||||
|
# (mainly used my the markdown viewer/editor)
|
||||||
|
#
|
||||||
|
# `no-dd` saves ~2k by removing the mouse cursor
|
||||||
|
|
||||||
|
|
||||||
# port install gnutar findutils gsed coreutils
|
# port install gnutar findutils gsed coreutils
|
||||||
@@ -57,14 +62,18 @@ use_gz=
|
|||||||
do_sh=1
|
do_sh=1
|
||||||
do_py=1
|
do_py=1
|
||||||
while [ ! -z "$1" ]; do
|
while [ ! -z "$1" ]; do
|
||||||
[ "$1" = clean ] && clean=1 && shift && continue
|
case $1 in
|
||||||
[ "$1" = re ] && repack=1 && shift && continue
|
clean) clean=1 ; ;;
|
||||||
[ "$1" = gz ] && use_gz=1 && shift && continue
|
re) repack=1 ; ;;
|
||||||
[ "$1" = no-ogv ] && no_ogv=1 && shift && continue
|
gz) use_gz=1 ; ;;
|
||||||
[ "$1" = no-cm ] && no_cm=1 && shift && continue
|
no-ogv) no_ogv=1 ; ;;
|
||||||
[ "$1" = no-sh ] && do_sh= && shift && continue
|
no-fnt) no_fnt=1 ; ;;
|
||||||
[ "$1" = no-py ] && do_py= && shift && continue
|
no-dd) no_dd=1 ; ;;
|
||||||
break
|
no-cm) no_cm=1 ; ;;
|
||||||
|
no-sh) do_sh= ; ;;
|
||||||
|
no-py) do_py= ; ;;
|
||||||
|
esac
|
||||||
|
shift
|
||||||
done
|
done
|
||||||
|
|
||||||
tmv() {
|
tmv() {
|
||||||
@@ -190,6 +199,18 @@ done
|
|||||||
sed -r '/edit2">edit \(fancy/d' <$f >t && tmv "$f"
|
sed -r '/edit2">edit \(fancy/d' <$f >t && tmv "$f"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[ $no_fnt ] && {
|
||||||
|
rm -f copyparty/web/deps/scp.woff2
|
||||||
|
f=copyparty/web/md.css
|
||||||
|
sed -r '/scp\.woff2/d' <$f >t && tmv "$f"
|
||||||
|
}
|
||||||
|
|
||||||
|
[ $no_dd ] && {
|
||||||
|
rm -rf copyparty/web/dd
|
||||||
|
f=copyparty/web/browser.css
|
||||||
|
sed -r 's/(cursor: )url\([^)]+\), (pointer)/\1\2/; /[0-9]+% \{cursor:/d; /animation: cursor/d' <$f >t && tmv "$f"
|
||||||
|
}
|
||||||
|
|
||||||
[ $repack ] ||
|
[ $repack ] ||
|
||||||
find | grep -E '\.py$' |
|
find | grep -E '\.py$' |
|
||||||
grep -vE '__version__' |
|
grep -vE '__version__' |
|
||||||
|
|||||||
Reference in New Issue
Block a user