This moves most selection logic from ZoteroPane.selectItem() into
collectionTreeView::selectItem() so that it can be used in the
edit-citation dialog.
Unlike itemTreeView::selectItem(), which only selects within a given
items tree, this function automatically switches to a library root if
necessary. ZoteroPane.selectItem() remains and does a little bit extra
(unminimizing Zotero, focusing the items pane) in addition to calling
collectionTreeView::selectItem().
If an object was uploaded but was changed locally during the upload (e.g., the
user typing in a note), the local changes would be lost when the remotely saved
version was applied. Instead, watch for modifications to objects during the
upload and don't apply the remote versions of those objects or mark them as
synced.
- New flat theme (with padding tightened a bit from the default to fit
in right-hand pane)
- Adds search/replace within notes
- Adds URL autolinking
- Image pasting/dragging is now properly disallowed (though TinyMCE 4
has hooks that may allow us to actually support this by automatically
creating attachments)
- New blockquote style with color bar
- Replaces custom context menu on link click with built-in version
To-do:
- Fix display of pop-ups, which are now modal dialogs within the note
frame instead of pop-up windows, to stay fully within the frame
- Localize (more important now that there are tooltips)
- Support image dragging
- Update elements list for HTML5, for better drag-and-drop?
- Move directionality control to context menu instead of taking up
toolbar space?
- Evaluate other plugins for potential inclusion
- Show additional controls in separate note window?
- Fix opacity of text in tooltips
Closes#451, closes#421
And change "Changes take effect in new windows" to "Changes take effect
after restart"
(The note font size still requires a restart, as do the shortcut keys in
the Advaned pane.)
Not sure we want to expose this, particularly since there are tons of
spurious warnings in current builds due to a chrome registration issue,
but it can be handy for debugging some issues.
Previously, if Standalone was open and Firefox was opened in connector
mode, ZoteroOverlay.onLoad() was never run, which meant that, among
other things, the before-reload handler that closed the Zotero pane when
switching out of full mode was never added.
And treat an existing non-empty directory as a failure during the
migration, since it should now never happen
Also suggest manually moving on Windows if more than 100 attachments
- Fix loading for libraries that haven't yet been loaded (including if
the Zotero pane hasn't yet been opened)
- Show a loading message over the items tree
- Fix item selection when editing citation (except if library data
hasn't yet been loaded, but that doesn't happen in Standalone)
* Mark feedItems read in a single batch SQL update
* Automatically remove old feed items
* User-facing preference globally and per-feed for feed item expiration
If you got the timing just right, you could wipe out all your
translators (though standard ones would be reinstalled on restart).
Hopefully that's fixed?
Improves proxy support
- Automatically detect and dehyphenise https proxies which use EZProxy
HttpsHyphens
- Web translators now pass around Zotero.Proxy instances which can
proxify/deproxify urls passed to `translate.setLocation()` before calling
`translate.getTranslators()`/ translate.detect()`. The proxy passing is
done within connector background/injected processes and between
standalone and connectors.
- Proxy protocol unified with connectors. Connectors can now pass
proxies to `/connector/save_items`. The proxies will be used to resolve
true item and attachment urls when saving.
Closeszotero/zotero#578, zotero/zotero#721
Relevant zotero/zotero#34, zotero/zotero#556
- Make Zotero.Attachments.createDirectoryForItem() delete existing
directory instead of moving it to orphaned-files; also now returns a
string path instead of an nsIFile
- Use above function during file sync instead of
_deleteExistingAttachmentFiles(), which was partly broken
- Fix throwing on errors when saving some attachment types
Lines default to 50%, but addLines() doesn't provide a mechanism for
updating the opacity, so all the callers that used addLines() showed as
gray. Instead, just default to 100% when using addLines().
- Don't block the UI with a progress meter during imports. Instead, show
a popup in the bottom right when the import is done that shows how
many items were saved.
- Fix hang when importing some files
- Fix various problems with asynchronous operations/transactions
- Use the save queue for imports instead of creating concurrent
transactions that can time out
- Wait for the save to finish before returning from the translate()
promise. All save modes now use the save queue, so code that
handled the non-save-queue process can probably be removed.
- Serialize child attachments instead of running them concurrently.
This might make multi-attachment saves a little slower, since they
can't download at the same time, but it avoids problems with
concurrent transactions. We might be able to improve this to allow
concurrent downloads, or allow concurrent saves for a limited
number of items (e.g., from web saving) if not for larger imports.
- Change collection handling during import, since UI is now active
- Select the root collection at the beginning of the import
- Assign items and collections to the root during the import instead
of at the end
- Don't select other collections
- Change a few ItemSaver functions to use promises and remove
unnecessary callbacks. (This includes some connector code that needs
to be tested.)
- Change some `parentID` variables in ItemSaver to `parentItemID` for
clarity, since collections are now handled in more places
To-do:
- Save items in smaller batches instead of doing all in the same
transaction
- Show progress meter in a bottom-right popup during the import
Zotero.getString() now takes a third parameter, `num` (which should also
appear in `params`) to use when determining which plural form of the
string to use. Localized strings should include all forms in the order
specified in [1], separated by semicolons.
[1] https://developer.mozilla.org/en-US/docs/Mozilla/Localization/Localization_and_Plurals
This reverts commit 60befe52e4 and adds a
better fix that leaves the notifier event in place. Feeds just don't
need to update after syncs during tests.
An endpoint can now take a single object containing 'method', 'pathname',
'query', 'headers', and 'data' and return an integer, an array containing
[statusCode, contentType, body], or a promise for either. This allows the
handlers to use the HTTP method and headers and removes the need for callbacks
when some handlers already use coroutine().
If init() returns a promise, it now has to use the new single-parameter
signature (because the check is done with Function.length, and combining
promises and callbacks doesn't make sense anyway).
This also makes a few changes to `callMethod`:
- Removes the deprecation warning when a string is passed and removes the
`httpMethod` `options` property. Any call that passes a string and includes
`data` can just remain as a POST. If `data` is null or undefined, a `GET`
will be sent. (If we find ourselves needing other methods, we can reevaluate.)
- Renames `httpHeaders` to `headers` for consistency with other code (and in the
absence of `httpMethod`)
Instead, just always show the (greatly shortened, after 0609b62a) menu
on export when the translator supports it (which probably fewer
translators actually need to do).
This leaves the pref in place, but it can be removed eventually (and
changing the default for a while I believe will cause the existing pref
line to be removed for anyone who has it set to true already).
See https://forums.zotero.org/discussion/comment/263644/#Comment_263644
We might want to consider removing the export charset checkbox in the
prefs and either always showing the charset option for translators or
always showing it for BibTeX (where "Western" really means "ASCII") but
nothing else.
Fixes#1124
The Zotero.DataDirectory equivalents return string paths instead of nsIFile
instances, so some of these calls now just use Zotero.File.pathToFile(), which
can be removed when the surrounding code is updated to OS.File,
Look for other profiles, from both apps (Firefox and Standalone), that
point to the data directory being migrated and update prefs.js in those
profiles to point to the new location.
Also reorganize code into Zotero.Profile and Zotero.DataDirectory
namespaces
This prevents us from moving the data directory if the other app
(Firefox or Standalone) is running from the same directory.
Also clean up stub code in migration tests
When an export translator is selected for Quick Copy, Quick Copy
initialization triggers translator initialization a few seconds after
startup, because the translator code needs to be available synchronously
for drag/drop. A Quick Copy test was changing the setting to BibTeX,
which was resulting in random timeouts after subsequent resetDB() calls
due to slow translator loading. This change skips initialization in test
mode. This might actually fix a lot of timeouts on Travis in the second
half of the tests...
This also resets the Quick Copy pref in those tests so that it's left at
the default, though really we should automatically reset all prefs after
all test groups and in resetDB().
Would be nice to have a determinate progress meter on Windows, but that
will require enumerating all files, which maybe would just make things
slower. Might be safer, though, by discouraging people from
force-quitting.
If showZoteroPaneProgressMeter() is called with the first argument
undefined, don't clear any existing message. To clear, pass
null/false/"". The message is also cleared when the progress meter is
hidden.
- Fix#1121, sorting of hasAttachments column -- doesn't work if
hasAttachments is the active sort column on startup, since file states
have to be cached, but works for subsequent clicks on the column
- Don't sort linked URL attachments as missing
- Use hiDPI icon in all cases
This adds a new button to the Advanced prefs to migrate the data directory to
$HOME/Zotero. The button only appears if the data directory is set to the
default location within a profile directory (including the other program from
the one running, even though that's technically stored as a custom data
directory).
On Mac/Linux, directories within the data directory are moved with /bin/mv. On
Windows, or if that fails, they're copied recursively using OS.File.move()
(which annoyingly doesn't reliably support directory moving). The former should
be instantaneous on most systems (unless the data directory or 'storage' were
on a different filesystem from $HOME).
If the database fails to transfer, migration fails and the data directory
setting remains on the old directory. If the database transfers but other files
fail, the data directory setting is updated. In both cases, the user is
encouraged to migrate remaining files manually with a button that reveals the
directories and quits the program.
This isn't yet tested on Linux or Windows, and migration isn't yet suggested
automatically.
Adds Zotero.File.reveal(), Zotero.File.directoryIsEmpty(), and
Zotero.File.moveDirectory().
.persistentDescriptor now appears to return (and parse) a string path anyway on
macOS, which is the only place where it didn't use a string path to begin with,
so this will only affect earlier users.
- Use $HOME/Zotero if zotero.sqlite exists, and set it as a custom data
directory so that 4.0 uses it if loaded (resulting in a
newer-db-version error instead of an empty database)
- Don't prompt whether to use data directory from the other version's
profile directory (i.e., Firefox or Standalone) -- just do it
- Show toolbar icon on startup error (fixes#742)
- Don't show DB upgrade error message for other startup errors
- Fix some cases of a startup error not being logged/presented
- Show actual error in error dialog for more errors