Commit graph

320 commits

Author SHA1 Message Date
Martynas Bagdonas
85b142ccb2
Restore tabs state (#2148) 2021-08-23 13:02:57 -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
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
Adomas Venčkauskas
7814efcfe2 Use zotero/translate and zotero/utilities for shared code 2021-07-28 15:46:07 +03:00
Martynas Bagdonas
814cbc0ee3 Introduce spell checker context menu and dictionaries managing 2021-06-23 19:25:46 -04:00
Dan Stillman
f3aca749d9 Autocomplete improvements
- Limit field autocomplete to current library in item pane (previously
  only done for creator and access date)
- Improve positional parameter usage to avoid duplicate parameters
- Code cleanup
2021-06-04 02:14:17 -04:00
Martynas Bagdonas
8799de5284 Display embedded images in item reports
Fixes #2002
2021-04-28 13:05:43 +03:00
Adomas Venčkauskas
50dae87b07 Add a warning dialog for an outdated doc template 2021-03-02 18:10:44 -05:00
Dan Stillman
f0816cc8fb Add temporary prefs checkbox to use internal PDF reader
And use when opening PDFs in My Library from items list and
zotero://open-pdf

This also adds "Zotero" to the main PDF reader pref, which will be the
real way to set this, but that option is hidden for now so that group
library items will still open with the configured reader.
2021-03-02 17:58:28 -05:00
Martynas Bagdonas
76e77d4422 Improve PDF import/export 2021-03-02 17:40:24 -05:00
Martynas Bagdonas
a89f7e8ec7 Improve PDF reader 2021-03-02 17:39:39 -05:00
Martynas Bagdonas
bce50e8e9c Add old note backup and preview 2021-03-02 17:36:05 -05:00
Martynas Bagdonas
af57565acf Reorganize and improve notes 2021-03-02 17:36:05 -05:00
Martynas Bagdonas
2543a695e8 Introduce PDF reader and note editor 2021-03-02 17:36:05 -05:00
Dan Stillman
c3ff6eb66e Protocol handler extension to proxy PDF.js and PDFs 2021-03-02 17:36:05 -05:00
Dan Stillman
8e1a15f6d0 Restore zotero://attachment protocol handler for area annotation images 2021-03-02 17:36:05 -05:00
Dan Stillman
007bc315cc Fix deprecation warning when using AsyncChannel in protocol handler 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
9152012368 Restore DB table reconciliation during integrity check
But skip it at startup, even if flagged on, if there are schema update
steps to perform, to avoid creating tables that aren't expected to exist
yet.

Originally added in 5b9e6497a but disabled in c4cc44528 and 7a434df53
2021-01-17 03:36:38 -05:00
Dan Stillman
a051746db4 Update zotero://select comment 2020-06-10 23:56:07 -04:00
Dan Stillman
2a804d5d4a Fix zotero://open-pdf links on Windows if no handler is set in registry 2020-02-09 14:07:11 -05:00
Dan Stillman
aef198d6b5 Increase autocomplete to 50 results
Up from 25 in 53ff8eecd2 (5.0.80)
2019-12-30 02:39:10 -05:00
Dan Stillman
991e542888 Fix broken autocomplete popup when editing a saved search
https://forums.zotero.org/discussion/comment/345646/#Comment_345646

This is probably the actual fix for what I was trying to fix in
360f034b5, and I couldn't reproduce it because it was about saved
searches.
2019-12-30 02:39:10 -05:00
Dan Stillman
360f034b51 Fix a report of broken autocomplete
I can't reproduce this, but the report has "Services is not defined"
from autocomplete.xml, triggered by zotero-autocomplete.js.

https://forums.zotero.org/discussion/comment/345190/#Comment_345190
2019-12-19 01:41:10 -05:00
Dan Stillman
53ff8eecd2 Limit autocomplete to 25 results
I'm not totally sure why we didn't do this years ago, but this fixes
performances problems in the new React tags box, and should improve
autocomplete performance generally in large libraries.
2019-12-03 16:05:04 -07:00
Dan Stillman
ba15c2b53e Fx60: Mostly fix autocomplete
There's still a bug when autocompleting tags where the value remains in
the new text field.
2019-10-24 04:45:45 -04:00
Dan Stillman
b08bd6849e Fx60: Update DB query onRow() behavior
onRow() handlers now get passed a cancellation function as a second
argument
2019-08-27 06:00:35 -04:00
Dan Stillman
433794916a Fx60: Remove instances of nsILocalFile
nsILocalFile was merged into nsIFile, so either replace it with that or
switch to Zotero.File.pathToFile().
2019-08-27 00:47:39 -04:00
Dan Stillman
e50fda90ca Remove obsolete zotero://attachment and zotero://fullscreen 2019-08-27 00:47:39 -04:00
Dan Stillman
76978aa912 Fx60: Fix protocol handler
These will need to be redone for Electron, but this keeps them working
in the meantime.
2019-08-27 00:47:39 -04:00
Dan Stillman
c771d9b046 Fx60: Fix devtools initialization 2019-08-27 00:47:39 -04:00
Dan Stillman
0ad308f5f6 Fx60: Update nsIInputStreamPump init() calls 2019-08-27 00:47:39 -04:00
Dan Stillman
78e9db9523 Fx60: Fix issues with JS code modules
- The Mozilla CommonJS loader is no longer available, so bundle the
  Fx52 version of it
- Strict mode is enforced
- `this` is only defined as a global object in .jsm files, not .js files
- `this` can't be converted to a string for BackstagePass test, so check
  for presence of Components.utils.import instead
- The return value from import() is no longer available
2019-08-27 00:47:39 -04:00
Dan Stillman
d551d1901f Fix zotero://select search selection 2019-08-01 22:11:03 -04:00
Dan Stillman
66f2d177a9 Load all files xpcom/ files as UTF-8
This fixes corrupted em dashes from citeproc-js:

https://forums.zotero.org/discussion/78327/dash-in-ama-is-producing-odd-characters-a%C2%80%C2%94
2019-07-25 07:39:32 -04:00
Dan Stillman
48580c49d1 Retraction Watch integration
- Check for retracted items using data from Retraction Watch
- Show an X next to retracted items in the items list, and show a
  scary message at the top of the item pane with more info and links.
- Lookup is done in a privacy-preserving manner using k-anonymity --
  the server is unable to determine the specific items that exist in
  the client, so people who don't sync don't need to share any library
  data (though the server doesn't log the lookups anyway).

TODO:

- Pop up an alert when new items are found
- Show a confirmation prompt when citing a retracted item
- Support items without DOIs or PMIDs
- Add a proper PMID field and expand DOI to more item types so these
  values don't need to be parsed out of Extra
- Clear the banner immediately when all possible fields are cleared
  instead of waiting a few seconds
2019-06-06 09:17:21 -04:00
Dan Stillman
ebda79a958 zotero://select improvements
- Support items within collections and searches:

zotero://select/library/collections/:collectionKey/items/:itemKey
zotero://select/groups/:groupID/collections/:collectionKey/items/:itemKey

- Fix the 'itemKey' parameter:

zotero://select/library/collections/:collectionKey/items?itemKey=:itemKey1,:itemKey2

- Select library root if collection/search not specified
2019-05-09 02:11:57 -04:00
Dan Stillman
945c413c42 Closes #1644, Allow selecting multiple items with zotero://select
This adds selectItems() to ZoteroPane and collectionTreeView and removes
the ancient, unused 'expand' argument to selectItem(), which didn't
really make sense there. It also includes a new
itemTreeView::ensureRowsAreVisible() that tries to scroll to an
appropriate place (or, better yet, not scroll at all) given the
specified rows and page size.
2019-02-23 17:35:09 -05:00
Adomas Venčkauskas
f5c4fb06e1 Ensure high-dpi icons are loaded in React components 2019-01-21 11:01:32 +02:00
Dan Stillman
bf6f1432c5 Move Utilities.Internal.escapeSQLExpression() to Zotero.DB 2018-12-16 02:10:15 -05:00
Dan Stillman
7d9b94c79e Fix autocomplete for tags beginning with _ or %
Addresses #1598
2018-11-25 00:36:04 -07:00
Dan Stillman
1e3608e82e Add zotero://select support for collections
zotero://select/(library|groups/:groupID)/collections/:collectionKey
2018-10-10 21:38:10 -04:00
Martynas Bagdonas
ae7ef109b7 Add universal progress queues (#1573) 2018-10-05 01:56:46 -04:00
Dan Stillman
b782120840 Add followRedirects: false option to Zotero.HTTP.request()
Currently only .status and .getResponseHeader() (for getting 'Location')
are available in the returned object, but we could make the body
available if necessary.
2018-09-22 04:03:25 -04:00
Dan Stillman
e48a1a2abb Remove lots of old Zotero for Firefox code
We still run tests in Firefox, so not everything can be removed.
2018-08-17 03:17:08 -04:00
Adomas Venčkauskas
51e181cb81 Fix some XPCOM Zotero breakage from previous commits 2018-08-06 12:24:17 +03:00
Sylvester Keil
38166d4e05
Add Zotero.intl namespace
Move `Zotero.getString()` and intl init code to `Zotero.intl` to make
it easier to re-use.

Link `Zotero.getString()` to `Zotero.intl.getString()`.

Do not expose `getStringFromBundle`, `pluralFormGet`, and
`pluralFormNumForms` because they are not used.
2018-07-28 21:31:20 +02:00
Adomas Venčkauskas
cb8280f0ff Move Zotero.Prefs into its own file 2018-07-11 15:53:46 +03:00
Sylvester Keil
06cb9aff98 Prefer use of Services.appinfo 2018-07-11 13:58:41 +03:00