Commit graph

8341 commits

Author SHA1 Message Date
Martynas Bagdonas
6206209ed2 Fix item pane opening creator-type-menu in a wrong itembox binding 2021-10-19 17:14:44 +03:00
Dan Stillman
5f61ac23aa Don't include non-regular items in one-off bibliographies
Applies to "Create Bibliography from Collection" and "Create
Bibliography from Items". Quick Copy already got this right.

https://forums.zotero.org/discussion/92305/sticky-notes-showing-in-bibliography
2021-10-18 17:53:14 -04:00
Martynas Bagdonas
a07c052cf0 Allow to use Quick Copy from PDF reader tab
Fixes #2023
2021-10-18 09:57:57 +03:00
Adomas Venčkauskas
4e68b624f2 Persist column settings in the select items dialog. Closes #2224
I didn't check the previous behavior, but I assume it's the same:
This will persist the same settings for the select items dialog in the
classic citation view as well as the add related item dialog.
2021-10-15 15:43:00 +03:00
Adomas Venčkauskas
7a9bd56b9d Fix when dragging outside of the text of item pane message. Closes #2223 2021-10-14 15:33:43 +03:00
Dan Stillman
3d4a1a230e
Merge pull request #2217 from tnajdek/2216-mendeley-import-skips-over-large-files
Concurrently downloading large files
2021-10-13 13:20:00 -04:00
Martynas Bagdonas
8b11737b82 Import existing images when opening a note
#2186
2021-10-13 17:49:44 +03:00
Martynas Bagdonas
a4f09419e5 Fix context pane not properly assigning new note as standalone/child 2021-10-08 22:18:23 +03:00
Martynas Bagdonas
645eb86cbc Don't focus Zotero Pane window when opening a tab in background 2021-10-05 17:30:44 +03:00
Martynas Bagdonas
3c3eac43de Don't focus recognized PDF parent if Zotero Pane tab is not selected 2021-10-05 17:30:44 +03:00
Adomas Venčkauskas
78e31cf50f Fix broken font scaling in the retrieve metadata/progress queue dialog.
Closes #2218
2021-10-05 12:55:38 +03:00
Adomas Venčkauskas
62e2ccafa0 Replace deprecated usage of Utilities.itemToCSLJSON 2021-10-05 12:55:38 +03:00
Adomas Venčkauskas
82eb7453a8 Add a method to remove event listeners from event dispatchers 2021-10-05 12:55:38 +03:00
Martynas Bagdonas
05139cfff8 Persist pdf-reader sidebar width
#2184
2021-10-04 17:10:31 +03:00
Martynas Bagdonas
7f23533ee9 Automatically update citations when user opens a note 2021-10-04 13:23:03 +03:00
Tom Najdek
a745cde2cf
New implementation of a download function #2216
This resolves a problem where, in certain scenarios,
Zotero.file.download throws an exception even though file is
successfully downloaded.

Furthermore this new download function should be more memory-efficient,
improving performance when dealing with large files.
2021-10-02 00:39:10 +02:00
Martynas Bagdonas
3b84e29c9e Update context pane notes list when note is moved to/from parent 2021-10-01 14:47:50 +03:00
Martynas Bagdonas
47c61d3a4d Add limitations for attachment notes 2021-10-01 13:19:20 +03:00
Martynas Bagdonas
c0ecd7691b Focus parent from tab "Show in Library", and PDF file from File menu 2021-09-27 13:46:19 +03:00
Martynas Bagdonas
1f634f9e31 Use OS.File.writeAtomic without tmpPath to avoid #2210 2021-09-23 13:53:47 +03:00
Martynas Bagdonas
47d4949b2a Upgrade note-editor schema to v5:
- Make citation node a leaf node.
- Don't parse citation node inner text.
- Don't trigger citation inner text updating on citation item changes.
- Format citation text only when serializing note HTML.
- Wrap individual citation items into `<span class="citation-item"></span>`.
2021-09-22 19:30:44 +03:00
Dan Stillman
7e8bc80c1d "Manage Lookup Engines" dialog tweaks (#2195)
- Lowercase "engines"
- Increase font size
- Switch to hyphenated element id
2021-09-17 05:38:56 -04:00
Abe Jellinek
241981057b Correct Lookup Engine description
The Locate dropdown isn't in the Info pane, and the text was a bit more
verbose than it needed to be.
2021-09-17 05:38:56 -04:00
Dan Stillman
f0a8c9ada3 Merge pull request #2070 from mrtcode:restore-context-pane-tags-related 2021-09-14 01:53:21 -04:00
Dan Stillman
647afbb089 Update related box if related items are renamed or deleted 2021-09-14 01:50:58 -04:00
Martynas Bagdonas
61e3e339bb Restore tags and related tabs, display note links box 2021-09-14 01:50:58 -04:00
Dan Stillman
fa4020f784 HTML tree: Disable clickthrough on collection and item trees
And also the tag selector, while we're at it. Leaving enabled for the
item pane.

(Clickthrough is responding to a click when the window doesn't have
focus, rather than having the first click just raise the window.)

Fixes #2203
2021-09-14 00:43:15 -04:00
Dan Stillman
aeabe0b3f6 Fix inability to drag subcollection to top level within group library
HTML tree regression

Fixes #2201
2021-09-14 00:43:15 -04:00
Abe Jellinek
c5067edd2d
Fix Scaffold failing to initialize (#2200) 2021-09-09 05:17:35 -04:00
Martynas Bagdonas
7468065528 Switch to library tab when dragging a PDF file over Zotero window 2021-09-07 16:53:20 +03:00
Martynas Bagdonas
d38d42d60c Focus main window when navigating to annotation from note window 2021-09-07 12:01:42 +03:00
Dan Stillman
7672340819 HTML tree: Don't select all items on Cmd-Shift-A 2021-09-02 20:24:44 -04:00
Dan Stillman
576b9b7817 Fix SQL error saving an item with hundreds of related items
Fixes #2139
2021-09-01 06:19:56 -04:00
Dan Stillman
14b7206276 Get row height from tree for ItemTree::ensureRowsAreVisible() 2021-09-01 05:15:44 -04:00
Dan Stillman
dadf630728 HTML tree: ensureRowsAreVisible() shouldn't scroll if unnecessary
Fixes #2166
2021-09-01 01:45:54 -04:00
Dan Stillman
69a43ec456 Hack to fix sorting after reordering columns
There's probably a better fix for this, but this seems to work.
2021-08-31 06:55:57 -04:00
Dan Stillman
4fa7070a31 Fix item tree sorting when column doesn't have .sortDirection property 2021-08-31 06:55:57 -04:00
Martynas Bagdonas
d77b00bf9a Clarify and comment tab moving code 2021-08-31 11:37:01 +03:00
Adomas Venčkauskas
d8af5b7923 Fix wrong collection contents shown when switching collections at startup
Closes #2175
2021-08-30 15:19:12 +03:00
Adomas Venčkauskas
d4b3ed7fd8 HTML Tree: Fix opening multiple items with [Enter] 2021-08-30 15:19:12 +03:00
Martynas Bagdonas
b5ea925d02 Jump back to the opening tab even if the PDF was already open
Fixes #1985
2021-08-30 14:56:09 +03:00
Martynas Bagdonas
295874f803 Fix issue where non-existing tab is selected when closing multiple tabs 2021-08-30 14:12:22 +03:00
Martynas Bagdonas
b8cb093f79 Open multiple PDFs in tabs if SHIFT wasn't pressed, remove old code 2021-08-30 13:43:14 +03:00
Adomas Ven
cb9df902bc
HTML Tree: make find as you type a virtualized table functionality (#2176)
Closes #2168, closes #2169.
Adds find-as-you-type to locate, preference style and export
formats managers.

To enable find as you type you need to specify the getRowString(index) prop
on the VirtualizedTable. See prop comment for more info.
2021-08-30 06:01:08 -04:00
Adomas Venčkauskas
94c4d975a9 HTML Tree: fix item deletion breakage when child items are selected.
Closes #2174
2021-08-30 12:50:29 +03:00
Adomas Venčkauskas
873846261e Fix export preferences HTML tree 2021-08-30 12:06:17 +03:00
Martynas Bagdonas
aa7f5289a3 Filter ink annotations before creating note from annotations 2021-08-30 11:06:10 +03:00
Dan Stillman
c2df338430 Allow 'ink' annotation type to be created 2021-08-30 03:58:58 -04:00
Adomas Venčkauskas
37d5e99fde Fix some keyboard selection bugs in HTML collection tree
Moving pivot via [CMD/CTRL]+[ArrowKey] would change collection tree
focus without updating the UI
Select-all shortcut worked in the collection tree
2021-08-30 10:23:03 +03:00
Adomas Venčkauskas
b8545590d5 HTML Tree: more fixes to find as you type 2021-08-30 09:57:28 +03:00
Adomas Venčkauskas
2ef5afdd9c Disable typing navigation with modifier keys pressed. Closes #2170 2021-08-30 09:52:13 +03:00
Dan Stillman
d723065a3d HTML tree: Don't move dragged external files by default on macOS
Fixes #2172
2021-08-30 02:40:06 -04:00
Dan Stillman
952663de73 Fix failing repo notice tests 2021-08-29 04:41:52 -04:00
Dan Stillman
2459614f04 Add mechanism for showing dialog with notice from repo
- Messages are shown once a day by default (within the same session for
  id-less messages)
- Messages with an `id` attribute include a checkbox to not show again
  for 30 days
- If an `infoURL` attribute is provided, a "More Information" button is
  shown that launches that URL
- If `title` is provided, it's used for the dialog title. Otherwise
  "Warning" is shown.
2021-08-29 04:25:49 -04:00
Dan Stillman
ba7d0a18aa Restore itemTree::saveSelection()
Deprecated for years, but used by ZotFile
2021-08-29 01:41:40 -04:00
Dan Stillman
8d3adb6f46 HTML tree: Add tree.focus()
And fix shortcut key for selecting library
2021-08-28 22:43:09 -04:00
Dan Stillman
dba77cd332 Additional tab context menu tweaks (#2162)
- Select last reopened tab instead of opening all in background
- Rearrange Close/Close Other Tabs/Reopen Closed Tabs options
- Use proper plural for Reopen Closed Tab[s]
2021-08-27 16:52:22 -04:00
Martynas Bagdonas
50732d1479 Add tab context menu (#2162) 2021-08-27 16:52:02 -04:00
Dan Stillman
7019544b48 Add ink annotation type 2021-08-27 16:28:45 +03:00
Adomas Venčkauskas
77f726fef3 HTML Tree: improve row scrolling into row behavior upon toggling open 2021-08-27 13:54:33 +03:00
Adomas Venčkauskas
b05e22fa77 HTML Tree: Make search context rows selectable. Closes #2164
Adds special handling such that context rows are not selected only
when performing a select-all.
2021-08-27 13:36:03 +03:00
Adomas Venčkauskas
0a7aa10463 HTML Tree: Fix refresh bugs when a feed is modified. Closes #2163 2021-08-27 13:05:35 +03:00
Adomas Venčkauskas
ab9414d1a4 HTML Tree: some additional documentation 2021-08-26 16:40:41 +03:00
Adomas Venčkauskas
a71addb12a Make sure including include.js multiple times does not break monkey-patching
This is important for plugins that want to monkey-patch interfaces that
are only accessible via require() calls
2021-08-26 16:21:52 +03:00
Adomas Venčkauskas
b08f2d829f Update the HTML tree to allow extension via Zotero plugins 2021-08-26 16:16:44 +03:00
Adomas Venčkauskas
20e2f33064 HTML Tree: Optimize tree invalidation 2021-08-26 14:40:59 +03:00
Adomas Venčkauskas
bffa64bdda HTML Tree: Re-add item tree methods lost in transition 2021-08-26 10:14:35 +03:00
Adomas Venčkauskas
b91664435f HTML Tree: Fix Show Items from Subcollections. Closes #2160 2021-08-26 09:33:47 +03:00
Martynas Bagdonas
89d1899690 Add UI feedback when moving tab
Fixes #1988
2021-08-26 08:23:19 +03:00
Martynas Bagdonas
d55b80df80 Show author and year in PDF reader tab/window title
Fixes #2034
2021-08-26 08:23:19 +03:00
Martynas Bagdonas
ecd6d7ce2c Implement tab jumpback
#1985
2021-08-26 08:23:19 +03:00
Martynas Bagdonas
b6d562b0cb Allow middle button click to close a tab
Fixes #1993
2021-08-26 08:23:19 +03:00
Adomas Venčkauskas
da7527e384 Fix intro message not getting cleared when adding new item. Closes #2158 2021-08-25 18:19:30 +03:00
Dan Stillman
13f2c57196 Fix sizes of items pane messages
7ef7943a17 made "Loading items…" small again after it got big during
HTMLification but made everything else (e.g., welcome message, My
Publications intro) small as well. This adds an ugly hack to keep the
loading message small for now (without passing dedicated HTML from a
bunch of different places).
2021-08-25 03:50:12 -04:00
Dan Stillman
0bbe064245 Don't toggle libraries-to-sync row on Enter
Otherwise if you close the dialog with Enter the current row (which is
probably the row you just changed) is toggled

Regression from HTMLification
2021-08-25 02:27:45 -04:00
Dan Stillman
4d88e99e9e Increase icon column width in libraries-to-sync dialog
A bit wider than d4e3a437f, since the column header seems to not
currently be centered properly at narrow widths
2021-08-25 02:18:08 -04:00
Dan Stillman
92e6a536f1 HTML tree: Add alternating rows to all trees except collections on macOS 2021-08-25 02:16:19 -04:00
Dan Stillman
d0635e12cb
Add disableFontSizeScaling prop to HTML tree (#2155)
Removes `defaultRowHeight` prop added in adb8aa39f in favor of a prop
that disables font size scaling. A non-default row height can still be
specified with `rowHeight`.

Most of our existing trees need to disable font size scaling, but the
idea is that pretty much everything _should_ scale with font size for
accessibility, and it's a limitation of the current prefs and other UIs
that they don't currently, so it's better to default to scaling and
gradually remove uses of this prop.

This fixes a bug where the HTML trees other than the collection and item
trees would have larger rows but without larger text when font size was
increased.

Also:

- Fixes #2157 by fixing line height adjustment on macOS when at the
  default font size, applying it to all trees, and moving the explicit
  `rowHeight` override from the item tree to the collection tree, which
  should have more spacing than all other trees (rather than the item tree
  having less).
2021-08-25 01:53:22 -04:00
Adomas Venčkauskas
462af98380 Restore libraries-to-sync UX. Closes #2156 2021-08-24 17:15:17 +03:00
Adomas Venčkauskas
6010390525 HTML Tree: Fix column separators misaligned at startup. Closes #2153 2021-08-24 16:44:55 +03:00
Dan Stillman
d4e3a437fd Reduce width of icon column in libraries-to-sync dialog
Changed during HTMLification
2021-08-24 01:25:47 -04:00
Martynas Bagdonas
85b142ccb2
Restore tabs state (#2148) 2021-08-23 13:02:57 -04:00
Dan Stillman
f9035c8fda Show emoji colored tags directly in items list
We can do fun things now.

Also:

- Make colored tag swatches resize with the font size
- Increase border radius for color swatches, and adjust with size
2021-08-22 04:41:34 -04:00
Dan Stillman
cc4225db1a Restore localized date in Styles list in Cite prefs
With the new tree, this was showing the full timestamp from the style
object.
2021-08-21 06:58:12 -04:00
Dan Stillman
adb8aa39f8 Reduce item tree row spacing
This matches the previous tree on macOS.
2021-08-21 06:58:12 -04:00
Dan Stillman
ec35291060 Decrease item tree indent
Roughly center child item icons between the parent item icon and text,
which looks a bit less awkward than the previous tree's positioning. An
alternative would be to align with the beginning of the parent item text
(a value of 21), but that's a bit spaced out, at least until we have
multiple levels with additional twisties.
2021-08-21 06:58:12 -04:00
Dan Stillman
c85a434eb6 Reduce collection tree indent
At least on macOS, this brings it back in line roughly with the previous
version.
2021-08-21 06:58:12 -04:00
Dan Stillman
c965e6159a Fix collection tree header indentation on macOS 2021-08-21 06:58:12 -04:00
Adomas Venčkauskas
881ab5f59e Store column prefs to a dedicated file in a profile dir instead of XPCOM prefs 2021-08-21 06:58:12 -04:00
Adomas Venčkauskas
a2062bf011 Fix selection not being maintained when collapsing/expanding rows 2021-08-21 06:58:12 -04:00
Adomas Venčkauskas
55c758c9d0 Fix header columns being misaligned with table columns in item tree
And reindent _virtualized-table.scss
2021-08-21 06:58:12 -04:00
Adomas Venčkauskas
431d7e1eaa Fix alternating-row colours switching upon child expand-collapse 2021-08-21 06:58:12 -04:00
Adomas Venčkauskas
efc009f724 Fix collection tree header alignment on macOS 2021-08-21 06:58:12 -04:00
Adomas Venčkauskas
7ec89c44ce Improve column sorting speed 2021-08-21 06:58:12 -04:00
Adomas Venčkauskas
ff627b7d3f Ensure column order and width prefs are properly retained 2021-08-21 06:58:12 -04:00
Adomas Venčkauskas
9e04250142 Do not sort a column on mouseup if mousedown occurred on a different one 2021-08-21 06:58:12 -04:00
Adomas Venčkauskas
4cea4519b8 Fix column resizing weirdness with fixed with columns 2021-08-21 06:58:12 -04:00
Adomas Venčkauskas
277503f879 Fix rows not being properly redrawn in duplicates view 2021-08-21 06:58:12 -04:00
Adomas Venčkauskas
a15fb83cc4 Fix feed sort being wrong 2021-08-21 06:58:12 -04:00
Adomas Venčkauskas
c496b5e367 Fix crash message not getting locked 2021-08-21 06:58:12 -04:00
Adomas Venčkauskas
8ebf1609b6 Item tree selection changes and fixes
- Fixes selection events always being debounced
- Fixes some failing tests
- Ensures Select All command selects search matching children of
collapsed parents. Adds tests for this case
2021-08-21 06:58:12 -04:00
Adomas Venčkauskas
6dce19d546 Expand search parents whith Select All shortcut in item tree 2021-08-21 06:58:12 -04:00
Adomas Venčkauskas
1db2eb4aea Ensure disabled item tree rows are not selectible with Select All 2021-08-21 06:58:12 -04:00
Adomas Venčkauskas
7265393be9 Fix item PDF not opening on double click in tree 2021-08-21 06:58:12 -04:00
Adomas Venčkauskas
9c7f28b126 Fix trees not properly redrawing on drag events 2021-08-21 06:58:12 -04:00
Adomas Venčkauskas
d83ec19c23 Do not try to open/close empty collection tree rows on + and - hotkeys
Causes performance issues
2021-08-21 06:58:12 -04:00
Adomas Venčkauskas
b5dc0e7630 Add a comment for how to open the data generator 2021-08-21 06:58:12 -04:00
Adomas Venčkauskas
87014451de Fix item tree selection issues when using + and - hotkeys 2021-08-21 06:58:12 -04:00
Adomas Venčkauskas
cc97545bd6 Fix advanced search item tree being invisible on open 2021-08-21 06:58:12 -04:00
Adomas Venčkauskas
700ac31eef Ensure \n\n in itemPaneMessage is displayed as a newline 2021-08-21 06:58:12 -04:00
Adomas Venčkauskas
82f87a0d8d Add a Restore Column Order choice in the column picker 2021-08-21 06:58:12 -04:00
Adomas Venčkauskas
2b6c7277f7 Item Tree: Do not display Title in the columnpicker 2021-08-21 06:58:12 -04:00
Adomas Venčkauskas
af597d943b Move js-tree files out from /containers subfolder 2021-08-21 06:58:12 -04:00
Adomas Venčkauskas
e68685521b Do not change selection on macOS when using PageUp/Down 2021-08-21 06:58:12 -04:00
Adomas Venčkauskas
f773f79d10 Documentation adjustments for virtualized-table 2021-08-21 06:58:12 -04:00
Adomas Venčkauskas
82914a9583 JSWindow - WindowedList 2021-08-21 06:58:12 -04:00
Adomas Venčkauskas
67d9e87c55 Icons.getDomElement() -> Icons.getDOMElement() 2021-08-21 06:58:12 -04:00
Adomas Venčkauskas
47094fc4c3 Misc new tree cleanup 2021-08-21 06:58:12 -04:00
Adomas Venčkauskas
d26eba2d2c Adjustments and documentation for Utilities.Internal.makeClassEventDispatcher 2021-08-21 06:58:12 -04:00
Adomas Venčkauskas
bcd9d777c9 Remove unused Debug._setLevel() 2021-08-21 06:58:12 -04:00
Adomas Venčkauskas
51f13412b9 Documentation for the tree selection 2021-08-21 06:58:12 -04:00
Adomas Venčkauskas
5a97f2bdd8 ReactDom -> ReactDOM 2021-08-21 06:58:12 -04:00
Adomas Venčkauskas
1e75425698 Fix highlighted collection not unhighlighting 2021-08-21 06:58:12 -04:00
Adomas Venčkauskas
2f72ed17b7 Ensure columns with different visibility group retain their config 2021-08-21 06:58:12 -04:00
Adomas Venčkauskas
cbbff600a6 XUL -> JS tree megacommit
- Just a single huge commit. This has been developed over too long a
time, required many tiny changes across too many files and has seen too
many iterations to be separated into separate commits.
The original branch with all the messy commits will be kept around for
posterity
bb220ad0f2...adomasven:feature/react-item-tree
- Replaces XUL <tree> element across the whole zotero client codebase
with a custom supermegafast virtualized-table inspired by
react-virtualized yet mimicking old XUL treeview API. The
virtualized-table sits on top on a raw-to-the-metal,
interpreted-at-runtime JS based windowing solution inspired by
react-window. React-based solutions could not be used because they were
slow and Zotero UI needs to be responsive and be able to
display thousands of rows in a treeview without any slowdowns.
- Attempts were made at making this screen-reader friendly, but yet to
be tested with something like JAWS
- RTL-friendly
- Styling and behaviour across all platforms was copied as closely as
possible to the original XUL tree
- Instead of row-based scroll snapping this has smooth-scrolling. If
you're using arrow keys to browse through the tree then it effectively
snap-scrolls. Current CSS snap scroll attributes do not seem to work in
the way we would require even on up-to-date browsers, yet alone the ESR
version of FX that Zotero is on. JS solutions are either terrible for
performance or produce inexcusable jitter.
- When dragging-and-dropping items the initial drag freezes the UI for
a fairly jarring amount of time. Does not seem to be fixable due to
the synchronous code that needs to be run in the dragstart handler.
Used to be possible to run that code async with the XUL tree.
- Item tree column picker no longer has a dedicated button. Just
right-click the columns. The column preferences (width, order, etc) are
no longer handled by XUL, which required a custom serialization and
storage solution that throws warnings in the developer console due to
the amount of data being stored. Might cause temporary freezing on HDDs
upon column resize/reorder/visibility toggling.
- Context menu handling code basically unchanged, but any UI changes
that plugins may have wanted to do (including adding new columns) will
have to be redone by them. No serious thought has gone into how plugin
developers would achieve that yet.
- Opens up the possibility for awesome alternative ways to render the
tree items, including things like multiple-row view for the item tree,
which has been requested for a long while especially by users switching
from other referencing software
2021-08-21 06:58:12 -04:00
Tom Najdek
f274323478
Mendeley import: Move temp downloaded files instead of copying #2149 (#2150)
During Mendeley api import all attachments are fetched into temporary
location and were previously copied to the storage folder. Only after
import completed, temporary files were deleted. Therefore a complete
import required storage equal to twice the final library size. Switching
to move avoids this problem.

Also:

- Fix _isTempDownloadedFile() check
2021-08-20 00:07:28 -04:00
Dan Stillman
ddc7be75c7 Use PRAGMA legacy_alter_table=ON for existing schema updates
This won't make a difference until we update Firefox and get a new
SQLite version, but at that point the existing schema update steps that
recreate tables by renaming the old table would result in broken foreign
keys.

This patch will make sure that newer SQLite versions will use the legacy
behavior for the existing steps, and going forward schema update steps
that want to recreate tables will need to create a new table, migrate
the data, delete the old table, and rename the new one into place.
2021-08-17 00:41:59 -04:00
Dan Stillman
0f96c20f3c Fix several possible DB upgrade errors from 4.0 to 5.0
- We were updating global schema before migrating userdata, but a 4 → 5
  upgrade involved a system.sql version bump, which wiped out itemTypes,
  causing 'annotation' to not exist after the upgrade. This moves global
  schema updates after userdata migration and bumps the global schema
  version to repair DBs that were already upgraded and broken.

- A system.sql bump without a global schema update would result in empty
  tables. This moves the global-schema-related tables to userdata.sql.

- The DB integrity check before userdata updates added in 5b9e6497a
  could fail when coming from an older DB, because the checks assume
  current schema. An integrity check is now done after a userdata update.
  (We were already skipping the new table/index reconciliation stuff. If
  old DBs are discovered to have problems that would cause a migration
  step to fail, we'll fix those explicitly in the steps.)

Also:

- Make sure `version` is `versionNumber` in the `fields` table. It was
  changed with a system.sql bump in 5.0, but hard-coded fields were later
  removed from system.sql in favor of schema.json, meaning that anyone who
  upgraded from 4.0 after that would never have `version` removed and so
  would have both fields (one from before and one from schema.json).
2021-08-17 00:41:59 -04:00
Dan Stillman
3732f97d41 Add OpenURL resolver directory
Remove the apparently obsolete [1] WorldCat `lookup?IP=requestor` search
functionality and replace with a hierarchical menu populated directly
from our directory [2].

Also switch to https://www.worldcat.org/registry/gateway as the default
resolver, which seems to be the same as
http://worldcatlibraries.org/registry/gateway but with HTTPS support

Fixes #1811
Fixes #1853

[1] https://forums.zotero.org/discussion/79312/search-for-resolvers-gives-out-of-date-information
[2] https://www.zotero.org/support/locate/openurl_resolvers
2021-08-13 06:25:16 -04:00
Adomas Venčkauskas
5118cd4164 Fix note insertion errors when note does not contain citations 2021-08-13 13:18:15 +03:00
Dan Stillman
ee2b63bf18 Update submodules 2021-08-06 16:56:31 -04:00
Dan Stillman
5ae8e819ef Update utilities submodule and add comment for MAX_TITLE_LENGTH 2021-08-06 16:06:29 -04:00
Martynas Bagdonas
9b3367f227 Allow zotero://open-pdf/ to navigate to specific annotation by key
zotero://open-pdf/library/items/AABBCCDD?annotation=[annotation-key]

Fallback to a page if annotation is missing:
zotero://open-pdf/library/items/AABBCCDD?page=123&annotation=[annotation-key]

Fixes #2125
2021-08-06 13:06:40 +03:00
Martynas Bagdonas
6472321000 Upgrade note-editor schema to v4:
- Set `annotation.attachmentURI` instead of `annotation.uri` when inserting annotations
- Migrate `annotation.uri` to `annotation.attachmentURI`
- Add `annotation.annotationKey` that references to the original annotation
2021-08-06 13:06:40 +03:00
Martynas Bagdonas
a065d477ed Add zoom options to View menu
Fixes #2138
2021-08-05 11:27:54 +03:00
Martynas Bagdonas
bd56b16247 Fix missing checkbox issue for standalone PDF reader window 2021-08-05 11:23:35 +03:00
Dan Stillman
97b381f435 Update utilities submodule (fixes #2141)
Follow-up to #2128
2021-08-04 20:40:27 -04:00
Dan Stillman
b1e63c8fe1 Update translate and utilities submodules 2021-08-04 20:02:46 -04:00
Abe Jellinek
4475e86eac
Fix error when connector requests translators (#2135)
The call to done() resulted in a 500 response and prevented the
connector from fetching the list of available translators.
2021-08-04 04:39:43 -04:00
Martynas Bagdonas
7015c8df59 Fix missing menu checkbox issue on pdf-reader and note-editor on Windows 2021-08-02 11:45:30 +03:00
Abe Jellinek
5bfdeb36ca
Exclude unmergeable types by name, not by ID (#2137)
Excluding by ID obscured which types were being excluded. IDs drifted
and we ended up blacklisting artwork and encyclopediaArticle.
2021-07-30 16:15:10 -04:00
Adomas Venčkauskas
0e2073b251 Revert removal of Utilities.Internal.itemToExportFormat() (since c929055) 2021-07-30 14:28:14 +03:00
Adomas Venčkauskas
4d497afea0 Use Translator Tester code from shared repo for Scaffold 2021-07-28 15:46:07 +03:00
Adomas Venčkauskas
8f90cfbcfd Remove obsolete files after shared code modularization 2021-07-28 15:46:07 +03:00
Adomas Venčkauskas
7814efcfe2 Use zotero/translate and zotero/utilities for shared code 2021-07-28 15:46:07 +03:00
Adomas Venčkauskas
c929055571 Refactor utilities code in preparation to move to external repo 2021-07-28 15:46:07 +03:00
Martynas Bagdonas
e0bc873bce Improve embedded note image loading and deletion:
- Delete unused embedded images when note is closed.
- Load images as soon as they are downloaded.
- Introduce new notification for download event, and a test for it.
- Prevent simultaneous downloads of the same attachment.
2021-07-28 13:49:04 +03:00
Martynas Bagdonas
3c658fc672
Copy embedded images, downloaded when needed or show a warning (#2129) 2021-07-26 13:04:38 +03:00
Martynas Bagdonas
a40ac2907e Open PDF files over viewAttachment() to reuse its logic (download, etc.) 2021-07-22 17:54:46 +03:00
Martynas Bagdonas
415973d83c Update citations only on note edit to avoid sync loops 2021-07-21 21:30:53 +03:00
Martynas Bagdonas
aa11c36a64 Little fixes to note editor:
- Fix invalid selector
- Filter itself sent postMessage messages
2021-07-21 21:20:20 +03:00
Dan Stillman
6a6e4fa92c Don't update retractions on bundled file update notification 2021-07-21 03:45:25 -04:00
Dan Stillman
2dd16b44d6 Ignore items in target library trash for cross-library drags
Just don't consider items in the trash to be linked items in
item.getLinkedItem(). I'm not totally sure why we didn't do this many
years ago, since it's one of the biggest sources of confusion in Zotero.

This addresses #1648 and closes #1610, though not by undeleting and
overwriting the item in the trash. When deleting an item and then
re-dragging it from another library, I think most people would expect
the item in the trash to still exist (possibly with notes, etc.), rather
than having been automatically restored and overwritten with new data.
2021-07-20 23:45:40 -04:00
J. Ryan Stinnett
6b8bbaf980 Rename metaOrCtrl to cmdOrCtrl
Since we're already testing for macOS, let's go for clarity and call the meta
key Cmd here, since that's what it is.
2021-07-15 09:26:36 +01:00
Tom Najdek
ec2ad91938
Mendeley import: Add "★" tag for favourite items (#2122)
Also ensure that "★" tag is added to an existing item on re-import
where appropriate.
2021-07-13 06:28:05 -04:00
Abe Jellinek
d2db842938
Scaffold: Add action to open test URL in internal browser (#2117) 2021-07-13 03:33:57 -04:00
J. Ryan Stinnett
738d449bea Add MetaOrCtrl-1 through 9 tab navigation 2021-07-11 02:28:25 +01:00
J. Ryan Stinnett
051a84686f Add Ctrl-Tab / Ctrl-Shift-Tab tab navigation 2021-07-11 02:28:25 +01:00
J. Ryan Stinnett
3a95e2e303 Add Cmd-Shift-[ / ] tab navigation on macOS only 2021-07-11 02:28:25 +01:00
J. Ryan Stinnett
28b34bb958 Add stop propagation to existing tab navigation 2021-07-11 01:32:17 +01:00
J. Ryan Stinnett
9afc6e8f47 Tweak existing tab navigation style 2021-07-11 01:29:42 +01:00
J. Ryan Stinnett
d231a03308 Move tab navigation above from and document checks
This ensure tab navigation functions are always available throughout Zotero.
2021-07-11 01:03:10 +01:00
Abe Jellinek
f942c224f5
Scaffold: Run/delete tests with the keyboard (#2118) 2021-07-09 03:42:08 -04:00
Dan Stillman
fb01339c6b Implement library.isGroup property, which was never properly implemented
And since `Zotero.Libraries.isGroupLibrary()` just checked that
property, that hasn't worked either since `isGroup` was added in 2015.

There's no test for `.isGroup`, and the test for `isGroupLibrary()` used
`if()` instead of `it()`, so it never actually ran.

Also:

- Remove old code block in search.js that called `isGroupLibrary()`.
  Since `isGroupLibrary()` didn't work, this block was unused, and its
  logic was previously added elsewhere.
2021-07-07 01:43:22 -04:00
Dan Stillman
314f66c84a Fix comment on Zotero.Item::clone() 2021-07-07 00:17:29 -04:00
Martynas Bagdonas
9e7ab68fb4 Localize color names in pdf-reader 2021-07-06 16:57:47 +03:00
Martynas Bagdonas
28f5fed509 Increase pdf-reader default sidebar width 2021-07-06 16:52:47 +03:00
Martynas Bagdonas
3b6c31319d Tweak pdf-reader and note-editor read-only mode code 2021-07-06 16:52:46 +03:00
Martynas Bagdonas
de7ede5d9b Properly disable read-only actions in notes list context menus 2021-07-01 14:14:43 +03:00
Martynas Bagdonas
0e76c31608 Add Zotero.enablePDFBuildForGroups switch 2021-06-30 17:30:24 +03:00
Martynas Bagdonas
26d784ca0f Allow read-only note editing in a separate window in PDF build 2021-06-30 17:03:10 +03:00
Martynas Bagdonas
ee9ebc6152 Fix contextPane note regression that unpurposely enables read-only mode 2021-06-30 17:03:10 +03:00
Martynas Bagdonas
f4e7c8293b Don't allow to create/delete notes in contextPane in read-only libraries 2021-06-29 17:27:27 +03:00
Martynas Bagdonas
ab200cc60b Improve annotations insertion into notes:
- Properly transform HTML tags flavored plain-text into actual HTML
- Add support for multiline comments and highlights
- Insert newline before citation/comment when necessary
2021-06-29 16:03:54 +03:00
Martynas Bagdonas
f2a440185b Filter i, b, sub, sup tags from annotation comment when exporting to PDF 2021-06-29 13:49:36 +03:00
Dan Stillman
fdcd4e51c5 Handle additional cases of conflicting translators
And fix test failure from bde9a74f9d in CI, where the file list order is
different
2021-06-26 20:17:57 -04:00
Dan Stillman
06075a25c0 Fix regression in b8ad18e96d
We're relying on Bluebird's synchronous promise inspection for noWait
translate mode (as used in Quick Copy). We should decide if we want to
keep the Bluebird dependency or rewrite this to use native promises
(e.g., with a separate synchronous `_loadTranslator()` function for
noWait mode), but for now just restore the `Zotero.Promise.method()`.
2021-06-26 17:51:17 -04:00
Dan Stillman
261bb7ee91 Dictionary handling improvements
- Fix installation of dictionaries on Windows
- Use version in XPI download URL (zotero/zotero-build@c3308c7a4)
- Improve display of download errors
2021-06-26 17:09:23 -04:00
Martynas Bagdonas
425daa3622 Make pdf-reader read-only when item is in trash or read-only group 2021-06-25 19:21:39 +03:00
Dan Stillman
b8ad18e96d Fix broken detection after error loading a translator's code
The bug fixed in bde9a74f9d was triggering an error getting code for a
deleted search translator, which due to this bug caused a double
complete() call that got detection all out of sync, which caused some
search translators to be skipped, which resulted in ISBN lookup
failures.
2021-06-25 06:49:54 -04:00
Dan Stillman
bde9a74f9d Clear caches properly when deleting duplicate translator
Among other things, if the name of a translator was changed, until
restart Zotero.Translators.getAllForType() would return the old cache
entry pointing to a file that no longer existed.
2021-06-25 06:49:18 -04:00
Dan Stillman
f80ba89971 Massively speed up tests
- Make a copy of the database after first initialization that can be
  swapped in when reinitializing in resetDB()
- Avoid unnecessary one-second delay on every reset

Probably more that can be done, but this should take minutes off the
test runs
2021-06-24 06:10:40 -04:00
Martynas Bagdonas
88280641ac Avoid setTimeout call on every note-editor context menu popup
Fixes #2111
2021-06-24 11:32:43 +03:00
Martynas Bagdonas
e3758dc581 Delay popup with spell checker initialization to fix missing checkmark 2021-06-23 21:56:11 -04:00
Dan Stillman
9a7016ad64 Spell checker improvements
- Add/Remove Dictionaries window
- Better account for the (unlikely) possibility that a dictionary could
  be replaced by another more popular dictionary provided by a different
  extension id (tested)
- Better account for the (very unlikely) possibility that an extension
  could bundle multiple dictionaries (untested)
- Use toolkit version comparator for proper extension version
  comparisons
- Localize strings
- Add tests for updating
2021-06-23 21:56:11 -04:00
Dan Stillman
7f2296b1fb Tweak a couple error messages for HTTP.BrowserOfflineException 2021-06-23 21:56:11 -04:00
Dan Stillman
1e2ad01f99 Zotero.File.download(): Throw error on non-200 response 2021-06-23 21:56:07 -04:00
Martynas Bagdonas
814cbc0ee3 Introduce spell checker context menu and dictionaries managing 2021-06-23 19:25:46 -04:00
Dan Stillman
00a0231e4f Remove "\n" from localized string for note annotation header
Follow-up to 47f897fe8c
2021-06-22 01:13:17 -04:00
Dan Stillman
91ebbc1bc9 Changes to colored tag toggling via keyboard
- Update Date Modified when toggling tags via keyboard
  (https://forums.zotero.org/discussion/90371/bug-toggling-a-colored-tag-with-number-keys-doesnt-update-date-modified)
- If any selected items don't have the tag, add it to all items, instead
  of deciding based on the first item
  (https://forums.zotero.org/discussion/79900/minor-issue-related-to-colored-tags)
2021-06-22 01:01:51 -04:00
Dan Stillman
42b4b173f3 Store lastCompatibleVersion during schema initialization
Otherwise switching back to release from beta doesn't show the last-used
version if the beta hasn't gone through at least one
compatibility-breaking schema update.
2021-06-21 01:16:18 -04:00
Abe Jellinek
e285415451
Make resolveURL available to translators (#2101) 2021-06-18 15:18:44 -04:00
Martynas Bagdonas
47f897fe8c Use two lines for extracted annotation header and fix title extraction
Fixes #2095
2021-06-18 13:03:25 +03:00
Martynas Bagdonas
b5edc0d9c1 Reorganize note-editor toolbar 2021-06-17 14:07:09 +03:00
Dan Stillman
7a4b27e774
Merge pull request #2071 from jryans/feed-processor
Import feed processor
2021-06-17 03:27:36 -04:00
J. Ryan Stinnett
eaa01901ef Wire up new feed processor to Zotero's feed reader
This connects the new feed processor to Zotero's existing feed reader. The new
feed processor assumes a content window environment, so a sandbox in a parent
window is used to load it.
2021-06-16 20:59:57 +01:00
J. Ryan Stinnett
af6029b854 Convert feed processor to native URLs 2021-06-16 20:59:57 +01:00
J. Ryan Stinnett
be80598c6b Convert feed processor data away from XPCOM
This changes the feed processor XPCOM array and property bags to native arrays
and objects.
2021-06-16 20:59:57 +01:00
J. Ryan Stinnett
088483b776 Fix lint issues in feedReader.js 2021-06-16 20:59:57 +01:00
Tom Najdek
f1414731da
Blur active field in switchCreatorMode #2087 (#2088) 2021-06-14 17:33:55 -04:00
Abe Jellinek
f83559feb8
Correct creator fields in OpenURL (#2079)
There is no isInstitution field, so OpenURL search was producing invalid
data for items with institutional authors. Instead we use the name field
in API JSON and the isInstitution flag in internal JSON.
2021-06-14 14:49:49 -04:00
qqobb
5359db39d0
Run JavaScript: Improve await regex (#2083)
Tests: https://regex101.com/r/eQYCIp/1
2021-06-12 02:44:39 -04:00
Tom Najdek
864b135da4
Mendeley import: Simplify filename logic #2067 (#2085) 2021-06-11 13:35:09 -04:00
Martynas Bagdonas
3beb858275 Upgrade note-editor schema to v3:
- No longer store `text` property in highlight annotation
- Remove `text` property when modifying a note
2021-06-09 17:48:55 +03:00
Martynas Bagdonas
43bd1af3e9 Prepare read-only check for group library annotations 2021-06-08 10:10:21 +03:00
Martynas Bagdonas
87ef6ceacc Fix notesList more button notes count 2021-06-04 18:27:43 +03:00
Martynas Bagdonas
6d0067b806 Do not escape existing HTML entities when citing note 2021-06-04 11:49:11 +03:00
Dan Stillman
2fd46157f3 Enable Basque locale 2021-06-04 02:16:20 -04:00
Dan Stillman
3cfc31c445 Add TODO to pass libraryID in advanced search autocomplete
This will probably conflict with an open PR, but that should be fixed to
do the same.
2021-06-04 02:15:16 -04:00
Dan Stillman
07eda894f3 Don't trigger 'redraw' event on attachment download 404
There's no need to refresh the attachments column of the item row if
nothing was downloaded.

Also remove some unnecessary logging
2021-06-03 23:39:52 -04:00
Martynas Bagdonas
a5fe49b866 Remove sync buttons from PDF reader toolbar
Fixes #2045
2021-06-02 20:39:44 +03:00
Martynas Bagdonas
a418d5ae8d Fix RTL mode in pdf-reader, note-editor, contextPane 2021-06-01 11:37:07 +03:00
Dan Stillman
1bf7b1e88e Fix updating of attachment title in right-hand pane when changed
https://forums.zotero.org/discussion/88225/attached-file-name-doesnt-change-immediately-at-5-0-97-beta-2-8b1b2ee56
2021-05-31 03:26:06 -04:00
Martynas Bagdonas
ded077dc8e Use Zotero.appName for localization in note-editor
Fixes #2073
2021-05-27 13:38:09 +03:00
Dan Stillman
6be797bc14 Fix additional imported Mendeley annotation color ("#000")
This is going to start redacting people's PDFs until we change the
default opacity.
2021-05-27 05:30:39 -04:00
Martynas Bagdonas
cf344335ed Use item display title for PDF reader tabs 2021-05-25 19:48:35 +03:00
Martynas Bagdonas
bb40928720 Localize formatted citations in notes
Fixes #2040
2021-05-25 13:07:24 +03:00
Martynas Bagdonas
faec1f1dee Provide filename for recognizer server 2021-05-25 10:30:54 +03:00
Martynas Bagdonas
b2acb5e339 Fix missing title in PDF reader standalone window 2021-05-21 17:20:12 +03:00
Martynas Bagdonas
eb085f2bbe Reorganize View menu, add checkmarks, introduce Go menu
Fixes #2037
Fixes #1997
2021-05-21 17:20:11 +03:00
Martynas Bagdonas
39b56a66dc Fix blank standalone PDF reader window issue 2021-05-21 15:44:38 +03:00
Martynas Bagdonas
a7c6979e75 Add space between items in multi-item citation 2021-05-21 15:24:56 +03:00
Dan Stillman
cdf1f3c856 Mendeley import: Use bytes for path/filename limits on Windows
It's not totally clear how it's calculated, but it doesn't seem to be
just characters.

And make the path limit 255, which is the File Explorer limit, even if
the filesystem can allow up to 260.
2021-05-21 03:02:41 -04:00
Abe Jellinek
06660d04f0
Scaffold: Update year and add spacing in template (#2066) 2021-05-21 00:53:19 -04:00
Dan Stillman
bec42fe2a5 Handle multibyte characters in Zotero.File.truncateFileName()
Filesystems care about byte length, not character length, so treat
maxLength as the byte length limit and truncate accordingly.

This will also now remove entire emoji characters without corrupting
them.
2021-05-20 19:25:57 -04:00
Dan Stillman
b511e452a8 Mendeley import: Only limit paths to 260 characters on Windows 2021-05-20 19:25:15 -04:00
Tom Najdek
7582147dd5
Mendeley Import: Prevent tmp path > 260 chars 2021-05-20 12:53:34 +02:00
Tom Najdek
63205a73e8
Improve truncateFileName logic for edge cases 2021-05-20 12:41:49 +02:00
Tom Najdek
89d81cee41
Mendeley import: Sanitize names of fetched files 2021-05-20 12:41:44 +02:00
Tom Najdek
faf094f0aa
Mendeley import: shorten tmp file path 2021-05-20 11:18:23 +02:00
Martynas Bagdonas
5497598c63 Localize pdf-reader and note-editor 2021-05-20 10:49:03 +03:00
Dan Stillman
861d5787d8 Mendeley online import: Fix error if downloaded file doesn't exist
If a file attached to an item with a URL wasn't found in the temp
directory, it would trigger an error that stopped the sync. (I'm not
sure how a file wouldn't exist.)
2021-05-20 03:15:15 -04:00
J. Ryan Stinnett
d3d2212a0f Start tab title tooltips on mousemove
By changing to `mousemove` to start the tab title tooltip, the behavior matches
applications like Firefox more closely: you can always get the latest tooltip
back after changing state by nudging the mouse (without having to exit and
re-enter anything).
2021-05-18 14:43:09 +01:00
J. Ryan Stinnett
b27ac6649e Hide tab title tooltips whenever the tab bar changes
This hides tooltips (such as the tab title tooltip) whenever the tab bar state
changes, such as when adding or removing a tab, to ensure we don't leave any
tooltips behind that no longer match reality.

Fixes https://github.com/zotero/zotero/issues/2060
2021-05-18 14:42:56 +01:00
J. Ryan Stinnett
5b7e01dff6 Rename tab event handlers to clarify target 2021-05-18 13:31:32 +01:00
Dan Stillman
e7f93cb548 Fix appearance of error report text in dark mode on Linux
Closes #2021
2021-05-16 05:08:44 -04:00
Dan Stillman
3815197b92 Don't allow site-specific Quick Copy setting without domain
And remove existing blank entry in schema update step

Closes #2053
2021-05-16 05:08:44 -04:00
Dan Stillman
3880687d2b
Merge pull request #2039 from HollandeP/master
Made About page text visible across default Linux themes
2021-05-16 04:15:17 -04:00
Dan Stillman
2799dfef5b Clarify sync-to-empty-database warning
Closes #1959
2021-05-15 15:09:33 -04:00
Dan Stillman
3aa355a8b4 Add Zotero.DB.path property 2021-05-15 15:09:33 -04:00
Dan Stillman
146e1af189 Update submodules 2021-05-14 22:44:33 -04:00
Dan Stillman
6834c6062b Fix auto-sync timeout in notes
Regression in 7ace5ea29
2021-05-14 05:13:19 -04:00
Dan Stillman
53f53779a3 Mendeley import: Don't show local import option
It's still possible to trigger a local import from a 1.18 database by
selecting the .sqlite file directly from the file option, but don't
offer it in the dialog.
2021-05-14 04:27:19 -04:00
Dan Stillman
7e23cfef96 Fix invalid imported Mendeley annotation color
After fix in 808b71832e

And require annotation colors to be 6-char hex colors going forward
2021-05-14 04:20:50 -04:00
Dan Stillman
f925f0e402 Don't cache SQL statements during initialization
From executeSQLFile()
2021-05-14 04:20:50 -04:00
Dan Stillman
d2b36c4218 Deduplicate libraryIDs passed to setSyncTimeout() for an auto-sync 2021-05-14 04:20:50 -04:00
Dan Stillman
5eb6935842 Deduplicate queued sync options
E.g., if a sync is ongoing and there are multiple item saves that would
trigger auto-sync with the same options, only queue a single sync.

7ace5ea29e fixed the main cause of this, but in case some other
saves end up happening during a sync, this will prevent them from
triggering multiple sync loops with the same options.
2021-05-14 04:20:36 -04:00
Dan Stillman
7ace5ea29e Fix unnecessary sync looping after downloading items
An extra sync loop would be performed for every object downloaded, so a
download to an empty database could result in a huge number of
unnecessary loops. This was a regression from 52932b6eb, which started
queuing auto-syncs while a sync was in progress. The fix here is to skip
auto-sync for all objects saved from a sync download.

There are two new mechanisms involved:

- Event-level notifier options that get passed to passed to notify() at
  the top level of extraData rather than being included with every
  object (e.g., because `skipAutoSync` should apply to an entire save
  transaction)
- The ability to pass event-level notifier options when initializing
  a Zotero.Notifier.Queue, such as the one used for sync downloads
2021-05-14 03:49:26 -04:00
Dan Stillman
5b0f02a12b Trigger auto-sync after item deletion
It looks like this has been broken for years.
2021-05-14 03:49:26 -04:00
Dan Stillman
9a47f74787 Specify note auto-sync timeout in save call, not in sync event listener
This will allow other operations to specify a longer timeout.
2021-05-14 03:49:26 -04:00
Tom Najdek
808b71832e Fix rgb to hex color conversion 2021-05-13 15:52:54 -04:00
Tom Najdek
833ee10516 Mendeley import: Switch to authorisation code flow via proxy 2021-05-10 14:32:02 -04:00
Dan Stillman
d3a78982f0 Add attr()/text() to search translators 2021-05-07 14:57:55 -04:00
Dan Stillman
d27b622f9f Mendeley import: Fill in Publication field on existing items if empty
It was skipped in online imports before eef0fc6fa8.
2021-05-06 15:59:46 -04:00
Dan Stillman
eef0fc6fa8 Mendeley online import: Fix "Journal" → "Publication" mapping 2021-05-06 15:46:35 -04:00
Dan Stillman
6d5b00e94c Fix descendant collections not skipping delete log
If a collection was deleted with `skipDeleteLog: true`, descendant
collections still ended up in the delete log, which could cause
constant "Reset Group and Sync" prompts.

https://forums.zotero.org/discussion/89485/warning-when-syncing-group-library
2021-05-06 03:34:09 -04:00
J. Ryan Stinnett
74b9604c7b Show full tab title on hover
Fixes https://github.com/zotero/zotero/issues/2033
2021-05-05 01:20:42 -04:00
J. Ryan Stinnett
12b100fd4b Hide tab bar for single tab case on Windows and Linux
This hides the tab bar on Windows and Linux, where it currently takes up a lot
of vertical space below the menu bar. On macOS, the tab bar remains always shown
since we don't have the menu bar and can move tabs in the window there.

Fixes https://github.com/zotero/zotero/issues/2019
2021-05-03 17:24:05 -04:00
Martynas Bagdonas
a74c012b65 Improve contextPane notes list performance 2021-05-03 21:41:41 +03:00
Dan Stillman
48d5ec240e Mendeley import: Tweak intro text 2021-04-30 07:14:19 -04:00
Dan Stillman
3877563abe Mendeley import: Clear cookies when closing OAuth window 2021-04-30 07:10:58 -04:00
Dan Stillman
57fbe61f93 Use notifier queue during Mendeley import
This dramatically speeds up Mendeley imports by avoiding UI updates.
Regular imports in fileInterface have done this for a while, but the
Mendeley importer used a fake translation object that didn't use the
passed queue.

After this change, a 10,000-item import goes from 9m30s to 2m45s, a 71%
decrease.
2021-04-29 00:46:18 -04:00
Dan Stillman
bb75fcd784 Fix support link in encrypted Mendeley database message
It started being flattened at some point.
2021-04-29 00:46:18 -04:00
Dan Stillman
3032cc6a02 Increase default basicViewer height to 700
Though this is currently persisted, so it stops being relevant as soon
as one instance of the basic viewer is resized, which maybe we don't
want.
2021-04-29 00:45:52 -04:00
Dan Stillman
d35719d0e8 Mendeley online import tweaks
- Add "(online import)" and "(local import)" next to "Mendeley Referance
  Manager" and "Mendeley Desktop", respectively
- Adjust size of OAuth window
- Use bound parameter instead of string literal for Fx78 compatibility
2021-04-29 00:45:23 -04:00
Tom Najdek
962222a5f5 Mendeley import: Import annotations from matching files in groups
All annotations in all groups are fetched and hashes are compared to
detect annotations created on the same file while it was in a group
library. Annotations created by other users are filtered out.
2021-04-29 00:40:44 -04:00
Tom Najdek
d4d2080a31 Mendeley online importer 2021-04-29 00:40:44 -04:00
Martynas Bagdonas
8799de5284 Display embedded images in item reports
Fixes #2002
2021-04-28 13:05:43 +03:00
Martynas Bagdonas
65329dbf27 Improve popup actions when read-only or multiple annotations selected
Fixes #2046
2021-04-28 12:45:53 +03:00
Martynas Bagdonas
3c3c1ba88a Add "Show in Library" option to PDF reader file menu #2032 2021-04-27 12:50:13 +03:00
Martynas Bagdonas
09125277ac Focus note-editor faster 2021-04-27 11:01:23 +03:00
Martynas Bagdonas
0b219ed8a7 Prevent opening multiple PDFs in windows when shift isn't pressed 2021-04-26 22:49:52 +03:00
Martynas Bagdonas
e7eae06d8d Optimize contextPane notes list rendering 2021-04-26 22:08:11 +03:00
Dan Stillman
76d8818bed Don't count missing annotation values as changed if empty string passed
Similar to 0d377a1c4a, this fixes an unnecessary annotation reload and
loss of unsaved typing on auto-sync immediately after an annotation is
created.
2021-04-26 03:49:59 -04:00
Dan Stillman
0d377a1c4a Clear changed state of annotation after saving color change
This was resulting in an extra 'modify' event after each sync upload.
2021-04-24 19:49:08 -04:00
Dan Stillman
ea42789206 Avoid memory leaks from caching unique DB statements
Many DB statements that were being cached included embedded ids or temp
table names, so they would permanently use memory and never get reused.
During large imports, this could result in hundreds of megabytes of
extra memory usage.

This commit marks many more statements as `noCache`, adds `noCache`
support for column and value queries, adds a log line at DB shutdown in
source builds with the number of cached statements, and adds
Zotero.DB.getCachedStatements() for auditing of cached statements.

Addresses #1531
2021-04-22 02:53:29 -04:00
Dan Stillman
12045a7cf8 Add Zotero.isSourceBuild
This should be used sparingly, since it risks missing problems in
released builds.
2021-04-21 21:37:56 -04:00
Martynas Bagdonas
1eb888d026 Fix missing itemData when creating a note from annotations 2021-04-21 16:55:44 +03:00
Martynas Bagdonas
3de7b6c5ec Trim whitespace from highlights and comments when creating a note 2021-04-21 16:52:19 +03:00
Dan Stillman
7065dacee8 Move About pane strings and URLs to ZOTERO_CONFIG 2021-04-19 18:30:21 -04:00
Dan Stillman
749e28dc1f Fix alphabetical sorting of child attachments in new databases
Broken after global schema introduction
2021-04-18 01:44:39 -04:00
Martynas Bagdonas
633710c90b Improve note-editor:
- Allow to format citations inside note-editor
- Allow quickFormat dialog to display and pick already cited items, even if an item no longer exists
- Watch and automatically update citation itemData in metadata container and re-format citations in body in opened notes
- Reorganize note metadata container handling and improve resistance to accidentally breaking it in further development
- Improve performance when typing in larger notes
- Rewrite note saving mechanism to support automatic note changes and reduce complexity for further development
- Cleanup and comment some core parts or note-editor as the preparation for further development
- Prepopulate quickFormat dialog with the currently opened PDF parent #1984 (doesn't include the currently scrolled page label yet)
2021-04-16 17:55:05 +03:00
HollandeP
4ab6fe8c59 Made About page text visible across default Linux themes 2021-04-13 11:46:56 -04:00
Adomas Venčkauskas
ffab4d5243 Add an optional callback for Integration.initPipe(). Addresses #2031 2021-04-12 12:35:51 +03:00
Dan Stillman
52932b6eb0 Reduce auto-sync timeout to 3 seconds and optimize auto-sync process
Reduce timeout after an object change from 15 seconds to 3 seconds,
ecxept for individual notes. We should probably kick off an auto-sync
3 seconds after a note is blurred, but that's not implemented.

We also now skip file syncing and full-text content syncing altogether
unless an attachment has changed.

Reindexing an item now kicks off auto-sync, whereas before it didn't.
2021-04-06 05:09:42 -04:00
Adomas Venčkauskas
8bff4cff42 Fix the attempt to display the delay citation updates dialog breaking updates
Since 2b3669afd
2021-04-05 16:23:43 +03:00
Adomas Venčkauskas
a6fc2cb206 Fix embedded item citing (since 2e9e6554)
I don't know how this has not been reported yet
2021-04-05 16:23:43 +03:00
Martynas Bagdonas
bbb0f8bca4 Do not strip abstract from citation items data in notes 2021-04-05 09:00:28 +03:00
Martynas Bagdonas
c3a74a22d7 Update signature for _serializeAnnotations and return object instead 2021-04-03 11:08:57 +03:00
Martynas Bagdonas
20022a5d7c Properly check schema version in note editor tests 2021-04-02 21:57:35 +03:00
Martynas Bagdonas
415e644211 Upgrade note schema to v2:
- Automatically upgrade all editable v1 notes when note is being opened
- Pull `itemData` from existing citations and annotations into metadata container attribute `data-citation-items`
- Strip `abstract` from `itemData`
- Fill `citationItem` (in citations and annotations) with `itemData` when passing an HTML fragment for further processing in `note-editor`
- Keep only `uri`, `text`, `color`, `pageLabel`, `position`, `citationItem` annotation properties
2021-04-02 18:35:01 +03:00
Dan Stillman
26bf507fe2 Throw invalid-data error on unknown annotation type 2021-04-01 05:52:14 -04:00
Dan Stillman
6d212b1759 Update About window
- Add Zotero logo
- Move most acknowledgements to the website, where they can be more more
easily updated and more comprehensive
- Increase font size
- Center window on screen
2021-03-29 01:41:37 -04:00
Dan Stillman
5e9636089d Fix primary item types not appearing in More menu when not in MRU list
Regression in 1c366de54
2021-03-29 01:41:37 -04:00
Martynas Bagdonas
5e98b9c533 Select library tab when navigating to item from syncRunner popup 2021-03-25 20:56:02 +02:00
Martynas Bagdonas
f6fa81fdac Strip abstract field to save note space, set new itemData on export 2021-03-25 20:56:01 +02:00
Martynas Bagdonas
3536a384a9 Ensure attachment storage dir exists when saving pdf-reader state 2021-03-24 18:51:27 +02:00
Martynas Bagdonas
ec7251fd98 Fix tab toolbar button icon scaling on HiDPI 2021-03-23 18:04:38 +02:00
Martynas Bagdonas
3d204f75e9 Focus pdf-reader on tab selection if not focused contextPane note editor 2021-03-23 18:00:07 +02:00
Dan Stillman
f690c666d4 Don't make 'engine' required in Sync.Storage.Request
Follow-up to dc12a2c95a
2021-03-23 03:49:05 -04:00