mirror of
https://github.com/9001/copyparty.git
synced 2025-11-03 05:23:31 +00:00
Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f9be4c62b1 | ||
|
|
027e8c18f1 | ||
|
|
4a3bb35a95 | ||
|
|
4bfb0d4494 | ||
|
|
7e0ef03a1e | ||
|
|
f7dbd95a54 |
@@ -1,8 +1,8 @@
|
||||
# coding: utf-8
|
||||
|
||||
VERSION = (0, 11, 42)
|
||||
VERSION = (0, 11, 44)
|
||||
CODENAME = "the grid"
|
||||
BUILD_DT = (2021, 7, 18)
|
||||
BUILD_DT = (2021, 7, 20)
|
||||
|
||||
S_VERSION = ".".join(map(str, VERSION))
|
||||
S_BUILD_DT = "{0:04d}-{1:02d}-{2:02d}".format(*BUILD_DT)
|
||||
|
||||
@@ -1146,7 +1146,7 @@ var audio_eq = (function () {
|
||||
v = parseFloat(vs);
|
||||
|
||||
if (isNaN(v) || v + '' != vs)
|
||||
throw 42;
|
||||
throw new Error('inval band');
|
||||
|
||||
if (isNaN(band))
|
||||
r.amp = Math.round((v + step * 0.2) * 100) / 100;
|
||||
@@ -1714,12 +1714,13 @@ var thegrid = (function () {
|
||||
|
||||
|
||||
function tree_scrollto() {
|
||||
var act = QS('#treeul a.hl');
|
||||
if (!act)
|
||||
var act = QS('#treeul a.hl'),
|
||||
ul = act ? act.offsetParent : null;
|
||||
|
||||
if (!ul)
|
||||
return;
|
||||
|
||||
var ctr = ebi('tree'),
|
||||
ul = act.offsetParent,
|
||||
em = parseFloat(getComputedStyle(act).fontSize),
|
||||
top = act.offsetTop + ul.offsetTop,
|
||||
min = top - 11 * em,
|
||||
@@ -2306,7 +2307,12 @@ var treectl = (function () {
|
||||
var fun = treectl.dir_cb;
|
||||
if (fun) {
|
||||
treectl.dir_cb = null;
|
||||
fun();
|
||||
try {
|
||||
fun();
|
||||
}
|
||||
catch (ex) {
|
||||
console.log("dir_cb failed", ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2954,7 +2960,7 @@ var arcfmt = (function () {
|
||||
|
||||
var ofs = href.lastIndexOf('?');
|
||||
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.textContent = fmt.split('_')[0];
|
||||
|
||||
@@ -176,7 +176,7 @@ function md_plug_err(ex, js) {
|
||||
var lns = js.split('\n');
|
||||
if (ln < lns.length) {
|
||||
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];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -290,8 +290,7 @@ function U2pvis(act, btns) {
|
||||
if (this.is_act(this.tab[a].in))
|
||||
console.log("tab %d/%d = sz %s", a, aa, this.tab[a].bt);
|
||||
|
||||
console.log("a");
|
||||
throw 42;
|
||||
throw new Error('see console');
|
||||
}
|
||||
|
||||
obj.innerHTML = fo.hp;
|
||||
@@ -304,15 +303,8 @@ function U2pvis(act, btns) {
|
||||
oldcat = fo.in,
|
||||
bz_act = this.act == "bz";
|
||||
|
||||
if (oldcat == newcat) {
|
||||
throw 42;
|
||||
}
|
||||
|
||||
//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);
|
||||
if (oldcat == newcat)
|
||||
return;
|
||||
|
||||
fo.in = newcat;
|
||||
this.ctr[oldcat]--;
|
||||
@@ -468,6 +460,12 @@ function U2pvis(act, btns) {
|
||||
}
|
||||
|
||||
|
||||
function fsearch_explain(e) {
|
||||
ev(e);
|
||||
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) {
|
||||
// show modal message
|
||||
function showmodal(msg) {
|
||||
@@ -1298,8 +1296,10 @@ function up2k_init(subtle) {
|
||||
smsg = '';
|
||||
|
||||
if (!response || !response.hits || !response.hits.length) {
|
||||
msg = 'not found on server';
|
||||
smsg = '404';
|
||||
msg = 'not found on server';
|
||||
if (has(perms, 'write'))
|
||||
msg += ' <a href="#" onclick="fsearch_explain()" class="fsearch_explain">(explain)</a>';
|
||||
}
|
||||
else {
|
||||
smsg = 'found';
|
||||
|
||||
@@ -257,6 +257,11 @@ html.light #u2foot .warn span {
|
||||
float: right;
|
||||
margin-bottom: -.3em;
|
||||
}
|
||||
.fsearch_explain {
|
||||
padding-left: .7em;
|
||||
font-size: 1.1em;
|
||||
line-height: 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -166,7 +166,10 @@ dbg.asyncStore.pendingBreakpoints = {}
|
||||
about:config >> devtools.debugger.prefs-schema-version = -1
|
||||
|
||||
# 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
|
||||
# (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
|
||||
@@ -57,14 +62,18 @@ use_gz=
|
||||
do_sh=1
|
||||
do_py=1
|
||||
while [ ! -z "$1" ]; do
|
||||
[ "$1" = clean ] && clean=1 && shift && continue
|
||||
[ "$1" = re ] && repack=1 && shift && continue
|
||||
[ "$1" = gz ] && use_gz=1 && shift && continue
|
||||
[ "$1" = no-ogv ] && no_ogv=1 && shift && continue
|
||||
[ "$1" = no-cm ] && no_cm=1 && shift && continue
|
||||
[ "$1" = no-sh ] && do_sh= && shift && continue
|
||||
[ "$1" = no-py ] && do_py= && shift && continue
|
||||
break
|
||||
case $1 in
|
||||
clean) clean=1 ; ;;
|
||||
re) repack=1 ; ;;
|
||||
gz) use_gz=1 ; ;;
|
||||
no-ogv) no_ogv=1 ; ;;
|
||||
no-fnt) no_fnt=1 ; ;;
|
||||
no-dd) no_dd=1 ; ;;
|
||||
no-cm) no_cm=1 ; ;;
|
||||
no-sh) do_sh= ; ;;
|
||||
no-py) do_py= ; ;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
|
||||
tmv() {
|
||||
@@ -190,6 +199,18 @@ done
|
||||
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 ] ||
|
||||
find | grep -E '\.py$' |
|
||||
grep -vE '__version__' |
|
||||
|
||||
Reference in New Issue
Block a user