Clicking it cancels the current window, opens the Cite pane of the
prefs, and selects the Styles tab. (This will be more useful once we
have inline style installation from that pane.)
- Move openPreferences() to Zotero.Utilities.Internal
- Add support for opening windows when there's no active browser window
- Allow selecting prefpane tab by id via 'tab' property
- openPreferences() now takes an object as its second argument with a
'tab', 'tabIndex', or 'action' property
In translation-server, the test timeout is overridden to 30 seconds, which was
also the deferred test delay, so there was a race condition that could cause
deferred tests to fail. This sets the deferred delay to 20 seconds.
Safari does not support generators yet. Removes coroutines
and removes the requirement for bluebird, which should
improve script injection performance.
For some reason, in the Fx48 translation-server, the processor passed to
processDocuments() calls in translators can't access document properties
even when they're on the same domain or even the same document. To get
around that, rewrap them for the sandbox, but there might be a better
fix here.
Addresses https://github.com/zotero/translation-server/issues/36
A few sites (e.g., Gallica) were causing alerts to pop up in Standalone during
testing, which breaks testing, so accept them automatically. (Hopefully these
don't happen during manual translation...?)
If an object exists locally but not remotely and the local version has a
version number, that's an error. I don't think that should ever happen,
but it can if things somehow get out of sync due to other bugs.
To address, reprocess the API delete log during a full sync and then
reset the version number of all remaining local objects that don't exist
remotely (not just unmodified objects, as was the case previously) to 0
for uploading.
When remote deletions are reprocessed, delete local objects that haven't
been modified and show the conflict resolution window for any local
items that have.
Also:
- Clean up checking of last remote library version during download
syncs
- Add Zotero.DataObjects.getAllKeys()
The client skips synced storage properties (md5, mtime) when uploading items to
ZFS-enabled libraries, but since the API returns JSON with those values
included after writes, they do get saved to the sync cache. If the local
attachment is then modified and the client generates a diff from the cached
version with those properties skipped, they'll be included in the patch JSON as
empty strings in order to clear them. This changes Zotero.Item::toJSON() to
skip those properties in patch mode as well.
This fixes a sync error ("Cannot change 'md5' directly in group library") when
a group attachment is updated locally.
Reapplies modifications to SpecialPowers code after a0843f317
This is essentially the changes within the SpecialPowers code block from this
diff, with some modifications for the new code:
git diff 1257b17e..a0571a9a17 chrome/content/zotero/xpcom/translation/translate_firefox.js
This fixes the "Proxy.create is not a function" errors during PDF
metadata retrieval in Firefox 48 after the old Proxy API removal, but it
still throws "doc.location is null".
Addresses #1076
This shouldn't happen, but if it does, the API should return a 412 for
such objects, resulting in a full sync. Until the API fix is rolled out,
do the same on a 404.
If the item was deleted on one side and moved to the trash on the other,
just delete the item on the trash side. Since trash emptying happens
automatically, this would otherwise result in a conflict even if the
user carefully avoided making changes before a manual sync.
There's no need for Zotero Standalone add-ons to be signed by Mozilla.
Currently only hides when the Extensions pane is first loaded, so if the user
switches to Appearance or Plugins and switches back, the warning reappears
On reset, items are overwritten with pristine versions if available and deleted
otherwise, and then the library is marked for a full sync. Unsynced/changed
files are deleted and marked for download.
Closes#1002
Todo:
- Handle API key access change (#953, in part)
- Handle 403 from data/file upload for existing users (#1041)
Set a unique id on the note editor at initialization and pass it along
to item.saveTx(). When notify() is called, if the save was triggered
from the current note field, don't do a refresh.
This does mean that the note field won't reflect changes (e.g.,
normalizations) made by the save process until the user clicks away and
back, which makes me a little uncomfortable. If we can find specific
cases where that occurs (paste?), we can reevaluate this approach.
This also reworks how the collection context menu is built to do more in
JS instead of XUL, though it can't do it all in JS because some
localized strings are in zotero.dtd and are used in standalone.xul too.
Previously they only showed for My Library by default, which I suspect
meant that most people didn't know you could get them for other
libraries...
This hides "Duplicate Items" and "Unfiled Items" from the context menu
when they're active, which may or may not be desirable (but we don't
show, say, "Trash" in the context menu).
Also tweaks selection behavior after hide to select next appropriate row
instead of the parent library.
If a field is open and the user right-clicks on another field (e.g., swap
names, creator type, transform text), any changed value in the open field was
lost.
Also:
- Don't show swap-names menu in single-field mode
I can't quite get programmatic access to context menus to work correctly, so
tests are disabled for now. (They work individually, but not together.)
I originally attempted this with zotero-persist and column attributes,
but there is no good way to make it succinct paramswise and the code was
painful to look at too. Thus different group settings are stored in
preferences.
Currently there are two view groups: "feed" and "default". Items view
columns have two new attributes:
`default-in` - a space separated list of views in which a column is
visible by default
`disabled-in` - a space separated list of views in which a column is
disabled by default (invisible + not possible to enable)
Fields not parsed for feeds are now disabled.
And don't skip alerts in Zotero.alert() during automated tests. (That
was intended to avoid long timeouts after unexpected failures, but,
e.g., PDF metadata lookups (which are currently disabled in automated
tests) should just be mocked so they don't intermittently fail.)
itemToCSLJSON() doesn't seem to need child items, so when a Zotero.Item
is passed to it, don't bother loading child items when calling
itemToExportFormat() to convert the item into the necessary format.
In order to make these mappings also available when the
script is used with `loadSubScript` from outside we
have to use `var` instead of `const`, `let`.
See https://github.com/aurimasv/z2csl/issues/6
getCellText() can be called between when a property (e.g., .name) is
changed and when ._changed is reset after the save, making this warning
unavoidable
Also changes Zotero.Item.prototype.clone() to take an `options` object for its
second parameter instead of a boolean `skipTags`. The object includes
`skipTags` as well as a new `includeCollections` property to add the new item
to the same collections.
Indexing currently happens a second after the 201 is returned to the
connector, so we have to wait for that before continuing tests, or else
a DB clear in a later test (e.g., storageLocal) will cause an error to
be logged when the indexing kicks off.
WPD code hasn't been updated in many years, and there was an issue with
document permissions in 5.0. We'll need to replace nsIWBP in Electron,
but this will do for now.
Attachments are opened using file:// URIs instead of
zotero://attachment, which is what Standalone does anyway. Ancient HTML
annotations and highlights won't be displayed anymore, but I'm not sure
they worked anyway, and it hasn't been possible to create them in years.
We might be able to write out existing annotations to notes.
iframes are skipped during saving, in an attempt to reduce the number of
junk ad files. JS can still cause problems with viewing, so we might
still want to either disable scripts or force the viewed page offline
(if such a thing is possible).
There might be issues with auxiliary filename length/characters during
cross-platform file syncing. (We modified the WPD code to shorten/clean
them.)
Not sure whether this is desired but it helps to reduce the use of nsIFile to a minimum. `file.launch()` and `file.reveal()` are two of the few things that are not possible with OS.File/OS.Path. When that changes, Zotero.launchFile is the only function that needs to be modified if it works with string paths.
After uploading a note to the API, the local version may be overwritten with
the sanitized version in the API write response. This commit prevents the note
from being resaved when the note is clicked, reformatted by TinyMCE, and
clicked away from, which would result in an endless resync cycle. Instead, the
note is only resaved (and marked for syncing) when the user manually makes a
change.
Please enter the commit message for your changes. Lines starting
If the API returns a modified item after an upload (e.g., to strip invalid
characters), don't update the Date Modified field when saving those changes to
the local version (though it would still be good to avoid API-side changes as
much as possible).
And omit in ZFS file sync requests
The API previously didn't allow these properties to be set for group items,
because they were set atomically during the file upload process, but 1) that's
not really necessary (makes a little sense for 'filename', but not really a big
deal if an old file is renamed on another computer before the new file is
synced down) and 2) skipping them results in the properties getting erased
after items are uploaded and the empty values returned by the server overwrite
the local values.
Before 5.0 we performed a regexp on new item data values to determine if
they were integers and saved them natively in SQLite if so. We no longer
do that, but setField() used strict equality when checking for changes,
so an item could be marked as changed when comparing to a new string
value (e.g., from a write response from the API, which always returns
strings). To avoid that, this converts all old values in the DB to
strings and saves all incoming values as strings automatically. (This
should also help with searching and some other things.)
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.