The current document is automatically used (but can still be provided as
the first argument to avoid accidental bugs during the transition).
Closes#1323
Addresses zotero/translators#1277
- Enable/disable download mode drop-down for groups separately from user
library
- Fixing hiding of terms of service message when Zotero storage isn't
selected
If you started typing just as auto-save was kicking in (i.e., 1 second
after stopping typing), any additional characters could be removed and
the cursor could jump back to the beginning of the note.
Fixes#1336, probably
- When a child note is opened in a separate window, the parent window is
selected. (This used to work but was broken in 5.0.)
- When a top-level note is opened (via double-click), the right-hand pane
changes to show "Editing in separate window".
- If a note that's currently open in a separate window is clicked on,
the right-hand pane shows "Editing in a separate window".
- If a note window is closed and the item is selected, the note editor
reappears in the right-hand pane after the note is saved.
This will avoid unnecessary UI updates and data loss bugs from the two
notes getting out of sync (and is just generally cleaner).
Also:
- General cleanup of note display code
Nesting the panel in the toolbarbutton seems to cause the button to
appear as if it were clicked on any click/right-click in the textbox,
and I couldn't find a way to prevent that with event.stopPropagation().
Also cleans up this code in general
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
And fix deprecation warning from passing an nsIFile
(Also updates the Zotero.Styles.install() documentation to note that the
first parameter's `file` property can be a string path.)
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.
If the read-only file is set on a file in the 'storage' directory, it's
added to the ZIP for snapshot/WebDAV syncing, and when extracted the
setDates() call was failing. This clears the read-only attribute (and
system and hidden) when extracting all files.
The check only does anything if we're using the default location, and
otherwise if we migrate the wrong directory (say, because somebody
opened Standalone 4.0 before upgrading to 5.0) we won't prompt until the
next restart.
f40b7ae6ac didn't help with people who've already upgraded, so check at
startup and show a warning if the profile is inaccessible until 1) the
profile has been accessed once or 2) the user checks "Don't show again"
in the warning dialog.
Also fix Zotero.Profile.getDefaultInProfilesDir() to properly throw an
error if it can't access the default directory.
The same as Zotero.getString(), but takes an nsIStringBundle as the
first parameter. Extensions could use this to get the same getString()
features with their own properties files.
Reverts a80f13099, "Avoid temporary table when getting tags for current view",
fixes a couple things, and removes the unused Zotero.Tags.getAllWithinSearch().
Fixes#1290
Setting `contentCharset` on the channel doesn't seem to work anymore, so
use `overrideMimeType()` instead like we do in the connector. As noted
in the comment, we should probably have a `responseContentType`
parameter instead, since that's what XHR actually allows. For the moment
we just use `text/plain`.
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()
- New 2x toolbar button shapes and other icons from @johanneskrtek --
this HiDPI-ifies basically all graphics other than a few remaining item
type icons
- Use the Mac search dropmarker for all menu buttons, since it's wider
and more pleasant. Reduce menu button padding slightly to compensate.
- Better toolbar button state for inactive window and pressed state
- Fix dropmarker overlap in tag selector icon
Closes#347, Better/retina-style OS X toolbar icons
Closes#1339, Create new button PNGs for macOS
Regression from e62433edfb
Load a locale file once via nsIConverterInputStream and cache it for
subsequent retrieveLocale() calls. I'm not sure if using a stream
instead of synchronous XHR is actually necessary now that there's
caching, but it can't hurt.
processDocuments() now uses an XHR 'document' request, wrapped to
provide a 'location' property, and uses promises for a simpler call
signature (though the old one will continue to work, for existing
translators). 'done' and 'exception' can now be handled via promises,
and in the translator sandbox an optional noCompleteOnError argument
instructs it not to automatically cancel the translation process with an
error (e.g., for supplementary materials).
Since we do need a hidden browser in some situations (e.g., for saving
snapshots), the old hidden-browser-based processDocuments() is still
available as Zotero.HTTP.loadDocuments().
This hopefully also fixes various problems with document property access
in translation-server.
If you swapped in a database with a different sync account from the
stored one and then opened the prefs, it would update the username to
match the username from the API key, and then when you synced it would
warn you using the new username for both accounts.
This stops the prefs from updating the username in the DB, so it only
happens during a sync.
(This behavior was put in in 77a95b5e6d, I guess so that if you open the
prefs twice before a sync it won't briefly show a missing/outdated
username after the first time, but that's not a big deal.)
This might help avoid the search bar brokenness that people are seeing
(and that we can't reproduce), though the same problem might just cause
a later error.
Return a 500 for read-only libraries for all save modes. Read-only views
within editable libraries will save to the library root.
Addresses #185, RIS/BibTeX interception to read-only view behaves
differently from save button
This is (hopefully) a better fix for selection issues than 2901174ba3. A
reference to the collectionTreeView is stored in a `view` property on
the collectionTreeRow, and when an itemTreeView is initialized and
passed a collectionTreeRow it assigns itself to an `itemTreeView`
property on the row's view.
Asyncify, make JSON load failures not fatal, and simplify icon download
code (which also fixes download of CrossRef icon, which was failing for
some reason).
Shows a progress meter, which allows for larger chunks and fewer
refreshes, avoids unnecessary updating of parent items that are
being deleted anyway, and skip re-sorting of modified items in the
trash.
Closes#1292, Emptying trash is slow
When migrating prefs from Zotero for Firefox, the prefs specified a
custom data dir, and that directory was missing, the "Previous
directory:" line was blank.
Can be an absolute path or 'profile' to use 'zotero' subdirectory of
profile directory as in earlier versions (but which won't be treated as
a legacy location eligible for migration)
Closes#1305
This should give better feedback when some identifiers fail, but for now
restore 4.0 behavior.
Also add items by identifier in order, not reverse order
If responseType isn't set and the response doesn't include a
Content-Type header, Firefox tries to parse the file as XML, and if the
file isn't XML it logs an "XML Parsing Error", which includes the
username and password.
Previously, if someone was upgrading from Zotero for Firefox to 5.0 but
at some point had installed Zotero Standalone and told it not to share
the data directory, 5.0 would use the data directory from the Zotero
profile directory, and people would end up with an empty database with a
Zotero Quick Start Guide from years ago.
This checks for the database with the most recent mtime and uses that
data directory instead. In the Firefox profile, that can be either the
default 'zotero' subdirectory or a custom data directory. If one of the
Firefox locations is used, Zotero prefs are read from Firefox, because
it means that Zotero for Firefox was being used (because if Zotero
Standalone had been in use it would've needed a custom data dir setting
pointing at the Firefox database).
With the new system, it wasn't possible through the UI to generate debug
output for another action that happened after a restart, since it just
restarted immediately. This adds a prompt after selecting the menu
option that allows for restarting now, restarting later, or cancelling.
Better instructions and behavior if the data directory is inaccessible
or missing, including automatically detecting a directory at the default
location if the configured directory is missing and offering to use the
default instead. Together, this means that if, say, security software
prevents Zotero from accessing the data directory within the Firefox
profile, it will suggest that the user move it to ~/Zotero and then
prompt to use that directory.