Commit graph

506 commits

Author SHA1 Message Date
Adomas Venčkauskas
af597d943b Move js-tree files out from /containers subfolder 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
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
ee2b63bf18 Update submodules 2021-08-06 16:56:31 -04:00
Dan Stillman
a5902fc466 Update translators 2021-07-22 02:17:35 -04:00
Dan Stillman
1c61c86801 Update translators 2021-07-07 01:45:11 -04:00
Adomas Venčkauskas
3199d23d09 Fix word plugin state display in the Pref dialog 2021-06-25 10:36:45 +03:00
Martynas Bagdonas
814cbc0ee3 Introduce spell checker context menu and dictionaries managing 2021-06-23 19:25:46 -04: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
2bd4904ead Add DOMParser-based XML reader
This adds a `DOMParser`-based XML reader which emits events like a SAX XML
reader for compatibility with the feed processor.
2021-06-16 20:59:57 +01:00
J. Ryan Stinnett
29ebaa5ec6 Assume fetch-based API for feed processsing
This converts the feed processor to expect a `fetch`-based API instead of an
XPCOM stream.
2021-06-16 20:59:57 +01:00
J. Ryan Stinnett
1d93296481 Convert feed processor to HTML attribute manipulation
This moves the feed processor away from custom XPCOM SAX attributes and over to
standard HTML attribute map APIs.
2021-06-16 20:59:57 +01:00
J. Ryan Stinnett
891ba599a6 Convert feed processor parsing to native DOM APIs
This uses native DOM APIs to create document fragments and parse content instead
of XPCOM utils.
2021-06-16 20:59:57 +01:00
J. Ryan Stinnett
b4303eaa45 Absorb feed processor types from interface
This moves the type constants into code, rather than pulling them from an XPCOM
interface.
2021-06-16 20:59:57 +01:00
J. Ryan Stinnett
a0694cd8fb Convert feed processor type checks away from XPCOM
This converts the type checks for arrays and interfaces to use native JS
approaches instead of XPCOM.
2021-06-16 20:59:57 +01:00
J. Ryan Stinnett
a3e6f96289 Remove MIME type description feature from feed processor
This removes the feed processor's feature of converting enclosure MIME types to
a textual type description. This is not used by Zotero and removes an XPCOM
dependency.
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
bea3b3d3b2 Remove unimplemented registerExtensionPrefix API 2021-06-16 20:59:57 +01:00
J. Ryan Stinnett
9d0e1932dc Convert feed processor structure away from XPCOM
This changes the various components to invoke each other directly as regular
objects without involving XPCOM.
2021-06-16 20:59:57 +01:00
J. Ryan Stinnett
e120ca7395 Align variable style in feed processor
This tweaks variable naming and related details to match Zotero conventions.
2021-06-16 20:59:57 +01:00
J. Ryan Stinnett
76873bda95 Approaching readable code in feed processor
This adjusts bracing style and other aesthetics to match Zotero conventions.
2021-06-16 20:59:57 +01:00
J. Ryan Stinnett
a210f1fbde More style alignment for feed processor 2021-06-16 20:59:57 +01:00
Dan Stillman
1daf4b0413 Update locales from Transifex and merge new English strings 2021-05-28 02:58:53 -04: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
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
146e1af189 Update submodules 2021-05-14 22:44:33 -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
J. Ryan Stinnett
71dc4e9bf9 Convert feed processor indentation to Zotero style
This adjust feed processor indentation to match Zotero conventions for tabs and
continuous indents in blocks.
2021-05-11 10:05:59 +01:00
J. Ryan Stinnett
48a6e90b4f Initial import of feed processor
This imports Mozilla's feed processor which has been removed upstream as part of
Firefox 66. Some changes are likely needed before this will actually run in
Zotero.
2021-05-07 14:02:56 +01:00
Dan Stillman
7065dacee8 Move About pane strings and URLs to ZOTERO_CONFIG 2021-04-19 18:30:21 -04:00
Dan Stillman
76d504c564 Delete child annotations when deleting attachment
And fix a FK definition that could result in orphaned `items` rows
without `itemAnnotations` rows after an attachment was deleted.
2021-03-12 06:35:21 -05:00
Dan Stillman
d98fabc5ab Add annotation type to schema 2021-03-03 03:33:52 -05:00
Martynas Bagdonas
83109fc076 Fix and attach image annotation renderer 2021-03-02 18:12:24 -05:00
Martynas Bagdonas
8d87eeae35 Capitalize acronyms 2021-03-02 18:10:44 -05:00
Dan Stillman
c8ee3196cd Replace attachmentPageIndex with synced-setting-based mechanism
The page index needs to be per-person in group libraries, and it should
still work in read-only libraries, so it doesn't make sense to store it
on the item. This uses a synced setting in the user's library instead.
2021-03-02 18:10:44 -05:00
Martynas Bagdonas
a19693fa7a Improve PDF importing and introduce rendering 2021-03-02 17:58:28 -05:00
Dan Stillman
ebc0ca2462 Add annotationIsExternal property to annotations 2021-03-02 17:58:28 -05:00
Dan Stillman
9a41dc69fe Add PDF attachment properties to Zotero.Item
- .attachmentLastProcessedModificationTime
- .attachmentPageIndex
2021-03-02 17:58:27 -05:00
Martynas Bagdonas
de5206d926 Hack in TinyMCE to support selection and links 2021-03-02 17:43:10 -05:00
Dan Stillman
199619f40e Remove .noteSchemaVersion
This leaves item.note in place, rather than reverting all the
`getNote()` → `.note` changes. We can consider which we want to keep.
2021-03-02 17:36:05 -05:00
Dan Stillman
ebc53a2bbc Add noteSchemaVersion, and replace item.getNote() with .note
```
var noteContents = item.note; // was item.getNote()
var schemaVersion = item.noteSchemaVersion;

item.setNote(contents) // default to Zotero.Notes.schemaVersion
item.setNote(contents, schemaVersion) - explicit version
```
2021-03-02 17:36:05 -05:00
Dan Stillman
1c366de546 Initial annotation support 2021-03-02 17:36:05 -05:00
Dan Stillman
8026f744c5 Remove old HTML snapshot annotation support
Any data trapped in these tables hasn't been accessible in many years.
2021-03-02 17:36:04 -05:00
Dan Stillman
b54d4e78b7 Save createdByUserID and lastModifiedByUserID for group items 2021-03-02 17:36:04 -05:00
Dan Stillman
b2b909b42c Update submodules 2021-02-25 18:45:28 -05:00
Dan Stillman
e45ca4edad Support deleted property for collections and searches
This lays the groundwork for moving collections and searches to the
trash instead of deleting them outright. We're not doing that yet, so
the `deleted` property will never be set (except for items), but this
will allow clients from this point forward to sync collections and
searches with that property for when it's used in the future. For now,
such objects will just be hidden from the collections pane as if they
had been deleted.
2021-01-13 00:49:12 -05:00
Dan Stillman
80b8280e9d Update submodules 2021-01-10 14:58:37 -05:00
Fletcher Hazlehurst
36d81e839c Use ace-builds NPM package 2020-12-18 10:45:38 -07:00
Dan Stillman
87352822fa Delay properly on 429 response in syncAPIClient
ConcurrentCaller wasn't waiting properly if start() was called again
while it was pausing, so 429 caused an immediate retry, which is pretty
much exactly what you don't want a 429 to do.
2020-12-11 02:02:20 -05:00