diff --git a/copyparty/httpcli.py b/copyparty/httpcli.py index d56d7b64..3b1aaa74 100644 --- a/copyparty/httpcli.py +++ b/copyparty/httpcli.py @@ -7384,6 +7384,7 @@ class HttpCli(object): else: self.log("doc 2big: %r" % (doc,), 6) doctxt = "( size of textfile exceeds serverside limit )" + # NOTE: browser.js expects this exact message else: self.log("doc 404: %r" % (doc,), 6) doctxt = "( textfile not found )" diff --git a/copyparty/web/browser.js b/copyparty/web/browser.js index a2c7311b..eae68df2 100644 --- a/copyparty/web/browser.js +++ b/copyparty/web/browser.js @@ -5037,7 +5037,7 @@ var showfile = (function () { } r.mktree(); if (em) { - if (r.taildoc) + if (r.taildoc || em[2] == '( size of textfile exceeds serverside limit )') r.show(em[0], true); else render(em); @@ -9651,7 +9651,7 @@ var rcm = (function () { break; case 'ply': selFile.type == 'gf' ? thegrid.imshow(selFile.name) : play('f-' + selFile.id); break; case 'pla': play('f-' + selFile.id); break; - case 'txt': location = selFile.dpath + '?doc=' + selFile.name; break; + case 'txt': showfile.show(selFile.name); break; case 'md': location = selFile.path + (has(selFile.path, '?') ? '&v' : '?v'); break; case 'cpl': cliptxt(selFile.url, function() {toast.ok(2, L.clipped)}); break; case 'dl': ebi('seldl').click(); break;