From b8e851c332a480b23fcedc8839074b358ba87dc9 Mon Sep 17 00:00:00 2001
From: ed
Date: Sun, 25 Jun 2023 23:09:29 +0000
Subject: [PATCH] cloudflare update + cosmetics: * toastb padding fixes
scrollbar on norwegian 403 in firefox * fix text aspect ratio in seekbaron
compact toggle * crashpage had link overlaps on homepage
---
copyparty/web/browser.js | 2 ++
copyparty/web/ui.css | 2 +-
copyparty/web/util.js | 17 +++++++++--------
3 files changed, 12 insertions(+), 9 deletions(-)
diff --git a/copyparty/web/browser.js b/copyparty/web/browser.js
index aedd9113..15c2ed00 100644
--- a/copyparty/web/browser.js
+++ b/copyparty/web/browser.js
@@ -3080,6 +3080,8 @@ function eval_hash() {
// compact media player
function setacmp() {
clmod(ebi('widget'), 'cmp', props.mcmp);
+ pbar.onresize();
+ vbar.onresize();
}
bcfg_bind(props, 'mcmp', 'au_compact', false, setacmp);
setacmp();
diff --git a/copyparty/web/ui.css b/copyparty/web/ui.css
index f2fcf5ec..58d3b226 100644
--- a/copyparty/web/ui.css
+++ b/copyparty/web/ui.css
@@ -73,7 +73,7 @@ html {
#toastb {
max-height: 70vh;
overflow-y: auto;
- padding: 1px;
+ padding: .1em;
}
#toast.scroll #toastb {
overflow-y: scroll;
diff --git a/copyparty/web/util.js b/copyparty/web/util.js
index 2f29fbf1..77cab381 100644
--- a/copyparty/web/util.js
+++ b/copyparty/web/util.js
@@ -159,8 +159,8 @@ function vis_exh(msg, url, lineNo, columnNo, error) {
window.onerror = undefined;
var html = [
'you hit a bug!
',
- '
try to reset copyparty settings if you are stuck here, or ignore this / ignore all / basic
', - 'please send me a screenshot arigathanks gozaimuch: github issue
', + 'try to reset copyparty settings if you are stuck here, or ignore this / ignore all / basic
', + 'please send me a screenshot arigathanks gozaimuch: new github issue
', '' + esc(url + ' @' + lineNo + ':' + columnNo), '
' + esc(String(msg)).replace(/\n/g, '
') + '
UA: ' + esc(navigator.userAgent + '') ]; @@ -225,7 +225,7 @@ function vis_exh(msg, url, lineNo, columnNo, error) { '#exbox{background:#222;color:#ddd;font-family:sans-serif;font-size:0.8em;padding:0 1em 1em 1em;z-index:80386;position:fixed;top:0;left:0;right:0;bottom:0;width:100%;height:100%;overflow:auto;width:calc(100% - 2em)} ' + '#exbox,#exbox *{line-height:1.5em;overflow-wrap:break-word} ' + '#exbox code{color:#bf7;background:#222;padding:.1em;margin:.2em;font-size:1.1em;font-family:monospace,monospace} ' + - '#exbox a{text-decoration:underline;color:#fc0} ' + + '#exbox a{text-decoration:underline;color:#fc0;background:#222;border:none} ' + '#exbox h1{margin:.5em 1em 0 0;padding:0} ' + '#exbox p.b{border-top:1px solid #999;margin:1em 0 0 0;font-size:1em} ' + '#exbox ul, #exbox li {margin:0 0 0 .5em;padding:0} ' + @@ -1786,16 +1786,17 @@ function xhrchk(xhr, prefix, e404, lvl, tag) { if (xhr.status < 400 && xhr.status >= 200) return true; - if (xhr.status == 403) + var errtxt = (xhr.response && xhr.response.err) || xhr.responseText, + fun = toast[lvl || 'err'], + is_cf = /[Cc]loud[f]lare|>Just a mo[m]ent|#cf-b[u]bbles|Chec[k]ing your br[o]wser|\/chall[e]nge-platform|"chall[e]nge-error|nable Ja[v]aScript and cook/.test(errtxt); + + if (xhr.status == 403 && !is_cf) return toast.err(0, prefix + (L && L.xhr403 || "403: access denied\n\ntry pressing F5, maybe you got logged out"), tag); if (xhr.status == 404) return toast.err(0, prefix + e404, tag); - var errtxt = (xhr.response && xhr.response.err) || xhr.responseText, - fun = toast[lvl || 'err']; - - if (xhr.status == 503 && /[Cc]loud[f]lare|>Just a mo[m]ent|#cf-b[u]bbles|Chec[k]ing your br[o]wser/.test(errtxt)) { + if (is_cf && (xhr.status == 403 || xhr.status == 503)) { var now = Date.now(), td = now - cf_cha_t; if (td < 15000) return;