papersearch 0.8.0 → 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.
Files changed (101) hide show
  1. package/NOTICE +1 -1
  2. package/README.fr.md +5 -8
  3. package/README.ja.md +5 -8
  4. package/README.ko.md +5 -8
  5. package/README.md +148 -151
  6. package/README.zh-Hant.md +5 -8
  7. package/README.zh.md +265 -0
  8. package/dist/capabilities/download/batch/batch.d.ts +4 -0
  9. package/dist/capabilities/download/batch/batch.d.ts.map +1 -1
  10. package/dist/capabilities/download/batch/batch.js +714 -198
  11. package/dist/capabilities/download/batch/batch.js.map +1 -1
  12. package/dist/capabilities/download/batch/windowPlan.d.ts +96 -0
  13. package/dist/capabilities/download/batch/windowPlan.d.ts.map +1 -0
  14. package/dist/capabilities/download/batch/windowPlan.js +196 -0
  15. package/dist/capabilities/download/batch/windowPlan.js.map +1 -0
  16. package/dist/capabilities/download/content/markdown/step.d.ts.map +1 -1
  17. package/dist/capabilities/download/content/markdown/step.js +4 -1
  18. package/dist/capabilities/download/content/markdown/step.js.map +1 -1
  19. package/dist/capabilities/download/content/pdf/open/tiers/scihub.d.ts.map +1 -1
  20. package/dist/capabilities/download/content/pdf/open/tiers/scihub.js +3 -1
  21. package/dist/capabilities/download/content/pdf/open/tiers/scihub.js.map +1 -1
  22. package/dist/infrastructure/http/hostGate.d.ts +24 -0
  23. package/dist/infrastructure/http/hostGate.d.ts.map +1 -0
  24. package/dist/infrastructure/http/hostGate.js +72 -0
  25. package/dist/infrastructure/http/hostGate.js.map +1 -0
  26. package/dist/infrastructure/pdf/PdfDownload.d.ts +1 -0
  27. package/dist/infrastructure/pdf/PdfDownload.d.ts.map +1 -1
  28. package/dist/infrastructure/pdf/PdfDownload.js +6 -1
  29. package/dist/infrastructure/pdf/PdfDownload.js.map +1 -1
  30. package/dist/infrastructure/runlog/RunLedger.d.ts +7 -0
  31. package/dist/infrastructure/runlog/RunLedger.d.ts.map +1 -1
  32. package/dist/infrastructure/runlog/RunLedger.js +17 -4
  33. package/dist/infrastructure/runlog/RunLedger.js.map +1 -1
  34. package/dist/infrastructure/school/SchoolMcpClient.d.ts +12 -2
  35. package/dist/infrastructure/school/SchoolMcpClient.d.ts.map +1 -1
  36. package/dist/infrastructure/school/SchoolMcpClient.js +122 -11
  37. package/dist/infrastructure/school/SchoolMcpClient.js.map +1 -1
  38. package/dist/infrastructure/school/SchoolReadiness.d.ts +7 -0
  39. package/dist/infrastructure/school/SchoolReadiness.d.ts.map +1 -1
  40. package/dist/infrastructure/school/SchoolReadiness.js +8 -0
  41. package/dist/infrastructure/school/SchoolReadiness.js.map +1 -1
  42. package/dist/infrastructure/school/index.d.ts +1 -1
  43. package/dist/infrastructure/school/index.d.ts.map +1 -1
  44. package/dist/infrastructure/school/types.d.ts +31 -1
  45. package/dist/infrastructure/school/types.d.ts.map +1 -1
  46. package/dist/infrastructure/school/types.js.map +1 -1
  47. package/dist/infrastructure/security/SecurityUtils.d.ts.map +1 -1
  48. package/dist/infrastructure/security/SecurityUtils.js +6 -2
  49. package/dist/infrastructure/security/SecurityUtils.js.map +1 -1
  50. package/dist/management/failures/index.d.ts.map +1 -1
  51. package/dist/management/failures/index.js +5 -2
  52. package/dist/management/failures/index.js.map +1 -1
  53. package/dist/management/school/autoUpdate.d.ts.map +1 -1
  54. package/dist/management/school/autoUpdate.js +9 -1
  55. package/dist/management/school/autoUpdate.js.map +1 -1
  56. package/dist/management/school/cliProgress.d.ts.map +1 -1
  57. package/dist/management/school/cliProgress.js +3 -1
  58. package/dist/management/school/cliProgress.js.map +1 -1
  59. package/package.json +2 -2
  60. package/school/paper_search_school/adapters/base.py +3 -0
  61. package/school/paper_search_school/adapters/optica/__init__.py +50 -4
  62. package/school/paper_search_school/adapters/platforms/atypon/__init__.py +4 -3
  63. package/school/paper_search_school/adapters/platforms/figshare/__init__.py +23 -4
  64. package/school/paper_search_school/assets/capsule.html +380 -41
  65. package/school/paper_search_school/assets/capsule_en.json +72 -4
  66. package/school/paper_search_school/assets/capsule_fr.json +72 -4
  67. package/school/paper_search_school/assets/capsule_ja.json +72 -4
  68. package/school/paper_search_school/assets/capsule_ko.json +72 -4
  69. package/school/paper_search_school/assets/capsule_zh-Hant.json +66 -3
  70. package/school/paper_search_school/browser/backend.py +125 -4
  71. package/school/paper_search_school/browser/batch_session.py +188 -7
  72. package/school/paper_search_school/browser/challenge/continuation.py +19 -1
  73. package/school/paper_search_school/browser/challenge/handlers/text_captcha.py +38 -10
  74. package/school/paper_search_school/browser/challenge/pro.py +24 -0
  75. package/school/paper_search_school/browser/challenge/services/solver.py +24 -4
  76. package/school/paper_search_school/browser/engine.py +4 -1
  77. package/school/paper_search_school/browser/user_turn.py +126 -0
  78. package/school/paper_search_school/browser/watchdog.py +213 -60
  79. package/school/paper_search_school/config.py +5 -0
  80. package/school/paper_search_school/engine/batch.py +9 -7
  81. package/school/paper_search_school/engine/batch_access.py +27 -7
  82. package/school/paper_search_school/engine/batch_capture.py +45 -13
  83. package/school/paper_search_school/engine/batch_institution.py +14 -0
  84. package/school/paper_search_school/engine/batch_login.py +177 -22
  85. package/school/paper_search_school/engine/batch_user.py +48 -3
  86. package/school/paper_search_school/engine/batch_waits.py +42 -2
  87. package/school/paper_search_school/engine/bridge.py +1 -2
  88. package/school/paper_search_school/engine/fulltext_page.py +10 -1
  89. package/school/paper_search_school/engine/supplements.py +7 -1
  90. package/school/paper_search_school/entitlements.py +28 -0
  91. package/school/paper_search_school/progress_capsule.py +33 -5
  92. package/school/paper_search_school/progress_reporter.py +189 -6
  93. package/school/paper_search_school/progress_view.py +142 -48
  94. package/school/paper_search_school/rate_limit.py +24 -1
  95. package/school/paper_search_school/school_login.py +170 -8
  96. package/school/paper_search_school/server.py +164 -19
  97. package/school/paper_search_school/user_settings.py +33 -4
  98. package/skills/paper-search/SKILL.md +1 -1
  99. package/skills/paper-search/references/browser-download.md +2 -2
  100. package/LICENSE-paper-search-mcp-nodejs +0 -24
  101. package/README.en.md +0 -268
@@ -123,8 +123,82 @@ svg.i { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-widt
123
123
  .paper-status .steps { flex: 1; min-width: 0; margin-top: 0; }
124
124
  .paper-status .line { flex: 1; min-width: 0; margin-top: 0; line-height: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
125
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); }
126
188
  .paper-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
127
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); }
128
202
  .steps .bars { display: flex; gap: 3px; flex: 1; }
129
203
  .steps .bars span { flex: 1; height: 3px; border-radius: 2px; background: var(--track); }
130
204
  .steps .bars span.done { background: var(--ok); }
@@ -173,6 +247,25 @@ svg.i { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-widt
173
247
  background: var(--hover); border: 0.5px solid var(--line); border-radius: 6px; padding: 0 8px; }
174
248
  .settings input:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
175
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; }
176
269
  /* The check of system notifications under its switch: a test, and what to change when they do not show. */
177
270
  #notify-test-button { margin-left: auto; margin-right: 10px; }
178
271
  #notify-test-button .btn { padding: 2px 9px; }
@@ -217,6 +310,7 @@ svg.i { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-widt
217
310
  .nav-row svg.i:last-child { color: var(--faint); }
218
311
  .nav-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
219
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; }
220
314
  .settings-note { font-size: 11px; color: var(--ok); margin-top: 8px; }
221
315
  .key-group { font-size: 11px; color: var(--faint); margin: 12px 0 2px; }
222
316
  /* The home page's last line (user, 2026-11-21): PaperSearch Pro, a blue link at its left; the language at its
@@ -493,6 +587,16 @@ svg.i { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-widt
493
587
  .attention-head { display: flex; align-items: center; gap: 6px; margin-bottom: 14px; color: var(--fg); }
494
588
  .attention-head b { flex: 1; font-size: 12px; }
495
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); }
496
600
 
497
601
  /* The finished card: totals, failures by reason, what was saved. No text wraps. */
498
602
  .done-stats { margin-top: 12px; }
@@ -627,6 +731,7 @@ const ICONS = {
627
731
  skip: '<path d="M6 6l8 6-8 6z"/><path d="M18 6v12"/>',
628
732
  stop: '<rect x="6.5" y="6.5" width="11" height="11" rx="2"/>',
629
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"/>',
630
735
  dots: '<circle cx="6" cy="12" r="1"/><circle cx="12" cy="12" r="1"/><circle cx="18" cy="12" r="1"/>',
631
736
  left: '<path d="M15 6l-6 6 6 6"/>',
632
737
  external: '<path d="M7 17L17 7M9 7h8v8"/>',
@@ -835,7 +940,9 @@ function pill() {
835
940
  if (v.mode === "attention") {
836
941
  const a = v.attention;
837
942
  return '<div class="pillrow icon-first capsule-drag-region">' + icon(a.login ? "lock" : "shield")
838
- + '<button type="button" class="pill-prompt attention-target" data-act="show_browser" title="点击切到下载浏览器" aria-label="打开下载浏览器">'
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="打开下载浏览器">')
839
946
  + '<b>' + esc(a.short) + '</b><span class="attention-countdown"></span></button></div>';
840
947
  }
841
948
  if (v.held_wait) {
@@ -851,7 +958,8 @@ function pill() {
851
958
  + (v.bad ? '<span class="dim">' + v.bad + " 篇失败</span>" : "") + "</div>";
852
959
  }
853
960
  if (v.mode === "running") {
854
- const where = [v.part, v.publisher].filter(Boolean).join(" · ");
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(" · ");
855
963
  return '<div class="pillrow capsule-drag-region">' + ring(v.pct, 24, 3, "")
856
964
  + '<span class="count">' + (v.total ? v.done + "/" + v.total : v.done) + "</span>"
857
965
  + (where ? '<span class="dim">' + esc(where) + "</span>" : "") + '<span class="dot"></span>'
@@ -882,7 +990,62 @@ function header(title, sub, closable, note) {
882
990
  + '" title="' + (closable ? "关闭" : "最小化到程序坞") + '">' + icon(closable ? "close" : "minimize") + "</button></div></div>";
883
991
  }
884
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
+
885
1047
  function paperBlock() {
1048
+ if (papersAtOnce()) return paperRows();
886
1049
  const v = V;
887
1050
  const note = flash.text && Date.now() < flash.until ? flash.text : v.notice;
888
1051
  // The paper being downloaded: a click shows its browser while it has one (user request, 2026-11-08).
@@ -896,10 +1059,10 @@ function paperBlock() {
896
1059
  // The step or the lane's line in one row of its own height, there when neither is (see .paper-status); a line
897
1060
  // longer than the row says the rest on hover.
898
1061
  html += '<div class="paper-status">';
899
- if (v.step) {
900
- html += '<div class="steps"><div class="bars">' + v.steps.map((_, i) =>
901
- "<span" + (i < v.step.index ? ' class="done"' : i === v.step.index ? ' class="now"' : "") + "></span>").join("")
902
- + '</div><span class="label">' + esc(v.step.label) + "</span></div>";
1062
+ if (v.transfer) {
1063
+ html += transferRow(v.transfer);
1064
+ } else if (v.step) {
1065
+ html += stepsRow(v.step, v.steps);
903
1066
  } else if (v.line) {
904
1067
  html += '<div class="line" title="' + esc(v.line) + '">' + esc(v.line) + "</div>";
905
1068
  }
@@ -917,7 +1080,8 @@ function actionsBlock() {
917
1080
  + (V.folder ? '<button class="btn link" data-act="folder">' + icon("folder") + "文件夹</button>" : "")
918
1081
  + '<span class="grow"></span>';
919
1082
  if (V.actions) {
920
- html += '<button class="btn" data-act="skip_item">' + icon("skip") + "跳过</button>"
1083
+ // Papers listed: each row skips its own (on the row).
1084
+ html += (papersAtOnce() ? "" : '<button class="btn" data-act="skip_item">' + icon("skip") + "跳过</button>")
921
1085
  + '<button class="btn" data-act="confirm">' + icon("stop") + "终止</button>"
922
1086
  // Only the problem report is left behind it: whether the school has access the download
923
1087
  // finds itself, the "no access" marks are gone (user, 2026-11-16).
@@ -1003,7 +1167,11 @@ function runningCard() {
1003
1167
  // paper; once 登录并继续 is pressed, what comes next (user, 2026-11-15).
1004
1168
  const asked = v.held_wait && resumeAsked();
1005
1169
  const paper = v.held_wait ? '<div class="paper"><div class="line">' + esc(asked ? "如需登录,会打开学校登录页" : v.line) + "</div></div>" : paperBlock();
1006
- return '<div class="card-body">' + header(asked ? "正在继续下载" : v.headline, sub, false, v.switch_note) + paper + heldBlock()
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()
1007
1175
  + '<div class="stats">' + stat("ok", v.ok, "成功", "var(--ok)")
1008
1176
  + stat("failed", v.bad, "失败", "var(--bad)")
1009
1177
  + (holding() ? stat(retryCount() ? "retry" : "", retryCount(), "重试", retryCount() ? "var(--warn-dot)" : "") : "")
@@ -1011,8 +1179,32 @@ function runningCard() {
1011
1179
  + actionsBlock() + "</div>";
1012
1180
  }
1013
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
+
1014
1205
  function attentionCard() {
1015
1206
  const a = V.attention;
1207
+ if (a.ways) return chooseCard();
1016
1208
  const title = a.short;
1017
1209
  let html = '<div class="card-body"><div class="attention-head capsule-drag-region"><b>PaperSearch</b>'
1018
1210
  + '<div class="tools">' + pinButton()
@@ -1216,12 +1408,11 @@ const field = (name) => settings.fields.find((f) => f.name === name);
1216
1408
  // The user's own folder as ~ on the home page's line (user, 2026-11-21: /Users/<name>/Downloads and the hourly limit
1217
1409
  // did not fit one line in English); the download page shows the folder whole.
1218
1410
  const shortPath = (path) => String(path || "").replace(/^(?:\/Users\/[^/]+|\/home\/[^/]+|[A-Za-z]:\\Users\\[^\\]+)(?=[\/\\]|$)/, "~");
1219
- // The folder on that line whole when it fits; else its middle folders left out, the first ones first, then all but its
1220
- // own name (user, 2026-11-24, 乙: D:\Project-XY\References and the hourly limit cut short in English). Measured once
1221
- // the page is drawn and translated, at the card's own width.
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.
1222
1413
  function fitPaths(node) {
1223
1414
  node.querySelectorAll(".nav-sub[data-path]").forEach((line) => {
1224
- const whole = line.dataset.path, rest = tr(line.dataset.rest || "");
1415
+ const whole = line.dataset.path;
1225
1416
  const sep = whole.includes("\\") ? "\\" : "/";
1226
1417
  const path = whole.length > 3 ? whole.replace(/[\\/]+$/, "") : whole;
1227
1418
  const parts = path.split(sep), head = parts[0], last = parts[parts.length - 1], middle = parts.slice(1, -1);
@@ -1229,7 +1420,7 @@ function fitPaths(node) {
1229
1420
  for (let k = 1; k <= middle.length; k++) tries.push([head, "…", ...middle.slice(k), last].join(sep));
1230
1421
  if (parts.length > 1) tries.push("…" + sep + last);
1231
1422
  for (const each of tries) {
1232
- line.textContent = rest ? each + " · " + rest : each;
1423
+ line.textContent = each;
1233
1424
  if (line.scrollWidth <= line.clientWidth) return;
1234
1425
  }
1235
1426
  });
@@ -1237,7 +1428,10 @@ function fitPaths(node) {
1237
1428
  function settingsHome() {
1238
1429
  const hourly = field("hourly"), login = field("login");
1239
1430
  const rows = [
1240
- ["download", "folder", "下载", [shortPath(settings.download_dir), hourly ? "每家每小时 " + hourly.value + " 篇" : ""], "", true],
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(" · ")]],
1241
1435
  ["wait", "clock", "等待和提醒", [login ? "登录页 " + login.value + " 秒" : "", "系统通知" + (notifyOn ? "开" : "关")]],
1242
1436
  ["keys", "key", "API key", [apiKeys && apiKeys.ok ? "已填 " + apiKeys.filled + "/" + apiKeys.total : ""]],
1243
1437
  ];
@@ -1263,14 +1457,15 @@ function languageMenu() {
1263
1457
  + '<div class="lang-more">' + esc("更多语言陆续加入") + "</div></div>" : "") + "</span>";
1264
1458
  }
1265
1459
 
1266
- // A row that opens a page: its icon, its name, what it holds now.
1267
- function navRow([page, glyph, title, sub, badge, folderFirst]) {
1268
- // folderFirst: its line begins with a folder, fitted to the line once drawn (fitPaths).
1269
- const fitted = folderFirst && sub[0] ? ' data-path="' + esc(sub[0]) + '" data-rest="' + esc(sub.slice(1).filter(Boolean).join(" · ")) + '"' : "";
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]) + '"' : "";
1270
1464
  return '<button type="button" class="nav-row" data-act="settings_page" data-page="' + page + '">' + (glyph === "pro-app" ? appIcon(16, true) : icon(glyph))
1271
1465
  + '<span class="nav-text"><span class="nav-title">' + esc(title)
1272
1466
  + (badge ? '<span class="pro-pill feature">' + esc(badge) + "</span>" : "") + '</span><span class="nav-sub"' + fitted + ">"
1273
- + esc(sub.filter(Boolean).join(" · ")) + "</span></span>" + icon("right") + "</button>";
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>";
1274
1469
  }
1275
1470
 
1276
1471
  function fieldRows(page) {
@@ -1300,7 +1495,42 @@ function settingsDownload() {
1300
1495
  + '<button class="btn" data-act="choose_folder">选择…</button></div>'
1301
1496
  + '<div class="hint">用于后续下载;命令中指定路径时优先使用指定路径。</div>'
1302
1497
  + (settingsErrors.download_dir ? '<div class="err">' + esc(settingsErrors.download_dir) + '</div>' : '') + '</div>'
1303
- + 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 : "");
1304
1534
  }
1305
1535
 
1306
1536
  // 失败后自动重试 (user, 2026-11-24): off by default; what it retries in a tip on its small icon, not on the page.
@@ -1635,19 +1865,24 @@ function settingsMarkdown() {
1635
1865
  }
1636
1866
 
1637
1867
  // The school sign-in page (PaperSearch Pro): the schools saved, each with its account, filled in on the
1638
- // school's own login page once Pro has tested that school; one of them the default for downloads, switched
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
1639
1870
  // here; another added by finding it in the federations' lists, in any language (user, 2026-11-20). The saved
1640
1871
  // password in its field, hidden until the eye shows it (the user's: they may see it).
1641
1872
  function schoolTag(status) {
1642
- if (status === "verified" || status === "surveyed") return ["fill", "自动填写"];
1643
- if (status === "trial") return ["trial", "实测中"];
1644
- if (status === "check") return ["check", "需自己登录"];
1645
- return ["none", "暂不支持"];
1873
+ if (status === "verified" || status === "surveyed") return ["fill", "已验证"];
1874
+ return ["none", "未验证"];
1646
1875
  }
1647
1876
  function tagHtml(status) {
1648
1877
  const [cls, text] = schoolTag(status);
1649
1878
  return '<span class="tag ' + cls + '">' + esc(text) + "</span>";
1650
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
+ }
1651
1886
  // A school's name in the window's language (user, 2026-11-21): in English its English name; in another its name in
1652
1887
  // that language where Pro has one (Wikidata's), in Traditional Chinese else its Chinese one (tr() turns its
1653
1888
  // characters); else its own name as its federation lists it, not a translation.
@@ -1734,7 +1969,7 @@ function loginSchool(s, index) {
1734
1969
  const row = '<button type="button" class="login-row ls-head' + (shown && items.length ? " with-menu" : "") + '" data-act="login_open" data-key="'
1735
1970
  + esc(s.key) + '" aria-expanded="' + shown + '">'
1736
1971
  + (many ? '<span class="ls-n">' + (index + 1) + "</span>" : "") + '<span class="ls-name">' + esc(schoolName(s)) + "</span>"
1737
- + (s.current ? '<span class="tag default">' + esc("默认") + "</span>" : "") + tagHtml(s.status)
1972
+ + (s.current ? '<span class="tag default">' + esc("默认") + "</span>" : "") + tagHtml(s.status) + entryTagHtml(s)
1738
1973
  + (shown ? "" : '<span class="ls-acct">' + esc(s.saved ? (s.enabled ? s.username : "已关闭") : "未填账号") + "</span>")
1739
1974
  + icon(shown ? "down" : "right") + "</button>";
1740
1975
  if (!shown) return '<div class="login-school">' + row + "</div>";
@@ -1789,7 +2024,7 @@ function loginFound() {
1789
2024
  if (!schoolFound) return "";
1790
2025
  if (!schoolFound.ok) return '<div class="err" role="status">' + esc(schoolFound.error || "查找失败") + "</div>";
1791
2026
  return (schoolFound.results || []).map((s) => '<div class="login-found"><span class="ls-name">' + esc(schoolName(s)) + "</span>"
1792
- + (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)
1793
2028
  + (s.added ? '<span class="ls-fed" style="margin-left:auto">' + esc("已添加") + "</span>"
1794
2029
  : '<button class="btn" data-act="add_school" data-key="' + esc(s.key) + '">' + esc("添加") + "</button>") + "</div>").join("")
1795
2030
  + (schoolFound.note ? '<div class="err" role="status">' + esc(schoolFound.note) + "</div>" : "");
@@ -1875,7 +2110,7 @@ function supportRows(list, where = null) {
1875
2110
  // Its name in the window's language (schoolName), wrapped when long; found by a search, where it is beside it (its
1876
2111
  // country, or its part of the country open).
1877
2112
  return list.map((s) => '<div class="login-found"><span class="ls-name">' + esc(schoolName(s))
1878
- + (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("");
1879
2114
  }
1880
2115
  function supportRow(act, key, count, open) {
1881
2116
  return '<button type="button" class="row" data-act="' + act + '" data-key="' + esc(key) + '"'
@@ -1945,11 +2180,11 @@ function settingsLoginSchools() {
1945
2180
  if (!supportList.ok) return head + '<div class="err" style="text-align:left">' + esc(supportList.error || "读取失败") + "</div>";
1946
2181
  const all = supportSchools();
1947
2182
  const filled = all.filter((s) => s.status === "surveyed" || s.status === "verified").length;
1948
- const check = all.filter((s) => s.status === "check").length;
2183
+ const check = all.length - filled;
1949
2184
  // The numbers, each saying what it counts, on the first page only; the line explaining them was removed (user,
1950
2185
  // 2026-11-21).
1951
- const stats = supportOpen ? "" : '<div class="stats" style="margin-top:10px"><div><b>' + filled + "</b><span>" + esc("所学校自动填写账号密码")
1952
- + "</span></div><div><b>" + check + "</b><span>" + esc("所学校需自己登录") + "</span></div></div>";
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>";
1953
2188
  const hint = supportOpen ? "搜索学校" : "搜索学校或地区";
1954
2189
  return '<div class="support-top">' + head + stats
1955
2190
  + '<label class="support-search">' + icon("search") + '<input id="support-filter" type="search" autocomplete="off" spellcheck="false" value="'
@@ -2149,7 +2384,9 @@ function keyError(text, tone) {
2149
2384
  let lastCls = "", lastPlace = "", hovering = false, closing = false, dragging = false, endingDrag = false;
2150
2385
  let dragReady = Promise.resolve();
2151
2386
  let attentionPointer = null;
2387
+ let waysShown = "", wayPicked = ""; // 选择登录方式: the prompt the card opened on, the one picked from
2152
2388
  let renderedAttention = null;
2389
+ let lastAsking = "";
2153
2390
 
2154
2391
  function updateAttentionCountdown() {
2155
2392
  const a = V.attention;
@@ -2169,12 +2406,13 @@ function render(force) {
2169
2406
  if (panel === "settings") html = settingsCard();
2170
2407
  else if (!open) { html = pill(); shape = "pill"; }
2171
2408
  else if (panel === "papers" && V.lists && (V.mode === "running" || V.mode === "done")) html = papersCard();
2172
- else if (V.mode === "attention") html = attentionCard();
2173
- else if (V.mode === "running") html = runningCard();
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();
2174
2412
  else if (V.mode === "done") html = doneCard();
2175
2413
  else html = idleCard();
2176
- const cls = shape + (V.mode === "attention" && panel !== "settings" ? " warn" : "");
2177
2414
  const attention = V.mode === "attention" && panel !== "settings";
2415
+ const cls = shape + (attention && (shape === "pill" || !papersAtOnce()) ? " warn" : "");
2178
2416
  const sameTask = !attention || (renderedAttention?.current === V.current
2179
2417
  && renderedAttention?.run_id === V.run_id);
2180
2418
  const unchanged = !force && sameTask && html === lastHtml && cls === lastCls;
@@ -2189,6 +2427,10 @@ function render(force) {
2189
2427
  // A scrolled list keeps its place while its page is redrawn (a key opened or saved, a group opened).
2190
2428
  const place = panel + ":" + (panel === "settings" ? settingsPage : papersKind);
2191
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;
2192
2434
  // The page itself scrolled (支持的学校's long list) keeps its place too (user, 2026-11-21: a press on the card's
2193
2435
  // background, which starts and ends a drag, drew it again at its top), put back once it scrolls (keepSupportPlace).
2194
2436
  if (pageScroll !== null) { keepScroll = pageScroll || null; pageScroll = null; }
@@ -2198,6 +2440,9 @@ function render(force) {
2198
2440
  root.innerHTML = '<div class="surface">' + html + "</div>";
2199
2441
  const list = root.querySelector(".papers-scroll, .keys-scroll");
2200
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);
2201
2446
  localize(root);
2202
2447
  fitPaths(root);
2203
2448
  if (panel === "settings") holdSettingsHeight();
@@ -2310,6 +2555,12 @@ async function tick() {
2310
2555
  // A prompt only turns the capsule amber (with a system notification); hovering opens it.
2311
2556
  // Once the prompt is handled an open card folds back unless the pointer is on it.
2312
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 = "";
2313
2564
  if (panel === "papers" && open) await loadPapers(); // an open list follows the download
2314
2565
  render(switched);
2315
2566
  // Also detect a real pointer departure when clamping moved the window away
@@ -2318,6 +2569,15 @@ async function tick() {
2318
2569
  }
2319
2570
 
2320
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
+ }
2321
2581
 
2322
2582
  let inputActivation = Promise.resolve();
2323
2583
  async function act(action, target) {
@@ -2359,10 +2619,19 @@ async function act(action, target) {
2359
2619
  }
2360
2620
  case "show_paper": return say(await api().show_paper(Number(target.dataset.index)));
2361
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
+ }
2362
2627
  case "show_browser": {
2363
2628
  try { await inputActivation; }
2364
2629
  catch (error) { return say("未能激活进度窗口,请重试"); }
2365
- return say(await api().act("show_browser", v.current, v.run_id));
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);
2366
2635
  }
2367
2636
  case "report":
2368
2637
  if (panel === "report") { panel = ""; return render(true); }
@@ -2373,7 +2642,9 @@ async function act(action, target) {
2373
2642
  case "cancel": panel = ""; return render(true);
2374
2643
  case "stop": panel = ""; return say(await api().act("stop_batch", v.current, v.run_id));
2375
2644
  case "skip_item":
2376
- panel = ""; return say(await api().act(action, v.current, v.run_id));
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));
2377
2648
  case "resume_held": {
2378
2649
  heldAsked = { run: v.run_id, keys: heldKeys() };
2379
2650
  render(true);
@@ -2694,13 +2965,39 @@ async function act(action, target) {
2694
2965
  const input = root.querySelector('input[data-field="' + f.name + '"]');
2695
2966
  if (input) { input.value = f.default; settingsDraft[f.name] = String(f.default); }
2696
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
+ }
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;
2697
2992
  return;
2993
+ }
2698
2994
  case "save": {
2699
2995
  // Only this page's fields; the notification switch has saved itself.
2700
2996
  const values = {};
2701
2997
  root.querySelectorAll("input[data-field]").forEach((input) => { values[input.dataset.field] = input.value; });
2702
2998
  const folder = root.querySelector('#download-dir');
2703
- 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);
2704
3001
  if (!result.ok) {
2705
3002
  settingsErrors = result.errors || {}; // what was typed stays in settingsDraft
2706
3003
  return render(true);
@@ -2713,10 +3010,10 @@ async function act(action, target) {
2713
3010
 
2714
3011
  // A paper list scrolls; pressing in it must not drag the window. Nor in 支持的学校's list (user, 2026-11-21: a press
2715
3012
  // between its rows dragged, and the redraw after it went back to the top).
2716
- const interactive = (target) => target.closest('button, input, select, textarea, a, [contenteditable="true"], [role="button"], .paper-list, .papers-scroll, .keys-scroll, #support-list');
3013
+ const interactive = (target) => target.closest('button, input, select, textarea, a, [contenteditable="true"], [role="button"], .paper-list, .papers-scroll, .keys-scroll, #support-list, .plist');
2717
3014
  root.addEventListener("pointerdown", (event) => {
2718
3015
  if (event.button === 0 && api().activate_on_input) inputActivation = api().activate_on_input();
2719
- if (event.button === 0 && event.target.closest(".attention-target")) {
3016
+ if (event.button === 0 && event.target.closest(".attention-target, .pp.asking")) {
2720
3017
  attentionPointer = event.pointerId;
2721
3018
  clearTimeout(hoverTimer); clearTimeout(leaveTimer);
2722
3019
  }
@@ -2775,8 +3072,12 @@ window.addEventListener("blur", finishDrag);
2775
3072
  root.addEventListener("input", (event) => {
2776
3073
  // What is typed goes into the page's model at once, so that a redraw keeps it.
2777
3074
  const input = event.target;
2778
- if (input.dataset.field) settingsDraft[input.dataset.field] = input.value;
2779
- else if (input.id === "download-dir") settingsDraft.download_dir = input.value;
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;
2780
3081
  else if (input.dataset.key && editing) editValues[input.dataset.key] = input.value;
2781
3082
  // The sign-in page's fields and 添加学校 (user, 2026-11-20: a click elsewhere had emptied them).
2782
3083
  else if (input.id === "login-user") loginValues.username = input.value;
@@ -2856,12 +3157,50 @@ async function observeHover(inside, force = false) {
2856
3157
  if (!force && lastNativePointer && pointer.x === lastNativePointer.x && pointer.y === lastNativePointer.y) return;
2857
3158
  lastNativePointer = pointer;
2858
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
+ }
2859
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);
2860
3172
  root.addEventListener("mouseenter", () => observeHover(true));
2861
3173
  root.addEventListener("mouseleave", () => {
2862
3174
  attentionPointer = null;
3175
+ markRow("");
2863
3176
  observeHover(false);
2864
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); });
2865
3204
  function endAttentionPress(event) {
2866
3205
  if (attentionPointer === null || (event.pointerId !== undefined && attentionPointer !== event.pointerId)) return;
2867
3206
  attentionPointer = null;