Commit graph

9502 commits

Author SHA1 Message Date
windingwind
91ec79401d Add window inactive opacity to toolbar and tabs 2024-01-24 23:31:50 -05:00
Dan Stillman
16f66227bd Tweak padding for test-build warning 2024-01-24 23:31:50 -05:00
windingwind
b18a47b0d2 Remove stop sync button 2024-01-24 23:31:50 -05:00
Tom Najdek
df80c7573a Animate chevron when opening collection/item 2024-01-24 23:31:50 -05:00
windingwind
db5863fa0a Use redesign loading icon for sync spinner 2024-01-24 23:31:50 -05:00
Dan Stillman
c8c3856214 Adjust font-size increments
- Align with integer px values
- Add more granular resizing for common sizes
- Allow sizes smaller than the default (now 13px)
2024-01-24 23:31:49 -05:00
windingwind
a8016b1b2f Fix MacOS non-native checkbox menu options should be indented even if no checkbox 2024-01-24 23:31:46 -05:00
windingwind
687a6c5091 Fix exiting a submenu flashes the entire menu closed 2024-01-24 04:03:40 -05:00
windingwind
f5f475f738 Fix closing and reopening a *native* menu too quickly causes it to be closed again 2024-01-24 04:03:40 -05:00
windingwind
2a16c3c161 Fix library lookup icon 2024-01-24 04:03:40 -05:00
Abe Jellinek
16cadf1de7 Prevent dragging library tab 2024-01-24 04:03:36 -05:00
Abe Jellinek
ba0475810c Scaffold: Implement new toolbar
New icons and new scaffold.scss go into chrome://zotero/skin. The separate root
for Scaffold is mostly a historical relic, and adding special cases to build
scripts, SCSS mixins, and so on would just make things complicated.
2024-01-24 04:03:36 -05:00
windingwind
df0c2e2fd2 Toolbar redesign 2024-01-24 04:03:36 -05:00
Tom Najdek
bd067df4f6 Tabs redesign 2024-01-24 04:03:36 -05:00
abaevbog
a2e034c921 collection search not focusing group on Enter fix
While looking for the first matching row to select, stop looking
and move focus to the tree only after the selection succeeded.
Some matching rows, like groups header, are not selectable. If it's the
first matching row, it will now be skipped.
2024-01-24 04:03:36 -05:00
Abe Jellinek
632870683b Fix regression that broke section opening animation 2024-01-24 04:03:36 -05:00
Abe Jellinek
e04ef87929 Scaffold: Initial redesign changes
- Space between Min. Version and Priority
- Fix white-on-white tabs
2024-01-24 04:03:35 -05:00
Abe Jellinek
c78739bf2f Update and improve attachment-row initialization
- Actually show un-deleted rows as context rows within trash
- Add all rows, hide ones that shouldn't be shown
- Check whether attachment is file before calling getAnnotations()
  - Fixes errors on update and new link attachments being shown as empty rows
2024-01-24 04:03:35 -05:00
Abe Jellinek
e4b329bffc Only scroll/pin section on left-click
To prevent a right-click on the Info section (which has no context menu) from
scrolling to it, along with other weirdness.
2024-01-24 04:03:35 -05:00
Abe Jellinek
c16a2d4b05 Resize editable-text after Esc pressed 2024-01-24 04:03:35 -05:00
Abe Jellinek
c50a3a8615 Use system color for Debug Output background 2024-01-24 04:03:28 -05:00
Abe Jellinek
dacfe68a28 Fix overscroll growing the item pane on Windows 11 2024-01-24 04:03:26 -05:00
Abe Jellinek
ef608c094a Remove Windows .zotero-view-item style overrides 2024-01-24 04:03:23 -05:00
Abe Jellinek
4a15b2633a Remove section title highlight on sidenav click 2024-01-24 04:03:18 -05:00
Tom Najdek
a8a1b8fe06 Reduce gap between tags in the tag selector 2024-01-24 04:03:17 -05:00
Abe Jellinek
19b78e2b20 Implement new pane selection algorithm, remove bottom padding 2024-01-24 04:03:17 -05:00
abaevbog
cc9d58e6be adjust spacing within tag selector
1. Decrease the gap after colored tags.
2. In compact mode, decrease the splitter height.
2024-01-24 04:03:17 -05:00
windingwind
97996310ea Show accessKey when press alt 2024-01-24 04:03:14 -05:00
Tom Najdek
f67efc90f1 Fix: Tags now have a proper drop target size 2024-01-24 04:03:13 -05:00
Tom Najdek
8627e92cb4 Fix items table potentially not rendering after merge
In d4f8c7c an entry has been removed from zotero.properties that is still being
used in items table. If `numNotes` column is visible, items table would not
render.

Instead of re-adding to zotero.properties, I've migrated this string to
zotero.ftl to fix this problem.
2024-01-24 04:03:13 -05:00
Abe Jellinek
bf72c9d828 Notes/Tags/Related redesign 2024-01-24 04:03:13 -05:00
Tom Najdek
374b5337d8 Items table redesign 2024-01-24 04:03:13 -05:00
windingwind
077214a327 Add menu icons and unify Open PDF/EPUB/Snapshot options 2024-01-24 04:03:13 -05:00
Bogdan Abaev
a7fe2130ce no override of arrow up/down actions in toolbar search fields 2024-01-24 04:03:12 -05:00
Bogdan Abaev
f8a6b82c63 collection search 2024-01-24 04:03:12 -05:00
windingwind
7da00957ef Unify tab bar on Windows/Linux 2024-01-24 04:03:12 -05:00
Tom Najdek
7fe5f0145d Restyle tags splitter 2024-01-24 04:03:12 -05:00
Tom Najdek
9ff76d2dd9 Restyle Tag Selector
* Render a colored dot for colored tags
* Improve spacing and positioning, especially on 2x screens
* Add scss map for tag colors in light/dark scheme
* Add support for compact/comfortable in tag selector
* Restyle filter box, add a placeholder and a new icon
2024-01-24 04:03:12 -05:00
Tom Najdek
ff115b0873 Tweak search component to accept data-/aria- props 2024-01-24 04:03:12 -05:00
Tom Najdek
ce64147aa8 Add "pick" and "omit" utils
Helpful when dealing with props in react components
2024-01-24 04:03:12 -05:00
Abe Jellinek
fe6fdd3ff6 Ensure require() is available to CEs 2024-01-24 04:03:08 -05:00
abaevbog
71af85adb3 minor fixes to keyboard navigation
1. Swap focus direction for ArrowUp and ArrowDown events when applicable.
ArrowUp = Shift-Tab, ArrowDown - Tab.
2. Remove ArrowLeft, ArrowRight event listeners from quicksearch menus
to not prevent cursor navigation within the actual text field.
3. Tweaks to fix advanced search mode from quicksearch when " is typed.
2024-01-24 04:03:02 -05:00
Abe Jellinek
6bc97a6af6 Extract field transform menu and use for title header
And extract edit context menu building code into a separate function in
`editMenuOverlay.js` so we can build menus on top of it.
2024-01-24 03:42:43 -05:00
Abe Jellinek
17f758d0cf Use Zotero.isMac in customElements CE patch
AppConstants is occasionally undefined - not sure why.
2024-01-24 03:42:43 -05:00
Abe Jellinek
810402c9c7 Implement pane header, non-tabbed layout, collapsible sections, and new abstract box 2024-01-24 03:42:43 -05:00
Abe Jellinek
d2694bfba7 Add attachmentEPUB[Link] to getImageSrc() 2024-01-24 03:42:43 -05:00
Abe Jellinek
a2f259d14c Use item type CSS icons in more places
.icon-item-type is now global, with extra styling to handle row selection when
it's inside the item tree.

getImageSrc() is still used for progress windows, which is probably OK for now
because those don't stay on screen for very long. I've updated it to return SVGs
based on the current UI color scheme.

Other code uses treeitem-* images directly; getting rid of those references will
cause a lot of conflicts and be a bit more involved than this initial pass, so
I'll put that in a separate PR.
2024-01-24 03:42:43 -05:00
abaevbog
200e1d7564 toolbar and keyboard navigation updates
1. Toolbarbuttons changes:
	1. “New Library” moved from toolbar to File menu
	2. “New note” on click makes a standalone note
	3. “New attachment” on click adds stored copy of a file
	4. Menuitems from old note or attachment menus moved to the File menu
	5. “Advanced search” removed. Sync and Locate buttons moved to the top-right corner (Locate - temporarily)
	6. Added “Opened tabs” toolbarbutton
	7. Updated tooltips
2. Added a toolbarbutton that reveals collection search field on click. Search field is hidden on blur if empty. Keyboard accessibility via tab/shift-tab.
3. Tab based navigation restructuring. For each component, create a mapping of target ids with desired focus destination for each relevant keyboard event and use that to determine where to move focus next. Fixed bugs with focus wraparound not working when a note or attachment is opened in contextMenu.
4. Make quick-search dropmarker a sibling of the textfield. QuickSearchTextbox does not extend search-textfield anymore. It serves as a container to house dropmarker and textfield as siblings. This is needed to remove focus ring from quick search textbook when focus moves onto the dropmarker.
5. Separate toolbars for item and collection trees. Removed unused code manually setting the width of toolbar section
6. Focusable tabs + keyboard navigation:
	1. Shift-tab from opened tabs menu moves focus to the currently opened tab
	2. When a tab has focus, use left/right arrows to select tabs, or CMD/Ctrl + arrows to move focus between tabs
	3. Enter or Space on a focused tab will select it if needed and move focus to the contentPane of the reader of this tab
	4. Shift-tab from tabs wraps focus around to itemTree or itemPane
7. “New collection” creates collection contextually within currently selected library or collection.
8. Items pane minimum width increase to avoid quicksearch from being squashed
9. Do not move focus to title field of itemBox after itemTypeMenu is closed with ESC.
10. Display all itemTypes without "Show more" submenu in "New Item" meunu. Removed "Store Copy of File" and "Link to File" from "New Item" menu.
2024-01-24 03:42:42 -05:00
Tom Najdek
3f91729141 collections tree redesign
- new icons
- new twisty (also for items tree)
- new mixin focus-states that can be re-used for less boilerplate
- dark/white compatible with tweaks for when tree is focused (these changes also affect items tree)
- removed macOS specific behaviour (blue-ish background, gradient for selected row)
- border-radius on highlight + spacing tweaks
- tweaked colors and fonts
- Support for "compact"/"comfortable"
2024-01-24 03:42:42 -05:00
Tom Najdek
03d10f7de7 Switch to new svg icons for item types 2024-01-24 03:39:09 -05:00
Tom Najdek
61f9d65552 Add utils for css-based icons 2024-01-24 03:39:09 -05:00
Abe Jellinek
1dd3812e00 Deprecate setFontSize(), replace with new Zotero.UIProperties
This new XPCOM module handles font size and UI density and automatically keeps
registered roots up to date when prefs change. Roots receive a
UIPropertiesChanged event after their properties are updated.
2024-01-24 03:39:09 -05:00
Abe Jellinek
d6e5da403c Add uiDensity pref and menu controls 2024-01-24 03:39:08 -05:00
abaevbog
be4ecb31bc separator after colored tags 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
abaevbog
5c337808ab show advanced search menuitem in quicksearch menu
In quicksearch menu, display a menuitem after a separator that
opens the advanced search window.
2024-01-24 03:39:08 -05:00
Abe Jellinek
a37dd2462a Disable error reporting in Scaffold 2024-01-23 12:06:40 -05:00
Adomas Ven
ac7eb87632
Add an "Open Documents" section to the citation dialog. Closes #3332 (#3544)
- Sort the Open Documents section by reverse-open order and further by
  reverse tab order (if unopened in this session).
- If Library is selected in the Zotero window, automatically show and
  filter at the top selected items
2024-01-21 01:34:09 -05:00
Abe Jellinek
21e50add60
Rename Safe Mode to Troubleshooting Mode (#3563) 2024-01-13 04:33:19 -05:00
Adomas Venčkauskas
7811d78cb0 Fix quick search item tree issues when moving attachments into/out of parents
Closes #3561
2024-01-12 10:31:00 +02:00
Adomas Venčkauskas
9a6b35b962 Ensure the captcha clearing window is activated upon open on macOS 2024-01-08 12:27:20 +02:00
Adomas Venčkauskas
b03dbee3e8 Fix Hidden Browser logged error when debugging is enabled
Regression 8b77c96
2024-01-08 12:19:14 +02:00
Abe Jellinek
8b7c0433e8 Preferences: Fix missing LABD icon when path contains a space 2024-01-04 13:46:04 -08:00
Abe Jellinek
071bf06995
Scaffold: Use standard ESLint options (#3498) 2023-12-27 05:29:12 -05:00
Dan Stillman
03432718e3 Update translate submodule 2023-12-27 04:44:47 -05:00
Adomas Ven
8b77c96e97
Displays a browser window to clear captcha when saving attachments. (#3526)
- Currently enabled only for ScienceDirect. Can be enabled via a whitelist
- Matches the HiddenBrowser loaded HTML page for a captcha element. If
  the captcha element class changes, this will break (but the
  alternative is potentially displaying a captcha clearing window when
  something else that is not a captcha guard is loaded).
- Captcha clear timeout for 60s.
- Doesn't automatically switch focus back to the browser which intiated
  the item save via the Connector.
- Stores the cookies used to clear the captcha for future saves from the
  same domain. Discards Connector supplied User Agent, since CF bot
  detector checks UA header against actual UA behavior like TLS handshake
  and if the UA acts different to what it's supposed to, the bot
  challenge is not cleared.

Other changes:
- Adjusted the cookie sandbox to allow multiple cookie sandboxes to be
  active (and simplified some legacy code that was meant to cover a bug
  in old FX codebase).
- HiddenBrowser API changed to be Object oriented, translator tester
  in the translate repo will need to be updated after a merge (have the
  change ready).
- Improved Connector Server attachment progress handling
2023-12-27 04:43:50 -05:00
Abe Jellinek
c9b4daf152
Add Help -> Restart in Safe Mode... and a toolbar indicator (#3209) 2023-12-23 00:05:36 -05:00
Adomas Venčkauskas
5536f8d2bd Citation dialog: match year-ranges (e.g. 1992-2002) for search
Instead of as page locators
2023-12-20 12:52:21 +02:00
Martynas Bagdonas
b31f66ddbd Fix related-box error in not yet connected element 2023-12-14 18:22:30 +02:00
Martynas Bagdonas
3cb12a2ad3 Avoid content loss when immediately leaving item note in context pane
Fixes #3532
2023-12-14 17:59:28 +02:00
Adomas Venčkauskas
32ba987c28 Fix failing Advanced Search test (regression 172fe371) 2023-12-12 18:14:19 +02:00
Adomas Venčkauskas
8243553260 Remove old xul tree column prefs 2023-12-12 08:36:38 +02:00
Adomas Venčkauskas
172fe371dd Allow a column picker and persist columns in advanced search. Closes #1118 2023-12-12 08:35:19 +02:00
Adomas Venčkauskas
f4284a3579 Returns the translators hash on Connector ping.
Part of zotero/zotero-connectors#452
2023-12-11 13:44:26 +02:00
Adomas Venčkauskas
9971f15e61 Use url of the page if no title available in /connector/saveSnapshot 2023-12-07 13:38:56 +02:00
Adomas Venčkauskas
5a0f369f0b Do not activate item on twisty dblclick. Closes #3507 2023-12-07 11:15:08 +02:00
Dan Stillman
8a66fc02fe Add cloud-storage warning for "BaiduSyncdisk"
https://forums.zotero.org/discussion/109845/
2023-12-01 02:34:35 -05:00
Abe Jellinek
0f447c87dc Fix ZP View -> Reset Zoom
Fixes #3510
2023-11-30 15:58:52 -05:00
Dan Stillman
8a620c3a7c Remove "Create Timeline" from Tools menu
Addresses #3463 and, well, fixes #3462
2023-11-30 06:52:18 -05:00
Dan Stillman
04b87e4db7 Fix NS_ERROR_MALFORMED_URI if WebDAV URL has leading or trailing space 2023-11-30 02:47:36 -05:00
Martynas Bagdonas
52c219c8b9 Switch to Library tab when dragging over EPUB or HTML files as well 2023-11-28 11:05:13 +00:00
Martynas Bagdonas
3eb1c3fb4f Fix reader PDF view iframes not receiving mouseup event 2023-11-28 08:44:25 +00:00
abaevbog
436b19d64c
Fix inconsistent ESC behavior on text edit when reader is opened (#3417)
This is needed to let itemBox, tagBox, etc. to handle ESC
events to revent any edits made to textfields. Only applied
if the currently focused element is input or textarea.

Fixes: #3246
2023-11-21 07:42:33 -05:00
Adomas Venčkauskas
9d710ea135 Be less aggressive about sending Zotero to back after http integration commands
Report https://forums.zotero.org/discussion/109479/bug-after-adding-citation-main-window-is-hidden-76
2023-11-21 10:34:36 +02:00
Dan Stillman
2c50749ab3 Add "GoogleDrive" as cloud storage path 2023-11-18 01:34:41 -05:00
Martynas Bagdonas
94070e1b7c Fix navigation to specific annotation when using zotero://open-pdf
Fixes #3487
2023-11-15 21:54:59 +00:00
abaevbog
7c5600913b
fix to collections highlight bugs (#3412)
1. Trigger ZoteroPane.handleBlur on focusout instead of blur
to remove highlight when itemTree entries loose focus
even if ctrl/alt is still being held.
2. Prevent default event on Alt click on linux to avoid moving
focus to menubar
3. Avoid re-triggering focus multiple times
when ctrl is being held on windows to prevent highlight from becoming
stuck and not going away.

Fixes: zotero#3410
2023-11-10 19:17:01 -05:00
Abe Jellinek
cdc59e6a29 Remove debug logging from search routine
Way too slow and noisy.
2023-11-10 16:40:12 -05:00
Abe Jellinek
835542bb6f Preferences search: Match Fluent strings 2023-11-10 16:40:12 -05:00
Dan Stillman
b6d8571860 Update Z.File.getSample() signature to match getBinaryContentsAsync()
Not updated with 2b41b0127c
2023-11-10 16:30:10 -05:00
Dan Stillman
f1373652e6 Fix file:// URI handling in getBinaryContentsAsync() 2023-11-10 15:58:53 -05:00
Adomas Venčkauskas
5efd181e5b Fix Zotero 2.1 and earlier citation upgrade code 2023-11-08 09:53:39 +02:00
Dan Stillman
bf478392ce Block most resource loading in reports 2023-11-02 17:50:16 -04:00
Dan Stillman
47e55286f7 Add Baidu Netdisk and MEGA to cloud-storage-folder checks
Closes #3465
2023-10-31 05:31:06 -04:00
Martynas Bagdonas
4266df4d3a Propagate annotation deletion between reader instances of the same file
Fixes #3375
Fixes #3241
2023-10-27 18:28:43 +01:00
Adomas Venčkauskas
b71012689f Updates translate submodule. Fixes #3182 2023-10-26 13:03:00 +03:00
Adomas Venčkauskas
011dabd372 Fix corner case after #3460. Closes #3461 2023-10-24 14:24:38 +03:00
Adomas Ven
3b9d0ac1bb
Allow the collection tree rows to have custom row heights (#3460)
- The underlying changes are in windowed-list, which the item tree and
  all virtualized tables are based on, so if there are bugs they might
  show up outside of the collection tree.
- The expensive operation is adding/removing rows, since row offsets
  have to be recalculated (this includes collapsing/expanding rows).
- The cost on further drawing while scrolling is constant and shouldn't
  affect performance much.
2023-10-24 03:56:07 -04:00
Martynas Bagdonas
7e82cc5ffd Fix recursion error when toggling/resizing sidebar in reader window
Fixes #3379
2023-10-19 18:15:51 +01:00
Dan Stillman
fc088bc1f3 Update utilities submodule
Includes https://github.com/zotero/utilities/pull/30
2023-10-06 06:58:50 -04:00
Dan Stillman
a1f6821fe1 Fix attachment-title renaming bug on Windows
https://forums.zotero.org/discussion/comment/444399/#Comment_444399
2023-10-06 04:56:19 -04:00
Adomas Venčkauskas
195ea69b19 Fix tiny Quick Format dialog before text entry. Closes #3443 2023-10-03 10:24:20 +03:00
Dan Stillman
e3c64fb047 Don't migrate prefs in new profile 2023-09-29 04:06:04 -04:00
Adomas Venčkauskas
2db19ad4ca Fix http word integration word path unicode issues. 2023-09-27 12:19:38 +03:00
Dan Stillman
aef49da233 Fix nsIZipReader.close error after invalid ZIP file download 2023-09-26 05:09:40 -04:00
abaevbog
bbfc6ed817
activate collection tree row only if it's focused (#3431)
Fixes: #3426
2023-09-24 05:34:00 -04:00
Abe Jellinek
79ef266f2f
Detect more EPUBs in viewAttachment() content type fixer (#3433) 2023-09-23 03:09:23 -04:00
Abe Jellinek
c45405190a importFromFile: Remove duplicate and unused declarations
Apparently a var doesn't shadow a parameter with the same name, but that wasn't
obvious.
2023-09-22 12:20:12 -04:00
abaevbog
399baf0d73
disable "Find available PDF" if files not editable (#3430)
For example, in a public group files are not editable,
so this menu item is disabled.

Fixes: #3428
2023-09-22 09:13:36 -04:00
Abe Jellinek
f28873382d Preferences: Highlight parent of selected pane in navigation
Also, fix help and back buttons not hiding when starting a search.

Closes #3425
2023-09-21 13:39:06 -04:00
Abe Jellinek
9779c70915 Reports: Don't strip valid surrogate pairs
Without the /u (Unicode) flag, [\ud800-\udfff] matches *all* surrogate pair code
points, even when they're in a valid position in the string.

Fixes #3421
2023-09-21 13:19:22 -04:00
Adomas Venčkauskas
220eba8c63 Fix bibliography editor dialog (regression c89590c7) 2023-09-21 10:34:11 +03:00
Adomas Venčkauskas
a8ccab78f5 Fix classic citation and bibliography dialogs not persisting dimensions
The persisting logic doesn't work without an id on the root element
2023-09-21 10:34:11 +03:00
Adomas Venčkauskas
f8c3a3a31e Fix citation dialog being moved to the wrong location sometimes 2023-09-21 10:34:11 +03:00
Dan Stillman
98c1a6ca1b Fix "Export PDFs…" stopping if attachment file isn't found 2023-09-21 02:47:48 -04:00
Abe Jellinek
540a174dab TranslationChild: Make "interactive" count as readyEnough
Some pages (notably the first DOI.js test case) never get to "complete". I don't
know why! But for practically all translators that don't use defer: true,
"interactive" is ready enough.
2023-09-20 12:56:02 -04:00
Abe Jellinek
6740b2644d Make relevant prefs available in RemoteTranslate 2023-09-20 12:09:37 -04:00
Abe Jellinek
667f940a6c Reader: Use url (was baseURI) for all reader types 2023-09-15 12:33:53 -04:00
Martynas Bagdonas
1b23838d37 Load PDF file from URI to avoid keeping extra file copy in memory 2023-09-15 11:05:31 +02:00
windingwind
78fe68164f Remove reader events when plugin is disabled 2023-09-14 07:54:29 +02:00
Martynas Bagdonas
96652ea9e8 Enable plugins adding custom content to reader UI and context menus
#3373
2023-09-13 14:16:28 +02:00
Abe Jellinek
87286ca776 Remove tab content immediately
Amends 30c70a6ecd.
On some machines, the callback added in that change would never actually run, so
memory usage would grow quickly when switching between tabs. By wrapping in
setTimeout() instead of requestIdleCallback(), we keep the performance gains
from removing once the element is no longer visible (so we can avoid repaints,
rebuilding the layout tree, etc.), but we make sure that the callback gets
called nearly immediately.

#3321
2023-09-07 13:38:55 -04:00
Dan Stillman
8d93fd4c8c Fix test breakage after f68818387 2023-09-06 07:38:14 -04:00
Dan Stillman
f688183878 Fix keyboard accessibility in conflict-resolution dialog
It's now possible to tab through the panes and the buttons, and
left/right-arrow also change the selection, so you can use Left/Right +
Return to move through multiple conflicts.

Fixes #3395
2023-09-06 06:40:59 -04:00
windingwind
b91ae86079 Mark ItemTreeColumnOptions.renderCell as optional 2023-09-06 14:02:18 +08:00
Dan Stillman
b4c3c0c7f9 Don't require unused date field in retractions list 2023-09-03 18:43:44 -04:00
Dan Stillman
b918ad2892 Fix error closing ZIP reader during file sync on Windows
In Z7 on Windows 10 (but not 11 for me), nsIZipReader doesn't properly
close the file after `findEntries()` is called (as discovered by
@abaevbog), so a `remove()` on the downloaded ZIP file during file
syncing triggers an access-denied error. Setting the zip-reader variable
to null and forcing garbage collection seems to fix it. Doing this
everywhere we use nsIZipReader just to be safe.

I found the `forceGC()` in only one test file in fx102, but setting the
reader to null is done more widely, so maybe they just don't try to
delete ZIP files before GC happens and manage to avoid this bug.

Fixes #3369
2023-08-31 06:17:18 -04:00
windingwind
794e89d307
Add itemTree render cell option (#3342) 2023-08-30 00:11:25 -04:00
Martynas Bagdonas
b72894d874 Fix still broken reader view focusing after tab switch 2023-08-29 13:47:11 +03:00
abaevbog
ae1c8bd059
set opened reader tab index on state restore (#3357)
Fixes: #3353
2023-08-28 23:29:41 -04:00
Abe Jellinek
85cade3fb2
Make preferences less janky, preload panes on hover, allow panes to delay visibility until promise resolves (#3363)
Prevents flashes of unlocalized labels and controls without values set.
Makes switching panes feel speedier overall because of preloading.

I thought there was an issue for the flashes of uninitialized content but can't
find it now.
2023-08-26 05:57:38 -04:00
Abe Jellinek
6cd44f19fe Fix more Z6/Z7 inconsistencies in Advanced Search
- Prevent row height from changing when switching between text input conditions
  and menulist conditions
   - Replace some of (far from all of) the XUL layout with flexbox
- Restore groupbox appearance
   - A little retro? We probably want some kind of border like we used to have
- Replace some duplicate IDs with classes for styling
2023-08-24 11:14:59 -04:00
Dan Stillman
075457be45 Use REPLACE instead of INSERT for ebook schema changes
Follow-up to bdea760 (#3360), which I changed incorrectly
2023-08-24 05:13:42 -04:00
Abe Jellinek
bdea76024b
Add EPUB to Attachment File Type in Advanced Search (#3360) 2023-08-24 03:06:33 -04:00
Abe Jellinek
8f4cb5002a
Fix progress queue segfault (#3359) 2023-08-23 04:56:21 -04:00
Abe Jellinek
30c70a6ecd Defer removing tab content
Improves EPUB close performance.

By wrapping with requestIdleCallback(), we ensure:

  1. remove() won't be called right away, so the DOM elements being removed
     won't be visible and won't trigger a relayout.
  2. remove() won't be called while there are pending UI events, so it
     shouldn't cause the UI to hang/lag/stutter.

Combined, these two improvements make the UI hang when closing a large EPUB
mostly imperceptible on my machine.

Addresses #3321; doesn't completely fix it because there's likely more to be
done on the reader side to optimize the DOM.
2023-08-21 12:20:57 -04:00
Dan Stillman
38d0750dd3 Don't include parent title in tab title for secondary attachments
As suggested in https://github.com/zotero/zotero/issues/2731#issuecomment-1201382522
2023-08-20 02:26:58 -04:00
Tom Najdek
4f19b1d13e
Improve file renaming preview in preferences (#3343) 2023-08-19 05:06:08 -04:00
Dan Stillman
4dbd52782c Better fixing of tab-title logic
Follow-up to 3eef4284d1, which wasn't totally correct, and adds the
attachment title before the parent metadata for secondary attachments.

https://forums.zotero.org/discussion/comment/441362/#Comment_441362
2023-08-19 04:51:04 -04:00
Dan Stillman
3eef4284d1 Fix "Filename" tab title option
https://forums.zotero.org/discussion/comment/441259/#Comment_441259
2023-08-19 04:00:49 -04:00
Martynas Bagdonas
b05ef8ed04 Properly focus reader iframe when opening a new reader instance 2023-08-18 18:33:52 +02:00
Abe Jellinek
17daf9fe8d Fix EPUB attachments with wrong MIME type on view
Fixes #3320
2023-08-15 17:54:37 -04:00
Abe Jellinek
7b26dab2f2 Show spread mode menu items in EPUB reader
Fixes #3318 (only odd spreads supported right now because of CSS grid
limitations)
2023-08-15 17:54:36 -04:00
Northword
dcca56d6c3
preferenceOptions.helpurl should be string instead string[] (#3310) 2023-08-11 07:13:58 -04:00
Dan Stillman
9dd182e9ca Collection tree selection fixes
Fixes various logic around what gets selected when collections and
searches are moved to or restored from the trash (which has never been
exposed) or when they're erased
2023-08-11 04:16:42 -04:00
Dan Stillman
c4eb9df716 Update utilities submodule 2023-08-09 18:09:03 -04:00
Dan Stillman
5e27a75010 Switch to better sentence-caser from zotero/utilities#26
Closes #293
2023-08-09 07:51:16 -04:00
Martynas Bagdonas
879109336a Rename pdf-reader paths to reader 2023-08-08 11:28:00 +03:00
Martynas Bagdonas
07e4d68760 Suppress noisy "dead object" error after each click inside reader tab 2023-08-07 16:07:56 -04:00
Dan Stillman
7e481e3e5f Move Language to the bottom of the General prefpane 2023-08-07 16:07:55 -04:00
Dan Stillman
38b9457ea9 Move new string to Fluent 2023-08-07 16:07:55 -04:00
Dan Stillman
caee5f29ca Update reader prefs
- Move open-in prefs into reader prefs
- Move reader prefs up below File Handling
- Move new strings to Fluent
- Fix clicking on labels to focus open-in drop-downs
- Tweak text
2023-08-07 16:07:55 -04:00
Abe Jellinek
deb6acaab1 Add preferences for ebook & snapshot file handling 2023-08-07 16:07:55 -04:00
Abe Jellinek
2ef560f7d8 Extract ISBNs and DOIs from EPUB content (#64)
And move EPUB functionality to class.
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
Martynas Bagdonas
80da0fbb56 Remove the unnecessary buf to Uint8Array conversion 2023-08-07 16:07:55 -04:00
Abe Jellinek
b0b11cfcf5 Use data option to initialize reader 2023-08-07 16:07:55 -04:00
Martynas Bagdonas
e031509966 Fix Reader 2.0 merge caused regressions 2023-08-07 16:07:55 -04:00
Martynas Bagdonas
c62ed29de9 Fix text annotation dragging error 2023-08-07 16:07:55 -04:00
Martynas Bagdonas
f18411c151 Properly trigger annotation position split if server says it's too long 2023-08-07 16:07:54 -04:00
Martynas Bagdonas
12fde2dd4a Fix reader error handling and properly display critical errors 2023-08-07 16:07:54 -04:00
Martynas Bagdonas
46d066394f Temporary fix for tab crashes caused by tab loading racing conditions 2023-08-07 16:07:54 -04:00
Martynas Bagdonas
7e28973f3a Fix reader focusing 2023-08-07 16:07:54 -04:00
Abe Jellinek
b408b43394 Support pre-SingleFile snapshots 2023-08-07 16:07:54 -04:00
Martynas Bagdonas
3c08604770 Fix PDF file printing 2023-08-07 16:07:54 -04:00
Martynas Bagdonas
17deb16779 Add partial underline annotation support for note-editor
(changes to note-editor have to be merged to have full support)
2023-08-07 16:07:54 -04:00
Abe Jellinek
e199f35006 Fix _getColorIcon(), update stroke color, use for selected menuitems
- Need to set width/height for macOS native menu
- CSS named grays are too light to show well on the background, so use #555
- type="checkbox" menuitems don't show their icons, so use the icon stroke
  instead
2023-08-07 16:07:54 -04:00
Abe Jellinek
3443d065a3 Use native context menus on macOS 2023-08-07 16:07:53 -04:00
Abe Jellinek
1740e5f1aa Call uninit() in close()
This properly unregisters pref observers and flushes the reader's state.
2023-08-07 16:07:53 -04:00
Abe Jellinek
0ee54b4a7e Use IOUtils instead of OS.File 2023-08-07 16:07:53 -04:00
Abe Jellinek
bdb444371f Debounce writing EPUB/snapshot state to disk 2023-08-07 16:07:53 -04:00
Abe Jellinek
6a4715c324 Enable "Add Note from Annotations" for EPUBs and snapshots 2023-08-07 16:07:53 -04:00
Abe Jellinek
db6ff88ad1 Add full-text indexer for EPUBs 2023-08-07 16:07:53 -04:00
Martynas Bagdonas
e8c5c22d05 Fix pdf-worker CMaps and standard fonts paths 2023-08-07 16:07:53 -04:00
Martynas Bagdonas
7fa05bc463 Properly handle reader window closing 2023-08-07 16:07:53 -04:00
Martynas Bagdonas
9d2d655039 Avoid memory leaks caused by never removed event listeners 2023-08-07 16:07:53 -04:00
Abe Jellinek
7791779289 Fix unloaded tab context menu actions
Show in Library and Move to New Window.

Will fix zotero/zotero#2685
2023-08-07 16:07:53 -04:00
Abe Jellinek
a729297f6b Add menu items to switch EPUB flow modes (paginated/scrolled) 2023-08-07 16:07:52 -04:00
Abe Jellinek
61f21f48e8 Fix browser-custom-element.js event handler error
Send real mouse/pointer events so that the CE can call, e.g.,
preventClickEvent().
2023-08-07 16:07:52 -04:00
Abe Jellinek
ba1b1b0639 Add EPUB format to Zotero.MIME 2023-08-07 16:07:52 -04:00
Abe Jellinek
1d89360765 Persist snapshot scroll position 2023-08-07 16:07:52 -04:00
Abe Jellinek
60f8d11c2d Persist EPUB CFI with setAttachmentLastPageIndex() 2023-08-07 16:07:52 -04:00
Martynas Bagdonas
3105bb9ff3 Fix add to note 2023-08-07 16:07:52 -04:00
Martynas Bagdonas
110f29b766 Save reader state into .zotero-reader-state file 2023-08-07 16:07:52 -04:00
Martynas Bagdonas
572cd3655e Fix reader context menu positioning in RTL mode 2023-08-07 16:07:51 -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
Abe Jellinek
378277206a Add Reset Zoom to EPUB/snapshot reader View menu 2023-08-07 16:07:51 -04:00
Abe Jellinek
3be3d8ebef Zotero.Items: Support EPUB and snapshot annotations 2023-08-07 16:07:51 -04:00
Martynas Bagdonas
681cdd809f Reader 2.0 2023-08-07 16:07:51 -04:00
Tom Najdek
19382a061f
Remove unnecessary code in getFileBaseNameFromItem 2023-08-07 17:03:27 +02:00
Dan Stillman
4e3977e9ce Update file-renaming prefs (#3228)
- Move file-renaming prefs to separate prefs section
- Fix template preview not updating on paste
- Update documentation URL
- Tweak text, styling, and ids
- Change "Automatically rename attachment files using parent metadata"
  to "Automatically rename locally added files" to reflect that
  downloaded files are always renamed, and add an intro saying so
2023-08-06 17:50:13 -04:00
Tom Najdek
d32b061c95 Add UI for editing attachment rename format pref (#3228) 2023-08-06 17:48:56 -04:00
Dan Stillman
af91173734 Look up PubMed IDs in batches of 200
https://forums.zotero.org/discussion/comment/440245/#Comment_440245
2023-08-05 00:01:55 -04:00
Dan Stillman
fcc68d6d80 Serialize lookup requests
These were switched to parallel in 86b77cc45, resulting in blocks:

https://forums.zotero.org/discussion/106658/limited-amount-of-articles-that-can-be-added-through-pmid
2023-08-04 23:21:35 -04:00
Abe Jellinek
251da0a148 Add SCSS styles to note.xhtml
Fixes #3193
2023-08-04 10:08:30 -04:00
Dan Stillman
3a43a98f10 Add IOUtils and PathUtils to plugin sandbox 2023-08-04 06:18:52 -04:00
Dan Stillman
9b0ce9558c
attachmentRenameFormatStringattachmentRenameTemplate (#3249) 2023-08-04 05:58:15 -04:00
windingwind
e44e3edef9
Fix itemBox.js eslint errors (#3244) 2023-08-04 04:15:08 -04:00
Dan Stillman
07309d7c25
Add Zotero.getMainWindows() 2023-08-03 05:11:26 -04:00
windingwind
1ca34261d3 Update ItemTreeManager.unregisterColumns example 2023-08-03 11:08:55 +08:00
Dan Stillman
fb4f55e809 Restore Word → LibreOffice order in Cite prefpane 2023-08-02 06:36:38 -04:00
Adomas Venčkauskas
b261d10b89 Fix Return not accepting citation dialog after pasting. Closes #3240 2023-08-01 09:47:42 +03:00
Adomas Venčkauskas
4b16269b7f Prefs: Add an event on pane switch
Fixes an issue with incomplete Style Manager tree rendering when
switching panes. Closes #3239
2023-08-01 09:18:30 +03:00
windingwind
836c8718b0 Fix itemTreeManager typo 2023-07-31 21:48:20 +08:00
windingwind
76c1db33e9 Fix itemTreeManager typo 2023-07-31 21:47:38 +08:00
Abe Jellinek
345bbcf50c Scaffold: Prompt to save before resetting
Now that Scaffold remembers and automatically loads the last edited translator
(65048fd624), it needs to be easier to create a
new translator without saving (and bumping the lastModified date on) the
translator you had open.
2023-07-31 09:44:20 -04:00
windingwind
ef7916b320
Add main window hooks for plugins (#3238) 2023-07-31 05:09:33 -04:00
Abe Jellinek
6dcc70f531 Zotero.PreferencePanes.register: Set default values for scripts/stylesheets
Without this, the calls to .map() below throw when one or both of those options
aren't set.
2023-07-29 22:28:10 -04:00
Abe Jellinek
8a7f3645bc
Item box: Add DOI menu listeners once, disable when DOI is invalid (#3237)
Fixes #3221

Co-authored-by: Dan Stillman <dstillman@zotero.org>
2023-07-29 04:25:34 -04:00
Dan Stillman
02198b12fe Fix dragging to My Publications
Also:

  - Don't show file options if only linked files
  - Don't set Rights field to "All Rights Reserved" if no files
2023-07-29 02:22:20 -04:00
Abe Jellinek
cbece42fb9 Fix merge pane overflow behavior
The item box CE can't be the scroll container, so it needs a wrapper element.

Fixes #3233
2023-07-28 15:06:02 -04:00
Abe Jellinek
7036073ed1
Resolve plugin-provided URIs relative to rootURI (#3235) 2023-07-28 00:16:58 -04:00
Abe Jellinek
e271b4e494 copyToUnique: Fail if source contains destination
To prevent unbounded recursion as in 16547f64c2.
2023-07-27 12:24:51 -04:00
Abe Jellinek
16547f64c2 renameAttachmentFile: Check rename() return value
And actually return -1 if it returns false.

Before this fix, attempting to rename an attachment file to a name that already
exists on disk would never return -1 as the docs say it should. Instead:

1. rename() would fail and return false
2. newName would be set to false
3. renameAttachmentFile() would pass false as the second argument to
   OS.Path.join()
4. OS.Path.join() would ignore it because it was falsy and return the attachment
   directory path without any modification
5. relinkAttachmentFile() would be called with path set to the attachment
   directory
6. relinkAttachmentFile() would notice that path's dirname wasn't the attachment
   directory - it was the attachment directory's parent - and attempt to copy it
   and its contents, recursively, into itself, using copyToFollowingLinks()

...which created a directory structure on disk over 100 directories deep -
not deeper only because the OS started returning errors due to paths exceeding
32,767 characters (the limit on my filesystem).
2023-07-27 12:24:32 -04:00
Dan Stillman
00683732d8 Make XMLSerializer available in plugins
https://groups.google.com/g/zotero-dev/c/ZKoDSBniSXs/m/VDhPpjNqAAAJ
2023-07-26 23:01:23 -04:00
Dan Stillman
0d70925816 Fix error loading plugin scope after 6a2fcd6898
`AddonManager.getActiveAddons(["extension"])` doesn't return fully
loaded addon objects if `getAllAddons()` hasn't been called
2023-07-26 23:01:17 -04:00
Dan Stillman
6a2fcd6898 Remove loadExtensionDefaults() in prefs.js
We now handle this in prefs.js.
2023-07-26 07:25:21 -04:00
Dan Stillman
a1f49e11d5 Fix low-res webpage icon 2023-07-25 07:35:03 -04:00
Adomas Venčkauskas
d96afa4499 Fix split-menu-button dropmarker triggering the button click event
Regression in fa31956d
2023-07-25 14:23:34 +03:00
Dan Stillman
630c6d0d97 Fix tags not being saved in item tags box when pressing Enter
SyntaxError: Element.querySelector: '[ztabindex=1]' is not a valid selector

https://forums.zotero.org/discussion/106405/zotero-7-changes-to-item-tag-do-not-persist
2023-07-25 05:51:41 -04:00
Dan Stillman
fb59345637 Fix "Check for Update" buttons in error dialogs
Fixes #3213
2023-07-25 01:53:22 -04:00
Dan Stillman
ed2cae9236 Adjust attachment-title handling on Rename File from Parent Metadata
Don't change the attachment title on a manual rename from metadata if it
doesn't match the current filename, with or without the extension

Closes #3220
2023-07-25 01:48:23 -04:00
windingwind
c89590c7b7
Add ItemTree column API (#3186) 2023-07-25 00:47:12 -04:00
Abe Jellinek
676f820f87
Strip bidi control characters in filenames and elsewhere (#3208)
Passing unformatted = true to Item#getField() now returns a bidi control
character-less result, and we use that in Reader#updateTitle() and
getFileBaseNameFromItem() to prevent bidi control characters from showing up in
filenames and window titles (the former everywhere, the latter on Windows only).

We also strip bidi control characters in getValidFileName() to be extra safe.
2023-07-22 03:30:28 -04:00
Abe Jellinek
1217710234 PDFWorker manager: OS.File -> IOUtils 2023-07-21 18:36:38 +03:00
Abe Jellinek
5aaf368149 Use pdf-worker for hasEmbeddedAnnotations() 2023-07-21 18:36:38 +03:00
Dan Stillman
2fad3d89ff Use getDisplayTitle() for titles in timelines
https://forums.zotero.org/discussion/106290/zotero-timeline-does-not-display-email-subject
2023-07-21 06:23:02 -04:00
windingwind
97235d2dea
Fix selectitems.xhtml persist bug (#3219)
See https://groups.google.com/g/zotero-dev/c/OscDKuO9Rao
2023-07-21 04:43:52 -04:00
Tom Najdek
0ba766f2e0
Customizable renaming rules #1413 (#2297) 2023-07-20 06:50:34 -04:00
Dan Stillman
96e2510165 Fix missing return in previous commit 2023-07-20 06:42:32 -04:00
Dan Stillman
590460cea4 Add Zotero.Prefs.prefHasUserValue(pref, global) 2023-07-20 06:41:23 -04:00
Dan Stillman
51c70eb925 Use system temp directory by default
Might help for something like
https://forums.zotero.org/discussion/106337/zotero-7-sync-error
2023-07-20 05:43:39 -04:00
Adomas Venčkauskas
75c46e1e5c Enable FAYT in document preferences. Closes #3214 2023-07-20 11:10:14 +03:00
Adomas Venčkauskas
1b30c8b2b5 Add a comment for bib style caching. Closes #3211 2023-07-18 10:58:12 +03:00
Adomas Venčkauskas
f61826281b Revert "Merge pull request #3195 from CommonLoon102/cl102/fix-bib-indent"
This reverts commit aca86967bf, reversing
changes made to 1a850d58c4.
2023-07-18 10:55:14 +03:00
abaevbog
9599d1712c
disable file > close for library if 1+ tabs open (#3210)
When there are multiple tabs opened, menuitem File > Close is disabled for the library tab.

Fixes: #3198
2023-07-18 03:40:19 -04:00
Martynas Bagdonas
e37eaac8d1 Fix panes overflowing in stacked view mode
Fixes #3180
2023-07-17 17:07:38 +03:00
Dan Stillman
c425f71ac4 fx-compat: Fix error passing cookieSandbox to Zotero.HTTP.request()
https://groups.google.com/g/zotero-dev/c/UgP_kZvrEjA/m/KjimYREGAgAJ

getInterface() seems to exist on XHR and nsIWBP without QIing to
nsIInterfaceRequestor, and XHR no longer has QueryInterface().
2023-07-17 06:42:14 -04:00
Dan Stillman
65fe50d11f Clear startup cache when uninstalling/upgrading plugins
https://groups.google.com/g/zotero-dev/c/0nfU-F2q1uI/m/1jBVmMZxBAAJ

Removed by Mozilla in
https://bugzilla.mozilla.org/show_bug.cgi?id=1445739, since
WebExtensions don't put anything in the startup cache
2023-07-15 18:39:59 -04:00
Dan Stillman
838152155e Log warning when not setting createdByUser/lastModifiedByUser
(I encountered this in a test when trying to set createdByUserID without
`Zotero.Users.setName()`.)
2023-07-14 05:48:48 -04:00
Dan Stillman
dc321ce643 Fix startup error on Windows
Regression from 8d3f874e64, which included this unfinished code by mistake.

Fixes #3196
2023-07-14 05:48:48 -04:00
abaevbog
0cd94555d5
prevent incorrect jumpback (#3204)
Fixes: #3152
2023-07-14 05:29:43 -04:00
Dan Stillman
d7449b4d78 Fix merging of group attachments with annotations created by another user
https://forums.zotero.org/discussion/106197/merge-in-group-library-fails-despite-having-edit-permissions
2023-07-13 19:58:47 -04:00
Adomas Venčkauskas
e5d25f3d66 Fix /connector/saveSnapshot still not including info about snapshots 2023-07-12 10:21:46 +03:00
Abe Jellinek
2aa34a6346 Merge: Remove spacing from annotation regex, delete external annotation items
- `/Subtype` isn't necessarily preceded or followed by a space
- Annotation items with `isExternal: true` are for display only and should be
  deleted on merge

https://forums.zotero.org/discussion/105960/external-annotations-ignored-when-merging
2023-07-11 11:12:58 -04:00
Adomas Venčkauskas
a0cdf11096 Fix failing test from 02ba9ca7 2023-07-11 15:57:35 +03:00
Adomas Venčkauskas
02ba9ca7f0 Include information about saved snapshots in /saveSnapshot 2023-07-11 15:45:51 +03:00
Martynas Bagdonas
5928147f26 Fix middle-click selecting tab that is being closed 2023-07-11 14:02:12 +03:00
Dan Stillman
8d3f874e64 Remove all uses of Zotero.isStandalone
(View diff with -w)
2023-07-11 05:35:32 -04:00
Dan Stillman
b98efe0b67 Remove ZoteroPane.updateTagsBoxSize()
Disabled several years ago in bb5075e8b8
2023-07-11 05:35:32 -04:00