papersearch 0.7.2 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE-paper-search-mcp-nodejs +24 -0
- package/NOTICE +8 -37
- package/README.en.md +7 -3
- package/README.fr.md +268 -0
- package/README.ja.md +268 -0
- package/README.ko.md +268 -0
- package/README.md +7 -3
- package/README.zh-Hant.md +268 -0
- package/dist/capabilities/download/batch/batch.d.ts +16 -1
- package/dist/capabilities/download/batch/batch.d.ts.map +1 -1
- package/dist/capabilities/download/batch/batch.js +669 -53
- package/dist/capabilities/download/batch/batch.js.map +1 -1
- package/dist/capabilities/download/batch/batchFolder.d.ts.map +1 -1
- package/dist/capabilities/download/batch/batchFolder.js +4 -3
- package/dist/capabilities/download/batch/batchFolder.js.map +1 -1
- package/dist/capabilities/download/batch/batchSummary.js +1 -1
- package/dist/capabilities/download/batch/batchSummary.js.map +1 -1
- package/dist/capabilities/download/batch/networkLoss.d.ts +12 -3
- package/dist/capabilities/download/batch/networkLoss.d.ts.map +1 -1
- package/dist/capabilities/download/batch/networkLoss.js +25 -4
- package/dist/capabilities/download/batch/networkLoss.js.map +1 -1
- package/dist/capabilities/download/batch/resume.d.ts +7 -0
- package/dist/capabilities/download/batch/resume.d.ts.map +1 -1
- package/dist/capabilities/download/batch/resume.js +50 -9
- package/dist/capabilities/download/batch/resume.js.map +1 -1
- package/dist/capabilities/download/content/markdown/pro.d.ts +6 -0
- package/dist/capabilities/download/content/markdown/pro.d.ts.map +1 -1
- package/dist/capabilities/download/content/markdown/pro.js.map +1 -1
- package/dist/capabilities/download/content/markdown/shortfall.d.ts +8 -5
- package/dist/capabilities/download/content/markdown/shortfall.d.ts.map +1 -1
- package/dist/capabilities/download/content/markdown/shortfall.js +27 -15
- package/dist/capabilities/download/content/markdown/shortfall.js.map +1 -1
- package/dist/capabilities/download/content/markdown/step.d.ts +9 -0
- package/dist/capabilities/download/content/markdown/step.d.ts.map +1 -1
- package/dist/capabilities/download/content/markdown/step.js +42 -2
- package/dist/capabilities/download/content/markdown/step.js.map +1 -1
- package/dist/capabilities/download/content/markdown/types.d.ts +10 -1
- package/dist/capabilities/download/content/markdown/types.d.ts.map +1 -1
- package/dist/capabilities/download/handler.d.ts.map +1 -1
- package/dist/capabilities/download/handler.js +13 -5
- package/dist/capabilities/download/handler.js.map +1 -1
- package/dist/capabilities/download/outputLayout.d.ts.map +1 -1
- package/dist/capabilities/download/outputLayout.js +3 -1
- package/dist/capabilities/download/outputLayout.js.map +1 -1
- package/dist/capabilities/download/tools.js +2 -2
- package/dist/capabilities/download/tools.js.map +1 -1
- package/dist/capabilities/download/types.d.ts +9 -1
- package/dist/capabilities/download/types.d.ts.map +1 -1
- package/dist/cli.js +3 -1
- package/dist/cli.js.map +1 -1
- package/dist/infrastructure/runlog/RunLedger.d.ts +7 -0
- package/dist/infrastructure/runlog/RunLedger.d.ts.map +1 -1
- package/dist/infrastructure/runlog/RunLedger.js +13 -0
- package/dist/infrastructure/runlog/RunLedger.js.map +1 -1
- package/dist/infrastructure/runlog/failureClass.d.ts +17 -9
- package/dist/infrastructure/runlog/failureClass.d.ts.map +1 -1
- package/dist/infrastructure/runlog/failureClass.js +89 -56
- package/dist/infrastructure/runlog/failureClass.js.map +1 -1
- package/dist/infrastructure/school/SchoolAttempt.d.ts +11 -0
- package/dist/infrastructure/school/SchoolAttempt.d.ts.map +1 -1
- package/dist/infrastructure/school/SchoolAttempt.js +107 -59
- package/dist/infrastructure/school/SchoolAttempt.js.map +1 -1
- package/dist/infrastructure/school/SchoolMcpClient.d.ts +7 -2
- package/dist/infrastructure/school/SchoolMcpClient.d.ts.map +1 -1
- package/dist/infrastructure/school/SchoolMcpClient.js +30 -7
- package/dist/infrastructure/school/SchoolMcpClient.js.map +1 -1
- package/dist/infrastructure/school/SchoolProgress.d.ts +2 -0
- package/dist/infrastructure/school/SchoolProgress.d.ts.map +1 -1
- package/dist/infrastructure/school/SchoolProgress.js +2 -0
- package/dist/infrastructure/school/SchoolProgress.js.map +1 -1
- package/dist/infrastructure/school/SchoolReadiness.d.ts +2 -0
- package/dist/infrastructure/school/SchoolReadiness.d.ts.map +1 -1
- package/dist/infrastructure/school/SchoolReadiness.js +2 -0
- package/dist/infrastructure/school/SchoolReadiness.js.map +1 -1
- package/dist/infrastructure/school/SchoolResultNormalizer.d.ts.map +1 -1
- package/dist/infrastructure/school/SchoolResultNormalizer.js +4 -0
- package/dist/infrastructure/school/SchoolResultNormalizer.js.map +1 -1
- package/dist/infrastructure/school/index.d.ts +2 -2
- package/dist/infrastructure/school/index.d.ts.map +1 -1
- package/dist/infrastructure/school/index.js +1 -1
- package/dist/infrastructure/school/index.js.map +1 -1
- package/dist/infrastructure/school/types.d.ts +52 -3
- package/dist/infrastructure/school/types.d.ts.map +1 -1
- package/dist/infrastructure/school/types.js.map +1 -1
- package/dist/management/failures/index.d.ts +28 -2
- package/dist/management/failures/index.d.ts.map +1 -1
- package/dist/management/failures/index.js +83 -21
- package/dist/management/failures/index.js.map +1 -1
- package/package.json +7 -2
- package/school/NOTICE +3 -2
- package/school/paper_search_school/adapters/__init__.py +2 -0
- package/school/paper_search_school/adapters/aps/__init__.py +3 -6
- package/school/paper_search_school/adapters/base.py +18 -0
- package/school/paper_search_school/adapters/copernicus/__init__.py +2 -7
- package/school/paper_search_school/adapters/elsevier/__init__.py +50 -1
- package/school/paper_search_school/adapters/frontiers/__init__.py +41 -2
- package/school/paper_search_school/adapters/ieee/__init__.py +6 -4
- package/school/paper_search_school/adapters/iop/__init__.py +8 -0
- package/school/paper_search_school/adapters/jama/__init__.py +8 -0
- package/school/paper_search_school/adapters/lww/__init__.py +14 -6
- package/school/paper_search_school/adapters/mdpi/__init__.py +12 -7
- package/school/paper_search_school/adapters/neurology/__init__.py +5 -2
- package/school/paper_search_school/adapters/optica/__init__.py +2 -9
- package/school/paper_search_school/adapters/oup/__init__.py +27 -4
- package/school/paper_search_school/adapters/platforms/__init__.py +4 -1
- package/school/paper_search_school/adapters/platforms/atypon/__init__.py +8 -0
- package/school/paper_search_school/adapters/platforms/jstage/__init__.py +64 -0
- package/school/paper_search_school/adapters/sage/__init__.py +4 -1
- package/school/paper_search_school/adapters/thieme/__init__.py +6 -11
- package/school/paper_search_school/api_keys.py +63 -13
- package/school/paper_search_school/assets/api_keys.json +14 -0
- package/school/paper_search_school/assets/capsule.html +274 -158
- package/school/paper_search_school/assets/capsule_en.json +99 -98
- package/school/paper_search_school/assets/capsule_fr.json +100 -99
- package/school/paper_search_school/assets/capsule_ja.json +99 -98
- package/school/paper_search_school/assets/capsule_ko.json +99 -98
- package/school/paper_search_school/assets/capsule_zh-Hant.json +94 -97
- package/school/paper_search_school/browser/batch_session.py +1 -1
- package/school/paper_search_school/browser/challenge/__init__.py +12 -9
- package/school/paper_search_school/browser/challenge/continuation.py +65 -0
- package/school/paper_search_school/browser/challenge/handlers/__init__.py +1 -0
- package/school/paper_search_school/browser/challenge/handlers/aws_waf.py +260 -0
- package/school/paper_search_school/browser/challenge/handlers/recaptcha_hcaptcha.py +167 -0
- package/school/paper_search_school/browser/challenge/handlers/text_captcha.py +100 -0
- package/school/paper_search_school/browser/challenge/handlers/turnstile.py +174 -0
- package/school/paper_search_school/browser/challenge/kinds.py +203 -0
- package/school/paper_search_school/browser/challenge/local/__init__.py +1 -0
- package/school/paper_search_school/browser/challenge/{interaction.py → local/interaction.py} +94 -13
- package/school/paper_search_school/browser/challenge/{pointer.py → local/pointer.py} +2 -2
- package/school/paper_search_school/browser/challenge/local/prompt.py +283 -0
- package/school/paper_search_school/browser/challenge/local/submission.py +33 -0
- package/school/paper_search_school/browser/challenge/services/__init__.py +1 -0
- package/school/paper_search_school/browser/challenge/services/solver.py +272 -0
- package/school/paper_search_school/cli_config.py +10 -5
- package/school/paper_search_school/cold_start.py +22 -11
- package/school/paper_search_school/config.py +11 -10
- package/school/paper_search_school/download_diagnostics.py +7 -2
- package/school/paper_search_school/engine/access_rules.py +15 -5
- package/school/paper_search_school/engine/batch.py +55 -15
- package/school/paper_search_school/engine/batch_access.py +59 -21
- package/school/paper_search_school/engine/batch_capture.py +215 -18
- package/school/paper_search_school/engine/batch_common.py +3 -0
- package/school/paper_search_school/engine/batch_diagnostics.py +25 -5
- package/school/paper_search_school/engine/batch_institution.py +168 -32
- package/school/paper_search_school/engine/batch_login.py +223 -16
- package/school/paper_search_school/engine/batch_pdf_urls.py +38 -7
- package/school/paper_search_school/engine/batch_waits.py +179 -12
- package/school/paper_search_school/engine/bridge.py +44 -7
- package/school/paper_search_school/engine/fulltext_page.py +45 -7
- package/school/paper_search_school/engine/router.py +18 -2
- package/school/paper_search_school/entitlements.py +1 -1
- package/school/paper_search_school/orchestrator.py +44 -18
- package/school/paper_search_school/pdf_utils.py +25 -16
- package/school/paper_search_school/progress_capsule.py +36 -6
- package/school/paper_search_school/progress_reporter.py +71 -13
- package/school/paper_search_school/progress_view.py +64 -44
- package/school/paper_search_school/publishers/builtin/iop.json +2 -1
- package/school/paper_search_school/publishers/builtin/neurology.json +4 -2
- package/school/paper_search_school/publishers/builtin/sage.json +4 -2
- package/school/paper_search_school/publishers/builtin/thieme.json +3 -1
- package/school/paper_search_school/publishers/site.py +12 -4
- package/school/paper_search_school/school_switch.py +34 -52
- package/school/paper_search_school/school_test.py +1 -1
- package/school/paper_search_school/server.py +24 -11
- package/school/paper_search_school/user_settings.py +13 -0
- package/school/pyproject.toml +1 -0
- package/skills/paper-search/SKILL.md +107 -107
- package/skills/paper-search/references/browser-download.md +102 -101
- package/skills/paper-search/references/capability-routing.md +89 -89
- package/skills/paper-search/references/cli-contract.md +78 -78
- package/skills/paper-search/references/federation-support.md +172 -172
- package/skills/paper-search/references/management-layer.md +78 -78
- package/skills/paper-search/references/publisher-support.md +38 -38
- package/skills/paper-search/references/school-setup.md +56 -55
- package/skills/paper-search/references/setup.md +20 -20
- package/skills/paper-search/references/troubleshooting.md +12 -12
- package/school/paper_search_school/browser/challenge/prompt.py +0 -154
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
through the card (user, 2026-11-10). */
|
|
10
10
|
--bg: #ffffff; --fg: #111827; --dim: #6b7280; --faint: #9ca3af;
|
|
11
11
|
--line: rgba(17, 24, 39, 0.10); --track: rgba(17, 24, 39, 0.10); --hover: rgba(17, 24, 39, 0.06);
|
|
12
|
+
--fill: rgba(17, 24, 39, 0.045); --edge: rgba(17, 24, 39, 0.12);
|
|
12
13
|
--accent: #2563eb; --ok: #16a34a; --bad: #dc2626;
|
|
13
14
|
--warn: #92400e; --warn-bg: #fef3c7; --warn-line: #f3d27a; --warn-dot: #d97706;
|
|
14
15
|
/* Inside the window's 10 px margin (body.mac): a shadow running past it was cut off
|
|
@@ -19,6 +20,7 @@
|
|
|
19
20
|
:root {
|
|
20
21
|
--bg: #202124; --fg: #f3f4f6; --dim: #a1a1aa; --faint: #71717a;
|
|
21
22
|
--line: rgba(255, 255, 255, 0.12); --track: rgba(255, 255, 255, 0.14); --hover: rgba(255, 255, 255, 0.08);
|
|
23
|
+
--fill: rgba(255, 255, 255, 0.05); --edge: rgba(255, 255, 255, 0.16);
|
|
22
24
|
--accent: #60a5fa; --ok: #4ade80; --bad: #f87171;
|
|
23
25
|
--warn: #fbbf24; --warn-bg: #3a2d10; --warn-line: #6b5216; --warn-dot: #fbbf24;
|
|
24
26
|
--shadow: 0 3px 7px rgba(0, 0, 0, 0.42), 0 1px 2px rgba(0, 0, 0, 0.32);
|
|
@@ -94,6 +96,9 @@ svg.i { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-widt
|
|
|
94
96
|
.head .text { flex: 1; min-width: 0; }
|
|
95
97
|
.head .title { font-weight: 600; font-size: 14px; }
|
|
96
98
|
.head .sub { font-size: 12px; color: var(--dim); }
|
|
99
|
+
.head .sub.noted { position: relative; }
|
|
100
|
+
.head .sub.noted .was { visibility: hidden; }
|
|
101
|
+
.head .sub.noted .note { position: absolute; left: 0; right: 0; top: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
|
|
97
102
|
/* The head's buttons close together (user, 2026-11-17): the pin's room comes from their gaps, not the text's. */
|
|
98
103
|
.tools { display: flex; align-items: center; gap: 0; margin-right: -3px; flex: none; }
|
|
99
104
|
/* Each a 32 px target, drawn where it was (user, 2026-11-21: 最小化 was hard to hit): the margins take back what the
|
|
@@ -138,30 +143,6 @@ svg.i { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-widt
|
|
|
138
143
|
.unverified-note .btn.link { display: inline; padding: 0; margin-left: 2px; font-size: inherit; }
|
|
139
144
|
.unverified-actions { margin-top: 6px; }
|
|
140
145
|
.stats { display: flex; padding: 12px 0; border-top: 0.5px solid var(--line); border-bottom: 0.5px solid var(--line); }
|
|
141
|
-
/* Markdown by rules not listed for its site: a dot beside 成功 and, pointed at, a card above the
|
|
142
|
-
counts (user, 2026-11-17: no yellow line for pages that were fine). */
|
|
143
|
-
.stats-wrap { position: relative; }
|
|
144
|
-
/* Pointing at the dot is not pointing at the count. */
|
|
145
|
-
.stats .stat:has(.rules-dot:hover) span { color: var(--dim); }
|
|
146
|
-
/* Up beside its label, taking no room: 成功, 失败 and 剩余 stay under their counts. */
|
|
147
|
-
.stats .stat > span { position: relative; }
|
|
148
|
-
.stats .rules-dot { position: absolute; left: 100%; top: -1px; margin-left: 3px; width: 6px; height: 6px; border-radius: 50%;
|
|
149
|
-
background: #8b9cf7; cursor: help; }
|
|
150
|
-
/* Its text in line with 成功 below: the card reaches past the counts by its own padding. */
|
|
151
|
-
.rules-pop { display: none; position: absolute; left: -11px; right: -11px; bottom: calc(100% + 6px); z-index: 5; padding: 9px 11px;
|
|
152
|
-
background: var(--bg); color: var(--fg); border-radius: 10px; font-size: 11.5px; line-height: 1.55;
|
|
153
|
-
/* Its edge drawn, not a border: a border pushed its text 1 px off 成功 (Windows, 2026-11-17). */
|
|
154
|
-
box-shadow: 0 0 0 0.5px var(--line), 0 6px 20px rgba(0, 0, 0, 0.14), 0 1px 3px rgba(0, 0, 0, 0.08); }
|
|
155
|
-
.rules-pop.show { display: block; }
|
|
156
|
-
/* The way down to the dot keeps it open. */
|
|
157
|
-
.rules-pop::after { content: ""; position: absolute; left: 0; right: 0; top: 100%; height: 8px; }
|
|
158
|
-
.rules-pop .h { display: flex; align-items: center; gap: 4px; font-weight: 600; font-size: 12px; margin-bottom: 2px; }
|
|
159
|
-
/* The heading's dot hangs in the margin: every line starts in line with 成功. */
|
|
160
|
-
.rules-pop .h i { width: 6px; height: 6px; border-radius: 50%; background: #8b9cf7; flex: none; margin-left: -10px; }
|
|
161
|
-
.rules-pop .r { color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
|
|
162
|
-
.rules-pop .r.counts { white-space: normal; }
|
|
163
|
-
.rules-pop .issue { display: block; margin-top: 6px; padding: 6px 0 0; width: 100%; text-align: left; border: none;
|
|
164
|
-
border-top: 0.5px solid var(--line); background: none; font: inherit; color: var(--accent); cursor: pointer; }
|
|
165
146
|
.stats div, .stats .stat { flex: 1; }
|
|
166
147
|
.stats .stat { padding: 0; border: none; background: none; font: inherit; color: inherit; text-align: left; cursor: pointer; }
|
|
167
148
|
.stats .stat:hover span, .stats .stat:focus-visible span { color: var(--accent); }
|
|
@@ -219,6 +200,13 @@ svg.i { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-widt
|
|
|
219
200
|
.mini-wrap:hover .mini-tip, .mini-wrap:focus-within .mini-tip { display: block; }
|
|
220
201
|
.mini-tip b { font-weight: 600; }
|
|
221
202
|
.mini-tip .k { color: var(--dim); display: inline-block; min-width: 2em; }
|
|
203
|
+
/* A label's small info icon (失败后自动重试): its tip under the row, from its left, inside the window in every language. */
|
|
204
|
+
.tip-row { position: relative; }
|
|
205
|
+
.tip-label { display: inline-flex; align-items: center; }
|
|
206
|
+
/* Pointed at, only its note shows: the cursor stays an arrow, no question mark (user, 2026-11-24). */
|
|
207
|
+
.mini-wrap.info { position: static; margin-left: 4px; color: var(--faint); cursor: default; }
|
|
208
|
+
.mini-wrap.info svg.i { width: 14px; height: 14px; }
|
|
209
|
+
.mini-tip.left { right: auto; left: 0; top: calc(100% - 4px); }
|
|
222
210
|
.foot { display: flex; align-items: center; justify-content: space-between; padding-top: 12px; border-top: 0.5px solid var(--line); }
|
|
223
211
|
/* Settings: a home list of three pages, each row with its current values; then the page itself. */
|
|
224
212
|
.nav-row, .key-row { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 0; border: none; border-top: 0.5px solid var(--line);
|
|
@@ -243,6 +231,10 @@ svg.i { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-widt
|
|
|
243
231
|
.about-name .pro-pill { margin-left: 6px; vertical-align: 2px; }
|
|
244
232
|
.about-version { font-size: 12px; color: var(--dim); margin-top: 3px; }
|
|
245
233
|
.about-version.new, .about-version.bad { color: var(--bad); }
|
|
234
|
+
/* 有新版本 X, a link to what is new (user, 2026-11-22: 乙, in the line, not under the button). */
|
|
235
|
+
.about-version .ver-notes { background: none; border: 0; padding: 0; margin: 0; font: inherit; color: inherit; cursor: pointer;
|
|
236
|
+
text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
|
|
237
|
+
.about-version .ver-notes svg.i { width: 11px; height: 11px; margin-left: 2px; vertical-align: -1px; stroke-width: 2.2; }
|
|
246
238
|
.about-action { display: flex; flex-direction: column; align-items: center; gap: 8px; margin-top: 14px; }
|
|
247
239
|
.about-action .btn.primary { width: 100%; justify-content: center; padding: 6px 10px; font-size: 13px; }
|
|
248
240
|
.about-action .btn.link { padding: 0; font-size: 12px; }
|
|
@@ -264,6 +256,7 @@ svg.i { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-widt
|
|
|
264
256
|
.version-link .pl-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
|
|
265
257
|
.version-link:hover .pl-text { text-decoration: underline; }
|
|
266
258
|
.version-link svg.i { width: 14px; height: 14px; flex: none; }
|
|
259
|
+
.version-link .pro-pill { margin-left: 2px; flex: none; }
|
|
267
260
|
.reopen-line { display: flex; align-items: center; gap: 8px; width: 100%; margin: 8px 0 0; padding: 7px 10px; border: none; border-radius: 8px;
|
|
268
261
|
background: rgba(22, 163, 74, 0.10); color: var(--ok); font: inherit; font-size: 12px; text-align: left; cursor: pointer; }
|
|
269
262
|
.reopen-line svg.i { width: 14px; height: 14px; flex: none; }
|
|
@@ -339,11 +332,32 @@ svg.i { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-widt
|
|
|
339
332
|
.key-row.editing:hover .nav-title { color: inherit; }
|
|
340
333
|
.key-set { font-size: 12px; color: var(--ok); white-space: nowrap; }
|
|
341
334
|
.key-row .btn { pointer-events: none; }
|
|
335
|
+
/* What a service is for, whole: on a second line where a language says it longer, not cut (user, 2026-11-25). */
|
|
336
|
+
.key-row .nav-sub { white-space: normal; }
|
|
342
337
|
.key-edit { background: var(--hover); border-radius: 8px; padding: 8px 10px; margin: 0 0 6px; }
|
|
343
338
|
/* The school sign-in page (PaperSearch Pro): the schools saved, one the default for downloads, each with its
|
|
344
339
|
account; the fields beside their names, close together (user, 2026-11-20). */
|
|
345
|
-
|
|
346
|
-
|
|
340
|
+
/* A card per school (user, 2026-11-22: 甲, the schools hard to tell apart in one list): the closed ones filled, the open
|
|
341
|
+
one white with an edge, 添加学校 a dashed one; its rarer actions in ⋯, a confirmation in place of its last line. */
|
|
342
|
+
.login-list { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
|
|
343
|
+
.login-school { position: relative; border-radius: 10px; background: var(--fill); padding: 0 10px; }
|
|
344
|
+
.login-school.open { background: var(--bg); box-shadow: 0 0 0 1px var(--edge), 0 2px 8px rgba(17, 24, 39, 0.06); padding-bottom: 10px; }
|
|
345
|
+
.login-school.add { background: none; border: 1px dashed color-mix(in srgb, var(--accent) 45%, transparent); }
|
|
346
|
+
.ls-dots { position: absolute; right: 29px; top: 7px; width: 24px; height: 24px; margin: 0; border-radius: 6px; background: var(--hover); }
|
|
347
|
+
.ls-dots svg.i { width: 15px; height: 15px; }
|
|
348
|
+
.ls-menu { position: absolute; right: 29px; top: 34px; z-index: 6; min-width: 120px; padding: 4px 0; border-radius: 8px; background: var(--bg);
|
|
349
|
+
box-shadow: 0 0 0 0.5px var(--line), 0 6px 20px rgba(0, 0, 0, 0.14), 0 1px 3px rgba(0, 0, 0, 0.08); }
|
|
350
|
+
.ls-menu button { display: block; width: 100%; padding: 6px 14px; border: none; background: none; font: inherit; font-size: 12.5px;
|
|
351
|
+
color: var(--fg); text-align: left; white-space: nowrap; cursor: pointer; }
|
|
352
|
+
.ls-menu button:hover, .ls-menu button:focus-visible { background: var(--hover); outline: none; }
|
|
353
|
+
.ls-menu button.danger { color: var(--bad); }
|
|
354
|
+
.login-foot { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; height: 30px; margin-top: 2px; font-size: 12px; color: var(--dim); }
|
|
355
|
+
.login-foot .grow { flex: 1; }
|
|
356
|
+
.login-foot .switch, .login-foot .btn { flex: none; white-space: nowrap; }
|
|
357
|
+
.login-foot.asking { padding: 0 4px 0 10px; border-radius: 8px; background: color-mix(in srgb, var(--bad) 9%, transparent); color: var(--bad); }
|
|
358
|
+
.login-foot.asking .q { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
359
|
+
.login-foot .btn.danger { background: var(--bad); border-color: var(--bad); color: #fff; }
|
|
360
|
+
.login-row { display: flex; align-items: center; gap: 6px; width: 100%; padding: 10px 0; text-align: left; font-size: 13px;
|
|
347
361
|
border: none; background: none; color: inherit; font-family: inherit; cursor: pointer; }
|
|
348
362
|
.login-row:hover .ls-name { color: var(--accent); }
|
|
349
363
|
.login-row:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: 6px; }
|
|
@@ -353,6 +367,13 @@ svg.i { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-widt
|
|
|
353
367
|
.settings .switch-row { border-top: none; border-bottom: 0.5px solid var(--line); }
|
|
354
368
|
.login-row .ls-acct { margin-left: auto; font-size: 11.5px; color: var(--dim); white-space: nowrap; }
|
|
355
369
|
.login-row svg.i { width: 13px; height: 13px; flex: none; color: var(--faint); }
|
|
370
|
+
/* A school's name whole (user, 2026-11-25, 乙): with its tags on one line where they fit, as before; where not (English and
|
|
371
|
+
French names, a long Chinese one) the name wraps and its tags go to the next line, not the name cut to "Hongmulan …". The
|
|
372
|
+
chevron, and on the open card the room for ⋯, stay at the top right. */
|
|
373
|
+
.ls-head { flex-wrap: wrap; row-gap: 4px; position: relative; padding-right: 20px; box-sizing: border-box; }
|
|
374
|
+
.ls-head.with-menu { padding-right: 49px; }
|
|
375
|
+
.ls-head > svg.i:last-child { position: absolute; right: 0; top: 13px; }
|
|
376
|
+
.login-row.ls-head .ls-name { flex: 0 1 auto; max-width: calc(100% - 18px); overflow: visible; white-space: normal; overflow-wrap: anywhere; }
|
|
356
377
|
.tag.fill { background: rgba(22, 163, 74, 0.12); color: var(--ok); }
|
|
357
378
|
.tag.trial { background: var(--hover); color: var(--accent); }
|
|
358
379
|
.tag.default { background: var(--accent); color: #fff; }
|
|
@@ -372,16 +393,14 @@ svg.i { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-widt
|
|
|
372
393
|
.login-form .key-actions .btn { white-space: nowrap; }
|
|
373
394
|
/* The less used ones under the buttons, the same for every school (user, 2026-11-20: rows of buttons that differed
|
|
374
395
|
from school to school, and wrapped). */
|
|
375
|
-
.login-links { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; font-size: 12px; }
|
|
376
|
-
.login-links .link-btn { border: none; background: none; padding: 0; font: inherit; color: var(--dim); cursor: pointer; }
|
|
377
|
-
.login-links .link-btn:hover, .login-links .link-btn:focus-visible { color: var(--accent); }
|
|
378
|
-
.login-links .link-btn.danger:hover, .login-links .link-btn.danger:focus-visible, .login-links .link-btn.confirm { color: var(--bad); }
|
|
379
|
-
.login-links .sep { color: var(--dim); }
|
|
380
396
|
/* 测试登录 (user, 2026-11-21, as drawn): the article, then how the test went; while it runs, its steps in rows of their
|
|
381
397
|
own height and one line for what the download says, so that the page does not move as it goes. */
|
|
382
398
|
.login-form .test-result { grid-column: 1 / -1; }
|
|
383
399
|
.login-form .test-err { grid-column: 2; }
|
|
384
400
|
.test-article { display: flex; align-items: center; gap: 8px; min-width: 0; }
|
|
401
|
+
.login-form .test-article { grid-column: 1 / -1; }
|
|
402
|
+
.test-article .lbl { flex: none; color: var(--dim); font-size: 12px; }
|
|
403
|
+
.test-article .link-btn.edit svg.i { width: 13px; height: 13px; }
|
|
385
404
|
.test-article .what { flex: 1; min-width: 0; color: var(--fg); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
|
|
386
405
|
.test-article .what.empty { color: var(--dim); font-size: 11.5px; } /* none filled in: what to do */
|
|
387
406
|
.test-article .test-btn { padding: 3px 10px; flex: none; white-space: nowrap; }
|
|
@@ -436,6 +455,11 @@ svg.i { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-widt
|
|
|
436
455
|
.login-add .err { text-align: left; margin: 6px 0 0; }
|
|
437
456
|
.login-add .err:empty { display: none; }
|
|
438
457
|
.settings .key-edit input { width: 100%; text-align: left; background: var(--bg); }
|
|
458
|
+
.key-field + .key-field { margin-top: 7px; }
|
|
459
|
+
.key-field label { display: block; margin-bottom: 3px; font-size: 11px; color: var(--dim); }
|
|
460
|
+
.key-input { position: relative; }
|
|
461
|
+
.key-input .iconbtn { position: absolute; right: 8px; top: 50%; margin: 0; transform: translateY(-50%); }
|
|
462
|
+
.settings .key-input input[data-secret] { padding-right: 30px; }
|
|
439
463
|
.key-note { font-size: 11px; line-height: 1.5; color: var(--dim); margin-bottom: 8px; }
|
|
440
464
|
.key-edit .err { text-align: left; margin: 6px 0 0; }
|
|
441
465
|
.key-edit .err:empty { display: none; }
|
|
@@ -444,6 +468,11 @@ svg.i { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-widt
|
|
|
444
468
|
.key-links, .key-actions { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
|
|
445
469
|
.key-actions { gap: 6px; }
|
|
446
470
|
.key-links .grow, .key-actions .grow { flex: 1; }
|
|
471
|
+
/* The editor's buttons on one line where they fit; where a language's words are longer (French on the Mac), 清除 取消 保存
|
|
472
|
+
together on the next line at the right, not cut off at the window's edge (user, 2026-11-25). */
|
|
473
|
+
.key-actions.wraps { flex-wrap: wrap; row-gap: 6px; }
|
|
474
|
+
.key-actions-end { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; margin-left: auto; }
|
|
475
|
+
.key-actions.wraps .btn { white-space: nowrap; }
|
|
447
476
|
.key-links .iconbtn { margin: 0; }
|
|
448
477
|
.iconbtn[aria-pressed="true"] { color: var(--accent); }
|
|
449
478
|
.strip { display: flex; align-items: center; gap: 6px; width: 100%; box-sizing: border-box; margin: 10px 0 2px; padding: 6px 10px;
|
|
@@ -506,7 +535,7 @@ svg.i { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-widt
|
|
|
506
535
|
.paper-list .open-article:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; border-radius: 3px; }
|
|
507
536
|
.tag { display: inline-block; font-size: 11px; line-height: 16px; padding: 0 6px; border-radius: 5px; flex: none; }
|
|
508
537
|
.tag.no_access, .tag.other { background: var(--hover); color: var(--fg); }
|
|
509
|
-
.tag.user_side, .tag.
|
|
538
|
+
.tag.user_side, .tag.external { background: var(--warn-bg); color: var(--warn); }
|
|
510
539
|
.tag.unsupported { background: rgba(37, 99, 235, 0.12); color: var(--accent); }
|
|
511
540
|
.tag.unexplained { background: rgba(220, 38, 38, 0.12); color: var(--bad); }
|
|
512
541
|
.tag.doubt { background: var(--hover); color: var(--dim); }
|
|
@@ -590,6 +619,8 @@ const ICONS = {
|
|
|
590
619
|
check: '<circle cx="12" cy="12" r="9"/><path d="M8 12.5l2.8 2.8L16 9.5"/>',
|
|
591
620
|
alert: '<circle cx="12" cy="12" r="9"/><path d="M12 7.5v5.5M12 16.5v.01"/>',
|
|
592
621
|
minimize: '<path d="M6 12h12"/>',
|
|
622
|
+
info: '<circle cx="12" cy="12" r="9"/><path d="M12 11v5.5M12 7.5v.01"/>',
|
|
623
|
+
download: '<path d="M12 4v11"/><path d="M7.5 10.5L12 15l4.5-4.5"/><path d="M5 20h14"/>',
|
|
593
624
|
pin: '<path d="M8 4h8"/><path d="M9.5 4v5.5L7 13h10l-2.5-3.5V4"/><path d="M12 13v7"/>',
|
|
594
625
|
close: '<path d="M7 7l10 10M17 7L7 17"/>',
|
|
595
626
|
folder: '<path d="M3.5 7.5a2 2 0 0 1 2-2h4l2 2h7a2 2 0 0 1 2 2v7a2 2 0 0 1-2 2h-13a2 2 0 0 1-2-2z"/>',
|
|
@@ -598,6 +629,8 @@ const ICONS = {
|
|
|
598
629
|
pause: '<path d="M9 6.5v11M15 6.5v11"/>',
|
|
599
630
|
dots: '<circle cx="6" cy="12" r="1"/><circle cx="12" cy="12" r="1"/><circle cx="18" cy="12" r="1"/>',
|
|
600
631
|
left: '<path d="M15 6l-6 6 6 6"/>',
|
|
632
|
+
external: '<path d="M7 17L17 7M9 7h8v8"/>',
|
|
633
|
+
edit: '<path d="M4 20h4L19 9l-4-4L4 16z"/><path d="M13.5 6.5l4 4"/>',
|
|
601
634
|
right: '<path d="M9 6l6 6-6 6"/>',
|
|
602
635
|
down: '<path d="M6 9l6 6 6-6"/>',
|
|
603
636
|
up: '<path d="M6 15l6-6 6 6"/>',
|
|
@@ -655,6 +688,8 @@ function appIcon(size, pro) {
|
|
|
655
688
|
+ '<path d="M352 236 Q352 252 368 252 Q352 252 352 268 Q352 252 336 252 Q352 252 352 236Z" fill="#fff" opacity=".9"/></svg>';
|
|
656
689
|
}
|
|
657
690
|
const esc = (s) => String(s == null ? "" : s).replace(/[&<>"']/g, (c) => ({ "&": "&", "<": "<", ">": ">", '"': """, "'": "'" }[c]));
|
|
691
|
+
// The ring: the batch's progress in blue, one arc (user, 2026-11-24: its saved, failed and held parts in three colours
|
|
692
|
+
// were not pleasing; the counts say those).
|
|
658
693
|
function ring(pct, size, stroke, label) {
|
|
659
694
|
const r = (size - stroke) / 2, c = 2 * Math.PI * r, d = Math.max(0, Math.min(100, pct)) / 100 * c;
|
|
660
695
|
return '<svg class="ring" width="' + size + '" height="' + size + '" viewBox="0 0 ' + size + " " + size + '" aria-hidden="true">'
|
|
@@ -675,7 +710,7 @@ let flash = { text: "", until: 0 };
|
|
|
675
710
|
// 登录并继续 pressed: the held publishers then ({run, keys}); the button says so at once,
|
|
676
711
|
// as the papers go on only after the paper running, or within seconds (user, 2026-11-15).
|
|
677
712
|
let heldAsked = null;
|
|
678
|
-
let settings = null, settingsErrors = {}, notifyOn = true, hourlyNow = false;
|
|
713
|
+
let settings = null, settingsErrors = {}, notifyOn = true, hourlyNow = false, retryOn = false;
|
|
679
714
|
// What is typed on this settings page and not yet saved. Any redraw shows it instead of the
|
|
680
715
|
// saved value: a click on the card's background is a drag, and its end redraws the card
|
|
681
716
|
// (a typed hourly limit went back to the saved one, Windows, 2026-11-13).
|
|
@@ -703,6 +738,7 @@ let proStatus = null, proInstall = { state: "idle" }, proInstallTimer = 0;
|
|
|
703
738
|
// The school sign-in page (school_login_state); its error line.
|
|
704
739
|
let schoolLogin = null, loginError = "", loginValues = {}, loginShown = false;
|
|
705
740
|
// The school whose account is open on the page (its entityID), and 添加学校: what was typed, what was found.
|
|
741
|
+
let loginMenu = ""; // the open school's ⋯ menu, open (its key)
|
|
706
742
|
let loginOpen = "", schoolQuery = "", schoolFound = null, schoolFinding = false, confirmForget = "", loginAdding = false;
|
|
707
743
|
// 测试登录 (school_test.py): the test as the window runs it ({state: idle, running (key, step, phase), done (key, ok,
|
|
708
744
|
// title, detail, seconds)}); the article it opens for the school open ({doi}: "" while none is set), and its box: open
|
|
@@ -816,7 +852,7 @@ function pill() {
|
|
|
816
852
|
}
|
|
817
853
|
if (v.mode === "running") {
|
|
818
854
|
const where = [v.part, v.publisher].filter(Boolean).join(" · ");
|
|
819
|
-
return '<div class="pillrow capsule-drag-region">' + ring(v.pct, 24, 3)
|
|
855
|
+
return '<div class="pillrow capsule-drag-region">' + ring(v.pct, 24, 3, "")
|
|
820
856
|
+ '<span class="count">' + (v.total ? v.done + "/" + v.total : v.done) + "</span>"
|
|
821
857
|
+ (where ? '<span class="dim">' + esc(where) + "</span>" : "") + '<span class="dot"></span>'
|
|
822
858
|
+ ((v.held || []).length ? heldTag() : "") + "</div>";
|
|
@@ -830,11 +866,16 @@ function pinButton() {
|
|
|
830
866
|
+ '" title="' + (pinned ? "已钉住,点一下取消" : "钉住:鼠标移开也不收起") + '">' + icon("pin") + "</button>";
|
|
831
867
|
}
|
|
832
868
|
|
|
833
|
-
|
|
869
|
+
// ``note``: said for a moment in the place of the line under the title (the next school), over it, one line whatever its
|
|
870
|
+
// length: the line stays, unseen, so the card keeps its height (a long school name wrapped, or the line wrapped in
|
|
871
|
+
// another language, would move the window twice).
|
|
872
|
+
function header(title, sub, closable, note) {
|
|
834
873
|
// Only the ring and the texts drag the window; the buttons stay clickable.
|
|
835
874
|
return '<div class="head"><div class="drag capsule-drag-region">'
|
|
836
875
|
+ (V.mode === "running" || V.mode === "attention" ? ring(V.pct, 40, 4, V.pct + "%") : "")
|
|
837
|
-
+ '<div class="text"><div class="title">' + esc(title) + '</div>' + (sub ? '<div class="sub
|
|
876
|
+
+ '<div class="text"><div class="title">' + esc(title) + '</div>' + (sub ? '<div class="sub' + (note ? ' noted' : "") + '">' + (note
|
|
877
|
+
? '<span class="was">' + esc(sub) + '</span><span class="note" title="' + esc(note) + '">' + esc(note) + "</span>" : esc(sub)) + "</div>" : "")
|
|
878
|
+
+ "</div></div>"
|
|
838
879
|
+ '<div class="tools">' + pinButton()
|
|
839
880
|
+ '<button class="iconbtn' + (newerVersion() ? " has-dot" : "") + '" data-act="settings" aria-label="设置">' + icon("gear") + "</button>"
|
|
840
881
|
+ '<button class="iconbtn" data-act="' + (closable ? "close" : "minimize") + '" aria-label="' + (closable ? "关闭" : "最小化")
|
|
@@ -894,8 +935,8 @@ function actionsBlock() {
|
|
|
894
935
|
}
|
|
895
936
|
|
|
896
937
|
// A count opens its list of papers once the batch has sent them (user, 2026-11-10).
|
|
897
|
-
function stat(list, value, label, color
|
|
898
|
-
const inner = "<b" + (color ? ' style="color:' + color + '"' : "") + ">" + value + "</b><span>" + label +
|
|
938
|
+
function stat(list, value, label, color) {
|
|
939
|
+
const inner = "<b" + (color ? ' style="color:' + color + '"' : "") + ">" + value + "</b><span>" + label + "</span>";
|
|
899
940
|
return V.lists && list ? '<button type="button" class="stat" data-act="papers" data-list="' + list + '">' + inner + "</button>"
|
|
900
941
|
: "<div>" + inner + "</div>";
|
|
901
942
|
}
|
|
@@ -926,38 +967,20 @@ function heldBlock() {
|
|
|
926
967
|
|
|
927
968
|
// Pages from sites not yet supported this batch: the site (or how many), how their Markdown
|
|
928
969
|
// went, and 查看 for those not kept, in the place of the held publishers' line (user, 2026-11-16).
|
|
929
|
-
//
|
|
930
|
-
//
|
|
931
|
-
//
|
|
932
|
-
//
|
|
933
|
-
//
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
const
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
const
|
|
941
|
-
|
|
942
|
-
}
|
|
943
|
-
function rulesCard() {
|
|
944
|
-
const s = rulesSites();
|
|
945
|
-
if (!s) return "";
|
|
946
|
-
const site = s.hosts.length === 1 ? s.hosts[0] : s.hosts.length + " 个网站";
|
|
947
|
-
// Whose rules were borrowed (user, 2026-11-17: "www.jacc.org · 采用 Atypon 规则").
|
|
948
|
-
const rules = s.rules && s.rules.length ? "采用 " + s.rules.join(" / ") + " 规则" : "没有适用的规则";
|
|
949
|
-
// Whether each one's Markdown came whole: only a complete one is saved.
|
|
950
|
-
const counts = ["完整已保存 " + s.saved + " 篇", "不完整未保存 " + s.unsaved + " 篇", s.skipped ? "未再尝试 " + s.skipped + " 篇" : ""]
|
|
951
|
-
.filter(Boolean).join(" · ");
|
|
952
|
-
// Saved or not, one way to have the site listed: the report goes with the issue (user, 2026-11-17).
|
|
953
|
-
const issue = '<button type="button" class="issue" data-act="markdown_issue">提 issue 纳入已登记网站</button>';
|
|
954
|
-
return '<div class="rules-pop' + (rulesShown ? " show" : "") + '"><div class="h"><i></i>' + esc(RULES_TITLE) + "</div>"
|
|
955
|
-
+ '<div class="r" title="' + esc(s.hosts.join("、")) + '">' + esc(site + " · " + rules) + '</div><div class="r counts">' + esc(counts) + "</div>" + issue + "</div>";
|
|
956
|
-
}
|
|
957
|
-
function showRules(on) {
|
|
958
|
-
rulesShown = on;
|
|
959
|
-
const pop = root.querySelector(".rules-pop");
|
|
960
|
-
if (pop) pop.classList.toggle("show", on);
|
|
970
|
+
// The papers held for a later try (V.later: without access, for the next school; 原因不明, once more at the end; their
|
|
971
|
+
// site blocked them, again at a time; their school login lapsed, after 登录并继续): 重试 beside
|
|
972
|
+
// 成功 and 失败 on the running card, its list naming them by why; 剩余 those not started (user, 2026-11-24: in place of
|
|
973
|
+
// the card the ring showed when pointed at). Without other saved schools (PaperSearch Pro) none waits for one.
|
|
974
|
+
// A batch that may hold papers for a later try (失败后自动重试 on, or 没权限时换下一所学校 with another school; user,
|
|
975
|
+
// 2026-11-24): otherwise no 重试, a paper paused for the school's login counted in 剩余.
|
|
976
|
+
const holding = () => V.holds !== false;
|
|
977
|
+
const retryCount = () => (holding() && V.later && V.later.total) || 0;
|
|
978
|
+
// The list behind 重试 from the counts alone, when the papers' list does not name them (a caller that sends no DOIs).
|
|
979
|
+
function retryCounts() {
|
|
980
|
+
const later = V.later || {};
|
|
981
|
+
const kinds = [["换学校再试 · 没权限", later.no_access], ["最后再试一次 · 原因不明", later.unexplained],
|
|
982
|
+
[(later.blocked_at ? later.blocked_at + " 再试 · " : "") + "被网站拦截", later.blocked], ["登录后继续 · 学校登录中途失效", later.login]];
|
|
983
|
+
return { count: retryCount(), groups: kinds.filter((kind) => kind[1] > 0).map(([label, count]) => ({ label, count, papers: [], counted: true })) };
|
|
961
984
|
}
|
|
962
985
|
|
|
963
986
|
// Under the group of pages from sites not yet supported: what that means, the sites with
|
|
@@ -980,10 +1003,11 @@ function runningCard() {
|
|
|
980
1003
|
// paper; once 登录并继续 is pressed, what comes next (user, 2026-11-15).
|
|
981
1004
|
const asked = v.held_wait && resumeAsked();
|
|
982
1005
|
const paper = v.held_wait ? '<div class="paper"><div class="line">' + esc(asked ? "如需登录,会打开学校登录页" : v.line) + "</div></div>" : paperBlock();
|
|
983
|
-
return '<div class="card-body">' + header(asked ? "正在继续下载" : v.headline, sub, false) + paper + heldBlock()
|
|
984
|
-
+ '<div class="stats
|
|
985
|
-
+ stat("failed", v.bad, "失败", "var(--bad)"
|
|
986
|
-
+ stat("
|
|
1006
|
+
return '<div class="card-body">' + header(asked ? "正在继续下载" : v.headline, sub, false, v.switch_note) + paper + heldBlock()
|
|
1007
|
+
+ '<div class="stats">' + stat("ok", v.ok, "成功", "var(--ok)")
|
|
1008
|
+
+ stat("failed", v.bad, "失败", "var(--bad)")
|
|
1009
|
+
+ (holding() ? stat(retryCount() ? "retry" : "", retryCount(), "重试", retryCount() ? "var(--warn-dot)" : "") : "")
|
|
1010
|
+
+ stat("left", v.left == null ? "—" : Math.max(0, v.left - retryCount()), "剩余") + "</div>"
|
|
987
1011
|
+ actionsBlock() + "</div>";
|
|
988
1012
|
}
|
|
989
1013
|
|
|
@@ -1006,8 +1030,10 @@ function attentionCard() {
|
|
|
1006
1030
|
return html + "</div></div>";
|
|
1007
1031
|
}
|
|
1008
1032
|
|
|
1009
|
-
|
|
1010
|
-
|
|
1033
|
+
// The five failure classes by the names PaperSearch gives them everywhere (failureClass.ts, 2026-11-22;
|
|
1034
|
+
// 待适配 was 暂不支持 until 2026-11-25).
|
|
1035
|
+
const CLASS_TAGS = { no_access: "没权限", user_side: "要你处理", external: "外部原因", unsupported: "待适配",
|
|
1036
|
+
unexplained: "原因不明", other: "其他", doubt: "待核对" };
|
|
1011
1037
|
let openGroups = null, groupsRun = ""; // null: each reason row as the view opens it
|
|
1012
1038
|
// Main-text rows first, then the supplementary files' rows, numbered on.
|
|
1013
1039
|
function allGroups() { return V.summary.groups.concat(V.summary.supplement_groups || [], V.summary.markdown_groups || [], V.summary.doubt_groups || []); }
|
|
@@ -1046,6 +1072,7 @@ function reasonRow(g, i, brief) {
|
|
|
1046
1072
|
function doneCard() {
|
|
1047
1073
|
const v = V, s = v.summary;
|
|
1048
1074
|
let html = '<div class="card-body">' + header(v.headline, v.total ? "共 " + v.total + " 篇" : "", true)
|
|
1075
|
+
// 成功 green, as on the running card (user, 2026-11-24: the ring alone is blue, the batch's progress).
|
|
1049
1076
|
+ '<div class="stats done-stats">' + stat("ok", v.ok, "成功", "var(--ok)") + stat("failed", v.bad, "失败", v.bad ? "var(--bad)" : "")
|
|
1050
1077
|
// Papers the stop left undone in place of the time: their list opens from it (user, 2026-11-16).
|
|
1051
1078
|
+ (v.stopped ? stat("left", v.stopped, "已终止") : stat("", esc(v.elapsed || "—"), "用时")) + "</div>";
|
|
@@ -1082,15 +1109,21 @@ function doneCard() {
|
|
|
1082
1109
|
}
|
|
1083
1110
|
|
|
1084
1111
|
// The list behind a count: its groups (by way, by reason, by lane), each opened on its own.
|
|
1085
|
-
const LIST_TITLES = { ok: "成功", failed: "失败", left: "剩余" };
|
|
1112
|
+
const LIST_TITLES = { ok: "成功", failed: "失败", retry: "重试", left: "剩余" };
|
|
1086
1113
|
let papersKind = "", papersList = null, listOpen = null;
|
|
1087
|
-
function shownList() {
|
|
1114
|
+
function shownList() {
|
|
1115
|
+
const list = (papersList || {})[papersKind];
|
|
1116
|
+
if (papersKind === "retry" && !(list && list.groups.length) && retryCount()) return retryCounts();
|
|
1117
|
+
return list || { count: 0, groups: [] };
|
|
1118
|
+
}
|
|
1088
1119
|
function listGroupOpen(i) { return listOpen ? listOpen.has(i) : !!(shownList().groups[i] || {}).open; }
|
|
1089
1120
|
async function loadPapers() {
|
|
1090
1121
|
try { papersList = await api().paper_lists(); } catch (e) { papersList = papersList || {}; }
|
|
1091
1122
|
}
|
|
1092
1123
|
|
|
1093
1124
|
function listRow(g, i) {
|
|
1125
|
+
// 重试 from its counts alone: a line for each why, nothing to open.
|
|
1126
|
+
if (g.counted) return '<div class="grp"><div class="row"><span class="reason">' + esc(g.label) + '</span><span class="n">' + g.count + " 篇</span></div></div>";
|
|
1094
1127
|
const opened = listGroupOpen(i);
|
|
1095
1128
|
const unverified = g.unverified && shownList().groups.findIndex((other, j) => other.unverified && listGroupOpen(j)) === i;
|
|
1096
1129
|
let html = '<div class="grp"><button type="button" class="row" data-act="list_group" data-group="' + i + '" aria-expanded="' + opened + '">'
|
|
@@ -1105,7 +1138,7 @@ function listRow(g, i) {
|
|
|
1105
1138
|
if (papersKind === "ok") {
|
|
1106
1139
|
return '<li><button type="button" class="open-article" data-act="show_paper" data-index="' + p.index + '" title="打开所在文件夹">' + lines + "</button></li>";
|
|
1107
1140
|
}
|
|
1108
|
-
if ((papersKind === "failed" || papersKind === "left") && p.doi) {
|
|
1141
|
+
if ((papersKind === "failed" || papersKind === "retry" || papersKind === "left") && p.doi) {
|
|
1109
1142
|
return '<li><button type="button" class="open-article" data-act="open_article" data-doi="' + esc(p.doi)
|
|
1110
1143
|
+ '" title="在浏览器打开这篇文章">' + lines + "</button></li>";
|
|
1111
1144
|
}
|
|
@@ -1154,9 +1187,11 @@ function taskStrip() {
|
|
|
1154
1187
|
+ '<span class="grow">请重新登录学校</span><span>去处理 ›</span></button>';
|
|
1155
1188
|
}
|
|
1156
1189
|
if (V.mode === "running") {
|
|
1157
|
-
|
|
1190
|
+
// A download icon for 正在下载 and an arrow for 返回进度: the publisher's name has the room in every language (user, 2026-11-24:
|
|
1191
|
+
// "Downloading 11/71 · Spri… Back to progress ›"; its words on pointing at it).
|
|
1192
|
+
return '<button type="button" class="strip" data-act="progress" title="返回进度">' + icon("download") + '<span class="grow">'
|
|
1158
1193
|
+ esc(V.total ? V.done + "/" + V.total : V.done) + (V.publisher ? " · " + esc(V.publisher) : "")
|
|
1159
|
-
+ "</span><span
|
|
1194
|
+
+ "</span><span>›</span></button>";
|
|
1160
1195
|
}
|
|
1161
1196
|
return "";
|
|
1162
1197
|
}
|
|
@@ -1181,10 +1216,28 @@ const field = (name) => settings.fields.find((f) => f.name === name);
|
|
|
1181
1216
|
// The user's own folder as ~ on the home page's line (user, 2026-11-21: /Users/<name>/Downloads and the hourly limit
|
|
1182
1217
|
// did not fit one line in English); the download page shows the folder whole.
|
|
1183
1218
|
const shortPath = (path) => String(path || "").replace(/^(?:\/Users\/[^/]+|\/home\/[^/]+|[A-Za-z]:\\Users\\[^\\]+)(?=[\/\\]|$)/, "~");
|
|
1219
|
+
// The folder on that line whole when it fits; else its middle folders left out, the first ones first, then all but its
|
|
1220
|
+
// own name (user, 2026-11-24, 乙: D:\Project-XY\References and the hourly limit cut short in English). Measured once
|
|
1221
|
+
// the page is drawn and translated, at the card's own width.
|
|
1222
|
+
function fitPaths(node) {
|
|
1223
|
+
node.querySelectorAll(".nav-sub[data-path]").forEach((line) => {
|
|
1224
|
+
const whole = line.dataset.path, rest = tr(line.dataset.rest || "");
|
|
1225
|
+
const sep = whole.includes("\\") ? "\\" : "/";
|
|
1226
|
+
const path = whole.length > 3 ? whole.replace(/[\\/]+$/, "") : whole;
|
|
1227
|
+
const parts = path.split(sep), head = parts[0], last = parts[parts.length - 1], middle = parts.slice(1, -1);
|
|
1228
|
+
const tries = [path];
|
|
1229
|
+
for (let k = 1; k <= middle.length; k++) tries.push([head, "…", ...middle.slice(k), last].join(sep));
|
|
1230
|
+
if (parts.length > 1) tries.push("…" + sep + last);
|
|
1231
|
+
for (const each of tries) {
|
|
1232
|
+
line.textContent = rest ? each + " · " + rest : each;
|
|
1233
|
+
if (line.scrollWidth <= line.clientWidth) return;
|
|
1234
|
+
}
|
|
1235
|
+
});
|
|
1236
|
+
}
|
|
1184
1237
|
function settingsHome() {
|
|
1185
1238
|
const hourly = field("hourly"), login = field("login");
|
|
1186
1239
|
const rows = [
|
|
1187
|
-
["download", "folder", "下载", [shortPath(settings.download_dir), hourly ? "每家每小时 " + hourly.value + " 篇" : ""]],
|
|
1240
|
+
["download", "folder", "下载", [shortPath(settings.download_dir), hourly ? "每家每小时 " + hourly.value + " 篇" : ""], "", true],
|
|
1188
1241
|
["wait", "clock", "等待和提醒", [login ? "登录页 " + login.value + " 秒" : "", "系统通知" + (notifyOn ? "开" : "关")]],
|
|
1189
1242
|
["keys", "key", "API key", [apiKeys && apiKeys.ok ? "已填 " + apiKeys.filled + "/" + apiKeys.total : ""]],
|
|
1190
1243
|
];
|
|
@@ -1211,10 +1264,12 @@ function languageMenu() {
|
|
|
1211
1264
|
}
|
|
1212
1265
|
|
|
1213
1266
|
// A row that opens a page: its icon, its name, what it holds now.
|
|
1214
|
-
function navRow([page, glyph, title, sub, badge]) {
|
|
1267
|
+
function navRow([page, glyph, title, sub, badge, folderFirst]) {
|
|
1268
|
+
// folderFirst: its line begins with a folder, fitted to the line once drawn (fitPaths).
|
|
1269
|
+
const fitted = folderFirst && sub[0] ? ' data-path="' + esc(sub[0]) + '" data-rest="' + esc(sub.slice(1).filter(Boolean).join(" · ")) + '"' : "";
|
|
1215
1270
|
return '<button type="button" class="nav-row" data-act="settings_page" data-page="' + page + '">' + (glyph === "pro-app" ? appIcon(16, true) : icon(glyph))
|
|
1216
1271
|
+ '<span class="nav-text"><span class="nav-title">' + esc(title)
|
|
1217
|
-
+ (badge ? '<span class="pro-pill feature">' + esc(badge) + "</span>" : "") + '</span><span class="nav-sub">
|
|
1272
|
+
+ (badge ? '<span class="pro-pill feature">' + esc(badge) + "</span>" : "") + '</span><span class="nav-sub"' + fitted + ">"
|
|
1218
1273
|
+ esc(sub.filter(Boolean).join(" · ")) + "</span></span>" + icon("right") + "</button>";
|
|
1219
1274
|
}
|
|
1220
1275
|
|
|
@@ -1248,8 +1303,16 @@ function settingsDownload() {
|
|
|
1248
1303
|
+ fieldRows("download") + settingsFoot();
|
|
1249
1304
|
}
|
|
1250
1305
|
|
|
1306
|
+
// 失败后自动重试 (user, 2026-11-24): off by default; what it retries in a tip on its small icon, not on the page.
|
|
1307
|
+
function retryRow() {
|
|
1308
|
+
return '<div class="row tip-row"><span class="tip-label">失败后自动重试<span class="mini-wrap info" tabindex="0" aria-label="说明">' + icon("info")
|
|
1309
|
+
+ '<span class="mini-tip left" role="tooltip"><div>原因不明的失败,最后再重试</div><div>被网站拦截的,10 分钟后再重试</div></span></span></span>'
|
|
1310
|
+
+ '<button class="switch' + (retryOn ? " on" : "") + '" data-act="retry" role="switch" aria-checked="' + retryOn
|
|
1311
|
+
+ '" aria-label="失败后自动重试"></button></div>' + (settingsErrors.retry ? '<div class="err">' + esc(settingsErrors.retry) + "</div>" : "");
|
|
1312
|
+
}
|
|
1313
|
+
|
|
1251
1314
|
function settingsWait() {
|
|
1252
|
-
return settingsHead("等待和提醒") + fieldRows("wait")
|
|
1315
|
+
return settingsHead("等待和提醒") + fieldRows("wait") + retryRow()
|
|
1253
1316
|
+ '<div class="row"><span>需要处理时发系统通知</span><span id="notify-test-button">' + notifyTestButton() + "</span>"
|
|
1254
1317
|
+ '<button class="switch' + (notifyOn ? " on" : "")
|
|
1255
1318
|
+ '" data-act="notify" role="switch" aria-checked="' + notifyOn + '" aria-label="系统通知"></button></div>'
|
|
@@ -1260,32 +1323,43 @@ function settingsWait() {
|
|
|
1260
1323
|
function keyRow(s) {
|
|
1261
1324
|
const name = '<span class="nav-text"><span class="nav-title">' + esc(s.name) + "</span>"
|
|
1262
1325
|
+ (s.use ? '<span class="nav-sub">' + esc(s.use) + "</span>" : "") + "</span>";
|
|
1326
|
+
const hasValues = s.keys.some((k) => k.set);
|
|
1263
1327
|
if (editing !== s.id) {
|
|
1264
1328
|
return '<button type="button" class="key-row" data-act="edit_key" data-service="' + esc(s.id) + '">' + name
|
|
1265
|
-
+ (s.set ? '<span class="key-set">' + esc(s.masked) + "</span>"
|
|
1329
|
+
+ (s.set ? '<span class="key-set">' + esc(s.masked) + "</span>"
|
|
1330
|
+
: '<span class="btn">' + (hasValues ? "补全" : "填写") + "</span>") + "</button>";
|
|
1266
1331
|
}
|
|
1267
1332
|
let html = '<div class="key-row editing">' + name
|
|
1268
|
-
+ (s.set ? '<span class="key-set">' + esc(s.masked) + "</span>"
|
|
1333
|
+
+ (s.set ? '<span class="key-set">' + esc(s.masked) + "</span>"
|
|
1334
|
+
: '<span class="dim" style="font-size:12px">' + (hasValues ? "待补全" : "未填") + "</span>")
|
|
1269
1335
|
+ '</div><div class="key-edit">';
|
|
1270
1336
|
// A saved key is in its field, hidden until the eye shows it.
|
|
1271
1337
|
// A contact email: what it is for above its field, and the field in plain text (user, 2026-11-11).
|
|
1272
1338
|
const emails = s.keys.every((k) => k.kind === "email");
|
|
1339
|
+
const labeled = s.keys.some((k) => k.kind === "zone");
|
|
1340
|
+
const eye = '<button class="iconbtn" data-act="reveal" aria-label="显示 key" aria-pressed="' + revealed + '">' + icon("eye") + "</button>";
|
|
1273
1341
|
if (s.note) html += '<div class="key-note">' + esc(s.note) + "</div>";
|
|
1274
1342
|
for (const k of s.keys) {
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1343
|
+
const id = "key-" + esc(k.key);
|
|
1344
|
+
const secret = k.kind !== "email" && k.kind !== "zone";
|
|
1345
|
+
const placeholder = k.kind === "zone" ? "填入“我的API”中的“名称”" : k.kind === "email" ? "填你常用的邮箱" : k.kind === "url" ? "服务地址" : "粘贴 key";
|
|
1346
|
+
if (labeled) html += '<div class="key-field"><label for="' + id + '">' + esc(k.label) + '</label><div class="key-input">';
|
|
1347
|
+
html += '<input id="' + id + '" data-key="' + esc(k.key) + '"' + (secret ? ' data-secret' : '')
|
|
1348
|
+
+ ' type="' + (secret && !revealed ? "password" : "text") + '" value="' + esc(editValues[k.key] || "")
|
|
1349
|
+
+ '" autocomplete="off" spellcheck="false"' + (labeled ? "" : ' aria-label="' + esc(s.name + " " + k.label) + '"')
|
|
1350
|
+
+ ' placeholder="' + placeholder + '">';
|
|
1351
|
+
if (labeled) html += (secret ? eye : "") + "</div></div>";
|
|
1278
1352
|
}
|
|
1279
1353
|
return html + '<div class="key-links">'
|
|
1280
1354
|
+ '<button class="btn link" data-act="signup" data-service="' + esc(s.id) + '">' + esc(s.signup_label || "去申请") + icon("external") + "</button>"
|
|
1281
1355
|
+ (s.guide ? '<button class="btn link" data-act="guide" data-service="' + esc(s.id) + '">' + esc(s.guide_label || "教程") + icon("external") + "</button>" : "")
|
|
1282
1356
|
+ '<span class="grow"></span>'
|
|
1283
|
-
+ (emails ? "" :
|
|
1284
|
-
+ '<div class="err" id="key-error" role="status"></div><div class="key-actions">'
|
|
1285
|
-
+ '<button class="btn" data-act="test_key" data-service="' + esc(s.id) + '">测试</button><span class="
|
|
1286
|
-
+ (
|
|
1357
|
+
+ (emails || labeled ? "" : eye) + "</div>"
|
|
1358
|
+
+ '<div class="err" id="key-error" role="status"></div><div class="key-actions wraps">'
|
|
1359
|
+
+ '<button class="btn" data-act="test_key" data-service="' + esc(s.id) + '">测试</button><span class="key-actions-end">'
|
|
1360
|
+
+ (hasValues ? '<button class="btn danger" data-act="clear_key" data-service="' + esc(s.id) + '">清除</button>' : "")
|
|
1287
1361
|
+ '<button class="btn" data-act="cancel_key">取消</button>'
|
|
1288
|
-
+ '<button class="btn primary" data-act="save_key" data-service="' + esc(s.id) + '">保存</button></div></div>';
|
|
1362
|
+
+ '<button class="btn primary" data-act="save_key" data-service="' + esc(s.id) + '">保存</button></span></div></div>';
|
|
1289
1363
|
}
|
|
1290
1364
|
|
|
1291
1365
|
function settingsKeys() {
|
|
@@ -1362,13 +1436,13 @@ const PRO_KEEPS = [["photo", "图片"], ["table", "表格"], ["formula", "公式
|
|
|
1362
1436
|
// said in full.
|
|
1363
1437
|
const PRO_MERITS = [
|
|
1364
1438
|
["file", "出版社原文", "取自出版社网页或 XML,不从 PDF 识别:章节、图注、表格(含合并单元格)和 LaTeX 公式按原文还原,避免识别错误。"],
|
|
1365
|
-
["check", "
|
|
1439
|
+
["check", "缺失会标明", "表格有缺失就不生成;图片没下到的在批量最后再取一次,仍缺就在原位置标明,清单里写明缺哪张图。"],
|
|
1366
1440
|
["link", "来源可追溯", "每篇保留出版社原始网页或 XML,以及来源清单:来源地址、DOI 核对结果和获取时间。"],
|
|
1367
1441
|
];
|
|
1368
1442
|
function proMerits() {
|
|
1369
1443
|
return '<button type="button" class="nav-row pro-row" data-act="pro_merits" aria-expanded="' + proMeritsOpen + '">' + icon("shield")
|
|
1370
1444
|
+ '<span class="nav-text"><span class="nav-title">' + esc("三项特点") + '</span><span class="nav-sub">'
|
|
1371
|
-
+ esc("出版社原文 ·
|
|
1445
|
+
+ esc("出版社原文 · 缺失会标明 · 来源可追溯") + "</span></span>" + icon(proMeritsOpen ? "down" : "right") + "</button>"
|
|
1372
1446
|
+ (proMeritsOpen ? '<div class="pro-merits">' + PRO_MERITS.map(([glyph, title, said]) => '<div class="pro-merit">' + icon(glyph)
|
|
1373
1447
|
+ "<div><b>" + esc(title) + "</b><span>" + esc(said) + "</span></div></div>").join("") + "</div>" : "");
|
|
1374
1448
|
}
|
|
@@ -1456,8 +1530,11 @@ function versionLink() {
|
|
|
1456
1530
|
const update = newerVersion();
|
|
1457
1531
|
const said = update ? (versionCheck.update ? "有新版本 " + versionCheck.latest + ",点此更新" : "有新版本,点此更新")
|
|
1458
1532
|
: "PaperSearch" + (versionInfo.running ? " " + versionInfo.running : "");
|
|
1533
|
+
// Pro installed: its pill after the version, as on its features' rows (user, 2026-11-22); a newer version's red line alone.
|
|
1534
|
+
const pro = !update && proOn() && !!(proStatus && proStatus.ok && proStatus.installed);
|
|
1459
1535
|
return '<button type="button" class="version-link' + (update ? " new" : "") + '" data-act="settings_page" data-page="about">'
|
|
1460
|
-
+ (update ? icon("upcircle") : "") + '<span class="pl-text">' + esc(said) + "</span
|
|
1536
|
+
+ (update ? icon("upcircle") : "") + '<span class="pl-text">' + esc(said) + "</span>"
|
|
1537
|
+
+ (pro ? '<span class="pro-pill">Pro</span>' : "") + "</button>";
|
|
1461
1538
|
}
|
|
1462
1539
|
|
|
1463
1540
|
|
|
@@ -1505,7 +1582,6 @@ function aboutAction() {
|
|
|
1505
1582
|
return '<div class="about-action">' + (busy()
|
|
1506
1583
|
? '<button type="button" class="btn primary" disabled>' + esc("下载结束后更新") + "</button>"
|
|
1507
1584
|
: '<button type="button" class="btn primary" data-act="update_all">' + esc(label) + "</button>")
|
|
1508
|
-
+ (versionCheck.update && versionCheck.notes ? '<button type="button" class="btn link" data-act="release_notes">' + esc("这次更新了什么") + "</button>" : "")
|
|
1509
1585
|
+ "</div>";
|
|
1510
1586
|
}
|
|
1511
1587
|
return versionCheck.state === "running" ? "" : '<div class="about-action"><button type="button" class="btn link" data-act="check_versions">'
|
|
@@ -1517,9 +1593,14 @@ const aboutComing = () => '<div class="about-sub">' + esc("即将推出") + "</d
|
|
|
1517
1593
|
function settingsAbout() {
|
|
1518
1594
|
const installed = proOn() && !!(proStatus && proStatus.ok && proStatus.installed);
|
|
1519
1595
|
const [tone, line] = versionLine();
|
|
1596
|
+
// A newer PaperSearch with its notes: 有新版本 X is the link to them, ↗ after it (user, 2026-11-22: 乙).
|
|
1597
|
+
const said = "有新版本 " + versionCheck.latest;
|
|
1598
|
+
const notes = tone === "new" && versionCheck.update && versionCheck.notes && line.endsWith(said);
|
|
1599
|
+
const version = notes ? esc(line.slice(0, -said.length)) + '<button type="button" class="ver-notes" data-act="release_notes">'
|
|
1600
|
+
+ esc(said) + icon("external") + "</button>" : esc(line);
|
|
1520
1601
|
const hero = '<div class="about-hero">' + appIcon(56, installed) + '<div class="about-name' + (installed ? " with-pill" : "") + '">PaperSearch'
|
|
1521
1602
|
+ (installed ? '<span class="pro-pill">Pro</span>' : "") + '</div><div class="about-version' + (tone ? " " + tone : "") + '" role="status">'
|
|
1522
|
-
+
|
|
1603
|
+
+ version + "</div></div>" + aboutAction();
|
|
1523
1604
|
let pro = "";
|
|
1524
1605
|
if (proOn() && installed) {
|
|
1525
1606
|
pro = '<div class="about-gap"></div>' + (proAction() ? '<div class="pro-action">' + proAction() + "</div>" : "") + proUsage(false) + aboutComing()
|
|
@@ -1624,7 +1705,7 @@ function loginTesting(t) {
|
|
|
1624
1705
|
// tests). 文章 beside 账号 and 密码, two characters each; its line ends where their boxes end.
|
|
1625
1706
|
function loginTest(s) {
|
|
1626
1707
|
if (!testArticle) return "";
|
|
1627
|
-
const label =
|
|
1708
|
+
const label = testArticle.doi || testEditing ? '<span class="lbl">' + esc("测试文章") + "</span>" : "";
|
|
1628
1709
|
const t = schoolTest.state === "done" && schoolTest.key === s.key ? schoolTest : null;
|
|
1629
1710
|
const result = t ? '<div class="test-result ' + (t.ok ? "ok" : "bad") + '" role="status">' + icon(t.ok ? "check" : "alert")
|
|
1630
1711
|
+ '<div><div class="t">' + esc(t.title) + "</div>" + (t.detail ? '<div class="d">' + esc(t.detail) + "</div>" : "")
|
|
@@ -1632,7 +1713,7 @@ function loginTest(s) {
|
|
|
1632
1713
|
// Also for a school whose account is not saved yet: 测试 saves what is typed first.
|
|
1633
1714
|
const test = '<button class="btn test-btn" data-act="school_test">' + esc("测试") + "</button>";
|
|
1634
1715
|
if (testEditing) {
|
|
1635
|
-
return result +
|
|
1716
|
+
return result + '<div class="test-article">' + label + '<span class="test-edit">'
|
|
1636
1717
|
+ '<input id="test-article" type="text" autocomplete="off" spellcheck="false" value="' + esc(testArticleText)
|
|
1637
1718
|
+ '" placeholder="' + esc("DOI 或文章网址") + '" aria-label="' + esc("测试文章") + '">'
|
|
1638
1719
|
+ '<button type="button" class="link-btn" data-act="test_article_save"' + (testArticleSaving ? " disabled" : "") + ">"
|
|
@@ -1640,23 +1721,27 @@ function loginTest(s) {
|
|
|
1640
1721
|
+ (testArticleError ? '<div class="err test-err" role="status">' + esc(testArticleError) + "</div>" : "");
|
|
1641
1722
|
}
|
|
1642
1723
|
const doi = testArticle.doi;
|
|
1643
|
-
return result +
|
|
1724
|
+
return result + '<div class="test-article">' + label + '<span class="what' + (doi ? "" : " empty") + '"' + (doi ? ' title="' + esc(doi) + '"' : "")
|
|
1644
1725
|
+ ">" + esc(doi || "填入学校订阅文章 DOI 或网址") + "</span>"
|
|
1645
|
-
+ '<button type="button" class="link-btn" data-act="test_article_edit"
|
|
1726
|
+
+ (doi ? '<button type="button" class="link-btn edit" data-act="test_article_edit" aria-label="' + esc("修改") + '">' + icon("edit") + "</button>"
|
|
1727
|
+
: '<button type="button" class="link-btn" data-act="test_article_edit">' + esc("填写") + "</button>") + test + "</div>";
|
|
1646
1728
|
}
|
|
1647
1729
|
|
|
1648
1730
|
function loginSchool(s, index) {
|
|
1649
|
-
const shown = loginOpen === s.key;
|
|
1731
|
+
const shown = loginOpen === s.key, items = loginMenuItems(s);
|
|
1650
1732
|
// Their order, where there is more than one (user, 2026-11-21: 没权限时换下一所学校 goes down it; 1 the default).
|
|
1651
1733
|
const many = ((schoolLogin && schoolLogin.schools) || []).length > 1;
|
|
1652
|
-
const row = '<button type="button" class="login-row
|
|
1734
|
+
const row = '<button type="button" class="login-row ls-head' + (shown && items.length ? " with-menu" : "") + '" data-act="login_open" data-key="'
|
|
1735
|
+
+ esc(s.key) + '" aria-expanded="' + shown + '">'
|
|
1653
1736
|
+ (many ? '<span class="ls-n">' + (index + 1) + "</span>" : "") + '<span class="ls-name">' + esc(schoolName(s)) + "</span>"
|
|
1654
1737
|
+ (s.current ? '<span class="tag default">' + esc("默认") + "</span>" : "") + tagHtml(s.status)
|
|
1655
|
-
+ '<span class="ls-acct">' + esc(s.saved ? (s.enabled ? s.username : "已关闭") : "未填账号") + "</span>"
|
|
1738
|
+
+ (shown ? "" : '<span class="ls-acct">' + esc(s.saved ? (s.enabled ? s.username : "已关闭") : "未填账号") + "</span>")
|
|
1656
1739
|
+ icon(shown ? "down" : "right") + "</button>";
|
|
1657
1740
|
if (!shown) return '<div class="login-school">' + row + "</div>";
|
|
1658
|
-
if (schoolTest.state === "running" && schoolTest.key === s.key) return '<div class="login-school">' + row + loginTesting(schoolTest) + "</div>";
|
|
1659
|
-
|
|
1741
|
+
if (schoolTest.state === "running" && schoolTest.key === s.key) return '<div class="login-school open">' + row + loginTesting(schoolTest) + "</div>";
|
|
1742
|
+
const menu = !items.length ? "" : '<button type="button" class="iconbtn ls-dots" data-act="login_menu" aria-label="' + esc("更多操作") + '" aria-expanded="'
|
|
1743
|
+
+ (loginMenu === s.key) + '">' + icon("dots") + "</button>" + (loginMenu === s.key ? '<div class="ls-menu" role="menu">' + items.join("") + "</div>" : "");
|
|
1744
|
+
return '<div class="login-school open">' + row + menu
|
|
1660
1745
|
+ (s.off === "rejected" ? '<div class="err" style="text-align:left;margin:0 0 8px">'
|
|
1661
1746
|
+ esc("学校没有接受保存的密码,自动登录已关闭;更新密码后保存,就会重新打开") + "</div>" : "")
|
|
1662
1747
|
+ '<div class="login-form">'
|
|
@@ -1669,24 +1754,34 @@ function loginSchool(s, index) {
|
|
|
1669
1754
|
+ icon("eye") + "</button></span>"
|
|
1670
1755
|
// A line for an error, or the next step once a school is added; "saved" said on the button itself (user, 2026-11-20).
|
|
1671
1756
|
+ '<div class="err' + (loginError ? "" : " ok") + '" id="login-error" role="status">' + esc(loginError || loginDone) + "</div>"
|
|
1672
|
-
+ loginTest(s)
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
|
|
1685
|
-
|
|
1686
|
-
|
|
1687
|
-
|
|
1688
|
-
|
|
1689
|
-
|
|
1757
|
+
+ loginTest(s) + loginFoot(s) + "</div></div>";
|
|
1758
|
+
}
|
|
1759
|
+
|
|
1760
|
+
// ⋯, the same for every school: set it as the default (not the default already), clear its account and password (saved
|
|
1761
|
+
// ones), remove it (not the default: another is made the default first); the last two asked again in place (loginFoot).
|
|
1762
|
+
function loginMenuItems(s) {
|
|
1763
|
+
const items = [];
|
|
1764
|
+
if (!s.current) items.push('<button type="button" role="menuitem" data-act="set_default" data-key="' + esc(s.key) + '">' + esc("设为默认") + "</button>");
|
|
1765
|
+
if (s.saved) items.push('<button type="button" role="menuitem" class="danger" data-act="clear_login">' + esc("清除账号密码") + "</button>");
|
|
1766
|
+
if (!s.current) items.push('<button type="button" role="menuitem" class="danger" data-act="forget_school" data-key="' + esc(s.key) + '">'
|
|
1767
|
+
+ esc("移除这所学校") + "</button>");
|
|
1768
|
+
return items;
|
|
1769
|
+
}
|
|
1770
|
+
|
|
1771
|
+
// The card's last line: 自动登录's switch (a saved account) and 保存; while a clearing or a removal is asked, that question
|
|
1772
|
+
// in its place, the same height (user, 2026-11-22: the old confirmation moved the page down).
|
|
1773
|
+
function loginFoot(s) {
|
|
1774
|
+
const forget = confirmForget === s.key;
|
|
1775
|
+
if (forget || confirmClear === "login") {
|
|
1776
|
+
return '<div class="login-foot asking" role="alert"><span class="q">' + esc(forget ? "移除这所学校?" : "清除账号和密码?") + '</span><span class="grow"></span>'
|
|
1777
|
+
+ '<button type="button" class="btn" data-act="cancel_confirm">' + esc("取消") + "</button>"
|
|
1778
|
+
+ (forget ? '<button type="button" class="btn danger" data-act="forget_school" data-key="' + esc(s.key) + '">' + esc("移除") + "</button>"
|
|
1779
|
+
: '<button type="button" class="btn danger" data-act="clear_login">' + esc("清除") + "</button>") + "</div>";
|
|
1780
|
+
}
|
|
1781
|
+
return '<div class="login-foot">' + (s.saved ? "<span>" + esc("自动登录") + '</span><button type="button" class="switch' + (s.enabled ? " on" : "")
|
|
1782
|
+
+ '" data-act="login_switch" role="switch" aria-checked="' + !!s.enabled + '" aria-label="' + esc("自动登录") + '"></button>' : "")
|
|
1783
|
+
+ '<span class="grow"></span><button type="button" class="btn primary" data-act="save_login">'
|
|
1784
|
+
+ (loginSaved ? icon("check") + esc("已保存") : esc("保存")) + "</button></div>";
|
|
1690
1785
|
}
|
|
1691
1786
|
|
|
1692
1787
|
function loginFound() {
|
|
@@ -1705,8 +1800,8 @@ function settingsLogin() {
|
|
|
1705
1800
|
if (!s || !s.ok) return head + '<div class="err" style="text-align:left">' + esc((s && s.error) || "读取失败") + "</div>";
|
|
1706
1801
|
if (!s.pro) return head + '<div class="pro-desc">' + esc("学校登录页自动填写账号和密码,批量下载不用守着。") + "</div>" + proNeeded();
|
|
1707
1802
|
// 添加学校 a row like the schools', opened to its search (user, 2026-11-20: a box alone said nothing).
|
|
1708
|
-
return head + '<div
|
|
1709
|
-
+ '<div class="login-school"><button type="button" class="login-row login-add-row" data-act="login_add" aria-expanded="' + loginAdding + '">'
|
|
1803
|
+
return head + '<div class="login-list">' + (s.schools || []).map(loginSchool).join("")
|
|
1804
|
+
+ '<div class="login-school add"><button type="button" class="login-row login-add-row" data-act="login_add" aria-expanded="' + loginAdding + '">'
|
|
1710
1805
|
+ icon("plus") + '<span class="ls-name">' + esc("添加学校") + "</span>" + icon(loginAdding ? "down" : "right") + "</button>"
|
|
1711
1806
|
+ (loginAdding ? '<div class="login-add"><div class="login-find"><input id="school-query" type="text" autocomplete="off" spellcheck="false" value="'
|
|
1712
1807
|
+ esc(schoolQuery) + '" placeholder="' + esc("中文名、英文名或学校网址") + '" aria-label="' + esc("学校名称") + '">'
|
|
@@ -2006,7 +2101,7 @@ function updateStrip() {
|
|
|
2006
2101
|
}
|
|
2007
2102
|
|
|
2008
2103
|
async function loadSettings() {
|
|
2009
|
-
settings = await api().settings(); notifyOn = settings.notify; hourlyNow = settings.hourly_now === true; settingsErrors = {}; settingsDraft = {}; notifyCheck = null;
|
|
2104
|
+
settings = await api().settings(); notifyOn = settings.notify; hourlyNow = settings.hourly_now === true; retryOn = settings.retry === true; settingsErrors = {}; settingsDraft = {}; notifyCheck = null;
|
|
2010
2105
|
try { apiKeys = await api().api_keys(); } catch (error) { apiKeys = null; }
|
|
2011
2106
|
if (!proOn()) return;
|
|
2012
2107
|
try { proStatus = await api().pro_status(); } catch (error) { proStatus = null; }
|
|
@@ -2104,6 +2199,7 @@ function render(force) {
|
|
|
2104
2199
|
const list = root.querySelector(".papers-scroll, .keys-scroll");
|
|
2105
2200
|
if (list) list.scrollTop = scrolled;
|
|
2106
2201
|
localize(root);
|
|
2202
|
+
fitPaths(root);
|
|
2107
2203
|
if (panel === "settings") holdSettingsHeight();
|
|
2108
2204
|
if (attention) updateAttentionCountdown();
|
|
2109
2205
|
renderedAttention = attention ? V : null;
|
|
@@ -2124,6 +2220,15 @@ function keepSupportPlace(last) {
|
|
|
2124
2220
|
if (last) keepScroll = null;
|
|
2125
2221
|
}
|
|
2126
2222
|
|
|
2223
|
+
// The card's own border, as drawn: 0.5px a side is one device pixel on a Retina screen but a whole pixel (1px a side)
|
|
2224
|
+
// on a 1x screen (user, 2026-11-22: an external 1080p screen). The surface is as wide as what the border leaves, so it
|
|
2225
|
+
// lies in the same place whichever edge it is anchored to while the window lays itself out.
|
|
2226
|
+
function rootBorder() {
|
|
2227
|
+
const style = getComputedStyle(root);
|
|
2228
|
+
return [parseFloat(style.borderLeftWidth) + parseFloat(style.borderRightWidth),
|
|
2229
|
+
parseFloat(style.borderTopWidth) + parseFloat(style.borderBottomWidth)].map((n) => n || 0);
|
|
2230
|
+
}
|
|
2231
|
+
|
|
2127
2232
|
let fitGeneration = 0, layoutQueue = Promise.resolve();
|
|
2128
2233
|
let settledGeneration = 0, settledSize = null, settledExpanded = null;
|
|
2129
2234
|
function fit(previous) {
|
|
@@ -2133,11 +2238,11 @@ function fit(previous) {
|
|
|
2133
2238
|
const to = [Math.ceil(target.width), Math.ceil(target.height)];
|
|
2134
2239
|
const from = previous.width && previous.height ? [previous.width, previous.height] : to;
|
|
2135
2240
|
const expanded = root.classList.contains("card");
|
|
2136
|
-
const border =
|
|
2241
|
+
const border = rootBorder();
|
|
2137
2242
|
// Fix the content width before awaiting the native bridge. Otherwise an
|
|
2138
2243
|
// absolutely positioned surface shrink-wraps for a frame on every tick.
|
|
2139
|
-
root.firstElementChild.style.width = Math.max(0, to[0] - border) + "px";
|
|
2140
|
-
root.style.setProperty("--content-max-height", Math.max(0, to[1] - border) + "px");
|
|
2244
|
+
root.firstElementChild.style.width = Math.max(0, to[0] - border[0]) + "px";
|
|
2245
|
+
root.style.setProperty("--content-max-height", Math.max(0, to[1] - border[1]) + "px");
|
|
2141
2246
|
if (settledGeneration === generation - 1 && settledExpanded === expanded && settledSize
|
|
2142
2247
|
&& to.every((size, i) => size === settledSize[i] && Math.abs(size - from[i]) < 1)) {
|
|
2143
2248
|
// Elapsed time/countdowns update the text, not the window geometry.
|
|
@@ -2156,13 +2261,17 @@ async function animateFit(generation, expanded, from, to, pad) {
|
|
|
2156
2261
|
if (generation !== fitGeneration || dragging || closing) return;
|
|
2157
2262
|
const layout = await api().begin_layout(expanded, to[0] + pad, to[1] + pad, generation);
|
|
2158
2263
|
if (generation !== fitGeneration || dragging || closing || !layout.vertical) return;
|
|
2159
|
-
document.body.classList.remove("grow-up", "grow-down", "grow-left", "grow-right");
|
|
2160
|
-
document.body.classList.add("grow-" + layout.vertical, "grow-" + layout.horizontal);
|
|
2161
2264
|
from = [layout.from_width - pad, layout.from_height - pad];
|
|
2162
2265
|
to = [layout.width - pad, layout.height - pad];
|
|
2163
|
-
|
|
2164
|
-
|
|
2165
|
-
|
|
2266
|
+
// Anchored to the edge that moves only along a side whose size changes: a layout that changes nothing (a size read
|
|
2267
|
+
// back a fraction of a pixel off on a 1x screen or at 125%/150% scaling) leaves the page where it lies, never a pixel
|
|
2268
|
+
// to one side for the length of the animation (user, 2026-11-22: it shook left and right there).
|
|
2269
|
+
document.body.classList.remove("grow-up", "grow-down", "grow-left", "grow-right");
|
|
2270
|
+
document.body.classList.add("grow-" + (Math.abs(to[1] - from[1]) >= 1 ? layout.vertical : "down"),
|
|
2271
|
+
"grow-" + (Math.abs(to[0] - from[0]) >= 1 ? layout.horizontal : "right"));
|
|
2272
|
+
const border = rootBorder();
|
|
2273
|
+
root.style.setProperty("--content-max-height", Math.max(0, to[1] - border[1]) + "px");
|
|
2274
|
+
root.firstElementChild.style.width = Math.max(0, to[0] - border[0]) + "px";
|
|
2166
2275
|
keepSupportPlace(false);
|
|
2167
2276
|
const duration = matchMedia('(prefers-reduced-motion: reduce)').matches ? 0 : 240;
|
|
2168
2277
|
const started = performance.now();
|
|
@@ -2212,6 +2321,7 @@ function say(text) { flash = { text: text, until: Date.now() + 6000 }; render(tr
|
|
|
2212
2321
|
|
|
2213
2322
|
let inputActivation = Promise.resolve();
|
|
2214
2323
|
async function act(action, target) {
|
|
2324
|
+
if (action !== "login_menu") loginMenu = "";
|
|
2215
2325
|
const v = V;
|
|
2216
2326
|
switch (action) {
|
|
2217
2327
|
// Back as a capsule when restored, unless pinned: a pinned card comes back open (user, 2026-11-20:
|
|
@@ -2236,11 +2346,7 @@ async function act(action, target) {
|
|
|
2236
2346
|
case "papers": {
|
|
2237
2347
|
papersKind = target.dataset.list; panel = "papers"; listOpen = null; papersList = null; render(true);
|
|
2238
2348
|
await loadPapers();
|
|
2239
|
-
// From the line on sites not yet supported: their group open, in view.
|
|
2240
|
-
const at = target.dataset.unverified ? shownList().groups.findIndex((g) => g.unverified) : -1;
|
|
2241
|
-
if (at >= 0) listOpen = new Set([at]);
|
|
2242
2349
|
render(true);
|
|
2243
|
-
if (at >= 0) { const shown = root.querySelector(".unverified-note"); if (shown) shown.closest(".grp").scrollIntoView({ block: "start" }); }
|
|
2244
2350
|
return;
|
|
2245
2351
|
}
|
|
2246
2352
|
case "markdown_issue": return say(await api().markdown_issue());
|
|
@@ -2322,7 +2428,7 @@ async function act(action, target) {
|
|
|
2322
2428
|
case "reveal":
|
|
2323
2429
|
revealed = !revealed;
|
|
2324
2430
|
target.setAttribute("aria-pressed", String(revealed));
|
|
2325
|
-
root.querySelectorAll(".key-edit input").forEach((input) => { input.type = revealed ? "text" : "password"; });
|
|
2431
|
+
root.querySelectorAll(".key-edit input[data-secret]").forEach((input) => { input.type = revealed ? "text" : "password"; });
|
|
2326
2432
|
return;
|
|
2327
2433
|
case "install_pro": {
|
|
2328
2434
|
try { proInstall = (await api().install_pro()) || { state: "idle" }; }
|
|
@@ -2472,6 +2578,11 @@ async function act(action, target) {
|
|
|
2472
2578
|
if (loginAdding) root.querySelector("#school-query")?.focus();
|
|
2473
2579
|
return;
|
|
2474
2580
|
}
|
|
2581
|
+
case "login_menu":
|
|
2582
|
+
loginMenu = loginMenu === loginOpen ? "" : loginOpen; confirmClear = ""; confirmForget = "";
|
|
2583
|
+
return render(true);
|
|
2584
|
+
case "cancel_confirm":
|
|
2585
|
+
confirmClear = ""; confirmForget = ""; return render(true);
|
|
2475
2586
|
case "login_open": {
|
|
2476
2587
|
loginOpen = loginOpen === target.dataset.key ? "" : target.dataset.key;
|
|
2477
2588
|
loginError = ""; loginDone = ""; confirmClear = ""; confirmForget = ""; loginShown = false; loginSaved = false;
|
|
@@ -2535,6 +2646,21 @@ async function act(action, target) {
|
|
|
2535
2646
|
} finally { target.disabled = false; }
|
|
2536
2647
|
return;
|
|
2537
2648
|
}
|
|
2649
|
+
case "retry": {
|
|
2650
|
+
target.disabled = true;
|
|
2651
|
+
try {
|
|
2652
|
+
const result = await api().set_retry(!retryOn);
|
|
2653
|
+
if (!result.ok) throw new Error(result.error || "设置保存失败");
|
|
2654
|
+
retryOn = result.retry;
|
|
2655
|
+
settings.retry = retryOn;
|
|
2656
|
+
target.classList.toggle("on", retryOn);
|
|
2657
|
+
target.setAttribute("aria-checked", String(retryOn));
|
|
2658
|
+
} catch (error) {
|
|
2659
|
+
settingsErrors.retry = error.message || "设置保存失败";
|
|
2660
|
+
render(true);
|
|
2661
|
+
} finally { target.disabled = false; }
|
|
2662
|
+
return;
|
|
2663
|
+
}
|
|
2538
2664
|
case "hourly_now": {
|
|
2539
2665
|
target.disabled = true;
|
|
2540
2666
|
try {
|
|
@@ -2588,21 +2714,6 @@ async function act(action, target) {
|
|
|
2588
2714
|
// A paper list scrolls; pressing in it must not drag the window. Nor in 支持的学校's list (user, 2026-11-21: a press
|
|
2589
2715
|
// between its rows dragged, and the redraw after it went back to the top).
|
|
2590
2716
|
const interactive = (target) => target.closest('button, input, select, textarea, a, [contenteditable="true"], [role="button"], .paper-list, .papers-scroll, .keys-scroll, #support-list');
|
|
2591
|
-
// The dot's card: open while the pointer is on the dot or the card, a moment's grace between
|
|
2592
|
-
// them. Told by where the pointer moves, not by its leaving: the card is redrawn every second
|
|
2593
|
-
// and a dot redrawn under the pointer never says it was left.
|
|
2594
|
-
const RULES_PARTS = ".rules-dot, .rules-pop";
|
|
2595
|
-
function rulesPointer(over) {
|
|
2596
|
-
if (over) {
|
|
2597
|
-
clearTimeout(rulesTimer);
|
|
2598
|
-
rulesTimer = 0;
|
|
2599
|
-
if (!rulesShown) showRules(true);
|
|
2600
|
-
} else if (rulesShown && !rulesTimer) {
|
|
2601
|
-
rulesTimer = setTimeout(() => { rulesTimer = 0; showRules(false); }, 300);
|
|
2602
|
-
}
|
|
2603
|
-
}
|
|
2604
|
-
document.addEventListener("pointermove", (event) => rulesPointer(!!(event.target.closest && event.target.closest(RULES_PARTS))));
|
|
2605
|
-
document.documentElement.addEventListener("pointerleave", () => rulesPointer(false));
|
|
2606
2717
|
root.addEventListener("pointerdown", (event) => {
|
|
2607
2718
|
if (event.button === 0 && api().activate_on_input) inputActivation = api().activate_on_input();
|
|
2608
2719
|
if (event.button === 0 && event.target.closest(".attention-target")) {
|
|
@@ -2695,6 +2806,11 @@ root.addEventListener("click", (event) => {
|
|
|
2695
2806
|
// the window's drag, while which the page is not drawn again.
|
|
2696
2807
|
document.addEventListener("pointerdown", (event) => {
|
|
2697
2808
|
if (languageOpen && !event.target.closest(".lang-wrap")) closeLanguageMenu();
|
|
2809
|
+
if (loginMenu && !event.target.closest(".ls-menu, .ls-dots")) {
|
|
2810
|
+
loginMenu = "";
|
|
2811
|
+
root.querySelector(".ls-menu")?.remove();
|
|
2812
|
+
root.querySelector(".ls-dots")?.setAttribute("aria-expanded", "false");
|
|
2813
|
+
}
|
|
2698
2814
|
}, true);
|
|
2699
2815
|
function closeLanguageMenu() {
|
|
2700
2816
|
languageOpen = false;
|