Commit graph

10002 commits

Author SHA1 Message Date
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
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
be2ae2c1d7 Fix missing labels on -/+ buttons in style manager after #4006 2024-06-07 00:54:32 -04:00
Dan Stillman
e86458f11b Remove redundant zotero.ftl line after #4006 2024-06-07 00:54:32 -04:00
windingwind
5cc6631fd3
Improve merge pane (#4200)
resolve: #4142
2024-06-07 00:37:54 -04:00
Abe Jellinek
c826805bca
editable-text CE: Don't modify the DOM in sizeToContent() (#4214) 2024-06-06 23:35:53 -04:00
Dan Stillman
4522704a77 Fix Zotero.FileTypes.getIDFromMIMEType() (unused) 2024-06-06 08:09:34 -04:00
Adomas Venčkauskas
d306fa9142 Sort translators before calculating the translator hash 2024-06-06 10:08:27 +03:00
abaevbog
4f7b43747a
vpat 27/28: rtfScan aria edits (#4020)
- linked input/output file labels to the input fields so
they have descriptive names
- added more detailed button labels
- fixed "No file selected" not appearing if no file is selected
2024-06-06 01:03:58 -04:00
Abe Jellinek
f30d8f07d5 Correct field/getter names in collapsible-section CE 2024-06-06 00:58:11 -04:00
Abe Jellinek
0f0fec0c64 Persist pinned item pane section across restarts 2024-06-06 00:58:11 -04:00
abaevbog
a81701d7e7
vpat 51: add aria labels to advanced search (#3987)
In addition, make toolbarbuttons explicitly focusable
and make them clickable on space/Enter.
2024-06-06 00:54:54 -04:00
abaevbog
5a45717270
vpat 3: make "-"" btn focusable even if hidden (#4053)
In libraries, notes and tags boxes, do not hide the actual
"-" toolbarbutton, hide the <image> inside of it. Visually,
it looks the same but the button can be focused via tab
without having to expicitly make it visible. It means that
shift-tab from the section header will not skip the "-" button.

Also, make "remove" toolbarbutton from tagsbox focusable like all
others for consistency.
2024-06-06 00:13:26 -04:00
abaevbog
70d52277b1
vpat 11: do not skip over disabled tags during arrow navigation (#4051) 2024-06-06 00:11:52 -04:00
abaevbog
c07a13fcfe
vpat 46: remaining aria-labels in preferences (#4006)
- Linked remaining found inputs/menulists to their labels.
- Made the "Choose resolver" a proper visible
label, so that it does not oddly disappear if you click
on the dropdown with "Custom" showing after even if the
selection did not change. For the purpose of VPAT, a
visible label is always good for success criteria 3.3.2
https://www.w3.org/WAI/WCAG21/Understanding/labels-or-instructions
- Added explicit names to +/- buttons
- aria-labelledBy for inputs surrounded by text
- fluent strings for resolver preferences
- remove openURL.version preference, hardcode "1.0"
2024-06-06 00:00:33 -04:00
Abe Jellinek
094b8157af Libraries & Collections pane: Use properties instead of global state 2024-06-05 14:33:51 -04:00
abaevbog
c9d60999d8
quickFormat guidance panel fixes (#4193)
- added 8px padding around text on linux. Mac and win already have some
padding around text through --panel-padding. Fixes: zotero#4187
- guidancePanel.js fetches text from .ftl file instead of zotero.properties
- added first-run-guidance-quickFormat to zotero.ftl with updated
text to better reflect current functionality. Fixes: zotero#4191
- removed unnecessary special treatment for qf guidance panel on mac
- moved guidance panel text for itemBox creator menu into zotero.ftl

---------

strings tweaked by @dstillman
2024-06-05 06:36:29 -04:00
Abe Jellinek
eca5f6bea1
zotero://select handler: Switch to library tab (#4204) 2024-06-05 00:52:03 -04:00
abaevbog
56980080ad
QuickFormat: adding multiple items with shift-arrow (#3851)
- multiple reference items can be selected with
shift-arrowUp/Down or Cmd/Ctrl-click and added as bubbles
via Enter or click on one of selected items
- Shift-click can be used to select the range of items
- if there is a retracted item among multiselected
that is not OK'd (cancel or view in library clicked),
no bubbles are added and the item is removed from
the multiselection
- added a red note to item's description indicating
if an item is retracted
2024-06-05 00:38:56 -04:00
Abe Jellinek
4d7c641f7b Libraries & Collections: Make all collections clickable in context pane
Fixes #4201
2024-06-04 11:14:10 -04:00
Abe Jellinek
5539bd50ce Remove redundant click handler code from FeedAbstract actor
Missed when committing 8eedfd4a14.
2024-06-04 10:55:14 -04:00
windingwind
a6076ce76c
Fix item pane header (#4159)
* Improve feed item pane header (fixes #4141)
* Show item pane custom head when headerMode is none (fixes #4116)
* fx115: Fix button style on windows (fixes #4120)
* Move split-menu-button styles to SCSS
2024-06-04 02:14:20 -04:00
Abe Jellinek
845f11b1da Remove nonfunctional style repo CSS modification code 2024-06-04 02:06:32 -04:00
Abe Jellinek
8eedfd4a14 basicViewer: Open links externally 2024-06-04 02:06:32 -04:00
windingwind
fab20327a5 Fix QF titlebar on wayland 2024-06-03 11:23:36 +03:00
Dan Stillman
b20926aa75 Update CSL locales
https://forums.zotero.org/discussion/comment/464380/#Comment_464380
2024-06-03 00:53:10 -04:00
windingwind
066eda7315
Fix collection tree renaming background color (#3829) 2024-05-31 07:16:05 -04:00
Tom Najdek
d6d9979f19
Fix dates not following configured locale. Resolve #3559 (#3880) 2024-05-31 06:58:14 -04:00
abaevbog
709281db02
vpat 56: added tooltip for quickFormat Z-menu (#4000)
It could be a simple aria-label but tooltip is more functional
2024-05-31 06:28:33 -04:00
abaevbog
c4dbf19446
vpat 23: better aria label for itembox merge btn (#4173)
Added the field name for the label to be more descriptive.
The new announced label is e.g. "Select version of title field".

Followup to https://github.com/zotero/zotero/pull/4096#issuecomment-2121894422
2024-05-30 01:44:49 -04:00
Abe Jellinek
6b4cac1fb5
Allow item pane sections to declare dependencies for rerender, fix Libraries and Collections not updating (#4155) 2024-05-30 01:44:11 -04:00
Dan Stillman
4a9ce6b82b Use correct URL for beta builds for Windows 32-bit-on-64-bit warning
For #4172
2024-05-29 07:05:15 -04:00
Tom Najdek
14a0a8ab24 Show banner to 32-bit Windows users to reinstall 64-bit version (#4172)
Resolves #3940
2024-05-29 07:03:57 -04:00
Dan Stillman
08ffa64abf Add Zotero.isBetaBuild and fix Zotero.isDevBuild
Previously `isDevBuild` was true for beta, dev, or source builds (but
also wasn't used anywhere)
2024-05-29 06:59:17 -04:00
windingwind
fe3dae2d15
Refactor AttachmentPreview render and discard (#4161) 2024-05-28 00:05:29 -04:00
abaevbog
c8cf38cdf1
fix itembox creator btns not hiding in view mode (#4169)
Fixes: #4166
2024-05-25 04:09:19 -04:00
Abe Jellinek
bbde79818f Snapshot resource handler: Use attachmentReaderType
isSnapshotAttachment() checks the link mode (needs to be IMPORTED_URL),
but we actually allow viewing all attachments with text/html MIME types
as "snapshots" in the reader. Don't throw on any HTML attachment that
the reader is willing to open.
2024-05-24 11:25:37 -04:00
Abe Jellinek
2776d21ba0 Fix leak warning when indexing snapshots
Closes #4133
2024-05-24 11:19:04 -04:00
Abe Jellinek
b68957debe Item box: Show View Online button in feeds
Fixes #4167
2024-05-24 10:34:54 -04:00
Abe Jellinek
81954d74d1
Item box: Save text selection along with focus (#4165) 2024-05-24 10:12:12 -04:00
Abe Jellinek
3176516b79 Feeds: Fix error parsing items with rights information
- 59afef6 added a duplicate assignment to item.rights that was putting
  a TextConstruct(!!!!) in the item JSON field instead of a string
- info.rights was being set to a TextConstruct (preexisting issue!)
2024-05-23 14:20:44 -04:00
Abe Jellinek
e20b02c124 Fix broken feeds due to rights fields missing in _textConstructs
And warn instead of throwing in the future.

Fixes #4162
2024-05-23 10:46:08 -04:00
abaevbog
9325f773cc
fix tagsbox enter glitch (#4160)
The 'blur' event needs to be dispatched by editable-text
before its state is reset (not after) because tagsbox uses
.initialValue in the 'blur' handler.

followup to 101e6d55d5

Fixes: #3575
2024-05-23 00:16:36 -04:00
Abe Jellinek
59afef6c2e
Feeds: Refactor to move field extraction to FeedProcessor (#4158)
And support more PRISM fields.
2024-05-22 18:29:58 -04:00
abaevbog
101e6d55d5
fix itembox creator row glitches (#4152)
- fix the infinite loop glitch. Tweak of editable-text to only
dispatch 'blur' event if the input was actually blured. It prevents
the hideEditor from being locked in an infinite loop due to the
call stack hideEditor -> modifyCreator -> moveCreator -> blur -> hideEditor
- refactor blurOpenField to not be async and to not be used in most
places. It is mainly redundant now that editable-text handles blur
if clicked anywhere outside of it, so it helps to avoid confusion.
- since moveCreator does not await or yield for anything anymore, remove the
Zotero.spawn part. The rest of the function is unchanged.
- on focusin of the empty unsaved creator row, use its future unsaved id
that reflects its positioning instead of its real id (which technically is
the very last creator row). That way, a tab from a creator row that was just
filled will land to the proper component after render, as opposed to
focusing the very last row.
- similar approach to removing the unsaved creator row when the focus is
in it - focus the row above it, as opposed to the last row.

Fixes: #4145
Addresses part of: #4143
2024-05-22 18:26:52 -04:00
Bogdan Abaev
2071a7c4cf enable + button on all creator rows
- plus button is enabled on all creator rows, not just the last one
- enabled plus button will add an empty unsaved creator row below
  current creator row. After that, plus button is disabled as long as
  the next row is unsaved.
- the grippy of a newly added unsaved row is disabled
- adding an unsaved creator row will remove another unsaved creator row
  if one exists. That way, only one unsaved row can exist at a time
- once the unsaved creator row is added, it is tentatively perceived as
  the "last" creator row based on its id. That is to avoid shifting all
  other creators' indicies and saving the item too many times.  When the
  field is blurred, that new creator is moved into its "unsavedIndex"
  before saving the item
2024-05-21 02:50:52 -04:00
Bogdan Abaev
fe01113935 fix wrong suggestions for creators
Fix to a glitch where after switching creator field mode, the
autocomplete suggestions for creators would still be for the old mode.
This only happened if the field mode was changed on an empty, unsaved
creator row.
2024-05-21 02:50:47 -04:00
Bogdan Abaev
c6799bc3c2 itembox focus edits and refactoring (#4096)
- removed ztabindex logic from itemBox. It is no longer needed, adds
  unnecessary complexity and is likely at the root of multiple glitches
  if a plugin inserts an arbitrary row that does not have ztabindex set.
- if a creator row is deleted when the focus is inside of the row, focus
  another creator row to not loose the focus.
- more centralized button handling in `_ensureButtonsFocusable` and
  `_updateCreatorButtonsStatus`
- refactoring of hidden toolbarbuttons css so that the icons are still
  hidden and don't occupy space (if desired) but are still visible for
  screen readers, so they are focusable without JS changing their
  visibility (this with ztabindex removal fixes vpat 24)
- removed `escape_enter` event from `editable-text`. It was a workaround
  to know when itemBox should move focus back to itemTree. Unhandled
  Enter on an input or Escape should focus itemTree (or reader) from
  anywhere in the itemPane/contextPane (not just itemBox), so that logic
  is moved to itemDetails.js. To avoid conflicts with Shift-Enter, do
  not propagate that event outside of multiline editable-text. Fixes:
  #3896
- removed not necessary keyboard nav handling from itemDetails.js. It
  was only needed for mac, and is redundant if "Keyboard navigation"
  setting is on
- using `keydown` instead of `keypress` for itemDetails keyboard nav
  handling because `Enter` `keypress` does not seem to get out of
  `editable-text` but `keydown` does.
- old handleKeyPress from itemBox is no longer relevant for most
  elements, so it is removed and substituted with a dedicated handler
  just for creator row.
- moved the creator's paste handler into its own dedicated function
  from the autocomplete handler (which was confusing)
- special handling for `enter` and `escape` events on `editable-text`
  with autocomplete to not stop event propagation, so that the events
  can bubble and be handled in `itemDetails`. It avoids some cases of
  the focus being lost and returned to the `window`. It was unnecessary
  earlier due to `escape_enter` workaround but only within itemBox and
  only within itemPane.
- removed explicit tab navigation handling from `collapsible-section`
  header. Currently, it may get stuck when buttons are hidden (e.g. in
  the trash mode). It was only added to enable keyboard navigation on
  mac before special "Keyboard navigation" setting was discovered (it
  was never an issue on windows), so now it's easier to just let mozilla
  handle it.
- always use `getTitleField` to find and focus the proper title field in
  itemBox
- on shift-tab from the focused tab, just move focus to the first
  focusable element before the splitter without any special handling for
  attachments, notes and duplicates pane as before. It ensures a more
  consistent and predictable keyboard navigation, especially now that
  itemPane is fairly keyboard accessible.

Fixes: #4076
2024-05-21 02:45:19 -04:00
Dan Stillman
1394381257 Include unixMode in OS.File.stat() shim 2024-05-21 01:56:38 -04:00
Dan Stillman
03be938444 Don't try to use Zotero.isWin in OS.File shim 2024-05-21 01:56:28 -04:00
Abe Jellinek
eed7acff08 Ignore sort keyboard shortcuts in non-library tabs
Fixes #4140
2024-05-20 10:34:13 -04:00
windingwind
7fa7cf310e Fix merge window (#4130)
- Fix render issues
- Fix merge pane min-width
- Use no-titlebar modal for merge window on MacOS
- Disable section collapsing in merge pane
- Disable section open state caching in merge pane

fix: #3611
2024-05-19 00:58:14 -04:00
windingwind
1f322cddb8 Fix eslint errors in mergeGroup.js 2024-05-19 00:55:10 -04:00
Abe Jellinek
90634fc5c8 numDistinctFileAttachmentsForLabel: Filter best attachment 2024-05-19 00:52:36 -04:00
Dan Stillman
95d5a54174 Fix file-import breakage from 8e7d9927ef
https://forums.zotero.org/discussion/114465/zotero-7-bug-report-latest-beta-build-78-5be5ca941-broke-file-import
2024-05-17 10:05:35 -04:00
Dan Stillman
cd0ec45dc8 Make all publicationTitle fields multi-line, not just bookTitle
For some reason applied only to Book Title in #890

https://forums.zotero.org/discussion/comment/463195/#Comment_463195
2024-05-17 05:27:40 -04:00
windingwind
126d12905b Revert menulist type=radio
Partially revert 5438247, 63012a8 because the menulist style is fixed by 4a0bb2d in SCSS
See also #4052
2024-05-17 17:23:22 +08:00
Abe Jellinek
f6ee160186 editable-text: Reset state after programmatic blur()
Regardless of whether the window is active.

Fully fixes #4101
2024-05-16 11:07:47 -04:00
Abe Jellinek
b4c5c5d539 Item pane header: Use focused getter instead of :focus-within
:focus-within doesn't match when the window is inactive but the field
is focused.

Addresses #4101, except that focusing the new item's title field and
pressing Escape will clear the field (without modifying the item).
2024-05-16 11:07:15 -04:00
Abe Jellinek
c7159a5fa6 Revert "Fix item type menuitem type attribute"
This reverts commit 6db62c6705.

Fixes #4106
2024-05-16 10:16:11 -04:00
Dan Stillman
5be5ca9416 Always return from numDistinctFileAttachmentsForLabel() once we're >1 2024-05-16 01:41:55 -04:00
Dan Stillman
834ee0ff6c Switch to separate localized strings for "Show File"/"Show Files"
https://github.com/zotero/zotero/pull/4124#issuecomment-2114036702
2024-05-16 01:41:17 -04:00
Abe Jellinek
1bf0fd7d57 Scaffold: Manage blank lines before test cases automatically 2024-05-15 12:42:00 -04:00
abaevbog
1e990f3ca0
vpat 42: link url label to input in scaffold (#4017) 2024-05-15 06:58:52 -04:00
windingwind
f1d8a1c289 Fix splitMenuButton dropdown icon 2024-05-15 06:45:10 -04:00
windingwind
bc47ee46c8 Fix item pane buttons after CEification
Fixes #4115
2024-05-15 06:45:10 -04:00
windingwind
9a23031c12 Rename ItemPaneHeader CE localName to item-pane-header
Closes #4114
2024-05-15 06:45:09 -04:00
windingwind
1e3ebc082e Rename PaneHeader to ItemPaneHeader
Addresses #4114
2024-05-15 06:45:09 -04:00
windingwind
4fc8850f1e Skip item pane section render when not in selected tab 2024-05-15 06:45:09 -04:00
windingwind
8b083aa426 Fix context pane unnecessary update
Fixes #4029
2024-05-15 06:45:09 -04:00
windingwind
91c0c28b5d Fix attachments & annotation box refresh bugs and add tests (#4031)
Fixes #3993
Fixes #3995
Closes #4082
2024-05-15 06:45:01 -04:00
Dan Stillman
0c8d3f0829 Improve counting of file attachments for Show File and Export PDFs
If a parent item and its primary attachment are selected, it should
still say "Show File" rather than "Show Files". This adds the
questionably named `Zotero.Items.numDistinctFileAttachmentsForLabel()`
to try to figure out if we're operating on 0, 1, or >1 items.

Follow-up to #4124
2024-05-15 05:50:47 -04:00
Abe Jellinek
c47617c809 Move "Show File" out of Locate menu and into File menu (#4124) 2024-05-15 05:50:42 -04:00
Dan Stillman
e1f1003318 Add Zotero.Item::numFileAttachments() 2024-05-15 05:48:03 -04:00
Abe Jellinek
bb146328b8
Update default locate engines (#4125) 2024-05-15 05:45:38 -04:00
Abe Jellinek
099c8e9958 Locate manager window: Support Accel-W to close 2024-05-14 14:58:45 -04:00
Abe Jellinek
c94c0bae8f Locate manager window: Update list after Restore Defaults 2024-05-14 14:57:31 -04:00
Abe Jellinek
9eabc169c4
Move Locate to sidenav (#3747) 2024-05-14 04:19:58 -04:00
abaevbog
7091fa3a58
touchscreen longpress displays context menu (#4104)
Fixes the issue where long press would not open up
context menu in a virtualized table and tab bar because
it was handled in mousedown events that longpress on a
touchscreen does not dispatch.

This behavior is still observed in the scrollable area
of the reader and the note editor.

Addresses: zotero#4094
2024-05-13 19:03:29 -04:00
Abe Jellinek
5dae581ad3
Lazy load CEs (#4112) 2024-05-11 04:11:22 -04:00
Bogdan Abaev
be1c890051 After new item creation, focus title in itemBox (#4113)
When item is created manually, title field in itemBox
will be focused instead of the title in the itemPane as before.
If the itemBox is collapsed, it will be opened.

Added 'open' setter to item pane section for brevity

Fixes #4111
2024-05-11 04:09:05 -04:00
Dan Stillman
c01b3ae270 Don't use [ztabindex] in selector when finding metadata fields 2024-05-11 03:47:51 -04:00
abaevbog
ffef57eed1
redone fix of focus sticking to tab after click (#4087)
- revert debcb9944d since it breaks
drag-drop reordering of tabs
- when reader is being refocused by contextPane, add a small delay
so that the focus settles on the tab before focusing the reader
- also explicitly refocus the reader tab after drag, since then focus
also lands on the tab and finds itself outside of the reader
2024-05-11 03:21:59 -04:00
Abe Jellinek
59b1d75b98
Item pane header customization (#3791) 2024-05-10 08:23:26 -04:00
abaevbog
8278140492
Prevent empty item type menu from appearing after Cmd-Shift-N when info section is collapsed (#4105)
If the info section is collapsed, do not try to focus and
open the itemType menu as it can lead to an empty dropdown.
Just focus the header title in that case
2024-05-10 03:23:20 -04:00
Dan Stillman
85f58cc97d Fix Utilities.Internal.md5Async() on missing files and empty strings
https://forums.zotero.org/discussion/114208/zotero-7-beta-bug-report-consistent-error-when-syncing
2024-05-08 01:16:37 -04:00
Abe Jellinek
634e27c621 Scaffold: Don't use cookie sandbox by default
Instead, just set an empty cookie sandbox when running tests without
"Remember cookies" enabled. The cookie sandbox doesn't remember cookies
set in JS, which breaks some sites in the Scaffold browser.

https://forums.zotero.org/discussion/114239/z7-beta77-scaffold-bugs-report
2024-05-07 15:11:03 -04:00
Abe Jellinek
19ab6b6643 Scaffold: Fix duplicate text in test status label 2024-05-07 14:30:56 -04:00
Abe Jellinek
387210e139 Scaffold: Fix Open URL 2024-05-07 14:28:50 -04:00
Abe Jellinek
655575eb77 Monaco / Scaffold: Use LF line endings on all platforms
https://forums.zotero.org/discussion/114239/z7-beta77-scaffold-bugs-report
2024-05-07 12:10:57 -04:00
Abe Jellinek
5f8ea3af9c PageDataChild: Return null channelInfo on non-HTTP channel
Rather than throwing. Fixes requireSuccessfulStatus on file: (etc.)
URIs.
2024-05-07 04:51:49 -04:00
Abe Jellinek
9b7d3edbb3 HiddenBrowser: Block all downloads 2024-05-07 04:51:49 -04:00
Abe Jellinek
8e7d9927ef Create Bibliography: Use HiddenBrowser to fix printing 2024-05-07 04:33:51 -04:00
Abe Jellinek
120d4cfacd HiddenBrowser: Add print support 2024-05-07 04:33:51 -04:00
Abe Jellinek
a473002663 Extract zoteroPrint() 2024-05-07 04:33:51 -04:00
Abe Jellinek
7f993a1528 Tab shortcuts: Use event.code for better keyboard layout compat 2024-05-07 04:29:20 -04:00
Abe Jellinek
13c96c6520 Sort shortcuts: Use Alt for better keyboard layout compat 2024-05-07 04:29:20 -04:00
Abe Jellinek
7e225c4517 Feed abstract: Load CSS asynchronously
Probably won't fix #4091, but can't hurt.
2024-05-06 14:12:23 -04:00
Abe Jellinek
e7b792e2d5 HiddenBrowser: options is optional, support data: URIs 2024-05-03 10:33:37 -04:00
abaevbog
debcb9944d
prevent focus from sticking to tab after click (#4078)
After clicking on a reader tab, the reader will get focused
but the default mousedown event handler can then shift
focus onto the actual tab. It looks like the focus gets "lost",
and breaks reader keyboard shortcuts so we want to avoid it.
Mainly happens on windows.

Fixes: #4077
2024-05-01 23:59:10 -04:00
Abe Jellinek
729b5a2082 Quick Search: Don't run on mode switch if field is empty
Fixes #4075
2024-05-01 14:43:42 -04:00
abaevbog
adaa61f2cf
Make opened tabs menu scrollable (#3833)
- If there are too many tabs opened to fit onto the screen,
the tabs menu can be scrolled
- When tabs menu is opened, scroll to the selected tab
- Use margins instead of padding to that the scrollbar does not
overlap with the cross button
- Make sure that if the tabs menu is long, there will
be a gap between it's top/bottom and the edge of the
screen
- On linux, screen.availTop and screen.availHeight are not always
correct and the menu can go outside of what is supposed to be
the available screen area. Special treatment for those
edge cases
2024-05-01 02:00:15 -04:00
abaevbog
9f453b55ad
post vpat-57: qf locator string tweak (#4067) 2024-05-01 01:18:28 -04:00
abaevbog
fa647459ac
set quicksearch placeholder as fluent argument (#4074)
Fluent seems to clear out label/placeholders attributes set directly
(not via .ftl file). So quicksearch placeholder added directly ends
up being emptied out.
This is the cleanest workaround found so far: add the placeholder
as the fluent argument

Fixes: #4073
2024-05-01 01:11:15 -04:00
windingwind
63012a816f Fix library menu type attribute
A follow up fix after #4052
Fix the padding of library menu on MacOS
2024-05-01 11:44:00 +08:00
abaevbog
638efad3eb
properly refocus tag from tag selector on re-enter (#4035)
- do not erase the last recorded tag on blur of the tag selector
- on tab from collectionTree or shift-tab from tag selector input,
try to refocus that last focused tag. If one does not exist,
try to focus the first non-disabled tag.

Fixes: #4008
2024-04-30 10:31:55 -04:00
Abe Jellinek
d5194f234d
Update progress window to use SVG icons (#4047)
* Fix translation progressWindow
* Use SVG icons, don't use determineAttachmentIcon() / getImageSrc()
* FeedItem#translate(): Pass itemDone params in correct order
* Why does FeedItem#clone() return JSON?
* Fix text misalignment
2024-04-30 05:32:54 -04:00
windingwind
6db62c6705 Fix item type menuitem type attribute
A follow up fix after #4052
Fix the padding of item type menu on MacOS
2024-04-30 16:46:30 +08:00
windingwind
dc06c699ec
Fix notes context handling issues (#4036)
fix: #4024
2024-04-30 03:03:17 -04:00
Abe Jellinek
da1eb6fda9 Feeds: Prefer content to summary when available 2024-04-30 02:14:57 -04:00