Since the search might return items in libraries that haven't yet been loaded,
we have to get those items asynchronously and load their data explicitly. Need
to test this with a large document to make sure it still properly populates the
list with search results and then adds matching cited items.
Bulk-loads data for objects that are potentially in different libraries. This
would generally be used to load necessary data for cross-library search
results, since those results might include objects in libraries that haven't
yet been loaded.
This avoids errors for a missing 'feeds' table during tests, when the callback
started in Zotero.Feeds.init() runs but the Zotero object has been torn down
and the database hasn't yet been reinitialized.
Until we have a consistent way of sanitizing HTML on client and server, account
for differences manually. More differences between HTMLPurifier and TinyMCE
should be added as necessary.
Would be better not to start until after the initial library's items had
been loaded, but that's a little awkward to do from non-window code.
Might make more sense when there's only Standalone.
extensions.zotero.sync.debugUploadPolicy = {1, 2}
1 to prompt, 2 to throw
This can be used to test sync functionality without altering the server
state unexpectedly. When prompting, the request body, if any, is logged
to debug output.
Previously, item-dependent menu options in the context menu of
collectionsTreeRow types other than 'collection' weren't updated after
the asynchronous loading of the items. The menu is now updated for all
types, so, e.g., "Empty Trash" is now updated properly after items in
the trash have been loaded.
- Fix upgrading of Mozilla-style attachments/storage file paths on upgrade
(requires re-upgrade)
- Save relative paths using forward slashes for consistency, and convert
to platform-appropriate slashes on use
Don't start the connector pipe (Mac/Linux), don't listen for IPC on the
command-line (Windows), and don't try to release Standalone's lock if DB is
busy when Firefox starts.
- Fixes#994, 5.0: "+" doesn't expand all collections within a library
- If a container (library, collection) is closed directly, the open state of
all containers below it are now restored when it's reopened. Previously all
collections would be closed on a manual reopen (though they might have been
restored on the next Zotero restart).
- If "-" is pressed, all containers are closed, and reopening the library will
show only top-level collections.
- Use custom exception for user-initiated sync cancellations, which can bubble
up to the sync runner -- this should help with a sync stop button (#915)
- Separate out deletions-downloading code
- Refactor delay generator handling on library version mismatch
- Clearer variable names
Return false for single ids or skip for multiple ids. This is the original
behavior, but at some point it started throwing an UnloadedDataException. IDs
are always loaded at initialization, though, so we know whether the objects
actually exist.
- Use an increasing notifier batch size, so objects initially appear one by one
but then start showing up in batches, up to 50. (UI updates are expensive, so
for larger syncs we don't want to update after each object.)
- Avoid separate save to update attachment file sync state, which was also
happening outside of notifier batches (causing individual updates regardless
of the batch size)
- Add a 10ms delay after processing each object, which keeps the UI responsive
during downloads. #989 could reduce this to 1 during idle, to save a few
minutes when downloading very large libraries.
.contains() was removed in Firefox 48, but .includes() wasn't available until
40, so use indexOf() for now. We can start using .contains() once we no longer
need to support 38 ESR.
This is necessary to get a library version after the write instead of an
item version. Otherwise after a full-text write, the main library
version is behind, so the next sync checks all object types for that
library instead of getting a 304.
Full text is batched up to 500K characters or 10 items, whichever is
less.
This also switches to using ?format=versions for /fulltext requests,
which isn't currently necessary but reflects what it's actually doing.
If a version is returned for an item's full-text content but a 404 is returned
for the content itself (because it's missing in Elasticsearch for some reason),
don't throw an error.
Also remove legacy array comprehensions in fulltext and syncFullTextEngine test
files, which apparently weren't being run.
Addresses #980. There are a couple other uses of the old API, but I'm not sure
how they're triggered, and we might be gone from Firefox before this is
relevant.
This is necessary because you can copy a database synced with a
different account into the data directory without affecting the stored
pref.
Also tweak the text to use proper quotes and remove quaint references to
"the server".
A queue can be created and passed as an option to data layer methods, which
will then queue events on that queue instead of the main internal queue. A
queue or an array of queues can then be passed to Zotero.Notifier.commit() to
commit those events.
Some auxiliary functions don't yet take a queue, so those events will still get
run on DB transaction commit.
Sync data processing now processes notifier events in batches to reduce
repaints, even though individual objects are processed within their own
transactions (so that failures don't roll back other objects' data).
Also remove some unused notifier code
I'm not sure this matters -- since it was broken, itemTreeView notify()
code probably accounts for situations where, say, a 'modify' comes in
before an 'add' -- but it might avoid some edge cases in the future.
It's generally not necessary to call this, but it can be useful if
specific data needs to be loaded in an unloaded library (e.g., an item's
creators for RTF Scan)
`nArcs` is undefined in `this.ItemProgress.prototype.setProgress()`. This has been the case for a long time but never came up because the progress indicator isn't used in Zotero, I believe. I think it's a nice UI element though and could be used for non-disruptive progress indicators.
- Only show first pane (without Sharing pane) if no files or files
aren't included
- Update authorship checkbox to reflect file include setting to avoid
confusion
- Clarify in intro text that license applies to files, not notes --
notes here are no different than notes in any public library, so it's
sort of up to the user to clarify those if they're substantial enough
for it to matter
- Adjust alignment of authorship checkbox if more than one line
Otherwise, when right-clicking on a collection that's not currently
selected, some of the menu items appear gray at first, and a second
right-click is necessary after the items have loaded. This way the menu
items turn black once the items have loaded.
Items in a library are now loaded only when a library is clicked on and
at sync time. There might be some other areas where they need to be
loaded or where this causes problems (e.g., drag and drop, word
processor integration).
I think this only happens if the Zotero pane hasn't yet been opened, which also
means an initial refresh() hasn't been done, which means that updates aren't
necessary.
Otherwise the test could run scrapeThisPage() before translators were ready. It
would be good to make scrapeThisPage wait for detection to complete so that an
early press still uses a translator for saving, but this way tests can also
test for the proper icon (though they don't now).
Instead of requiring a click on the menuitem at the top of the submenu, allow
a click on the menu itself.
This is a hack that, among other things, replicates the flash effect on
menuitems on OS X. Unfortunately, <menu> elements can't have checkboxes, so
only the menuitem in the submenu will be checked. (Otherwise I'd remove the
redundant menuitem in the submenu.)
- Allow clicking on non-editable abstract field to expand/collapse it
- Change cursor when hovering over abstract to show it can be toggled
- Default abstracts to expanded
- Fix persistence of last translation target
- Add checkbox to menuitem of selected target
- Remove unnecessary flex attributes
Also:
- Move collectionTreeView row id (e.g., "L1", "C123") and image
generation to Zotero.Library and Zotero.Collection properaties,
.collectionTreeViewID and .collectionTreeViewImage -- currently used
only for the feed add-to button, but could be expanded for use in
collectionTreeView
And without extra init() call
This fixes the button being initialized before Zotero.hiDPI is set, resulting
in a low-res icon until the target is changed.
The on-change auto-sync now syncs only the modified library, and does so
quite efficiently (and should be able to be made more efficient), so we
might be able to reduce the timeout below 15 seconds.
Instead of getting batches of unused primary key ids, even if they're lower
than other ids, which for some reason seemed like a good idea in 2008, just do
a `MAX()` on the table at startup and return the next available id on each call
to `Zotero.ID.get()`. This is much simpler, and not reusing ids allows them to
be used as a chronological sort field.
While SQLite's `SELECT last_insert_rowid()` could return auto-increment values,
it's unsafe with async DB access, since a second `INSERT` can come in before
the first `last_insert_rowid()` is called. This is true even in a transaction
unless a function that calls it is never called in parallel (e.g., with
`Zotero.Promise.all()`, which can be faster than sequential `yield`s).
Note that the next id is always initialized as MAX() + 1, so if an object is
added and then deleted, after a restart the same id will be given. (This is
equivalent to (though unrelated to) SQLite's `INTEGER PRIMARY KEY` behavior,
as opposed to its `INTEGER PRIMARY KEY AUTOINCREMENT` behavior.)
Closes#993, Feed items out of order