papersearch 0.7.3 → 0.8.1
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/NOTICE +8 -37
- package/README.fr.md +265 -0
- package/README.ja.md +265 -0
- package/README.ko.md +265 -0
- package/README.md +149 -148
- package/README.zh-Hant.md +265 -0
- package/README.zh.md +265 -0
- package/dist/capabilities/download/batch/batch.d.ts +20 -1
- package/dist/capabilities/download/batch/batch.d.ts.map +1 -1
- package/dist/capabilities/download/batch/batch.js +1057 -208
- 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 +3 -2
- package/dist/capabilities/download/batch/batchFolder.js.map +1 -1
- package/dist/capabilities/download/batch/networkLoss.d.ts +11 -2
- package/dist/capabilities/download/batch/networkLoss.d.ts.map +1 -1
- package/dist/capabilities/download/batch/networkLoss.js +24 -3
- 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/batch/windowPlan.d.ts +96 -0
- package/dist/capabilities/download/batch/windowPlan.d.ts.map +1 -0
- package/dist/capabilities/download/batch/windowPlan.js +196 -0
- package/dist/capabilities/download/batch/windowPlan.js.map +1 -0
- 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 +22 -10
- 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 +46 -3
- 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/content/pdf/open/tiers/scihub.d.ts.map +1 -1
- package/dist/capabilities/download/content/pdf/open/tiers/scihub.js +3 -1
- package/dist/capabilities/download/content/pdf/open/tiers/scihub.js.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/http/hostGate.d.ts +24 -0
- package/dist/infrastructure/http/hostGate.d.ts.map +1 -0
- package/dist/infrastructure/http/hostGate.js +72 -0
- package/dist/infrastructure/http/hostGate.js.map +1 -0
- package/dist/infrastructure/pdf/PdfDownload.d.ts +1 -0
- package/dist/infrastructure/pdf/PdfDownload.d.ts.map +1 -1
- package/dist/infrastructure/pdf/PdfDownload.js +6 -1
- package/dist/infrastructure/pdf/PdfDownload.js.map +1 -1
- package/dist/infrastructure/runlog/RunLedger.d.ts +14 -0
- package/dist/infrastructure/runlog/RunLedger.d.ts.map +1 -1
- package/dist/infrastructure/runlog/RunLedger.js +30 -4
- package/dist/infrastructure/runlog/RunLedger.js.map +1 -1
- package/dist/infrastructure/runlog/failureClass.d.ts +2 -1
- package/dist/infrastructure/runlog/failureClass.d.ts.map +1 -1
- package/dist/infrastructure/runlog/failureClass.js +27 -4
- 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 +48 -5
- package/dist/infrastructure/school/SchoolAttempt.js.map +1 -1
- package/dist/infrastructure/school/SchoolMcpClient.d.ts +13 -2
- package/dist/infrastructure/school/SchoolMcpClient.d.ts.map +1 -1
- package/dist/infrastructure/school/SchoolMcpClient.js +138 -15
- 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 +9 -0
- package/dist/infrastructure/school/SchoolReadiness.d.ts.map +1 -1
- package/dist/infrastructure/school/SchoolReadiness.js +10 -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 +73 -1
- package/dist/infrastructure/school/types.d.ts.map +1 -1
- package/dist/infrastructure/school/types.js.map +1 -1
- package/dist/infrastructure/security/SecurityUtils.d.ts.map +1 -1
- package/dist/infrastructure/security/SecurityUtils.js +6 -2
- package/dist/infrastructure/security/SecurityUtils.js.map +1 -1
- package/dist/management/failures/index.d.ts +23 -0
- package/dist/management/failures/index.d.ts.map +1 -1
- package/dist/management/failures/index.js +68 -20
- package/dist/management/failures/index.js.map +1 -1
- package/dist/management/school/autoUpdate.d.ts.map +1 -1
- package/dist/management/school/autoUpdate.js +9 -1
- package/dist/management/school/autoUpdate.js.map +1 -1
- package/dist/management/school/cliProgress.d.ts.map +1 -1
- package/dist/management/school/cliProgress.js +3 -1
- package/dist/management/school/cliProgress.js.map +1 -1
- package/package.json +8 -3
- 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 +19 -2
- 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 +52 -13
- package/school/paper_search_school/adapters/oup/__init__.py +7 -4
- package/school/paper_search_school/adapters/platforms/__init__.py +4 -1
- package/school/paper_search_school/adapters/platforms/atypon/__init__.py +12 -3
- package/school/paper_search_school/adapters/platforms/figshare/__init__.py +23 -4
- package/school/paper_search_school/adapters/platforms/jstage/__init__.py +64 -0
- package/school/paper_search_school/adapters/taylor_francis/__init__.py +0 -3
- package/school/paper_search_school/adapters/thieme/__init__.py +2 -9
- 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 +526 -147
- package/school/paper_search_school/assets/capsule_en.json +140 -49
- package/school/paper_search_school/assets/capsule_fr.json +141 -50
- package/school/paper_search_school/assets/capsule_ja.json +140 -49
- package/school/paper_search_school/assets/capsule_ko.json +140 -49
- package/school/paper_search_school/assets/capsule_zh-Hant.json +134 -48
- package/school/paper_search_school/browser/backend.py +125 -4
- package/school/paper_search_school/browser/batch_session.py +189 -8
- package/school/paper_search_school/browser/challenge/__init__.py +12 -9
- package/school/paper_search_school/browser/challenge/continuation.py +83 -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 +128 -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/pro.py +24 -0
- package/school/paper_search_school/browser/challenge/services/__init__.py +1 -0
- package/school/paper_search_school/browser/challenge/services/solver.py +292 -0
- package/school/paper_search_school/browser/engine.py +4 -1
- package/school/paper_search_school/browser/user_turn.py +126 -0
- package/school/paper_search_school/browser/watchdog.py +213 -60
- package/school/paper_search_school/cli_config.py +10 -5
- package/school/paper_search_school/config.py +16 -10
- package/school/paper_search_school/download_diagnostics.py +7 -2
- package/school/paper_search_school/engine/access_rules.py +12 -3
- package/school/paper_search_school/engine/batch.py +52 -18
- package/school/paper_search_school/engine/batch_access.py +62 -16
- package/school/paper_search_school/engine/batch_capture.py +260 -31
- 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 +52 -3
- package/school/paper_search_school/engine/batch_login.py +398 -36
- package/school/paper_search_school/engine/batch_pdf_urls.py +38 -7
- package/school/paper_search_school/engine/batch_user.py +48 -3
- package/school/paper_search_school/engine/batch_waits.py +221 -14
- package/school/paper_search_school/engine/bridge.py +29 -6
- package/school/paper_search_school/engine/fulltext_page.py +55 -8
- package/school/paper_search_school/engine/router.py +16 -1
- package/school/paper_search_school/engine/supplements.py +7 -1
- package/school/paper_search_school/entitlements.py +29 -1
- package/school/paper_search_school/pdf_utils.py +25 -16
- package/school/paper_search_school/progress_capsule.py +69 -11
- package/school/paper_search_school/progress_reporter.py +243 -11
- package/school/paper_search_school/progress_view.py +205 -91
- 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/site.py +12 -4
- package/school/paper_search_school/rate_limit.py +24 -1
- package/school/paper_search_school/school_login.py +170 -8
- package/school/paper_search_school/school_test.py +1 -1
- package/school/paper_search_school/server.py +179 -23
- package/school/paper_search_school/user_settings.py +46 -4
- package/school/pyproject.toml +1 -0
- package/skills/paper-search/SKILL.md +107 -107
- package/skills/paper-search/references/browser-download.md +102 -99
- 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/README.en.md +0 -264
- package/school/paper_search_school/browser/challenge/prompt.py +0 -154
|
@@ -96,6 +96,9 @@ svg.i { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-widt
|
|
|
96
96
|
.head .text { flex: 1; min-width: 0; }
|
|
97
97
|
.head .title { font-weight: 600; font-size: 14px; }
|
|
98
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; }
|
|
99
102
|
/* The head's buttons close together (user, 2026-11-17): the pin's room comes from their gaps, not the text's. */
|
|
100
103
|
.tools { display: flex; align-items: center; gap: 0; margin-right: -3px; flex: none; }
|
|
101
104
|
/* Each a 32 px target, drawn where it was (user, 2026-11-21: 最小化 was hard to hit): the margins take back what the
|
|
@@ -120,8 +123,82 @@ svg.i { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-widt
|
|
|
120
123
|
.paper-status .steps { flex: 1; min-width: 0; margin-top: 0; }
|
|
121
124
|
.paper-status .line { flex: 1; min-width: 0; margin-top: 0; line-height: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
|
|
122
125
|
.paper-link:hover .name { text-decoration: underline; }
|
|
126
|
+
/* 并行下载 (user, 2026-11-29, 乙): the papers downloading at once in the one paper's block, its height kept (its own
|
|
127
|
+
lines there, unseen, under the list). Two papers on two lines each; three and more on a line each (journal, step),
|
|
128
|
+
four to the block, more scrolling inside it with a thin bar and the edge with more faded. The one asking for the
|
|
129
|
+
user first, a small tag in its step's place; on a row, its own 跳过 (a click on the row shows its browser). */
|
|
130
|
+
.paper.listing { position: relative; }
|
|
131
|
+
.paper.listing > .name, .paper.listing > .where, .paper.listing > .paper-status { visibility: hidden; }
|
|
132
|
+
.plist { position: absolute; top: 0; bottom: 0; left: -8px; right: -8px; padding: 0 8px; overflow: hidden;
|
|
133
|
+
display: flex; flex-direction: column; justify-content: space-between; }
|
|
134
|
+
.pp { position: relative; margin: 0 -8px; padding: 0 8px; border-radius: 8px; cursor: pointer; }
|
|
135
|
+
.pp.hover { background: var(--hover); }
|
|
136
|
+
.pp:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
|
|
137
|
+
.plist:not(.compact) .pp.hover { box-shadow: 0 0 0 4px var(--hover); }
|
|
138
|
+
.pp .t { font-size: 13px; line-height: 18px; height: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
|
|
139
|
+
.pp .s { display: flex; align-items: center; gap: 8px; height: 18px; margin-top: 3px; font-size: 12px; }
|
|
140
|
+
.pp .j, .pp .jt { color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 0 1 auto; max-width: 48%; }
|
|
141
|
+
.pp .jt { display: none; }
|
|
142
|
+
.pp .s .steps, .pp .s .xfer { flex: 1; min-width: 0; margin-top: 0; }
|
|
143
|
+
.pp .row-line, .pp .row-note { margin-left: auto; min-width: 0; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
|
|
144
|
+
.ask-tag { margin-left: auto; flex: none; display: inline-flex; align-items: center; gap: 4px; height: 18px; padding: 0 8px; box-sizing: border-box;
|
|
145
|
+
border-radius: 999px; border: 0.5px solid var(--warn-line); background: var(--warn-bg); color: var(--warn); font-size: 11.5px; white-space: nowrap; }
|
|
146
|
+
.ask-tag svg.i { width: 12px; height: 12px; }
|
|
147
|
+
.ask-tag .attention-countdown { margin-left: 2px; }
|
|
148
|
+
.row-tools { display: none; gap: 3px; flex: none; }
|
|
149
|
+
.pp.hover .row-tools { display: flex; }
|
|
150
|
+
.row-tools button { display: inline-flex; align-items: center; gap: 3px; font: inherit; font-size: 11px; color: var(--dim); background: var(--bg);
|
|
151
|
+
border: 0.5px solid var(--line); border-radius: 6px; padding: 1px 6px; cursor: pointer; }
|
|
152
|
+
.row-tools button:hover { color: var(--fg); }
|
|
153
|
+
.row-tools svg.i { width: 12px; height: 12px; }
|
|
154
|
+
.plist:not(.compact) .row-tools { position: absolute; right: 6px; top: -2px; }
|
|
155
|
+
.plist:not(.compact) .pp.hover .t { padding-right: 60px; }
|
|
156
|
+
.plist.compact { display: block; }
|
|
157
|
+
.plist.compact .pp { height: 25%; display: flex; align-items: center; }
|
|
158
|
+
.plist.compact .pp .s { flex: 1; min-width: 0; margin-top: 0; }
|
|
159
|
+
.plist.compact .j, .plist.compact .jt { flex: 1; max-width: none; color: var(--fg); font-size: 12.5px; }
|
|
160
|
+
.plist.compact .s .steps, .plist.compact .s .xfer { flex: 0 0 132px; }
|
|
161
|
+
.plist.compact .xfer .what { display: none; }
|
|
162
|
+
.plist.compact .row-line, .plist.compact .row-note { max-width: 60%; }
|
|
163
|
+
/* A row on a line of its own, pointed at (user's Mac, 2026-11-29: "可以变成2行…看到它大概的内容"): it opens into two
|
|
164
|
+
lines over the next row, the rows staying where they are: its title across the card, then its journal and its own
|
|
165
|
+
跳过 (its step is on the row the rest of the time). The lowest row opens upward. The line over the other row lets the
|
|
166
|
+
pointer through to that row, so every row can be pointed at. */
|
|
167
|
+
.plist.compact .pp.hover { z-index: 2; }
|
|
168
|
+
.plist.compact .pp.hover .s { position: absolute; left: 0; right: 0; top: 0; height: 200%; margin: 0; padding: 0 8px; box-sizing: border-box;
|
|
169
|
+
display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: 1fr 1fr; align-items: center; column-gap: 8px;
|
|
170
|
+
border-radius: 8px; border: 0.5px solid var(--line); background: linear-gradient(var(--hover), var(--hover)), var(--bg);
|
|
171
|
+
box-shadow: 0 3px 10px rgba(0, 0, 0, 0.14); pointer-events: none; }
|
|
172
|
+
.plist.compact .pp.hover.up .s { top: -100%; }
|
|
173
|
+
.plist.compact .pp.hover .jt { display: block; grid-area: 1 / 1 / 2 / 3; max-width: none; color: var(--fg); font-size: 13px; }
|
|
174
|
+
.plist.compact .pp.hover .j { grid-area: 2 / 1; color: var(--faint); font-size: 12px; }
|
|
175
|
+
.plist.compact .pp.hover .row-tools { grid-area: 2 / 2; pointer-events: auto; }
|
|
176
|
+
.plist.compact .pp.hover .s > .steps, .plist.compact .pp.hover .s > .xfer, .plist.compact .pp.hover .s > .ask-tag,
|
|
177
|
+
.plist.compact .pp.hover .s > .row-line, .plist.compact .pp.hover .s > .row-note { display: none; }
|
|
178
|
+
/* The one asking for the user keeps its tag, in its journal's place. */
|
|
179
|
+
.plist.compact .pp.asking.hover .s > .j { display: none; }
|
|
180
|
+
.plist.compact .pp.asking.hover .s > .ask-tag { display: inline-flex; grid-area: 2 / 1; justify-self: start; margin-left: 0; }
|
|
181
|
+
.plist.scrolls { overflow-y: auto; overscroll-behavior: contain; scroll-snap-type: y mandatory; padding-right: 6px; }
|
|
182
|
+
.plist.scrolls .pp { scroll-snap-align: start; }
|
|
183
|
+
.plist::-webkit-scrollbar { width: 4px; background: transparent; }
|
|
184
|
+
.plist::-webkit-scrollbar-thumb { background: var(--faint); border-radius: 2px; }
|
|
185
|
+
.plist.more-below { -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 12px), transparent); mask-image: linear-gradient(to bottom, #000 calc(100% - 12px), transparent); }
|
|
186
|
+
.plist.more-above { -webkit-mask-image: linear-gradient(to top, #000 calc(100% - 12px), transparent); mask-image: linear-gradient(to top, #000 calc(100% - 12px), transparent); }
|
|
187
|
+
.plist.more-above.more-below { -webkit-mask-image: linear-gradient(transparent, #000 12px, #000 calc(100% - 12px), transparent); mask-image: linear-gradient(transparent, #000 12px, #000 calc(100% - 12px), transparent); }
|
|
123
188
|
.paper-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
|
|
124
189
|
.steps { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
|
|
190
|
+
/* A file arriving (the PDF, a supplementary file): how far it has come of its size, numbers only, the same in every
|
|
191
|
+
language; amber with a pause when nothing has come for a while, its words on hover (user, 2026-11-26). */
|
|
192
|
+
.xfer { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; font-size: 12px; }
|
|
193
|
+
.xfer .what, .xfer .amount { display: inline-flex; align-items: center; gap: 3px; white-space: nowrap; }
|
|
194
|
+
.xfer .what { color: var(--dim); }
|
|
195
|
+
.xfer svg.i { width: 13px; height: 13px; }
|
|
196
|
+
.xfer .bar { flex: 1; min-width: 40px; height: 3px; border-radius: 2px; background: var(--track); overflow: hidden; }
|
|
197
|
+
.xfer .bar span { display: block; height: 100%; border-radius: 2px; background: var(--accent); }
|
|
198
|
+
.xfer .bar.unknown span { width: 30%; opacity: .55; }
|
|
199
|
+
.xfer .amount { color: var(--accent); font-variant-numeric: tabular-nums; }
|
|
200
|
+
.xfer.stalled .bar span { background: var(--warn-dot); }
|
|
201
|
+
.xfer.stalled .amount { color: var(--warn); }
|
|
125
202
|
.steps .bars { display: flex; gap: 3px; flex: 1; }
|
|
126
203
|
.steps .bars span { flex: 1; height: 3px; border-radius: 2px; background: var(--track); }
|
|
127
204
|
.steps .bars span.done { background: var(--ok); }
|
|
@@ -140,30 +217,6 @@ svg.i { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-widt
|
|
|
140
217
|
.unverified-note .btn.link { display: inline; padding: 0; margin-left: 2px; font-size: inherit; }
|
|
141
218
|
.unverified-actions { margin-top: 6px; }
|
|
142
219
|
.stats { display: flex; padding: 12px 0; border-top: 0.5px solid var(--line); border-bottom: 0.5px solid var(--line); }
|
|
143
|
-
/* Markdown by rules not listed for its site: a dot beside 成功 and, pointed at, a card above the
|
|
144
|
-
counts (user, 2026-11-17: no yellow line for pages that were fine). */
|
|
145
|
-
.stats-wrap { position: relative; }
|
|
146
|
-
/* Pointing at the dot is not pointing at the count. */
|
|
147
|
-
.stats .stat:has(.rules-dot:hover) span { color: var(--dim); }
|
|
148
|
-
/* Up beside its label, taking no room: 成功, 失败 and 剩余 stay under their counts. */
|
|
149
|
-
.stats .stat > span { position: relative; }
|
|
150
|
-
.stats .rules-dot { position: absolute; left: 100%; top: -1px; margin-left: 3px; width: 6px; height: 6px; border-radius: 50%;
|
|
151
|
-
background: #8b9cf7; cursor: help; }
|
|
152
|
-
/* Its text in line with 成功 below: the card reaches past the counts by its own padding. */
|
|
153
|
-
.rules-pop { display: none; position: absolute; left: -11px; right: -11px; bottom: calc(100% + 6px); z-index: 5; padding: 9px 11px;
|
|
154
|
-
background: var(--bg); color: var(--fg); border-radius: 10px; font-size: 11.5px; line-height: 1.55;
|
|
155
|
-
/* Its edge drawn, not a border: a border pushed its text 1 px off 成功 (Windows, 2026-11-17). */
|
|
156
|
-
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); }
|
|
157
|
-
.rules-pop.show { display: block; }
|
|
158
|
-
/* The way down to the dot keeps it open. */
|
|
159
|
-
.rules-pop::after { content: ""; position: absolute; left: 0; right: 0; top: 100%; height: 8px; }
|
|
160
|
-
.rules-pop .h { display: flex; align-items: center; gap: 4px; font-weight: 600; font-size: 12px; margin-bottom: 2px; }
|
|
161
|
-
/* The heading's dot hangs in the margin: every line starts in line with 成功. */
|
|
162
|
-
.rules-pop .h i { width: 6px; height: 6px; border-radius: 50%; background: #8b9cf7; flex: none; margin-left: -10px; }
|
|
163
|
-
.rules-pop .r { color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
|
|
164
|
-
.rules-pop .r.counts { white-space: normal; }
|
|
165
|
-
.rules-pop .issue { display: block; margin-top: 6px; padding: 6px 0 0; width: 100%; text-align: left; border: none;
|
|
166
|
-
border-top: 0.5px solid var(--line); background: none; font: inherit; color: var(--accent); cursor: pointer; }
|
|
167
220
|
.stats div, .stats .stat { flex: 1; }
|
|
168
221
|
.stats .stat { padding: 0; border: none; background: none; font: inherit; color: inherit; text-align: left; cursor: pointer; }
|
|
169
222
|
.stats .stat:hover span, .stats .stat:focus-visible span { color: var(--accent); }
|
|
@@ -194,6 +247,25 @@ svg.i { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-widt
|
|
|
194
247
|
background: var(--hover); border: 0.5px solid var(--line); border-radius: 6px; padding: 0 8px; }
|
|
195
248
|
.settings input:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
|
|
196
249
|
.settings .err { color: var(--bad); font-size: 11px; text-align: right; margin: -6px 0 6px; }
|
|
250
|
+
/* 同时下载 (user, 2026-11-29): serial or parallel in two buttons; parallel, its two numbers on a light grey panel,
|
|
251
|
+
each with − and + about a box that takes typing, their units in a column of their own (subgrid) so the boxes line up. */
|
|
252
|
+
.settings .seg { display: inline-flex; border: 0.5px solid var(--line); border-radius: 7px; overflow: hidden; }
|
|
253
|
+
.settings .seg button { font: inherit; font-size: 12px; padding: 3px 11px; border: none; background: transparent; color: var(--dim); cursor: pointer; }
|
|
254
|
+
.settings .seg button.on { background: var(--accent); color: #fff; }
|
|
255
|
+
.settings .sub-panel { background: var(--fill); border-radius: 8px; padding: 0 10px; margin: -2px 0 8px;
|
|
256
|
+
display: grid; grid-template-columns: 1fr auto auto; column-gap: 6px; }
|
|
257
|
+
.settings .sub-row { display: grid; grid-column: 1 / -1; grid-template-columns: subgrid; align-items: center; padding: 6px 0; font-size: 12px; color: var(--dim); }
|
|
258
|
+
.settings .sub-row + .sub-row { border-top: 0.5px solid var(--line); }
|
|
259
|
+
.settings .stepper { display: inline-flex; align-items: center; height: 24px; border: 0.5px solid var(--line); border-radius: 6px; background: var(--bg); overflow: hidden; }
|
|
260
|
+
.settings .stepper button { width: 22px; height: 24px; border: none; background: none; color: var(--dim); font: inherit; font-size: 14px; line-height: 1; padding: 0; cursor: pointer; }
|
|
261
|
+
.settings .stepper button:disabled { color: var(--faint); cursor: default; }
|
|
262
|
+
.settings .stepper input { width: 30px; height: 24px; border: none; border-left: 0.5px solid var(--line); border-right: 0.5px solid var(--line); border-radius: 0; background: transparent; text-align: center; padding: 0; }
|
|
263
|
+
.settings .sub-panel + .err { margin-top: -4px; }
|
|
264
|
+
/* A tip of two columns, the left as wide as its words. */
|
|
265
|
+
.mini-tip.wide { white-space: normal; word-break: keep-all; width: max-content; max-width: 286px; }
|
|
266
|
+
.tip-grid { display: grid; grid-template-columns: max-content 1fr; column-gap: 10px; row-gap: 2px; }
|
|
267
|
+
.tip-grid .k { min-width: 0; }
|
|
268
|
+
.tip-after { margin-top: 4px; }
|
|
197
269
|
/* The check of system notifications under its switch: a test, and what to change when they do not show. */
|
|
198
270
|
#notify-test-button { margin-left: auto; margin-right: 10px; }
|
|
199
271
|
#notify-test-button .btn { padding: 2px 9px; }
|
|
@@ -221,6 +293,13 @@ svg.i { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-widt
|
|
|
221
293
|
.mini-wrap:hover .mini-tip, .mini-wrap:focus-within .mini-tip { display: block; }
|
|
222
294
|
.mini-tip b { font-weight: 600; }
|
|
223
295
|
.mini-tip .k { color: var(--dim); display: inline-block; min-width: 2em; }
|
|
296
|
+
/* A label's small info icon (失败后自动重试): its tip under the row, from its left, inside the window in every language. */
|
|
297
|
+
.tip-row { position: relative; }
|
|
298
|
+
.tip-label { display: inline-flex; align-items: center; }
|
|
299
|
+
/* Pointed at, only its note shows: the cursor stays an arrow, no question mark (user, 2026-11-24). */
|
|
300
|
+
.mini-wrap.info { position: static; margin-left: 4px; color: var(--faint); cursor: default; }
|
|
301
|
+
.mini-wrap.info svg.i { width: 14px; height: 14px; }
|
|
302
|
+
.mini-tip.left { right: auto; left: 0; top: calc(100% - 4px); }
|
|
224
303
|
.foot { display: flex; align-items: center; justify-content: space-between; padding-top: 12px; border-top: 0.5px solid var(--line); }
|
|
225
304
|
/* Settings: a home list of three pages, each row with its current values; then the page itself. */
|
|
226
305
|
.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);
|
|
@@ -231,6 +310,7 @@ svg.i { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-widt
|
|
|
231
310
|
.nav-row svg.i:last-child { color: var(--faint); }
|
|
232
311
|
.nav-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
|
|
233
312
|
.nav-sub { font-size: 11px; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
|
|
313
|
+
.nav-sub + .nav-sub { margin-top: 1px; }
|
|
234
314
|
.settings-note { font-size: 11px; color: var(--ok); margin-top: 8px; }
|
|
235
315
|
.key-group { font-size: 11px; color: var(--faint); margin: 12px 0 2px; }
|
|
236
316
|
/* The home page's last line (user, 2026-11-21): PaperSearch Pro, a blue link at its left; the language at its
|
|
@@ -346,6 +426,8 @@ svg.i { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-widt
|
|
|
346
426
|
.key-row.editing:hover .nav-title { color: inherit; }
|
|
347
427
|
.key-set { font-size: 12px; color: var(--ok); white-space: nowrap; }
|
|
348
428
|
.key-row .btn { pointer-events: none; }
|
|
429
|
+
/* What a service is for, whole: on a second line where a language says it longer, not cut (user, 2026-11-25). */
|
|
430
|
+
.key-row .nav-sub { white-space: normal; }
|
|
349
431
|
.key-edit { background: var(--hover); border-radius: 8px; padding: 8px 10px; margin: 0 0 6px; }
|
|
350
432
|
/* The school sign-in page (PaperSearch Pro): the schools saved, one the default for downloads, each with its
|
|
351
433
|
account; the fields beside their names, close together (user, 2026-11-20). */
|
|
@@ -355,9 +437,6 @@ svg.i { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-widt
|
|
|
355
437
|
.login-school { position: relative; border-radius: 10px; background: var(--fill); padding: 0 10px; }
|
|
356
438
|
.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; }
|
|
357
439
|
.login-school.add { background: none; border: 1px dashed color-mix(in srgb, var(--accent) 45%, transparent); }
|
|
358
|
-
/* The open card's head: no masked account (its field is under it), room kept for ⋯ before the chevron. */
|
|
359
|
-
.login-row .ls-end { flex: none; width: 0; margin-left: auto; }
|
|
360
|
-
.login-row .ls-end.with-menu { width: 24px; }
|
|
361
440
|
.ls-dots { position: absolute; right: 29px; top: 7px; width: 24px; height: 24px; margin: 0; border-radius: 6px; background: var(--hover); }
|
|
362
441
|
.ls-dots svg.i { width: 15px; height: 15px; }
|
|
363
442
|
.ls-menu { position: absolute; right: 29px; top: 34px; z-index: 6; min-width: 120px; padding: 4px 0; border-radius: 8px; background: var(--bg);
|
|
@@ -382,6 +461,13 @@ svg.i { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-widt
|
|
|
382
461
|
.settings .switch-row { border-top: none; border-bottom: 0.5px solid var(--line); }
|
|
383
462
|
.login-row .ls-acct { margin-left: auto; font-size: 11.5px; color: var(--dim); white-space: nowrap; }
|
|
384
463
|
.login-row svg.i { width: 13px; height: 13px; flex: none; color: var(--faint); }
|
|
464
|
+
/* A school's name whole (user, 2026-11-25, 乙): with its tags on one line where they fit, as before; where not (English and
|
|
465
|
+
French names, a long Chinese one) the name wraps and its tags go to the next line, not the name cut to "Hongmulan …". The
|
|
466
|
+
chevron, and on the open card the room for ⋯, stay at the top right. */
|
|
467
|
+
.ls-head { flex-wrap: wrap; row-gap: 4px; position: relative; padding-right: 20px; box-sizing: border-box; }
|
|
468
|
+
.ls-head.with-menu { padding-right: 49px; }
|
|
469
|
+
.ls-head > svg.i:last-child { position: absolute; right: 0; top: 13px; }
|
|
470
|
+
.login-row.ls-head .ls-name { flex: 0 1 auto; max-width: calc(100% - 18px); overflow: visible; white-space: normal; overflow-wrap: anywhere; }
|
|
385
471
|
.tag.fill { background: rgba(22, 163, 74, 0.12); color: var(--ok); }
|
|
386
472
|
.tag.trial { background: var(--hover); color: var(--accent); }
|
|
387
473
|
.tag.default { background: var(--accent); color: #fff; }
|
|
@@ -463,6 +549,11 @@ svg.i { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-widt
|
|
|
463
549
|
.login-add .err { text-align: left; margin: 6px 0 0; }
|
|
464
550
|
.login-add .err:empty { display: none; }
|
|
465
551
|
.settings .key-edit input { width: 100%; text-align: left; background: var(--bg); }
|
|
552
|
+
.key-field + .key-field { margin-top: 7px; }
|
|
553
|
+
.key-field label { display: block; margin-bottom: 3px; font-size: 11px; color: var(--dim); }
|
|
554
|
+
.key-input { position: relative; }
|
|
555
|
+
.key-input .iconbtn { position: absolute; right: 8px; top: 50%; margin: 0; transform: translateY(-50%); }
|
|
556
|
+
.settings .key-input input[data-secret] { padding-right: 30px; }
|
|
466
557
|
.key-note { font-size: 11px; line-height: 1.5; color: var(--dim); margin-bottom: 8px; }
|
|
467
558
|
.key-edit .err { text-align: left; margin: 6px 0 0; }
|
|
468
559
|
.key-edit .err:empty { display: none; }
|
|
@@ -471,6 +562,11 @@ svg.i { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-widt
|
|
|
471
562
|
.key-links, .key-actions { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
|
|
472
563
|
.key-actions { gap: 6px; }
|
|
473
564
|
.key-links .grow, .key-actions .grow { flex: 1; }
|
|
565
|
+
/* The editor's buttons on one line where they fit; where a language's words are longer (French on the Mac), 清除 取消 保存
|
|
566
|
+
together on the next line at the right, not cut off at the window's edge (user, 2026-11-25). */
|
|
567
|
+
.key-actions.wraps { flex-wrap: wrap; row-gap: 6px; }
|
|
568
|
+
.key-actions-end { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; margin-left: auto; }
|
|
569
|
+
.key-actions.wraps .btn { white-space: nowrap; }
|
|
474
570
|
.key-links .iconbtn { margin: 0; }
|
|
475
571
|
.iconbtn[aria-pressed="true"] { color: var(--accent); }
|
|
476
572
|
.strip { display: flex; align-items: center; gap: 6px; width: 100%; box-sizing: border-box; margin: 10px 0 2px; padding: 6px 10px;
|
|
@@ -491,6 +587,16 @@ svg.i { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-widt
|
|
|
491
587
|
.attention-head { display: flex; align-items: center; gap: 6px; margin-bottom: 14px; color: var(--fg); }
|
|
492
588
|
.attention-head b { flex: 1; font-size: 12px; }
|
|
493
589
|
#root.card.warn { background: var(--bg); }
|
|
590
|
+
/* 选择登录方式 (user, 2026-11-29): a sign-in chooser's ways, picked here, in a list of their own. */
|
|
591
|
+
.prompt.choose-head { cursor: default; }
|
|
592
|
+
.ways { margin-top: 10px; background: var(--bg); border: 0.5px solid var(--line); border-radius: 11px; overflow: hidden; }
|
|
593
|
+
.way-row { display: flex; align-items: center; gap: 10px; width: 100%; padding: 11px 12px; border: none; border-top: 0.5px solid var(--line);
|
|
594
|
+
background: none; font: inherit; font-size: 13px; color: var(--fg); text-align: left; cursor: pointer; }
|
|
595
|
+
.way-row:first-child { border-top: none; }
|
|
596
|
+
.way-row:hover { background: var(--hover); }
|
|
597
|
+
.way-row:disabled { cursor: default; color: var(--dim); background: none; }
|
|
598
|
+
.way-row span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
599
|
+
.way-row svg.i { width: 15px; height: 15px; color: var(--faint); }
|
|
494
600
|
|
|
495
601
|
/* The finished card: totals, failures by reason, what was saved. No text wraps. */
|
|
496
602
|
.done-stats { margin-top: 12px; }
|
|
@@ -617,12 +723,15 @@ const ICONS = {
|
|
|
617
723
|
check: '<circle cx="12" cy="12" r="9"/><path d="M8 12.5l2.8 2.8L16 9.5"/>',
|
|
618
724
|
alert: '<circle cx="12" cy="12" r="9"/><path d="M12 7.5v5.5M12 16.5v.01"/>',
|
|
619
725
|
minimize: '<path d="M6 12h12"/>',
|
|
726
|
+
info: '<circle cx="12" cy="12" r="9"/><path d="M12 11v5.5M12 7.5v.01"/>',
|
|
727
|
+
download: '<path d="M12 4v11"/><path d="M7.5 10.5L12 15l4.5-4.5"/><path d="M5 20h14"/>',
|
|
620
728
|
pin: '<path d="M8 4h8"/><path d="M9.5 4v5.5L7 13h10l-2.5-3.5V4"/><path d="M12 13v7"/>',
|
|
621
729
|
close: '<path d="M7 7l10 10M17 7L7 17"/>',
|
|
622
730
|
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"/>',
|
|
623
731
|
skip: '<path d="M6 6l8 6-8 6z"/><path d="M18 6v12"/>',
|
|
624
732
|
stop: '<rect x="6.5" y="6.5" width="11" height="11" rx="2"/>',
|
|
625
733
|
pause: '<path d="M9 6.5v11M15 6.5v11"/>',
|
|
734
|
+
clip: '<path d="M21 11.5l-8.6 8.6a5 5 0 0 1-7.1-7.1l8.6-8.6a3.4 3.4 0 0 1 4.8 4.8l-8.6 8.6a1.7 1.7 0 0 1-2.4-2.4l7.9-7.9"/>',
|
|
626
735
|
dots: '<circle cx="6" cy="12" r="1"/><circle cx="12" cy="12" r="1"/><circle cx="18" cy="12" r="1"/>',
|
|
627
736
|
left: '<path d="M15 6l-6 6 6 6"/>',
|
|
628
737
|
external: '<path d="M7 17L17 7M9 7h8v8"/>',
|
|
@@ -684,6 +793,8 @@ function appIcon(size, pro) {
|
|
|
684
793
|
+ '<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>';
|
|
685
794
|
}
|
|
686
795
|
const esc = (s) => String(s == null ? "" : s).replace(/[&<>"']/g, (c) => ({ "&": "&", "<": "<", ">": ">", '"': """, "'": "'" }[c]));
|
|
796
|
+
// The ring: the batch's progress in blue, one arc (user, 2026-11-24: its saved, failed and held parts in three colours
|
|
797
|
+
// were not pleasing; the counts say those).
|
|
687
798
|
function ring(pct, size, stroke, label) {
|
|
688
799
|
const r = (size - stroke) / 2, c = 2 * Math.PI * r, d = Math.max(0, Math.min(100, pct)) / 100 * c;
|
|
689
800
|
return '<svg class="ring" width="' + size + '" height="' + size + '" viewBox="0 0 ' + size + " " + size + '" aria-hidden="true">'
|
|
@@ -704,7 +815,7 @@ let flash = { text: "", until: 0 };
|
|
|
704
815
|
// 登录并继续 pressed: the held publishers then ({run, keys}); the button says so at once,
|
|
705
816
|
// as the papers go on only after the paper running, or within seconds (user, 2026-11-15).
|
|
706
817
|
let heldAsked = null;
|
|
707
|
-
let settings = null, settingsErrors = {}, notifyOn = true, hourlyNow = false;
|
|
818
|
+
let settings = null, settingsErrors = {}, notifyOn = true, hourlyNow = false, retryOn = false;
|
|
708
819
|
// What is typed on this settings page and not yet saved. Any redraw shows it instead of the
|
|
709
820
|
// saved value: a click on the card's background is a drag, and its end redraws the card
|
|
710
821
|
// (a typed hourly limit went back to the saved one, Windows, 2026-11-13).
|
|
@@ -829,7 +940,9 @@ function pill() {
|
|
|
829
940
|
if (v.mode === "attention") {
|
|
830
941
|
const a = v.attention;
|
|
831
942
|
return '<div class="pillrow icon-first capsule-drag-region">' + icon(a.login ? "lock" : "shield")
|
|
832
|
-
|
|
943
|
+
// 选择登录方式: the card with the ways, not the browser (user, 2026-11-29).
|
|
944
|
+
+ (a.ways ? '<button type="button" class="pill-prompt attention-target" data-act="expand" aria-label="选择登录方式">'
|
|
945
|
+
: '<button type="button" class="pill-prompt attention-target" data-act="show_browser" title="点击切到下载浏览器" aria-label="打开下载浏览器">')
|
|
833
946
|
+ '<b>' + esc(a.short) + '</b><span class="attention-countdown"></span></button></div>';
|
|
834
947
|
}
|
|
835
948
|
if (v.held_wait) {
|
|
@@ -845,8 +958,9 @@ function pill() {
|
|
|
845
958
|
+ (v.bad ? '<span class="dim">' + v.bad + " 篇失败</span>" : "") + "</div>";
|
|
846
959
|
}
|
|
847
960
|
if (v.mode === "running") {
|
|
848
|
-
|
|
849
|
-
|
|
961
|
+
// Papers listed: how many at once in the publisher's place.
|
|
962
|
+
const where = [v.part, papersAtOnce() ? "同时 " + v.papers.length + " 篇" : v.publisher].filter(Boolean).join(" · ");
|
|
963
|
+
return '<div class="pillrow capsule-drag-region">' + ring(v.pct, 24, 3, "")
|
|
850
964
|
+ '<span class="count">' + (v.total ? v.done + "/" + v.total : v.done) + "</span>"
|
|
851
965
|
+ (where ? '<span class="dim">' + esc(where) + "</span>" : "") + '<span class="dot"></span>'
|
|
852
966
|
+ ((v.held || []).length ? heldTag() : "") + "</div>";
|
|
@@ -860,18 +974,78 @@ function pinButton() {
|
|
|
860
974
|
+ '" title="' + (pinned ? "已钉住,点一下取消" : "钉住:鼠标移开也不收起") + '">' + icon("pin") + "</button>";
|
|
861
975
|
}
|
|
862
976
|
|
|
863
|
-
|
|
977
|
+
// ``note``: said for a moment in the place of the line under the title (the next school), over it, one line whatever its
|
|
978
|
+
// length: the line stays, unseen, so the card keeps its height (a long school name wrapped, or the line wrapped in
|
|
979
|
+
// another language, would move the window twice).
|
|
980
|
+
function header(title, sub, closable, note) {
|
|
864
981
|
// Only the ring and the texts drag the window; the buttons stay clickable.
|
|
865
982
|
return '<div class="head"><div class="drag capsule-drag-region">'
|
|
866
983
|
+ (V.mode === "running" || V.mode === "attention" ? ring(V.pct, 40, 4, V.pct + "%") : "")
|
|
867
|
-
+ '<div class="text"><div class="title">' + esc(title) + '</div>' + (sub ? '<div class="sub
|
|
984
|
+
+ '<div class="text"><div class="title">' + esc(title) + '</div>' + (sub ? '<div class="sub' + (note ? ' noted' : "") + '">' + (note
|
|
985
|
+
? '<span class="was">' + esc(sub) + '</span><span class="note" title="' + esc(note) + '">' + esc(note) + "</span>" : esc(sub)) + "</div>" : "")
|
|
986
|
+
+ "</div></div>"
|
|
868
987
|
+ '<div class="tools">' + pinButton()
|
|
869
988
|
+ '<button class="iconbtn' + (newerVersion() ? " has-dot" : "") + '" data-act="settings" aria-label="设置">' + icon("gear") + "</button>"
|
|
870
989
|
+ '<button class="iconbtn" data-act="' + (closable ? "close" : "minimize") + '" aria-label="' + (closable ? "关闭" : "最小化")
|
|
871
990
|
+ '" title="' + (closable ? "关闭" : "最小化到程序坞") + '">' + icon(closable ? "close" : "minimize") + "</button></div></div>";
|
|
872
991
|
}
|
|
873
992
|
|
|
993
|
+
// A file arriving, in the row of the paper's step: what it is (PDF, or a supplementary file's place among them),
|
|
994
|
+
// its share of its size, what has come (progress_view.transfer_view).
|
|
995
|
+
function transferRow(t) {
|
|
996
|
+
const tip = t.stalled ? t.said : t.name;
|
|
997
|
+
const share = t.share === null || t.share === undefined ? null : Math.max(2, Math.min(100, Number(t.share)));
|
|
998
|
+
return '<div class="xfer' + (t.stalled ? " stalled" : "") + '"' + (tip ? ' title="' + esc(tip) + '"' : "") + ">"
|
|
999
|
+
+ '<span class="what">' + (t.kind === "supplement" ? icon("clip") : "") + esc(t.label) + "</span>"
|
|
1000
|
+
+ '<div class="bar' + (share === null ? " unknown" : "") + '"><span' + (share === null ? "" : ' style="width:' + share + '%"') + "></span></div>"
|
|
1001
|
+
+ '<span class="amount">' + (t.stalled ? icon("pause") : "") + esc(t.amount) + "</span></div>";
|
|
1002
|
+
}
|
|
1003
|
+
|
|
1004
|
+
// A paper's step among its steps: the bars, done, now and to come, and the step's name.
|
|
1005
|
+
const stepsRow = (step, steps) => '<div class="steps"><div class="bars">' + steps.map((_, i) =>
|
|
1006
|
+
"<span" + (i < step.index ? ' class="done"' : i === step.index ? ' class="now"' : "") + "></span>").join("")
|
|
1007
|
+
+ '</div><span class="label">' + esc(step.label) + "</span></div>";
|
|
1008
|
+
|
|
1009
|
+
// 并行下载 (user, 2026-11-29): papers downloading at once, listed from two on (progress_view._papers); a prompt
|
|
1010
|
+
// picked from in the card itself (选择登录方式) is the card's.
|
|
1011
|
+
const papersAtOnce = () => (V.papers || []).length > 1 && !(V.attention && V.attention.ways)
|
|
1012
|
+
&& (V.mode !== "attention" || V.papers.some((p) => p.ask));
|
|
1013
|
+
let hoverRow = "", rowNote = null; // the row the pointer is on, the answer to a click on a row's button
|
|
1014
|
+
function paperRow(p, compact) {
|
|
1015
|
+
const said = rowNote && rowNote.current === p.current && Date.now() < rowNote.until ? rowNote.text : p.notice;
|
|
1016
|
+
const title = p.title || p.current;
|
|
1017
|
+
let right = "";
|
|
1018
|
+
if (p.ask) {
|
|
1019
|
+
right = '<span class="ask-tag">' + icon(p.ask.login ? "lock" : "shield") + "<span>" + esc(p.ask.short) + "</span>"
|
|
1020
|
+
+ (p.current === V.current ? '<span class="attention-countdown"></span>' : "") + "</span>";
|
|
1021
|
+
} else if (said) right = '<span class="row-note" title="' + esc(said) + '">' + esc(said) + "</span>";
|
|
1022
|
+
else if (p.transfer) right = transferRow(p.transfer);
|
|
1023
|
+
else if (p.step) right = stepsRow(p.step, p.steps);
|
|
1024
|
+
else if (p.line) right = '<span class="row-line" title="' + esc(p.line) + '">' + esc(p.line) + "</span>";
|
|
1025
|
+
// Its own 跳过 (a click on the row itself shows its browser; user's Mac, 2026-11-29: no 浏览器 button beside it).
|
|
1026
|
+
const tools = '<span class="row-tools"><button type="button" data-act="skip_item" data-current="' + esc(p.current)
|
|
1027
|
+
+ '" aria-label="跳过本篇">' + icon("skip") + "跳过</button></span>";
|
|
1028
|
+
// A click on the row shows its browser window, as the one paper's block does. No tooltip of the whole title (user's
|
|
1029
|
+
// Mac, 2026-11-29: "那个有点丑"; the paper's page in its window says it).
|
|
1030
|
+
return '<div class="pp' + (p.ask ? " asking" : "") + '" role="button" tabindex="0" data-act="show_browser" data-current="'
|
|
1031
|
+
+ esc(p.current) + '" aria-label="' + esc(title) + '">' + (compact ? "" : '<div class="t">' + esc(title) + "</div>")
|
|
1032
|
+
+ '<div class="s"><span class="j">' + esc(p.journal) + "</span>" + (compact ? '<span class="jt">' + esc(title) + "</span>" : "")
|
|
1033
|
+
+ right + tools + "</div></div>";
|
|
1034
|
+
}
|
|
1035
|
+
function paperRows() {
|
|
1036
|
+
const papers = V.papers, compact = papers.length > 2;
|
|
1037
|
+
return '<div class="paper listing"><div class="name"></div><div class="where"></div><div class="paper-status"></div>'
|
|
1038
|
+
+ '<div class="plist' + (compact ? " compact" : "") + (papers.length > (compact ? 4 : 2) ? " scrolls" : "") + '">'
|
|
1039
|
+
+ papers.map((p) => paperRow(p, compact)).join("") + "</div></div>";
|
|
1040
|
+
}
|
|
1041
|
+
// The list's edges with more beyond them, faded.
|
|
1042
|
+
function fadeEdges(list) {
|
|
1043
|
+
list.classList.toggle("more-below", list.scrollTop + list.clientHeight < list.scrollHeight - 2);
|
|
1044
|
+
list.classList.toggle("more-above", list.scrollTop > 2);
|
|
1045
|
+
}
|
|
1046
|
+
|
|
874
1047
|
function paperBlock() {
|
|
1048
|
+
if (papersAtOnce()) return paperRows();
|
|
875
1049
|
const v = V;
|
|
876
1050
|
const note = flash.text && Date.now() < flash.until ? flash.text : v.notice;
|
|
877
1051
|
// The paper being downloaded: a click shows its browser while it has one (user request, 2026-11-08).
|
|
@@ -885,10 +1059,10 @@ function paperBlock() {
|
|
|
885
1059
|
// The step or the lane's line in one row of its own height, there when neither is (see .paper-status); a line
|
|
886
1060
|
// longer than the row says the rest on hover.
|
|
887
1061
|
html += '<div class="paper-status">';
|
|
888
|
-
if (v.
|
|
889
|
-
html +=
|
|
890
|
-
|
|
891
|
-
|
|
1062
|
+
if (v.transfer) {
|
|
1063
|
+
html += transferRow(v.transfer);
|
|
1064
|
+
} else if (v.step) {
|
|
1065
|
+
html += stepsRow(v.step, v.steps);
|
|
892
1066
|
} else if (v.line) {
|
|
893
1067
|
html += '<div class="line" title="' + esc(v.line) + '">' + esc(v.line) + "</div>";
|
|
894
1068
|
}
|
|
@@ -906,7 +1080,8 @@ function actionsBlock() {
|
|
|
906
1080
|
+ (V.folder ? '<button class="btn link" data-act="folder">' + icon("folder") + "文件夹</button>" : "")
|
|
907
1081
|
+ '<span class="grow"></span>';
|
|
908
1082
|
if (V.actions) {
|
|
909
|
-
|
|
1083
|
+
// Papers listed: each row skips its own (on the row).
|
|
1084
|
+
html += (papersAtOnce() ? "" : '<button class="btn" data-act="skip_item">' + icon("skip") + "跳过</button>")
|
|
910
1085
|
+ '<button class="btn" data-act="confirm">' + icon("stop") + "终止</button>"
|
|
911
1086
|
// Only the problem report is left behind it: whether the school has access the download
|
|
912
1087
|
// finds itself, the "no access" marks are gone (user, 2026-11-16).
|
|
@@ -924,8 +1099,8 @@ function actionsBlock() {
|
|
|
924
1099
|
}
|
|
925
1100
|
|
|
926
1101
|
// A count opens its list of papers once the batch has sent them (user, 2026-11-10).
|
|
927
|
-
function stat(list, value, label, color
|
|
928
|
-
const inner = "<b" + (color ? ' style="color:' + color + '"' : "") + ">" + value + "</b><span>" + label +
|
|
1102
|
+
function stat(list, value, label, color) {
|
|
1103
|
+
const inner = "<b" + (color ? ' style="color:' + color + '"' : "") + ">" + value + "</b><span>" + label + "</span>";
|
|
929
1104
|
return V.lists && list ? '<button type="button" class="stat" data-act="papers" data-list="' + list + '">' + inner + "</button>"
|
|
930
1105
|
: "<div>" + inner + "</div>";
|
|
931
1106
|
}
|
|
@@ -956,38 +1131,20 @@ function heldBlock() {
|
|
|
956
1131
|
|
|
957
1132
|
// Pages from sites not yet supported this batch: the site (or how many), how their Markdown
|
|
958
1133
|
// went, and 查看 for those not kept, in the place of the held publishers' line (user, 2026-11-16).
|
|
959
|
-
//
|
|
960
|
-
//
|
|
961
|
-
//
|
|
962
|
-
//
|
|
963
|
-
//
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
const
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
const
|
|
971
|
-
|
|
972
|
-
}
|
|
973
|
-
function rulesCard() {
|
|
974
|
-
const s = rulesSites();
|
|
975
|
-
if (!s) return "";
|
|
976
|
-
const site = s.hosts.length === 1 ? s.hosts[0] : s.hosts.length + " 个网站";
|
|
977
|
-
// Whose rules were borrowed (user, 2026-11-17: "www.jacc.org · 采用 Atypon 规则").
|
|
978
|
-
const rules = s.rules && s.rules.length ? "采用 " + s.rules.join(" / ") + " 规则" : "没有适用的规则";
|
|
979
|
-
// Whether each one's Markdown came whole: only a complete one is saved.
|
|
980
|
-
const counts = ["完整已保存 " + s.saved + " 篇", "不完整未保存 " + s.unsaved + " 篇", s.skipped ? "未再尝试 " + s.skipped + " 篇" : ""]
|
|
981
|
-
.filter(Boolean).join(" · ");
|
|
982
|
-
// Saved or not, one way to have the site listed: the report goes with the issue (user, 2026-11-17).
|
|
983
|
-
const issue = '<button type="button" class="issue" data-act="markdown_issue">提 issue 纳入已登记网站</button>';
|
|
984
|
-
return '<div class="rules-pop' + (rulesShown ? " show" : "") + '"><div class="h"><i></i>' + esc(RULES_TITLE) + "</div>"
|
|
985
|
-
+ '<div class="r" title="' + esc(s.hosts.join("、")) + '">' + esc(site + " · " + rules) + '</div><div class="r counts">' + esc(counts) + "</div>" + issue + "</div>";
|
|
986
|
-
}
|
|
987
|
-
function showRules(on) {
|
|
988
|
-
rulesShown = on;
|
|
989
|
-
const pop = root.querySelector(".rules-pop");
|
|
990
|
-
if (pop) pop.classList.toggle("show", on);
|
|
1134
|
+
// The papers held for a later try (V.later: without access, for the next school; 原因不明, once more at the end; their
|
|
1135
|
+
// site blocked them, again at a time; their school login lapsed, after 登录并继续): 重试 beside
|
|
1136
|
+
// 成功 and 失败 on the running card, its list naming them by why; 剩余 those not started (user, 2026-11-24: in place of
|
|
1137
|
+
// the card the ring showed when pointed at). Without other saved schools (PaperSearch Pro) none waits for one.
|
|
1138
|
+
// A batch that may hold papers for a later try (失败后自动重试 on, or 没权限时换下一所学校 with another school; user,
|
|
1139
|
+
// 2026-11-24): otherwise no 重试, a paper paused for the school's login counted in 剩余.
|
|
1140
|
+
const holding = () => V.holds !== false;
|
|
1141
|
+
const retryCount = () => (holding() && V.later && V.later.total) || 0;
|
|
1142
|
+
// The list behind 重试 from the counts alone, when the papers' list does not name them (a caller that sends no DOIs).
|
|
1143
|
+
function retryCounts() {
|
|
1144
|
+
const later = V.later || {};
|
|
1145
|
+
const kinds = [["换学校再试 · 没权限", later.no_access], ["最后再试一次 · 原因不明", later.unexplained],
|
|
1146
|
+
[(later.blocked_at ? later.blocked_at + " 再试 · " : "") + "被网站拦截", later.blocked], ["登录后继续 · 学校登录中途失效", later.login]];
|
|
1147
|
+
return { count: retryCount(), groups: kinds.filter((kind) => kind[1] > 0).map(([label, count]) => ({ label, count, papers: [], counted: true })) };
|
|
991
1148
|
}
|
|
992
1149
|
|
|
993
1150
|
// Under the group of pages from sites not yet supported: what that means, the sites with
|
|
@@ -1010,15 +1167,44 @@ function runningCard() {
|
|
|
1010
1167
|
// paper; once 登录并继续 is pressed, what comes next (user, 2026-11-15).
|
|
1011
1168
|
const asked = v.held_wait && resumeAsked();
|
|
1012
1169
|
const paper = v.held_wait ? '<div class="paper"><div class="line">' + esc(asked ? "如需登录,会打开学校登录页" : v.line) + "</div></div>" : paperBlock();
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1170
|
+
// Papers listed: how many at once, and an answer to a click on the card in the line under it (no paper's line to say it).
|
|
1171
|
+
const listed = !v.held_wait && papersAtOnce();
|
|
1172
|
+
const title = asked ? "正在继续下载" : listed ? "同时下载 " + v.papers.length + " 篇" : v.headline;
|
|
1173
|
+
const note = listed && flash.text && Date.now() < flash.until ? flash.text : v.switch_note;
|
|
1174
|
+
return '<div class="card-body">' + header(title, sub, false, note) + paper + heldBlock()
|
|
1175
|
+
+ '<div class="stats">' + stat("ok", v.ok, "成功", "var(--ok)")
|
|
1176
|
+
+ stat("failed", v.bad, "失败", "var(--bad)")
|
|
1177
|
+
+ (holding() ? stat(retryCount() ? "retry" : "", retryCount(), "重试", retryCount() ? "var(--warn-dot)" : "") : "")
|
|
1178
|
+
+ stat("left", v.left == null ? "—" : Math.max(0, v.left - retryCount()), "剩余") + "</div>"
|
|
1017
1179
|
+ actionsBlock() + "</div>";
|
|
1018
1180
|
}
|
|
1019
1181
|
|
|
1182
|
+
// A way's name without the school's, the card's line saying it already ("Hongmulan University - Staff": "Staff").
|
|
1183
|
+
function wayName(way, school) {
|
|
1184
|
+
const rest = school && way.startsWith(school) ? way.slice(school.length) : "";
|
|
1185
|
+
return /^\s*[-–—::|]\s*\S/.test(rest) ? rest.replace(/^\s*[-–—::|]\s*/, "") : way;
|
|
1186
|
+
}
|
|
1187
|
+
// 选择登录方式 (user, 2026-11-29): the ways a sign-in chooser offers, one picked here; pressed in the browser by the
|
|
1188
|
+
// download and kept for the school, so asked once a school.
|
|
1189
|
+
function chooseCard() {
|
|
1190
|
+
const a = V.attention, picked = wayPicked === V.current + "|" + (a.school || "");
|
|
1191
|
+
let html = '<div class="card-body"><div class="attention-head capsule-drag-region"><b>PaperSearch</b>'
|
|
1192
|
+
+ '<div class="tools">' + pinButton()
|
|
1193
|
+
+ '<button class="iconbtn" data-act="minimize" aria-label="最小化">' + icon("minimize") + '</button>'
|
|
1194
|
+
+ '<button class="iconbtn" data-act="close" aria-label="关闭">' + icon("close") + '</button></div></div>'
|
|
1195
|
+
+ '<div class="prompt attention-target choose-head">' + icon("lock")
|
|
1196
|
+
+ '<div class="attention-copy"><div class="t">' + esc(a.short) + '</div><div class="s">' + esc(a.school || "") + '</div></div></div>'
|
|
1197
|
+
+ '<div class="ways">' + a.ways.map((way, i) => '<button type="button" class="way-row" data-act="choose_way" data-way="' + i + '"'
|
|
1198
|
+
+ (picked ? " disabled" : "") + '><span>' + esc(wayName(way, a.school || "")) + '</span>' + icon("right") + '</button>').join("") + '</div>';
|
|
1199
|
+
html += '<div class="actions"><button class="iconbtn' + (newerVersion() ? " has-dot" : "") + '" data-act="settings" aria-label="设置">' + icon("gear")
|
|
1200
|
+
+ '</button><span class="grow"></span>';
|
|
1201
|
+
if (V.actions) html += '<button class="btn" data-act="skip_item">跳过本篇</button><button class="btn" data-act="confirm">终止</button>';
|
|
1202
|
+
return html + "</div></div>";
|
|
1203
|
+
}
|
|
1204
|
+
|
|
1020
1205
|
function attentionCard() {
|
|
1021
1206
|
const a = V.attention;
|
|
1207
|
+
if (a.ways) return chooseCard();
|
|
1022
1208
|
const title = a.short;
|
|
1023
1209
|
let html = '<div class="card-body"><div class="attention-head capsule-drag-region"><b>PaperSearch</b>'
|
|
1024
1210
|
+ '<div class="tools">' + pinButton()
|
|
@@ -1036,8 +1222,9 @@ function attentionCard() {
|
|
|
1036
1222
|
return html + "</div></div>";
|
|
1037
1223
|
}
|
|
1038
1224
|
|
|
1039
|
-
// The five failure classes by the names PaperSearch gives them everywhere (failureClass.ts, 2026-11-22
|
|
1040
|
-
|
|
1225
|
+
// The five failure classes by the names PaperSearch gives them everywhere (failureClass.ts, 2026-11-22;
|
|
1226
|
+
// 待适配 was 暂不支持 until 2026-11-25).
|
|
1227
|
+
const CLASS_TAGS = { no_access: "没权限", user_side: "要你处理", external: "外部原因", unsupported: "待适配",
|
|
1041
1228
|
unexplained: "原因不明", other: "其他", doubt: "待核对" };
|
|
1042
1229
|
let openGroups = null, groupsRun = ""; // null: each reason row as the view opens it
|
|
1043
1230
|
// Main-text rows first, then the supplementary files' rows, numbered on.
|
|
@@ -1077,6 +1264,7 @@ function reasonRow(g, i, brief) {
|
|
|
1077
1264
|
function doneCard() {
|
|
1078
1265
|
const v = V, s = v.summary;
|
|
1079
1266
|
let html = '<div class="card-body">' + header(v.headline, v.total ? "共 " + v.total + " 篇" : "", true)
|
|
1267
|
+
// 成功 green, as on the running card (user, 2026-11-24: the ring alone is blue, the batch's progress).
|
|
1080
1268
|
+ '<div class="stats done-stats">' + stat("ok", v.ok, "成功", "var(--ok)") + stat("failed", v.bad, "失败", v.bad ? "var(--bad)" : "")
|
|
1081
1269
|
// Papers the stop left undone in place of the time: their list opens from it (user, 2026-11-16).
|
|
1082
1270
|
+ (v.stopped ? stat("left", v.stopped, "已终止") : stat("", esc(v.elapsed || "—"), "用时")) + "</div>";
|
|
@@ -1113,15 +1301,21 @@ function doneCard() {
|
|
|
1113
1301
|
}
|
|
1114
1302
|
|
|
1115
1303
|
// The list behind a count: its groups (by way, by reason, by lane), each opened on its own.
|
|
1116
|
-
const LIST_TITLES = { ok: "成功", failed: "失败", left: "剩余" };
|
|
1304
|
+
const LIST_TITLES = { ok: "成功", failed: "失败", retry: "重试", left: "剩余" };
|
|
1117
1305
|
let papersKind = "", papersList = null, listOpen = null;
|
|
1118
|
-
function shownList() {
|
|
1306
|
+
function shownList() {
|
|
1307
|
+
const list = (papersList || {})[papersKind];
|
|
1308
|
+
if (papersKind === "retry" && !(list && list.groups.length) && retryCount()) return retryCounts();
|
|
1309
|
+
return list || { count: 0, groups: [] };
|
|
1310
|
+
}
|
|
1119
1311
|
function listGroupOpen(i) { return listOpen ? listOpen.has(i) : !!(shownList().groups[i] || {}).open; }
|
|
1120
1312
|
async function loadPapers() {
|
|
1121
1313
|
try { papersList = await api().paper_lists(); } catch (e) { papersList = papersList || {}; }
|
|
1122
1314
|
}
|
|
1123
1315
|
|
|
1124
1316
|
function listRow(g, i) {
|
|
1317
|
+
// 重试 from its counts alone: a line for each why, nothing to open.
|
|
1318
|
+
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>";
|
|
1125
1319
|
const opened = listGroupOpen(i);
|
|
1126
1320
|
const unverified = g.unverified && shownList().groups.findIndex((other, j) => other.unverified && listGroupOpen(j)) === i;
|
|
1127
1321
|
let html = '<div class="grp"><button type="button" class="row" data-act="list_group" data-group="' + i + '" aria-expanded="' + opened + '">'
|
|
@@ -1136,7 +1330,7 @@ function listRow(g, i) {
|
|
|
1136
1330
|
if (papersKind === "ok") {
|
|
1137
1331
|
return '<li><button type="button" class="open-article" data-act="show_paper" data-index="' + p.index + '" title="打开所在文件夹">' + lines + "</button></li>";
|
|
1138
1332
|
}
|
|
1139
|
-
if ((papersKind === "failed" || papersKind === "left") && p.doi) {
|
|
1333
|
+
if ((papersKind === "failed" || papersKind === "retry" || papersKind === "left") && p.doi) {
|
|
1140
1334
|
return '<li><button type="button" class="open-article" data-act="open_article" data-doi="' + esc(p.doi)
|
|
1141
1335
|
+ '" title="在浏览器打开这篇文章">' + lines + "</button></li>";
|
|
1142
1336
|
}
|
|
@@ -1185,9 +1379,11 @@ function taskStrip() {
|
|
|
1185
1379
|
+ '<span class="grow">请重新登录学校</span><span>去处理 ›</span></button>';
|
|
1186
1380
|
}
|
|
1187
1381
|
if (V.mode === "running") {
|
|
1188
|
-
|
|
1382
|
+
// A download icon for 正在下载 and an arrow for 返回进度: the publisher's name has the room in every language (user, 2026-11-24:
|
|
1383
|
+
// "Downloading 11/71 · Spri… Back to progress ›"; its words on pointing at it).
|
|
1384
|
+
return '<button type="button" class="strip" data-act="progress" title="返回进度">' + icon("download") + '<span class="grow">'
|
|
1189
1385
|
+ esc(V.total ? V.done + "/" + V.total : V.done) + (V.publisher ? " · " + esc(V.publisher) : "")
|
|
1190
|
-
+ "</span><span
|
|
1386
|
+
+ "</span><span>›</span></button>";
|
|
1191
1387
|
}
|
|
1192
1388
|
return "";
|
|
1193
1389
|
}
|
|
@@ -1212,10 +1408,30 @@ const field = (name) => settings.fields.find((f) => f.name === name);
|
|
|
1212
1408
|
// The user's own folder as ~ on the home page's line (user, 2026-11-21: /Users/<name>/Downloads and the hourly limit
|
|
1213
1409
|
// did not fit one line in English); the download page shows the folder whole.
|
|
1214
1410
|
const shortPath = (path) => String(path || "").replace(/^(?:\/Users\/[^/]+|\/home\/[^/]+|[A-Za-z]:\\Users\\[^\\]+)(?=[\/\\]|$)/, "~");
|
|
1411
|
+
// The folder on its line whole when it fits; else its middle folders left out, the first ones first, then all but its
|
|
1412
|
+
// own name (user, 2026-11-24, 乙: D:\Project-XY\References). Measured once the page is drawn, at the card's own width.
|
|
1413
|
+
function fitPaths(node) {
|
|
1414
|
+
node.querySelectorAll(".nav-sub[data-path]").forEach((line) => {
|
|
1415
|
+
const whole = line.dataset.path;
|
|
1416
|
+
const sep = whole.includes("\\") ? "\\" : "/";
|
|
1417
|
+
const path = whole.length > 3 ? whole.replace(/[\\/]+$/, "") : whole;
|
|
1418
|
+
const parts = path.split(sep), head = parts[0], last = parts[parts.length - 1], middle = parts.slice(1, -1);
|
|
1419
|
+
const tries = [path];
|
|
1420
|
+
for (let k = 1; k <= middle.length; k++) tries.push([head, "…", ...middle.slice(k), last].join(sep));
|
|
1421
|
+
if (parts.length > 1) tries.push("…" + sep + last);
|
|
1422
|
+
for (const each of tries) {
|
|
1423
|
+
line.textContent = each;
|
|
1424
|
+
if (line.scrollWidth <= line.clientWidth) return;
|
|
1425
|
+
}
|
|
1426
|
+
});
|
|
1427
|
+
}
|
|
1215
1428
|
function settingsHome() {
|
|
1216
1429
|
const hourly = field("hourly"), login = field("login");
|
|
1217
1430
|
const rows = [
|
|
1218
|
-
|
|
1431
|
+
// Two lines (user, 2026-11-29): the folder; the hourly limit and serial or parallel, which fit one line in each
|
|
1432
|
+
// language without 同时下载's own words.
|
|
1433
|
+
["download", "folder", "下载", [shortPath(settings.download_dir)], "", true,
|
|
1434
|
+
[[hourly ? "每家每小时 " + hourly.value + " 篇" : "", parallelLine()].filter(Boolean).join(" · ")]],
|
|
1219
1435
|
["wait", "clock", "等待和提醒", [login ? "登录页 " + login.value + " 秒" : "", "系统通知" + (notifyOn ? "开" : "关")]],
|
|
1220
1436
|
["keys", "key", "API key", [apiKeys && apiKeys.ok ? "已填 " + apiKeys.filled + "/" + apiKeys.total : ""]],
|
|
1221
1437
|
];
|
|
@@ -1241,12 +1457,15 @@ function languageMenu() {
|
|
|
1241
1457
|
+ '<div class="lang-more">' + esc("更多语言陆续加入") + "</div></div>" : "") + "</span>";
|
|
1242
1458
|
}
|
|
1243
1459
|
|
|
1244
|
-
// A row that opens a page: its icon, its name, what it holds now.
|
|
1245
|
-
function navRow([page, glyph, title, sub, badge]) {
|
|
1460
|
+
// A row that opens a page: its icon, its name, what it holds now (``more``: lines of their own under it).
|
|
1461
|
+
function navRow([page, glyph, title, sub, badge, folderFirst, more]) {
|
|
1462
|
+
// folderFirst: its line is a folder, fitted to the line once drawn (fitPaths).
|
|
1463
|
+
const fitted = folderFirst && sub[0] ? ' data-path="' + esc(sub[0]) + '"' : "";
|
|
1246
1464
|
return '<button type="button" class="nav-row" data-act="settings_page" data-page="' + page + '">' + (glyph === "pro-app" ? appIcon(16, true) : icon(glyph))
|
|
1247
1465
|
+ '<span class="nav-text"><span class="nav-title">' + esc(title)
|
|
1248
|
-
+ (badge ? '<span class="pro-pill feature">' + esc(badge) + "</span>" : "") + '</span><span class="nav-sub">
|
|
1249
|
-
+ esc(sub.filter(Boolean).join(" · ")) + "</span
|
|
1466
|
+
+ (badge ? '<span class="pro-pill feature">' + esc(badge) + "</span>" : "") + '</span><span class="nav-sub"' + fitted + ">"
|
|
1467
|
+
+ esc(sub.filter(Boolean).join(" · ")) + "</span>"
|
|
1468
|
+
+ (more || []).filter(Boolean).map((line) => '<span class="nav-sub">' + esc(line) + "</span>").join("") + "</span>" + icon("right") + "</button>";
|
|
1250
1469
|
}
|
|
1251
1470
|
|
|
1252
1471
|
function fieldRows(page) {
|
|
@@ -1276,11 +1495,54 @@ function settingsDownload() {
|
|
|
1276
1495
|
+ '<button class="btn" data-act="choose_folder">选择…</button></div>'
|
|
1277
1496
|
+ '<div class="hint">用于后续下载;命令中指定路径时优先使用指定路径。</div>'
|
|
1278
1497
|
+ (settingsErrors.download_dir ? '<div class="err">' + esc(settingsErrors.download_dir) + '</div>' : '') + '</div>'
|
|
1279
|
-
+ fieldRows("download") + settingsFoot();
|
|
1498
|
+
+ fieldRows("download") + concurrencyRows() + settingsFoot();
|
|
1499
|
+
}
|
|
1500
|
+
|
|
1501
|
+
// 同时下载 (user, 2026-11-29): serial by default; parallel, how many publishers at once (不同出版社) and how many papers
|
|
1502
|
+
// of one publisher at once (同一出版社), at least 1 each and no upper bound. What they mean in the tip on its small icon,
|
|
1503
|
+
// not on the page. Saved with 保存, like the page's other values.
|
|
1504
|
+
const parallelDraft = () => ("parallel" in settingsDraft ? settingsDraft.parallel : settings.parallel === true);
|
|
1505
|
+
const fieldDraft = (name) => { const f = field(name); return f ? String(name in settingsDraft ? settingsDraft[name] : f.value) : "1"; };
|
|
1506
|
+
// The home page's line: 串行, or the publishers at once.
|
|
1507
|
+
const parallelLine = () => !field("pubs") ? "" : settings.parallel === true
|
|
1508
|
+
? "并行," + field("pubs").value + " 家 × " + (field("each") ? field("each").value : 1) + " 篇" : "串行";
|
|
1509
|
+
function stepper(name) {
|
|
1510
|
+
const value = fieldDraft(name), f = field(name);
|
|
1511
|
+
return '<span class="stepper"><button type="button" data-act="step" data-field-step="' + esc(name) + '" data-delta="-1"'
|
|
1512
|
+
+ (!(Number(value) > 1) ? " disabled" : "") + ' aria-label="减少">−</button>'
|
|
1513
|
+
+ '<input data-field="' + esc(name) + '" value="' + esc(value) + '" inputmode="numeric" aria-label="' + esc(f ? f.label : name) + '">'
|
|
1514
|
+
+ '<button type="button" data-act="step" data-field-step="' + esc(name) + '" data-delta="1" aria-label="增加">+</button></span>';
|
|
1515
|
+
}
|
|
1516
|
+
function concurrencyRows() {
|
|
1517
|
+
if (!field("pubs") || !field("each")) return "";
|
|
1518
|
+
const parallel = parallelDraft();
|
|
1519
|
+
// English and French say no unit after 不同出版社's number (user, 2026-11-29); its column stays, so the boxes line up.
|
|
1520
|
+
const unit = (name) => (name === "pubs" && ["en", "fr"].includes(lang) ? "" : field(name).unit);
|
|
1521
|
+
const sub = (name) => '<div class="sub-row"><span>' + esc(field(name).label) + "</span>" + stepper(name)
|
|
1522
|
+
+ "<span>" + esc(unit(name)) + "</span></div>";
|
|
1523
|
+
const errors = ["pubs", "each"].filter((name) => settingsErrors[name]).map((name) => '<div class="err">' + esc(settingsErrors[name]) + "</div>").join("");
|
|
1524
|
+
return '<div class="row tip-row"><span class="tip-label">同时下载<span class="mini-wrap info" tabindex="0" aria-label="说明">' + icon("info")
|
|
1525
|
+
+ '<span class="mini-tip left wide" role="tooltip"><div class="tip-grid">'
|
|
1526
|
+
+ '<span class="k">串行</span><span>逐篇下载</span>'
|
|
1527
|
+
+ '<span class="k">并行</span><span>同时下载 = 出版社数 × 每家篇数</span>'
|
|
1528
|
+
+ "<span></span><span>例:2 家 × 1 篇 = 同时下载 2 篇</span></div>"
|
|
1529
|
+
+ '<div class="tip-after">并行数越多,触发风控风险越高,建议合理设置</div></span></span></span>'
|
|
1530
|
+
+ '<span class="seg" role="radiogroup" aria-label="同时下载">'
|
|
1531
|
+
+ '<button type="button" role="radio" data-act="parallel_mode" data-mode="serial" aria-checked="' + !parallel + '"' + (parallel ? "" : ' class="on"') + ">串行</button>"
|
|
1532
|
+
+ '<button type="button" role="radio" data-act="parallel_mode" data-mode="parallel" aria-checked="' + parallel + '"' + (parallel ? ' class="on"' : "") + ">并行</button></span></div>"
|
|
1533
|
+
+ (parallel ? '<div class="sub-panel">' + sub("pubs") + sub("each") + "</div>" + errors : "");
|
|
1534
|
+
}
|
|
1535
|
+
|
|
1536
|
+
// 失败后自动重试 (user, 2026-11-24): off by default; what it retries in a tip on its small icon, not on the page.
|
|
1537
|
+
function retryRow() {
|
|
1538
|
+
return '<div class="row tip-row"><span class="tip-label">失败后自动重试<span class="mini-wrap info" tabindex="0" aria-label="说明">' + icon("info")
|
|
1539
|
+
+ '<span class="mini-tip left" role="tooltip"><div>原因不明的失败,最后再重试</div><div>被网站拦截的,10 分钟后再重试</div></span></span></span>'
|
|
1540
|
+
+ '<button class="switch' + (retryOn ? " on" : "") + '" data-act="retry" role="switch" aria-checked="' + retryOn
|
|
1541
|
+
+ '" aria-label="失败后自动重试"></button></div>' + (settingsErrors.retry ? '<div class="err">' + esc(settingsErrors.retry) + "</div>" : "");
|
|
1280
1542
|
}
|
|
1281
1543
|
|
|
1282
1544
|
function settingsWait() {
|
|
1283
|
-
return settingsHead("等待和提醒") + fieldRows("wait")
|
|
1545
|
+
return settingsHead("等待和提醒") + fieldRows("wait") + retryRow()
|
|
1284
1546
|
+ '<div class="row"><span>需要处理时发系统通知</span><span id="notify-test-button">' + notifyTestButton() + "</span>"
|
|
1285
1547
|
+ '<button class="switch' + (notifyOn ? " on" : "")
|
|
1286
1548
|
+ '" data-act="notify" role="switch" aria-checked="' + notifyOn + '" aria-label="系统通知"></button></div>'
|
|
@@ -1291,32 +1553,43 @@ function settingsWait() {
|
|
|
1291
1553
|
function keyRow(s) {
|
|
1292
1554
|
const name = '<span class="nav-text"><span class="nav-title">' + esc(s.name) + "</span>"
|
|
1293
1555
|
+ (s.use ? '<span class="nav-sub">' + esc(s.use) + "</span>" : "") + "</span>";
|
|
1556
|
+
const hasValues = s.keys.some((k) => k.set);
|
|
1294
1557
|
if (editing !== s.id) {
|
|
1295
1558
|
return '<button type="button" class="key-row" data-act="edit_key" data-service="' + esc(s.id) + '">' + name
|
|
1296
|
-
+ (s.set ? '<span class="key-set">' + esc(s.masked) + "</span>"
|
|
1559
|
+
+ (s.set ? '<span class="key-set">' + esc(s.masked) + "</span>"
|
|
1560
|
+
: '<span class="btn">' + (hasValues ? "补全" : "填写") + "</span>") + "</button>";
|
|
1297
1561
|
}
|
|
1298
1562
|
let html = '<div class="key-row editing">' + name
|
|
1299
|
-
+ (s.set ? '<span class="key-set">' + esc(s.masked) + "</span>"
|
|
1563
|
+
+ (s.set ? '<span class="key-set">' + esc(s.masked) + "</span>"
|
|
1564
|
+
: '<span class="dim" style="font-size:12px">' + (hasValues ? "待补全" : "未填") + "</span>")
|
|
1300
1565
|
+ '</div><div class="key-edit">';
|
|
1301
1566
|
// A saved key is in its field, hidden until the eye shows it.
|
|
1302
1567
|
// A contact email: what it is for above its field, and the field in plain text (user, 2026-11-11).
|
|
1303
1568
|
const emails = s.keys.every((k) => k.kind === "email");
|
|
1569
|
+
const labeled = s.keys.some((k) => k.kind === "zone");
|
|
1570
|
+
const eye = '<button class="iconbtn" data-act="reveal" aria-label="显示 key" aria-pressed="' + revealed + '">' + icon("eye") + "</button>";
|
|
1304
1571
|
if (s.note) html += '<div class="key-note">' + esc(s.note) + "</div>";
|
|
1305
1572
|
for (const k of s.keys) {
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1573
|
+
const id = "key-" + esc(k.key);
|
|
1574
|
+
const secret = k.kind !== "email" && k.kind !== "zone";
|
|
1575
|
+
const placeholder = k.kind === "zone" ? "填入“我的API”中的“名称”" : k.kind === "email" ? "填你常用的邮箱" : k.kind === "url" ? "服务地址" : "粘贴 key";
|
|
1576
|
+
if (labeled) html += '<div class="key-field"><label for="' + id + '">' + esc(k.label) + '</label><div class="key-input">';
|
|
1577
|
+
html += '<input id="' + id + '" data-key="' + esc(k.key) + '"' + (secret ? ' data-secret' : '')
|
|
1578
|
+
+ ' type="' + (secret && !revealed ? "password" : "text") + '" value="' + esc(editValues[k.key] || "")
|
|
1579
|
+
+ '" autocomplete="off" spellcheck="false"' + (labeled ? "" : ' aria-label="' + esc(s.name + " " + k.label) + '"')
|
|
1580
|
+
+ ' placeholder="' + placeholder + '">';
|
|
1581
|
+
if (labeled) html += (secret ? eye : "") + "</div></div>";
|
|
1309
1582
|
}
|
|
1310
1583
|
return html + '<div class="key-links">'
|
|
1311
1584
|
+ '<button class="btn link" data-act="signup" data-service="' + esc(s.id) + '">' + esc(s.signup_label || "去申请") + icon("external") + "</button>"
|
|
1312
1585
|
+ (s.guide ? '<button class="btn link" data-act="guide" data-service="' + esc(s.id) + '">' + esc(s.guide_label || "教程") + icon("external") + "</button>" : "")
|
|
1313
1586
|
+ '<span class="grow"></span>'
|
|
1314
|
-
+ (emails ? "" :
|
|
1315
|
-
+ '<div class="err" id="key-error" role="status"></div><div class="key-actions">'
|
|
1316
|
-
+ '<button class="btn" data-act="test_key" data-service="' + esc(s.id) + '">测试</button><span class="
|
|
1317
|
-
+ (
|
|
1587
|
+
+ (emails || labeled ? "" : eye) + "</div>"
|
|
1588
|
+
+ '<div class="err" id="key-error" role="status"></div><div class="key-actions wraps">'
|
|
1589
|
+
+ '<button class="btn" data-act="test_key" data-service="' + esc(s.id) + '">测试</button><span class="key-actions-end">'
|
|
1590
|
+
+ (hasValues ? '<button class="btn danger" data-act="clear_key" data-service="' + esc(s.id) + '">清除</button>' : "")
|
|
1318
1591
|
+ '<button class="btn" data-act="cancel_key">取消</button>'
|
|
1319
|
-
+ '<button class="btn primary" data-act="save_key" data-service="' + esc(s.id) + '">保存</button></div></div>';
|
|
1592
|
+
+ '<button class="btn primary" data-act="save_key" data-service="' + esc(s.id) + '">保存</button></span></div></div>';
|
|
1320
1593
|
}
|
|
1321
1594
|
|
|
1322
1595
|
function settingsKeys() {
|
|
@@ -1393,13 +1666,13 @@ const PRO_KEEPS = [["photo", "图片"], ["table", "表格"], ["formula", "公式
|
|
|
1393
1666
|
// said in full.
|
|
1394
1667
|
const PRO_MERITS = [
|
|
1395
1668
|
["file", "出版社原文", "取自出版社网页或 XML,不从 PDF 识别:章节、图注、表格(含合并单元格)和 LaTeX 公式按原文还原,避免识别错误。"],
|
|
1396
|
-
["check", "
|
|
1669
|
+
["check", "缺失会标明", "表格有缺失就不生成;图片没下到的在批量最后再取一次,仍缺就在原位置标明,清单里写明缺哪张图。"],
|
|
1397
1670
|
["link", "来源可追溯", "每篇保留出版社原始网页或 XML,以及来源清单:来源地址、DOI 核对结果和获取时间。"],
|
|
1398
1671
|
];
|
|
1399
1672
|
function proMerits() {
|
|
1400
1673
|
return '<button type="button" class="nav-row pro-row" data-act="pro_merits" aria-expanded="' + proMeritsOpen + '">' + icon("shield")
|
|
1401
1674
|
+ '<span class="nav-text"><span class="nav-title">' + esc("三项特点") + '</span><span class="nav-sub">'
|
|
1402
|
-
+ esc("出版社原文 ·
|
|
1675
|
+
+ esc("出版社原文 · 缺失会标明 · 来源可追溯") + "</span></span>" + icon(proMeritsOpen ? "down" : "right") + "</button>"
|
|
1403
1676
|
+ (proMeritsOpen ? '<div class="pro-merits">' + PRO_MERITS.map(([glyph, title, said]) => '<div class="pro-merit">' + icon(glyph)
|
|
1404
1677
|
+ "<div><b>" + esc(title) + "</b><span>" + esc(said) + "</span></div></div>").join("") + "</div>" : "");
|
|
1405
1678
|
}
|
|
@@ -1592,19 +1865,24 @@ function settingsMarkdown() {
|
|
|
1592
1865
|
}
|
|
1593
1866
|
|
|
1594
1867
|
// The school sign-in page (PaperSearch Pro): the schools saved, each with its account, filled in on the
|
|
1595
|
-
// school's own login page
|
|
1868
|
+
// school's own login page, tested or not (user, 2026-11-28: the tag only says whether Pro has tested it, 已验证 or
|
|
1869
|
+
// 未验证; what keeps a school from being filled in is told during the download); one of them the default for downloads, switched
|
|
1596
1870
|
// here; another added by finding it in the federations' lists, in any language (user, 2026-11-20). The saved
|
|
1597
1871
|
// password in its field, hidden until the eye shows it (the user's: they may see it).
|
|
1598
1872
|
function schoolTag(status) {
|
|
1599
|
-
if (status === "verified" || status === "surveyed") return ["fill", "
|
|
1600
|
-
|
|
1601
|
-
if (status === "check") return ["check", "需自己登录"];
|
|
1602
|
-
return ["none", "暂不支持"];
|
|
1873
|
+
if (status === "verified" || status === "surveyed") return ["fill", "已验证"];
|
|
1874
|
+
return ["none", "未验证"];
|
|
1603
1875
|
}
|
|
1604
1876
|
function tagHtml(status) {
|
|
1605
1877
|
const [cls, text] = schoolTag(status);
|
|
1606
1878
|
return '<span class="tag ' + cls + '">' + esc(text) + "</span>";
|
|
1607
1879
|
}
|
|
1880
|
+
function entryTagHtml(s) {
|
|
1881
|
+
const app = ["微信", "企业微信", "钉钉"].includes(s.app) ? s.app : "";
|
|
1882
|
+
const text = s.entry === "check_first" ? "先验证一次" : s.entry === "sms_only" ? "短信登录"
|
|
1883
|
+
: s.entry === "qr_only" ? ({"微信": "微信扫码", "企业微信": "企业微信扫码", "钉钉": "钉钉扫码"}[app] || "扫码登录") : "";
|
|
1884
|
+
return text ? '<span class="tag check">' + esc(text) + '</span>' : "";
|
|
1885
|
+
}
|
|
1608
1886
|
// A school's name in the window's language (user, 2026-11-21): in English its English name; in another its name in
|
|
1609
1887
|
// that language where Pro has one (Wikidata's), in Traditional Chinese else its Chinese one (tr() turns its
|
|
1610
1888
|
// characters); else its own name as its federation lists it, not a translation.
|
|
@@ -1688,11 +1966,11 @@ function loginSchool(s, index) {
|
|
|
1688
1966
|
const shown = loginOpen === s.key, items = loginMenuItems(s);
|
|
1689
1967
|
// Their order, where there is more than one (user, 2026-11-21: 没权限时换下一所学校 goes down it; 1 the default).
|
|
1690
1968
|
const many = ((schoolLogin && schoolLogin.schools) || []).length > 1;
|
|
1691
|
-
const row = '<button type="button" class="login-row
|
|
1969
|
+
const row = '<button type="button" class="login-row ls-head' + (shown && items.length ? " with-menu" : "") + '" data-act="login_open" data-key="'
|
|
1970
|
+
+ esc(s.key) + '" aria-expanded="' + shown + '">'
|
|
1692
1971
|
+ (many ? '<span class="ls-n">' + (index + 1) + "</span>" : "") + '<span class="ls-name">' + esc(schoolName(s)) + "</span>"
|
|
1693
|
-
+ (s.current ? '<span class="tag default">' + esc("默认") + "</span>" : "") + tagHtml(s.status)
|
|
1694
|
-
+ (shown ? '<span class="ls-
|
|
1695
|
-
: '<span class="ls-acct">' + esc(s.saved ? (s.enabled ? s.username : "已关闭") : "未填账号") + "</span>")
|
|
1972
|
+
+ (s.current ? '<span class="tag default">' + esc("默认") + "</span>" : "") + tagHtml(s.status) + entryTagHtml(s)
|
|
1973
|
+
+ (shown ? "" : '<span class="ls-acct">' + esc(s.saved ? (s.enabled ? s.username : "已关闭") : "未填账号") + "</span>")
|
|
1696
1974
|
+ icon(shown ? "down" : "right") + "</button>";
|
|
1697
1975
|
if (!shown) return '<div class="login-school">' + row + "</div>";
|
|
1698
1976
|
if (schoolTest.state === "running" && schoolTest.key === s.key) return '<div class="login-school open">' + row + loginTesting(schoolTest) + "</div>";
|
|
@@ -1746,7 +2024,7 @@ function loginFound() {
|
|
|
1746
2024
|
if (!schoolFound) return "";
|
|
1747
2025
|
if (!schoolFound.ok) return '<div class="err" role="status">' + esc(schoolFound.error || "查找失败") + "</div>";
|
|
1748
2026
|
return (schoolFound.results || []).map((s) => '<div class="login-found"><span class="ls-name">' + esc(schoolName(s)) + "</span>"
|
|
1749
|
-
+ (s.federation ? '<span class="ls-fed">' + esc(s.federation) + "</span>" : "") + tagHtml(s.status)
|
|
2027
|
+
+ (s.federation ? '<span class="ls-fed">' + esc(s.federation) + "</span>" : "") + tagHtml(s.status) + entryTagHtml(s)
|
|
1750
2028
|
+ (s.added ? '<span class="ls-fed" style="margin-left:auto">' + esc("已添加") + "</span>"
|
|
1751
2029
|
: '<button class="btn" data-act="add_school" data-key="' + esc(s.key) + '">' + esc("添加") + "</button>") + "</div>").join("")
|
|
1752
2030
|
+ (schoolFound.note ? '<div class="err" role="status">' + esc(schoolFound.note) + "</div>" : "");
|
|
@@ -1832,7 +2110,7 @@ function supportRows(list, where = null) {
|
|
|
1832
2110
|
// Its name in the window's language (schoolName), wrapped when long; found by a search, where it is beside it (its
|
|
1833
2111
|
// country, or its part of the country open).
|
|
1834
2112
|
return list.map((s) => '<div class="login-found"><span class="ls-name">' + esc(schoolName(s))
|
|
1835
|
-
+ (where && where(s) ? '<span class="ls-fed"> · ' + esc(where(s)) + "</span>" : "") + "</span>" + tagHtml(s.status) + "</div>").join("");
|
|
2113
|
+
+ (where && where(s) ? '<span class="ls-fed"> · ' + esc(where(s)) + "</span>" : "") + "</span>" + tagHtml(s.status) + entryTagHtml(s) + "</div>").join("");
|
|
1836
2114
|
}
|
|
1837
2115
|
function supportRow(act, key, count, open) {
|
|
1838
2116
|
return '<button type="button" class="row" data-act="' + act + '" data-key="' + esc(key) + '"'
|
|
@@ -1902,11 +2180,11 @@ function settingsLoginSchools() {
|
|
|
1902
2180
|
if (!supportList.ok) return head + '<div class="err" style="text-align:left">' + esc(supportList.error || "读取失败") + "</div>";
|
|
1903
2181
|
const all = supportSchools();
|
|
1904
2182
|
const filled = all.filter((s) => s.status === "surveyed" || s.status === "verified").length;
|
|
1905
|
-
const check = all.
|
|
2183
|
+
const check = all.length - filled;
|
|
1906
2184
|
// The numbers, each saying what it counts, on the first page only; the line explaining them was removed (user,
|
|
1907
2185
|
// 2026-11-21).
|
|
1908
|
-
const stats = supportOpen ? "" : '<div class="stats" style="margin-top:10px"><div><b>' + filled + "</b><span>" + esc("
|
|
1909
|
-
+ "</span></div><div><b>" + check + "</b><span>" + esc("
|
|
2186
|
+
const stats = supportOpen ? "" : '<div class="stats" style="margin-top:10px"><div><b>' + filled + "</b><span>" + esc("所学校已验证")
|
|
2187
|
+
+ "</span></div><div><b>" + check + "</b><span>" + esc("所学校未验证") + "</span></div></div>";
|
|
1910
2188
|
const hint = supportOpen ? "搜索学校" : "搜索学校或地区";
|
|
1911
2189
|
return '<div class="support-top">' + head + stats
|
|
1912
2190
|
+ '<label class="support-search">' + icon("search") + '<input id="support-filter" type="search" autocomplete="off" spellcheck="false" value="'
|
|
@@ -2058,7 +2336,7 @@ function updateStrip() {
|
|
|
2058
2336
|
}
|
|
2059
2337
|
|
|
2060
2338
|
async function loadSettings() {
|
|
2061
|
-
settings = await api().settings(); notifyOn = settings.notify; hourlyNow = settings.hourly_now === true; settingsErrors = {}; settingsDraft = {}; notifyCheck = null;
|
|
2339
|
+
settings = await api().settings(); notifyOn = settings.notify; hourlyNow = settings.hourly_now === true; retryOn = settings.retry === true; settingsErrors = {}; settingsDraft = {}; notifyCheck = null;
|
|
2062
2340
|
try { apiKeys = await api().api_keys(); } catch (error) { apiKeys = null; }
|
|
2063
2341
|
if (!proOn()) return;
|
|
2064
2342
|
try { proStatus = await api().pro_status(); } catch (error) { proStatus = null; }
|
|
@@ -2106,7 +2384,9 @@ function keyError(text, tone) {
|
|
|
2106
2384
|
let lastCls = "", lastPlace = "", hovering = false, closing = false, dragging = false, endingDrag = false;
|
|
2107
2385
|
let dragReady = Promise.resolve();
|
|
2108
2386
|
let attentionPointer = null;
|
|
2387
|
+
let waysShown = "", wayPicked = ""; // 选择登录方式: the prompt the card opened on, the one picked from
|
|
2109
2388
|
let renderedAttention = null;
|
|
2389
|
+
let lastAsking = "";
|
|
2110
2390
|
|
|
2111
2391
|
function updateAttentionCountdown() {
|
|
2112
2392
|
const a = V.attention;
|
|
@@ -2126,12 +2406,13 @@ function render(force) {
|
|
|
2126
2406
|
if (panel === "settings") html = settingsCard();
|
|
2127
2407
|
else if (!open) { html = pill(); shape = "pill"; }
|
|
2128
2408
|
else if (panel === "papers" && V.lists && (V.mode === "running" || V.mode === "done")) html = papersCard();
|
|
2129
|
-
|
|
2130
|
-
else if (V.mode === "
|
|
2409
|
+
// Papers listed (并行下载): the one asking for the user is a row of the running card, the card not amber.
|
|
2410
|
+
else if (V.mode === "attention" && !papersAtOnce()) html = attentionCard();
|
|
2411
|
+
else if (V.mode === "running" || V.mode === "attention") html = runningCard();
|
|
2131
2412
|
else if (V.mode === "done") html = doneCard();
|
|
2132
2413
|
else html = idleCard();
|
|
2133
|
-
const cls = shape + (V.mode === "attention" && panel !== "settings" ? " warn" : "");
|
|
2134
2414
|
const attention = V.mode === "attention" && panel !== "settings";
|
|
2415
|
+
const cls = shape + (attention && (shape === "pill" || !papersAtOnce()) ? " warn" : "");
|
|
2135
2416
|
const sameTask = !attention || (renderedAttention?.current === V.current
|
|
2136
2417
|
&& renderedAttention?.run_id === V.run_id);
|
|
2137
2418
|
const unchanged = !force && sameTask && html === lastHtml && cls === lastCls;
|
|
@@ -2146,6 +2427,10 @@ function render(force) {
|
|
|
2146
2427
|
// A scrolled list keeps its place while its page is redrawn (a key opened or saved, a group opened).
|
|
2147
2428
|
const place = panel + ":" + (panel === "settings" ? settingsPage : papersKind);
|
|
2148
2429
|
const scrolled = place === lastPlace ? root.querySelector(".papers-scroll, .keys-scroll")?.scrollTop || 0 : 0;
|
|
2430
|
+
// The papers downloading at once keep their place too, back at the top when one comes to ask for the user.
|
|
2431
|
+
const asking = (V.papers || []).filter((p) => p.ask).map((p) => p.current).join(" ");
|
|
2432
|
+
const rowsAt = asking === lastAsking ? root.querySelector(".plist")?.scrollTop || 0 : 0;
|
|
2433
|
+
lastAsking = asking;
|
|
2149
2434
|
// The page itself scrolled (支持的学校's long list) keeps its place too (user, 2026-11-21: a press on the card's
|
|
2150
2435
|
// background, which starts and ends a drag, drew it again at its top), put back once it scrolls (keepSupportPlace).
|
|
2151
2436
|
if (pageScroll !== null) { keepScroll = pageScroll || null; pageScroll = null; }
|
|
@@ -2155,7 +2440,11 @@ function render(force) {
|
|
|
2155
2440
|
root.innerHTML = '<div class="surface">' + html + "</div>";
|
|
2156
2441
|
const list = root.querySelector(".papers-scroll, .keys-scroll");
|
|
2157
2442
|
if (list) list.scrollTop = scrolled;
|
|
2443
|
+
const rows = root.querySelector(".plist.scrolls");
|
|
2444
|
+
if (rows) { rows.scrollTop = rowsAt; fadeEdges(rows); }
|
|
2445
|
+
if (hoverRow) markRow(hoverRow, true);
|
|
2158
2446
|
localize(root);
|
|
2447
|
+
fitPaths(root);
|
|
2159
2448
|
if (panel === "settings") holdSettingsHeight();
|
|
2160
2449
|
if (attention) updateAttentionCountdown();
|
|
2161
2450
|
renderedAttention = attention ? V : null;
|
|
@@ -2266,6 +2555,12 @@ async function tick() {
|
|
|
2266
2555
|
// A prompt only turns the capsule amber (with a system notification); hovering opens it.
|
|
2267
2556
|
// Once the prompt is handled an open card folds back unless the pointer is on it.
|
|
2268
2557
|
if (before === "attention" && V.mode !== "attention" && !hovering && !dragging && !panel && !pinned) open = false;
|
|
2558
|
+
// 选择登录方式 opens the card itself, once a prompt (user, 2026-11-29): its ways are picked here, not in the browser,
|
|
2559
|
+
// and asked once a school.
|
|
2560
|
+
const asked = V.mode === "attention" && V.attention && V.attention.ways ? V.current + "|" + (V.attention.school || "") : "";
|
|
2561
|
+
if (asked && asked !== waysShown) { open = true; panel = ""; }
|
|
2562
|
+
waysShown = asked;
|
|
2563
|
+
if (!asked) wayPicked = "";
|
|
2269
2564
|
if (panel === "papers" && open) await loadPapers(); // an open list follows the download
|
|
2270
2565
|
render(switched);
|
|
2271
2566
|
// Also detect a real pointer departure when clamping moved the window away
|
|
@@ -2274,6 +2569,15 @@ async function tick() {
|
|
|
2274
2569
|
}
|
|
2275
2570
|
|
|
2276
2571
|
function say(text) { flash = { text: text, until: Date.now() + 6000 }; render(true); }
|
|
2572
|
+
/** The download's answers to 切到浏览器 when it did: not shown (``act``). */
|
|
2573
|
+
const SWITCHED = ["正在切到下载浏览器", "已切到下载浏览器"];
|
|
2574
|
+
// The answer to a row's button, on that row (已跳过 for its skip) and under the headline, which a row pointed at
|
|
2575
|
+
// does not cover (user's Mac, 2026-11-29: what a click on 浏览器 answered was not to be seen).
|
|
2576
|
+
function sayOnRow(current, text) {
|
|
2577
|
+
rowNote = { current, text: text === "已跳过本篇,进入下一篇" ? "已跳过" : text, until: Date.now() + 6000 };
|
|
2578
|
+
flash = { text, until: Date.now() + 6000 };
|
|
2579
|
+
render(true);
|
|
2580
|
+
}
|
|
2277
2581
|
|
|
2278
2582
|
let inputActivation = Promise.resolve();
|
|
2279
2583
|
async function act(action, target) {
|
|
@@ -2302,11 +2606,7 @@ async function act(action, target) {
|
|
|
2302
2606
|
case "papers": {
|
|
2303
2607
|
papersKind = target.dataset.list; panel = "papers"; listOpen = null; papersList = null; render(true);
|
|
2304
2608
|
await loadPapers();
|
|
2305
|
-
// From the line on sites not yet supported: their group open, in view.
|
|
2306
|
-
const at = target.dataset.unverified ? shownList().groups.findIndex((g) => g.unverified) : -1;
|
|
2307
|
-
if (at >= 0) listOpen = new Set([at]);
|
|
2308
2609
|
render(true);
|
|
2309
|
-
if (at >= 0) { const shown = root.querySelector(".unverified-note"); if (shown) shown.closest(".grp").scrollIntoView({ block: "start" }); }
|
|
2310
2610
|
return;
|
|
2311
2611
|
}
|
|
2312
2612
|
case "markdown_issue": return say(await api().markdown_issue());
|
|
@@ -2319,10 +2619,19 @@ async function act(action, target) {
|
|
|
2319
2619
|
}
|
|
2320
2620
|
case "show_paper": return say(await api().show_paper(Number(target.dataset.index)));
|
|
2321
2621
|
case "group": return toggleGroup(Number(target.dataset.group));
|
|
2622
|
+
case "choose_way": {
|
|
2623
|
+
wayPicked = v.current + "|" + (v.attention && v.attention.school || "");
|
|
2624
|
+
render(true); // its ways pressed no more while the download takes the pick
|
|
2625
|
+
return say(await api().choose_way(Number(target.dataset.way), v.current, v.run_id));
|
|
2626
|
+
}
|
|
2322
2627
|
case "show_browser": {
|
|
2323
2628
|
try { await inputActivation; }
|
|
2324
2629
|
catch (error) { return say("未能激活进度窗口,请重试"); }
|
|
2325
|
-
|
|
2630
|
+
const row = target && target.dataset && target.dataset.current;
|
|
2631
|
+
const said = await api().act("show_browser", row || v.current, v.run_id);
|
|
2632
|
+
// Switched: nothing said, the browser in front says it (user's Mac, 2026-11-29); only why it did not.
|
|
2633
|
+
if (SWITCHED.includes(said)) return;
|
|
2634
|
+
return row ? sayOnRow(row, said) : say(said);
|
|
2326
2635
|
}
|
|
2327
2636
|
case "report":
|
|
2328
2637
|
if (panel === "report") { panel = ""; return render(true); }
|
|
@@ -2333,7 +2642,9 @@ async function act(action, target) {
|
|
|
2333
2642
|
case "cancel": panel = ""; return render(true);
|
|
2334
2643
|
case "stop": panel = ""; return say(await api().act("stop_batch", v.current, v.run_id));
|
|
2335
2644
|
case "skip_item":
|
|
2336
|
-
panel = "";
|
|
2645
|
+
panel = "";
|
|
2646
|
+
if (target && target.dataset && target.dataset.current) return sayOnRow(target.dataset.current, await api().act(action, target.dataset.current, v.run_id));
|
|
2647
|
+
return say(await api().act(action, v.current, v.run_id));
|
|
2337
2648
|
case "resume_held": {
|
|
2338
2649
|
heldAsked = { run: v.run_id, keys: heldKeys() };
|
|
2339
2650
|
render(true);
|
|
@@ -2388,7 +2699,7 @@ async function act(action, target) {
|
|
|
2388
2699
|
case "reveal":
|
|
2389
2700
|
revealed = !revealed;
|
|
2390
2701
|
target.setAttribute("aria-pressed", String(revealed));
|
|
2391
|
-
root.querySelectorAll(".key-edit input").forEach((input) => { input.type = revealed ? "text" : "password"; });
|
|
2702
|
+
root.querySelectorAll(".key-edit input[data-secret]").forEach((input) => { input.type = revealed ? "text" : "password"; });
|
|
2392
2703
|
return;
|
|
2393
2704
|
case "install_pro": {
|
|
2394
2705
|
try { proInstall = (await api().install_pro()) || { state: "idle" }; }
|
|
@@ -2606,6 +2917,21 @@ async function act(action, target) {
|
|
|
2606
2917
|
} finally { target.disabled = false; }
|
|
2607
2918
|
return;
|
|
2608
2919
|
}
|
|
2920
|
+
case "retry": {
|
|
2921
|
+
target.disabled = true;
|
|
2922
|
+
try {
|
|
2923
|
+
const result = await api().set_retry(!retryOn);
|
|
2924
|
+
if (!result.ok) throw new Error(result.error || "设置保存失败");
|
|
2925
|
+
retryOn = result.retry;
|
|
2926
|
+
settings.retry = retryOn;
|
|
2927
|
+
target.classList.toggle("on", retryOn);
|
|
2928
|
+
target.setAttribute("aria-checked", String(retryOn));
|
|
2929
|
+
} catch (error) {
|
|
2930
|
+
settingsErrors.retry = error.message || "设置保存失败";
|
|
2931
|
+
render(true);
|
|
2932
|
+
} finally { target.disabled = false; }
|
|
2933
|
+
return;
|
|
2934
|
+
}
|
|
2609
2935
|
case "hourly_now": {
|
|
2610
2936
|
target.disabled = true;
|
|
2611
2937
|
try {
|
|
@@ -2639,13 +2965,39 @@ async function act(action, target) {
|
|
|
2639
2965
|
const input = root.querySelector('input[data-field="' + f.name + '"]');
|
|
2640
2966
|
if (input) { input.value = f.default; settingsDraft[f.name] = String(f.default); }
|
|
2641
2967
|
}
|
|
2968
|
+
if (settingsPage === "download" && field("pubs")) {
|
|
2969
|
+
// 同时下载 back to serial, its two numbers to theirs.
|
|
2970
|
+
for (const f of fieldsOn("parallel")) settingsDraft[f.name] = String(f.default);
|
|
2971
|
+
settingsDraft.parallel = false;
|
|
2972
|
+
return render(true);
|
|
2973
|
+
}
|
|
2642
2974
|
return;
|
|
2975
|
+
case "parallel_mode": {
|
|
2976
|
+
const parallel = target.dataset.mode === "parallel";
|
|
2977
|
+
if (parallel === parallelDraft()) return;
|
|
2978
|
+
settingsDraft.parallel = parallel;
|
|
2979
|
+
// Parallel at 1 and 1 is serial: 不同出版社 starts at 2, 同一出版社 stays (user, 2026-11-29).
|
|
2980
|
+
if (parallel && fieldDraft("pubs") === "1" && fieldDraft("each") === "1") settingsDraft.pubs = "2";
|
|
2981
|
+
return render(true);
|
|
2982
|
+
}
|
|
2983
|
+
case "step": {
|
|
2984
|
+
const name = target.dataset.fieldStep, input = root.querySelector('input[data-field="' + name + '"]');
|
|
2985
|
+
if (!input) return;
|
|
2986
|
+
const now = Number.parseInt(input.value, 10);
|
|
2987
|
+
const next = Math.max(1, (Number.isFinite(now) ? now : 1) + Number(target.dataset.delta));
|
|
2988
|
+
input.value = String(next);
|
|
2989
|
+
settingsDraft[name] = input.value;
|
|
2990
|
+
const minus = input.parentElement.querySelector('button[data-delta="-1"]');
|
|
2991
|
+
if (minus) minus.disabled = next <= 1;
|
|
2992
|
+
return;
|
|
2993
|
+
}
|
|
2643
2994
|
case "save": {
|
|
2644
2995
|
// Only this page's fields; the notification switch has saved itself.
|
|
2645
2996
|
const values = {};
|
|
2646
2997
|
root.querySelectorAll("input[data-field]").forEach((input) => { values[input.dataset.field] = input.value; });
|
|
2647
2998
|
const folder = root.querySelector('#download-dir');
|
|
2648
|
-
const result = await api().save_settings(values, folder ? folder.value : null
|
|
2999
|
+
const result = await api().save_settings(values, folder ? folder.value : null,
|
|
3000
|
+
settingsPage === "download" && field("pubs") ? parallelDraft() : null);
|
|
2649
3001
|
if (!result.ok) {
|
|
2650
3002
|
settingsErrors = result.errors || {}; // what was typed stays in settingsDraft
|
|
2651
3003
|
return render(true);
|
|
@@ -2658,25 +3010,10 @@ async function act(action, target) {
|
|
|
2658
3010
|
|
|
2659
3011
|
// A paper list scrolls; pressing in it must not drag the window. Nor in 支持的学校's list (user, 2026-11-21: a press
|
|
2660
3012
|
// between its rows dragged, and the redraw after it went back to the top).
|
|
2661
|
-
const interactive = (target) => target.closest('button, input, select, textarea, a, [contenteditable="true"], [role="button"], .paper-list, .papers-scroll, .keys-scroll, #support-list');
|
|
2662
|
-
// The dot's card: open while the pointer is on the dot or the card, a moment's grace between
|
|
2663
|
-
// them. Told by where the pointer moves, not by its leaving: the card is redrawn every second
|
|
2664
|
-
// and a dot redrawn under the pointer never says it was left.
|
|
2665
|
-
const RULES_PARTS = ".rules-dot, .rules-pop";
|
|
2666
|
-
function rulesPointer(over) {
|
|
2667
|
-
if (over) {
|
|
2668
|
-
clearTimeout(rulesTimer);
|
|
2669
|
-
rulesTimer = 0;
|
|
2670
|
-
if (!rulesShown) showRules(true);
|
|
2671
|
-
} else if (rulesShown && !rulesTimer) {
|
|
2672
|
-
rulesTimer = setTimeout(() => { rulesTimer = 0; showRules(false); }, 300);
|
|
2673
|
-
}
|
|
2674
|
-
}
|
|
2675
|
-
document.addEventListener("pointermove", (event) => rulesPointer(!!(event.target.closest && event.target.closest(RULES_PARTS))));
|
|
2676
|
-
document.documentElement.addEventListener("pointerleave", () => rulesPointer(false));
|
|
3013
|
+
const interactive = (target) => target.closest('button, input, select, textarea, a, [contenteditable="true"], [role="button"], .paper-list, .papers-scroll, .keys-scroll, #support-list, .plist');
|
|
2677
3014
|
root.addEventListener("pointerdown", (event) => {
|
|
2678
3015
|
if (event.button === 0 && api().activate_on_input) inputActivation = api().activate_on_input();
|
|
2679
|
-
if (event.button === 0 && event.target.closest(".attention-target")) {
|
|
3016
|
+
if (event.button === 0 && event.target.closest(".attention-target, .pp.asking")) {
|
|
2680
3017
|
attentionPointer = event.pointerId;
|
|
2681
3018
|
clearTimeout(hoverTimer); clearTimeout(leaveTimer);
|
|
2682
3019
|
}
|
|
@@ -2735,8 +3072,12 @@ window.addEventListener("blur", finishDrag);
|
|
|
2735
3072
|
root.addEventListener("input", (event) => {
|
|
2736
3073
|
// What is typed goes into the page's model at once, so that a redraw keeps it.
|
|
2737
3074
|
const input = event.target;
|
|
2738
|
-
if (input.dataset.field)
|
|
2739
|
-
|
|
3075
|
+
if (input.dataset.field) {
|
|
3076
|
+
settingsDraft[input.dataset.field] = input.value;
|
|
3077
|
+
// 同时下载's boxes: − only above 1.
|
|
3078
|
+
const minus = input.closest(".stepper")?.querySelector('button[data-delta="-1"]');
|
|
3079
|
+
if (minus) minus.disabled = !(Number.parseInt(input.value, 10) > 1);
|
|
3080
|
+
} else if (input.id === "download-dir") settingsDraft.download_dir = input.value;
|
|
2740
3081
|
else if (input.dataset.key && editing) editValues[input.dataset.key] = input.value;
|
|
2741
3082
|
// The sign-in page's fields and 添加学校 (user, 2026-11-20: a click elsewhere had emptied them).
|
|
2742
3083
|
else if (input.id === "login-user") loginValues.username = input.value;
|
|
@@ -2816,12 +3157,50 @@ async function observeHover(inside, force = false) {
|
|
|
2816
3157
|
if (!force && lastNativePointer && pointer.x === lastNativePointer.x && pointer.y === lastNativePointer.y) return;
|
|
2817
3158
|
lastNativePointer = pointer;
|
|
2818
3159
|
setHover(pointer.inside, force);
|
|
3160
|
+
// The row under the pointer, from where the window says it is: with the browser in front the page gets no pointer
|
|
3161
|
+
// moves, and a row stayed marked until the window was clicked (user's Mac, 2026-11-29).
|
|
3162
|
+
if (!pointer.inside) markRow("");
|
|
3163
|
+
else if (typeof pointer.page_x === "number") {
|
|
3164
|
+
const under = document.elementFromPoint(pointer.page_x, pointer.page_y);
|
|
3165
|
+
markRow(under?.closest?.(".pp")?.dataset.current || "");
|
|
3166
|
+
}
|
|
2819
3167
|
}
|
|
3168
|
+
// While papers are listed, the pointer is asked for more often than the download's state (the row under it).
|
|
3169
|
+
setInterval(() => {
|
|
3170
|
+
if (open && !panel && papersAtOnce() && document.body.classList.contains("mac") && !document.hasFocus()) observeHover();
|
|
3171
|
+
}, 150);
|
|
2820
3172
|
root.addEventListener("mouseenter", () => observeHover(true));
|
|
2821
3173
|
root.addEventListener("mouseleave", () => {
|
|
2822
3174
|
attentionPointer = null;
|
|
3175
|
+
markRow("");
|
|
2823
3176
|
observeHover(false);
|
|
2824
3177
|
});
|
|
3178
|
+
// The row the pointer is on (并行下载), kept as the card is drawn again under a still pointer (``again``); one at the
|
|
3179
|
+
// list's foot opens upward.
|
|
3180
|
+
function markRow(current, again = false) {
|
|
3181
|
+
if (current === hoverRow && !again) return;
|
|
3182
|
+
hoverRow = current;
|
|
3183
|
+
const list = root.querySelector(".plist")?.getBoundingClientRect();
|
|
3184
|
+
root.querySelectorAll(".pp").forEach((row) => {
|
|
3185
|
+
const on = !!current && row.dataset.current === current;
|
|
3186
|
+
row.classList.toggle("hover", on);
|
|
3187
|
+
const box = on && list ? row.getBoundingClientRect() : null;
|
|
3188
|
+
row.classList.toggle("up", !!box && box.bottom + box.height > list.bottom + 1);
|
|
3189
|
+
});
|
|
3190
|
+
}
|
|
3191
|
+
root.addEventListener("pointerover", (event) => markRow(event.target.closest(".pp")?.dataset.current || ""));
|
|
3192
|
+
// A row from the keyboard: Enter or Space shows its browser, as a click does. A press of the mouse does not focus it
|
|
3193
|
+
// (it would stay marked once the pointer has left).
|
|
3194
|
+
root.addEventListener("mousedown", (event) => { if (event.target.closest(".pp")) event.preventDefault(); });
|
|
3195
|
+
root.addEventListener("keydown", (event) => {
|
|
3196
|
+
if ((event.key === "Enter" || event.key === " ") && event.target.matches?.(".pp")) { event.preventDefault(); act("show_browser", event.target); }
|
|
3197
|
+
});
|
|
3198
|
+
root.addEventListener("scroll", (event) => {
|
|
3199
|
+
if (!event.target.classList?.contains("plist")) return;
|
|
3200
|
+
fadeEdges(event.target);
|
|
3201
|
+
if (hoverRow) markRow(hoverRow, true);
|
|
3202
|
+
}, true);
|
|
3203
|
+
root.addEventListener("focusin", (event) => { const row = event.target.closest?.(".pp"); if (row) markRow(row.dataset.current); });
|
|
2825
3204
|
function endAttentionPress(event) {
|
|
2826
3205
|
if (attentionPointer === null || (event.pointerId !== undefined && attentionPointer !== event.pointerId)) return;
|
|
2827
3206
|
attentionPointer = null;
|