Commit graph

9985 commits

Author SHA1 Message Date
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
Abe Jellinek
4fe7d6fa0e Feed abstract: Add <base>
Fixes broken relative (or protocol-relative) images.
2024-04-30 02:14:57 -04:00
Abe Jellinek
302d8e925e
Remove a bunch of unused PNG icons (#4071) 2024-04-30 02:13:17 -04:00
Abe Jellinek
472ee72093
Fix column-sorting shortcuts on Windows (#4068) 2024-04-30 02:10:03 -04:00
Abe Jellinek
b9a93faabb Fix color picker tiles only showing outline
The @windows-form-element-base mixin sets background-image, so we need
to override that instead of just setting background-color.

Fixes #4065
2024-04-29 13:06:38 -04:00
Adomas Venčkauskas
1626ecf48e Limit related-items dialog to same library
Add ability to filter collection tree based on list of library IDs
Closes #4060
2024-04-29 17:19:32 +03:00
windingwind
54382475be Fix advanced search menu issues
Fix needsgutter padding of menupopup in menulist on MacOS
fix: #4052
Fix advanced search operator menu multi-select status
2024-04-29 11:45:09 +08:00
windingwind
3ec1a64a6b Fix QuickSearchTextbox value property
fix: #4057
2024-04-29 10:56:14 +08:00
Dan Stillman
81ed1f6ebb Strip line and paragraph separators in filenames
And don't fail on existing filenames with these characters in
`Item::attachmentFilename`

https://forums.zotero.org/discussion/114025/pdf-files-renaming-casuing-syncing-issue
2024-04-28 07:51:25 -04:00
Dan Stillman
41726fef84 Fix error message trying to add related item in another library
https://forums.zotero.org/discussion/114027/zotero-7-beta-remove-other-libraries-from-the-add-related-window
2024-04-28 04:08:04 -04:00
Martynas Bagdonas
7afbdd2150 Render PDF annotation images using PDF worker
Fixes #3191
2024-04-26 11:17:57 +01:00
Abe Jellinek
a5393ca0e5 Merge: Keep external annotations on master, don't erase on other
PDFWorker only re-imports external annotations when the file changes on
disk. Keep annotation items corresponding to external annotations so
that they don't disappear after the merge (and then come back when the
file is edited).

Tweaks behavior introduced in 2aa34a6.

https://forums.zotero.org/discussion/113943/zotero-7-beta-merging-pdf-files-leaves-ghost-external-annotations
2024-04-25 16:35:09 -04:00
Abe Jellinek
3a7145f4d5 Fix progress queue dialog overflow 2024-04-25 06:25:20 -04:00
Bogdan Abaev
fbfe4b2dfa qf: fix prepending multiple inputs to the editor
Fixes: #4041
2024-04-24 08:31:03 +03:00
Abe Jellinek
12b6645a1f
CookieSandbox: Fix attachToInterfaceRequestor() for XHRs (#4043) 2024-04-23 18:53:46 -04:00
Bogdan Abaev
0077c3f07a post vpat 57: revert layout changes to locator
Locator type dropdown just has aria-label "Locator type".
The locator input is labelled by a hidden label with "Locator input"
string, as well as the locator type. That way both are announced
when it is focused.

Fixes: #4039
2024-04-23 16:36:33 +03:00
Dan Stillman
60fd0829b0 fx-compat: Fix positioning and size of progress popups
In Firefox 115, overwriting `outerHeight` caused it to not report the
correct value later, and whatever issue were were working around seems
to have been resolved since Firefox 3.

https://forums.zotero.org/discussion/113633/zotero-7-beta-bug-report-the-progresswindow-shows-at-incorrect-position
2024-04-23 04:28:57 -04:00
Bogdan Abaev
784ccdd996 vpat 57/58: classic citation editor aria fixes
- vpat 57: remove tabindex values, set tabindex=0 on all focusable
fields. It allows mozilla to determine the best focus sequence
for keyboard navigation and fixes wrong order where some inputs would
go before the "Ok" and "Cancel" buttons and some - after
- vpat 58: added labels to all inputs to be announced when focused.
Added separate labels for locator menulist and for the locator input so
that the locator type has a proper label. It is also better to have
visible explicit labels when possible
2024-04-23 09:09:52 +03:00