Commit graph

11285 commits

Author SHA1 Message Date
Abe Jellinek
c52ca2ee32
EPUB / Snapshot: Support printing (#4279) 2024-06-26 10:48:36 -04:00
Dan Stillman
a2dc0f7e37 Sort related items by title
Closes #4281
2024-06-26 01:02:07 -04:00
Abe Jellinek
0861710245 Style Editor: Indent with 2 spaces
Closes #4269
2024-06-24 11:14:39 -04:00
Dan Stillman
9c519948bc Add missing async to CollectionTree::selectSearch() 2024-06-24 02:45:20 -04:00
Dan Stillman
c61892e4b6 Fix Collections.getCollectionsContainingItems() when no ids are passed
Previously it would return all collections
2024-06-23 05:09:31 -04:00
Dan Stillman
c384fef867 Add getSelectedObjects() and limit getSelectedItems() to items
This adds an explicit function on ZoteroPane and the item tree for
getting objects -- including collections and searches in the trash --
and limits `getSelectedItems()` to returning actual items from the
selection. We shim various item properties on the collections and
searches in the trash, but code that's getting the selection should be
explicit about what it wants. Outside of the trash, they're equivalent,
except `getSelectedObjects()` does have an `asIDs` mode.

This switches to using getSelectedObjects() in various places and fixes
collections in the trash appearing as belonging to My Publications when
using the collections-containing-an-item highlight [1].

This also adds support for highlighting the parent collections of
collections in the trash.

[1] https://forums.zotero.org/discussion/115449/zotero-7-beta-deleted-collection-appears-as-belonging-to-my-publications
2024-06-23 05:09:31 -04:00
Dan Stillman
a612c1227e Fix collections in trash showing up in menus
New Collection menu and Add to Collection menu

https://forums.zotero.org/discussion/115447/zotero-7-beta-deleted-collections-still-appear-in-the-ui
2024-06-22 16:33:11 -04:00
abaevbog
3c6625f3cf
Tweaks to itembox unsaved creator row (#4178)
- Remove unsaved creator row on blur or escape
- Rename "unsavedRow" for "position" as we want to be able to find
the relative position of creators after the next refresh not only
for unsaved rows. In many cases "unsavedRow" as returned by getCreatorFields
is the actual index of the creator row.
- Calculate and use "position" in getCreatorFields for all creator rows, not
only unsaved one, when a new row is being added.
This fixed a bug where wrong row gets focused if an unsaved creator row is
added, some text is typed and then another creator row below this unsaved row is clicked.
- fixed a bug where autocomplete options would not be updated after creator mode
is switched for the default empty row (if there are no creators)
- simplified paste handler of creators to use modifyCreator that
also shifts creators if a creator is unsaved. Fixed bug brought up in
https://github.com/zotero/zotero/pull/4165#issue-2313280474 where
pasting creators does not always focus the last added creator.
- Fixed another bug brought up in https://github.com/zotero/zotero/pull/4165#issue-2313280474
where shift-enter from creator before "_ more creators" label
will add a new row in the end instead of focusing the next creator.
- Fixed bug where adding a row right before "_ more creators" label
and blurring it will remove all creators after it. Now, clicking +
on a creator right before the "_ more creators" label will display
all creators and add a row after it.
- Fixed a bug where if "_ more creators" is present, editing
a creator name and pressing shift-enter would loose focus
instead of adding and focusing a new row in the end.
- Fixed a bug where focus got lost from some buttons

Fixes #4143
Fixes #4241
2024-06-21 01:28:28 -04:00
Dan Stillman
6b5b47a83a Sidenav: Only show context menu with "Pin Section" on section buttons
Don't show on Locate menu button

Addresses #4253
2024-06-21 01:02:22 -04:00
abaevbog
bb3d9ccf8f
vpat 46: more aria for preferences inputs (#4264)
- linked color scheme radio buttons to their label. Using
aria-describedby on individual radio buttons instead of
linking color scheme label to radiogroup because voiceover
does not announce the label in that case.
- linked item pane header dropdown to its label
- linked markdown and richtext note format checkboxes to their labels.
- added aria description to linked attachments base directory
so the input and "choose" button
- linked virtualized tables to their labels

Data directory location setting needs some more labeling as well
but it's mechanics should be generally reworked per vpat 50.
2024-06-20 23:34:23 -04:00
Abe Jellinek
3231e24bd5 Local API: Use getByLibraryAndKeyAsync() 2024-06-20 13:20:09 -04:00
abaevbog
3f45def928
tabs startup loading optimization (#4174)
- if an unloaded tab is being opened, do not close the
tab and have reader re-open a fresh tab. Instead, keep the
tab as is, have reader use the tab as a container and
just change the tab's type. It should fix a glitch on
windows when if you click on a tab during initial loading,
it will disappear until reader re-adds it. A few tweaks
to allow unloaded tabs be generally "selectable".
Fixes: #4149
- during startup loading, select the yet-unloaded tab right
away. That way, a tab is almost immediately selected,
instead of being stuck on the library tab until the reader is ready.
- if the items are not loaded yet, use a placeholder
icon for tabs. Fixes: #4150
- special handling for reader loading message during initial
load. When an unloaded tab is selected, the loading message
needs to be displayed but, since there is no reader yet, we
add it in Zotero_Tabs.select and try to remove by the reader
when it's loaded.
2024-06-20 05:41:14 -04:00
Dan Stillman
d188857e06 Fix Reset not graying out after resetting note font size
https://forums.zotero.org/discussion/115372/zotero-7-beta-reset-is-not-greyed-when-using-default-note-font-size
2024-06-20 03:08:27 -04:00
abaevbog
13812f46b4
open itembox creator type menu on arrowUp/down (#4257)
To preserve behavior from zotero 6. We likely want to make
the creator type menu a proper menulist in the future.

Addresses: #4248
2024-06-19 02:28:26 -04:00
windingwind
24b5f2efb4
Assign ItemPane#_itemDetails default tabType (#4261)
Fix pinnedPane set to ItemDetails before tabType is assigned not stored to pref
fix: #4260
2024-06-19 02:26:08 -04:00
Abe Jellinek
310e741a01
Fix duplicate attachment row from attachments-box notify() (#4250) 2024-06-19 02:23:46 -04:00
Dan Stillman
fad3e25278 Local API: Return 404 for unknown group library 2024-06-19 00:40:13 -04:00
Dan Stillman
ecfc217ce9 Local API: Load library items if not yet loaded
Fixes #4244
2024-06-19 00:28:25 -04:00
Dan Stillman
e00b754fce Use Type instead of Genre for column in items list
https://forums.zotero.org/discussion/comment/465996/#Comment_465996
2024-06-18 13:52:45 -04:00
Dan Stillman
f8a8f694b4 Use sentence case for tooltip 2024-06-18 06:29:12 -04:00
Dan Stillman
30890b322a Remove obsolete strings
Calling code removed in 9eabc169c4
2024-06-18 06:28:21 -04:00
Dan Stillman
8d8ffd52b5 Add colons after labels in Locate settings
We left these out on purpose, but we've decided to keep colons in
non-phrase labels for now.
2024-06-18 06:20:35 -04:00
Martynas Bagdonas
06127d84da Update reader submodule and add missing strings 2024-06-18 09:49:54 +03:00
abaevbog
4d3b36efd3
new aria strings for the reader (#4239)
Aria labels and descriptions used by zotero/reader@e0e595a
to add a number of accessibility improvements to the reader
2024-06-17 23:19:24 -04:00
Dan Stillman
e7e7e4d230 Tweaks to trash functionality for collections and searches (#3307)
- Use SVG icons
- Show "[x] collection selected" or "[x] searches selected" in the item pane
- Show "[x] objects selected" if multiple types are selected, which I
  don't love, but I don't have a better idea
- Use existing strings for ARIA labels
2024-06-17 23:14:48 -04:00
Bogdan Abaev
a532cfb475 trash functionality for collections and searches (#3307)
When a collection or a saved search is deleted, it appears in
trash among other trashed items. From there, it can be restored
or permanently deleted.

Items of trashed collections are not affected my the trashing/permanent
deletion of a collection and need to be deleted separately like before.

Subcollections of a trashed collection do not appear in the trash and
are restored or permanently deleted with the top-most trashed parent.
2024-06-17 23:14:21 -04:00
Bogdan Abaev
f4d428cb16 vpat 37: run JS aria edits + localization (#4021) 2024-06-17 06:17:39 -04:00
Dan Stillman
f829d7c43e Explicitly close file input stream at end of md5Async()
Fixes "Could not remove the non-empty directory at…" file-sync error on
Windows

Fixes #4246
2024-06-17 01:24:15 -04:00
Dan Stillman
f7d7625c1c Redownload file marked as a forced download when opening file
Previously we were redownloading only `SYNC_STATE_TO_DOWNLOAD` files,
not `SYNC_STATE_FORCE_DOWNLOAD`, because the latter gets downloaded even
when using on-demand file syncing, but if the download fails for some
reason, it should be retried on a manual open.
2024-06-16 16:31:04 -04:00
Dan Stillman
e7ddf810c0 Fix error reporting for download failure on attachment open 2024-06-16 16:31:03 -04:00
Dan Stillman
49d3bae256 Fix Mac Word breakage after 44d9530ec
(Which predated HTTP Mac Word integration, so didn't include a change
for server_integration.js)
2024-06-16 16:31:03 -04:00
Abe Jellinek
dab423e857
Preferences: Replace legacy options with single scrollTo option (#4242) 2024-06-15 00:24:11 -04:00
abaevbog
2c74b0279d
fix focus not moving from reader into contextPane (#4238)
If the header is in bibliography entry mode.

Instead of trying to focus editable-text of the header (which
may not be possible), just focus the next node after the header.
2024-06-15 00:19:48 -04:00
Abe Jellinek
50e2250fe0
Add pref to enable local API (#4236)
And keep enabled in tests
2024-06-14 06:25:39 -04:00
Dan Stillman
3aaf3432da Local API: Add note to switch to getLibraryWebURL() (#4270)
Once #2893 is merged
2024-06-12 05:50:21 -04:00
Dan Stillman
9f4b15bbb7 Local API: Better handle users who have never logged in (#4270)
- Don't include `alternate` links
- Replace `users/local/:localKey` with `users/:userID` in `self` links
- Use `0` for id in `library` block
2024-06-12 05:48:34 -04:00
Dan Stillman
d33a904207 Local API: Use libraryTypeID rather than libraryID for library (#4270) 2024-06-12 05:48:29 -04:00
Dan Stillman
6b79b5849e Local API: numChildren=0, not false (#4270) 2024-06-12 05:45:54 -04:00
Dan Stillman
3363cb448a Local API: Attachment size fixes (#4270)
- Don't fail on missing attachment
- Get size of main file only
- Include best-attachment `attachmentSize` for parent items
2024-06-12 05:45:51 -04:00
Abe Jellinek
5d197e4b12 Mostly complete (read-only) compatibility with web library (#4270)
- Add pagination, limits, and Link header
- Add schema endpoints and dummy /settings endpoint
- Add /file endpoints
  - Browser security restrictions prevent the web library from actually loading
    the file: URIs that the local API returns, but out-of-browser use will work
    fine
- Add toResponseJSONAsync() DataObject function: delegates to toResponseJSON()
  by default, adds information that requires awaiting promises
  - Best attachment (links.attachment) and file size (links.enclosure.length)
    for items, meta.numItems for groups
  - Separate function for compatibility with the existing test code that uses
    toResponseJSON(), but we could consider unifying

This commit does not add the Access-Control headers that allow webpages to make
requests to the local API, since I don't think we actually want that.
2024-06-12 05:45:48 -04:00
Abe Jellinek
44d9530ecf Add local implementation of Zotero web API (#4270)
This required some tweaks to other parts of Zotero infrastructure:
- Search:
  - Add 'includeDeleted' condition to match behavior of 'includeTrashed' API
    parameter in a single search
- Data objects:
  - Improve toResponseJSON() implementations so output better matches the web
    API
    - Add toResponseJSON() to Zotero.Tags - has to be async so it can query the
      database and generally works differently from other toResponseJSON()
      functions, but accomplishes the same task
  - Remove unused getAPIData() and apiDataGenerator() DataObject functions. They
    aren't functional and wouldn't really make implementing the local server
    easier, so now seemed like a decent time to remove them
- Server:
  - Support resolving routes using pathparser.jsm
    - Add allowMissingParams option to PathParser#add(): prevents /route from
      matching /route/:param
  - Replace the query property of the data object sent to endpoint init()s with
    searchParams, an instance of URLSearchParams - supports #getAll() for
    repeatable parameters
- URIs:
  - Make getObjectURI() public, add utilities for converting URIs to API
    endpoints and web library URLs
2024-06-12 05:45:38 -04:00
Tom Najdek
88743682c3 Improve Advanced Search Dialog #4190 (#4225)
- Set the window minimum size to 700px x 500px.
- Fix a regression where non-applicable operators remain visible.
- Fix the "✔️" appearing next to multiple operators in the operator popup menu.
- Include the "Year" and "Attachments" columns by default in the results table.
2024-06-12 00:37:22 -04:00
Martynas Bagdonas
1d33b68761 Fix exported PDF annotation date and update reader/pdf-worker submodules 2024-06-11 21:13:17 +03:00
Martynas Bagdonas
50a037ecdc Add item pane preview mode support to reader and update its submodule 2024-06-10 16:35:46 +03:00
Dan Stillman
e3a831a68b Show dependent styles in CSL Preview
Addresses #4219
2024-06-10 05:52:29 -04:00
abaevbog
98066b1bc5
qf: improved multiselect (#4217)
- richlistbox shift-click selects a range starting with
_selectionStart. After a few cmd/ctrl clicks, _selectionStart
ends up not being correct - it can even point at an unselected item.
To help richlistbox properly select a range, before each click is
processed, reset _selectionStart to be either the first
or last selected item, depending on where shift-click landed.
- also, fixed a small glitch where inputs would be created if
you click on the red border outside of the actual editor.

Fixes: #4206
2024-06-08 04:55:24 -04:00
Dan Stillman
85a15175ae Fix sizing problems in Create Parent dialog
Use a regular paragraph for the intro text rather than an input
placeholder, which gets cut off it's too long, and allow the window to
be sized dynamically based on the title and localized strings.

Fixes #4109
2024-06-08 04:42:14 -04:00
abaevbog
249c5b8d12
vpat 49: refactor note format preference section (#4027)
"Note format" section in "Export" tab is technically a table and is
announced as such by screen readers, which is misleading.
It also opens a menulist when a checkbox is clicked, which is
not an expected behavior and can shift focus.

This refactors the "Note format" section to be a vbox container
with <checkbox>es and labels, which is more correct semantically and
does not confuse screen readers. In addition, when a chekbox is
clicked, dispatch a "change" event instead of unnecessarily open
up a menu.
2024-06-07 05:25:37 -04:00
Dan Stillman
7f84716c7e Update OpenURL setup prompt and add intro text to prefs
Closes #3788
2024-06-07 05:07:20 -04:00
Dan Stillman
4af4212360 Reorder preferences strings 2024-06-07 00:54:32 -04:00