Add newly added attachments to a queue, start processing it after five
seconds have passed since the last attachment was added, and process
another every half second after that unless another is added.
This queue won't survive a restart, so the queue should really be in the
DB, but this should avoid problems when adding multiple attachments at
once.
Addresses #1284
Applies to dragging to the collections pane or the items pane, adding
via New Item menu, or saving via the connector server
If the renaming pref is enabled, the PDF is renamed after recognition.
Can be disabled in the preferences
Closes#917
Do cleanup on 'unload' rather than 'close' (which is limited to a click
on the close button and doesn't get called for win.close()) and clear
the queue after each test.
Automatic renaming is now done for dragging of an external file onto an
item (as added in 7cb95f41) as well as dragging as a linked file,
dragging a non-native (not text or HTML) URL, "Attach Link to File…",
"Attach Stored Copy of File…", and "Retrieve Metadata for PDF". It only
applies if a single file is being added and if the parent item has no
non-HTML attachments. By default, the renaming only applies to PDFs, but
this can be changed with the renameAttachmentFiles.automatic.fileTypes
hidden pref.
A new General pref, "Automatically rename attachment files using parent
metadata", controls whether the renaming happens.
Files saved via web translators are renamed regardless of this pref,
because they would often be gibberish otherwise.
Closes#113
Check file-editing access for the group from the API before offering to
reset, update the filesEditable setting properly, and restart the sync
automatically after resetting.
If a transaction took over 30 seconds and another transaction timed out
waiting for it, the second transaction would reset the notifier queue,
but if the first transaction then tried to queue an event, it would fail
with this error and roll back. (It would be nice to figure out why
transactions are taking over 30 seconds, though.)
- Updates /saveItems and /saveSnapshot to take a sessionID
- Provides a list of editable collections in the current library
- Adds an /updateSession method that takes a sessionID and updates the
collection and tags of any items saved via that operation (and changes
the currently selected collection)
Cross-library changes are not yet supported
This is a simplified version of the fix from #872. Unlike the proposal
in #36, this doesn't require all child items to be selected, since in a
search some children might be grayed out. If the child of an unselected
parent item is included, the drag isn't allowed.
Closes#36
- Moves a bunch of citation related processing from Integration.Session
- Replaces missing item handling with a function instead of exception
- Solves some really confusing flow issues in _processFields
Restores the "Restore to Zotero Server" functionality, now using the
API:
1. Get all remote keys and send `DELETE` for any that don't exist
locally.
2. Upload all local objects in full (non-patch) mode using only library
version so that the remotes are overwritten.
3. Reset file sync history, causing all files to be uploaded (or, more
likely, reassociated with existing remote files).
Since these are treated as regular updates on the server, they'll sync
down to other clients normally. Unsynced changes by other clients might
still trigger conflicts.
This and Reset File Sync History can also now be run on group libraries,
with a library selector in the Reset pane (which I forgot to do with
React).
The full sync option is now removed from the Reset pane, since there
wasn't ever really a reason to run it manually.
We should be able to reimplement Restore from Online Library (#1386)
using the inverse of this approach.
Closes#914
A XUL one for the current use in Advanced Search and an HTML one for
future uses. Sets the value to libraryID and adds data attributes for
editable/filesEditable on the HTML one.
In advance of #1356
We're not properly handling DOIs in parentheses or brackets (which would
require non-regex logic), so those tests are skipped for now.
Use Atom namespace when getting fields, and use `<updated>` date before
`<published>`. (The dates are also available on the nsIFeedContainer
(`feedEntry`), but we're getting them directly from the fields for some
reason.)
- Return `undefined` instead of throwing an error trying to access
`libraryTypeID` on a Zotero.Feed -- this fixes a test failure with
the latest Chai, which annoyingly runs inspect() on an object passed
to .include() regardless of whether the test succeeds
- Make some deprecated properties non-enumerable to avoid unnecessary
logging when the object is dumped
When an item is created, an active quick search is cleared, but that's
now an async operation. We weren't waiting for that, which meant that
new items weren't selected and depending on a race condition could even
show the welcome pane despite there being items in the library.
- Move identifier detection to `Zotero.Utilities.Internal.extractIdentifiers()`
so that it can be used for things other than Add Item by Identifier
(e.g., translation-server)
- Add a `Zotero.Translate.Search::setIdentifier()` function that takes an
identifier object produced by `extractIdentifiers()` (`{ DOI: "10/..." }`),
converts that to the search format expected by translators, and calls setSearch()