Commit graph

224 commits

Author SHA1 Message Date
Abe Jellinek
ad7159834c Reader: Add support code for popup position persistence 2026-08-11 13:42:20 -06:00
Dan Stillman
bca6537e6d fx153: Allow eval() in the parent process
Translators are evaluated with the system principal, which worked until
now only because nsContentSecurityUtils::IsEvalAllowed() exempted any
profile with "JS hacks" present -- which for us meant
xpinstall.signatures.required being false. Bug 2038660 dropped that
exemption, so ask for eval explicitly.
2026-08-03 11:48:40 -04:00
Dan Stillman
1c005c7e21 fx153: Re-enable chrome: DTD loading
Bug 2043845 put the FORCE_ALLOWED_DTD content policy type behind a pref
that's off for everything but Thunderbird, so NS_NewChannel() refused the
load with NS_ERROR_CONTENT_BLOCKED and the XML parser silently skipped the
entity. Custom elements whose markup uses DTD entities then failed to
parse with "not well-formed XML".
2026-08-03 11:48:39 -04:00
Dan Stillman
14b43c9559 fx153: Disable Firefox's baseline CSP for chrome: documents
Bug 2038660 applies "script-src chrome: resource: moz-src:" to every
chrome: document, which blocks inline <script>s and inline event
handlers, so the main window loaded but ran none of its scripts.

We should move our inline scripts and event handlers into separate files
so that we can drop the pref.
2026-08-03 11:48:39 -04:00
Abe Jellinek
5a785c4e0f Read Aloud: Support highlight granularity customization & timestamps 2026-07-20 10:50:56 -04:00
Tom Najdek
e71bd89e0d Add support for undo/redo (#5823)
---------

Co-authored-by: Dan Stillman <dstillman@zotero.org>
2026-06-19 14:12:54 -04:00
Bogdan Abaev
0f2d3e103d Citation dialog: show placeholder after a new bubble is added (#5932)
After the first bubble is added, the focused input gets a placeholder
indicating that typing a number will add it as a page to the just-added
bubble. The placeholder is truncated if it's too close to the edge in
multi-item citations.

Also add a tip to the item details popup explaining that locators can
be typed into the main input field, with a link to the documentation.
The tip stops appearing once a typed locator has been used.

---------

Co-authored-by: Dan Stillman <dstillman@zotero.org>
2026-06-12 15:07:17 -04:00
abaevbog
fa3e0f683f
Citation dialog: display preview of the citation (#5916)
In Add/Edit Citation mode, display a preview of the citation
in the bottom section. The section can be hidden/displayed
via the toggle in the right corner.

Remove io.preview from editor instance, so that citation
dialog knows not to show the preview even if the preference
is set.

A minor refactor to have resizeWindow() resolve
when the animation is fully over, and clear minHeight
on window in list mode before resizing, restoring
it when resizing animation is done, same as in library mode.
It allows us to fully expand the window in list mode before
showing the preview.

Fixes: zotero#5910
2026-06-09 12:35:30 -04:00
Abe Jellinek
f0474fa250 Add support for clearing challenge in browser during translation 2026-04-23 15:34:28 -04:00
Dan Stillman
56ef61e45b Store vacuum.lastTime as seconds, not milliseconds
Also drop the default pref, since this is just internal state
2026-04-13 12:39:51 -04:00
Dan Stillman
b27c4cb023 Enable SQLite WAL mode and add periodic VACUUM INTO
- Switch journal mode from DELETE to WAL for better write performance.
  With EXCLUSIVE locking mode, SQLite uses heap memory for the WAL
  index, avoiding an -shm file. Set synchronous=NORMAL (matching what
  Mozilla uses for Places). Checkpoint WAL on database close so the
  .sqlite file has all data (for copies or backups).
- Add periodic database compaction on idle (after DB backup) using
  VACUUM INTO and do an atomic file swap back to zotero.sqlite if no
  writes occurred during the operation. Check if vacuuming is needed
  based on time interval (default 14 days) and freelist ratio (default
  10% threshold).
- Disable auto_vacuum, which causes fragmentation and is unnecessary
  with periodic VACUUM
- Remove the VACUUM call from the integrity check, which was always just
  an awkward hack to let people trigger a VACUUM without having an
  explicit button

Closes #652
2026-04-10 13:19:32 -04:00
Bogdan Abaev
6bec3c817e Citation dialog: allow to insert annotations (#5356) 2026-03-23 15:00:22 -04:00
Abe Jellinek
0abf2b455f
Add Read Aloud first-run guidance panel (#5818)
Plus guidance-panel changes:

- Fix description not updating when multiple panels exist
  in the document
- Fix nonfunctional noautohide attribute
- Show "Got It" button for noautohide with no navigation

---------

Co-authored-by: Dan Stillman <dstillman@zotero.org>
2026-03-05 20:07:06 -05:00
abaevbog
bd8d56e384
Preference to hide context annotation rows (#5315)
hideContextAnnotationRows pref, accessible via View > Hide Non-Matching Annotations,
will hide non-matching context annotation rows.
Enabled by default.

Fixes zotero#5264
2026-02-06 00:51:01 -05:00
windingwind
e522f6185e
Add note as tab (#5528) 2025-12-18 23:49:42 -05:00
Dan Stillman
0cb8116bed Add default pref for showAttachmentFilenames
Missing from #4601
2025-12-18 23:06:33 -05:00
Dan Stillman
4ca9bbdae5 Automatically show post-upgrade banner for each new major version
And remove the density switcher
2025-12-16 13:50:27 -05:00
Tom Najdek
aec7b6a1ea
Persist the state of the Reader sidebar #5489 (#5593) 2025-11-13 10:32:34 -05:00
Tom Najdek
e896fd0137
Add continuous-renaming functionality for attachment files (#3860)
Resolves #1685
2025-09-11 04:54:03 -04:00
Abe Jellinek
d854058be6 Don't reopen collection/item pane on restart (#5495) 2025-08-20 02:00:31 -04:00
Dan Stillman
845361bdbc Update default Chicago style after upstream id changes 2025-07-15 00:46:10 -04:00
windingwind
61b62d0a02 Improve tabs menu (#4961) 2025-05-07 01:52:54 -04:00
abaevbog
929147b33a
citation dlg: miscellaneous followup fixes (#5095)
- last-closed -> last-used for citationDialogMode pref value
- pref label citationDialogLastClosedMode -> citationDialogLastUsedMode
- update Zotero.Prefs version. While migrating, if
integration.useClassicAddCitationDialog is true, set
integration.citationDialogLastUsedMode to 'library'
so the citation dialog opens in library mode on the first run.
If citationDialogLastClosedMode pref exists, it is
migrated to citationDialogLastUsedMode and cleared
- redone logic of extracting the locator to allow for better
detection of locators and to not rely on long regular
expressions that are hard to troubleshoot. Added tests for it.

These are the new rules for extracting locators:
- locator value can be either a set of numbers potentially
with some punctuation in between OR text surrounded with
single or double quotes
- locator labels can be typed in any of 3 formats:
full (chapter), short (chap.), or short with no
punctuation (chap)
- locator labels go before the locator values and there
may or may not be a space in between. For example,
chap.10 is the same as chap. 10.

Fixes: #5092
Fixes: #5093
2025-03-27 03:45:31 -04:00
Bogdan Abaev
4a00304925 Redesigned citation dialog (#4872)
Implemented redesigned citation dialog with library
and list modes one can switch between. This dialog is
a direct replacement of quickFormat and classic citation
dialogs.

In Library Mode:
- items table has a new + button column to add items from the
citation and rows of selected items are highlighted
- open, cited and selected items appear in a section
between the items table and bubbleInput. When there are no
matches, a message is shown.
- only top-level items are shown when citing
items and only notes/notes' parents - when adding a note
- selected items are gathered in a collapsible deck to save space.
Click on the deck will expand it. All selected items can be
added via "Add all" button.
- when an item is added, bubble-input may increase in height and
push itemTree lower. To try to preserve relative positioning
of the mouse, itemTree will scroll to be over the row that was just clicked

In List mode:
- arrow up/down from the input will change the selected item
with the focus remaining in the input
- selected items are a collapsible list section

Other behaviors and fixes:
- one can add any locator (not just pages) by typing its full or short name
in an input and pressing Enter (e.g. line 10, or l. 10, or chap. "test chapter")
- Added a new preference to select if the citation dialog
should always open in list mode, library mode or in the last
mode that was used
- bubbles whose items are selected in library or list mode
are highlighted
- arrow up/down from a bubble will focus the bubble
above/below it for easier navigation across bubble-input
- multi-select is supported on items in list mode or item cards in
library mode via Shift-arrow or Cmd+click to select multiple items
- Cmd/Ctrl + Enter will always accept the dialog no matter what
is focused
- when there are no bubbles, accept button is disabled
- after an item is added, bubble-input is always refocused
- added suppressed property to itemTreeMenubar to be able to
hide if in list mode, where it is not relevant. Fixed menubar
getting stuck or re-appearing on Alt keypress on Linux by setting
height: 0 vs hiding it via hidden.
- added initialFolder and onActivate prop to collectionTree to set which collection
should be reopened when dialog opens and to be able to set a custom
onActivate handler.
- added getExtraField prop to itemTree to get data on if
an item is in a citation or not

Implementation details:
- citationDialog.js is the main file. It relies on a number of
helper files in citationDialog/* directory to keep the main
file less cluttered. popupHandler.js contains the logic of
opening/closing the item details popup to add locator/prefix/suffix/etc.
keyboardHandler.js is responsible for overall keyboard navigation
throughout the dialog. searchHandler.js contains the logic
for running the search based on user's query. Finally, Helpers.js
has general helper functions that don't handle any actual logic.
- SearchHandler is set to run search in two ways: for cited/selected/open
items (which are cached and do not involve any actual SQL query) and
general search for items across all libraries. When layout.search
runs, firstly cited/selected/open items are updated after which the
SQL search runs.
- bubbleInput.js is a customElement responsible for bubbles interface.
bubbleInput.refresh takes a list of items and handles adding/removing/reordering
of bubbles as needed. It always has two inputs on each side of
a bubble, as opposed to having inputs inserted dynamically. It
allows keyboardHandler.js to handle navigation with arrows within
bubbleInput.
- when user interacts with bubbleInput, it emits custom events that are
handled by IOManager singleton in citationDialog.js, which
may update the items information and pass them back to bubbleInput.refresh
to have the list of bubbles updated
- CitationDataManager singleton is responsible for storing
items added into the citation in CitationDataManager.items
in an object with both Zotero.Item and the actual citation item.
It is easier to pass both items to other components
and helpers, as opposed to sharing functions to convert
items back and forth.
2025-03-10 22:40:43 -04:00
PChemGuy
8a06edab49
Sort strings naturally or alphabetically (#5075)
Hidden setting. If true, use natural collection sorting matching the current behavior. If false, use conventional alphabetic sorting.
2025-03-07 02:08:11 -05:00
Tom Najdek
6add721e68
Convert customThemes from a pref to a synced setting (#5071) 2025-03-05 06:43:52 -05:00
Martynas Bagdonas
553f0f3994 Implement reader appearance popup with custom themes support
Implements #4949, #5005
2025-02-04 13:43:50 +02:00
windingwind
c1c2bc76b7 fx128: Enable -moz-context-properties for SVG context properties 2025-01-07 23:50:46 -05:00
Martynas Bagdonas
75fb301f0a
Add pref to control auto-turnoff of note, text, image annotation tools (#4851) 2024-11-19 05:47:43 -05:00
Abe Jellinek
5f717d3bde Show first-run banner on upgrade (#3807) 2024-07-28 03:26:12 -04:00
Martynas Bagdonas
abad33116b Add reader text selection popup annotation mode toggle pref
Fixes #3352
2024-07-15 15:43:53 +03:00
Abe Jellinek
5a6b1a9f76
Add hyphenation and text appearance options for EPUBs (#4256)
And remove duplicate string
2024-06-27 06:02:47 -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
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
59b1d75b98
Item pane header customization (#3791) 2024-05-10 08:23:26 -04:00
Dan Stillman
613a907f3e Change pref from reader.useDarkModeForContent to reader.contentDarkMode 2024-01-24 23:32:23 -05:00
Martynas Bagdonas
c208325aeb Add menu option to toggle dark mode for reader content 2024-01-24 23:32:21 -05:00
Abe Jellinek
6e651271e8 Use two decimal points in default fontSize pref 2024-01-24 23:32:18 -05:00
windingwind
6af4605bd0 Implement attachment preview
- Implement attachment preview
- Implement attachment-box redesign
- Make filename editable
- Use new reindex icon
- Update attachment note layout
- Fix reader.js eslint errors
- Add fallback attachment icon and use redesign
- Use attachment preview for regular items
- Fix pinned pane not exists error
- Double click preview to open to page
- Fix itemPane pin bug
- Preload preview iframe
- Fix item pane scroll
- Add media preview support
- Fix item pane scroll bar on macos
- Fix reader sidebar with standalone attachment
- Fix attributeChangedCallback
- Add attachmentBox _updateAttachmentIDs
- Make attachment notes readonly and simplify note window script
- Implement convert attachment note to new note
- Support preview dragging
- Annotations box redesign
- Support custom buttons in the collapsible-section
- Add preview toggle button
- Fix collapsible section attribute listener
- Make attachment box notify sync to fix errors in test
2024-01-24 23:32:15 -05:00
Abe Jellinek
d6e5da403c Add uiDensity pref and menu controls 2024-01-24 03:39:08 -05:00
Abe Jellinek
c3d45a8a29 Set auto dark mode by default, add pref control 2024-01-24 03:39:08 -05:00
Abe Jellinek
deb6acaab1 Add preferences for ebook & snapshot file handling 2023-08-07 16:07:55 -04:00
Abe Jellinek
cab0fa93e7 Extend Retrieve Metadata to support EPUBs (#57) 2023-08-07 16:07:55 -04:00
Abe Jellinek
f5381403c0 Add ebook font to preferences
Choose from a list of preset font stacks, or any font on your system.
2023-08-07 16:07:51 -04:00
Dan Stillman
9b0ce9558c
attachmentRenameFormatStringattachmentRenameTemplate (#3249) 2023-08-04 05:58:15 -04:00
Dan Stillman
f4f9712bc9 Increase default title length limit to 100 in attachment filenames 2023-07-21 06:33:01 -04:00
Tom Najdek
0ba766f2e0
Customizable renaming rules #1413 (#2297) 2023-07-20 06:50:34 -04:00
Adomas Venčkauskas
e10fc538d0
Add a prompt to import Mendeley DB if mendeley citation found in doc 2023-04-06 17:10:13 +02:00
Dan Stillman
382bde0fc2 Rename PDF tab title pref to include reader
In case we have a separate pref for notes or something else

(cherry picked from commit 6d0e5959e6)
2023-02-09 17:21:21 +00:00
Martynas Bagdonas
c0c1d011fa Add a hidden pref for tab title with support for Creator-Year-Title option (#2985)
(cherry picked from commit a5fb64f295)
2023-02-09 17:21:21 +00:00