And since `Zotero.Libraries.isGroupLibrary()` just checked that
property, that hasn't worked either since `isGroup` was added in 2015.
There's no test for `.isGroup`, and the test for `isGroupLibrary()` used
`if()` instead of `it()`, so it never actually ran.
Also:
- Remove old code block in search.js that called `isGroupLibrary()`.
Since `isGroupLibrary()` didn't work, this block was unused, and its
logic was previously added elsewhere.
- Properly transform HTML tags flavored plain-text into actual HTML
- Add support for multiline comments and highlights
- Insert newline before citation/comment when necessary
We're relying on Bluebird's synchronous promise inspection for noWait
translate mode (as used in Quick Copy). We should decide if we want to
keep the Bluebird dependency or rewrite this to use native promises
(e.g., with a separate synchronous `_loadTranslator()` function for
noWait mode), but for now just restore the `Zotero.Promise.method()`.
The bug fixed in bde9a74f9d was triggering an error getting code for a
deleted search translator, which due to this bug caused a double
complete() call that got detection all out of sync, which caused some
search translators to be skipped, which resulted in ISBN lookup
failures.
Among other things, if the name of a translator was changed, until
restart Zotero.Translators.getAllForType() would return the old cache
entry pointing to a file that no longer existed.
- Make a copy of the database after first initialization that can be
swapped in when reinitializing in resetDB()
- Avoid unnecessary one-second delay on every reset
Probably more that can be done, but this should take minutes off the
test runs
- Add/Remove Dictionaries window
- Better account for the (unlikely) possibility that a dictionary could
be replaced by another more popular dictionary provided by a different
extension id (tested)
- Better account for the (very unlikely) possibility that an extension
could bundle multiple dictionaries (untested)
- Use toolkit version comparator for proper extension version
comparisons
- Localize strings
- Add tests for updating
Otherwise switching back to release from beta doesn't show the last-used
version if the beta hasn't gone through at least one
compatibility-breaking schema update.
This connects the new feed processor to Zotero's existing feed reader. The new
feed processor assumes a content window environment, so a sandbox in a parent
window is used to load it.
There is no isInstitution field, so OpenURL search was producing invalid
data for items with institutional authors. Instead we use the name field
in API JSON and the isInstitution flag in internal JSON.
It's not totally clear how it's calculated, but it doesn't seem to be
just characters.
And make the path limit 255, which is the File Explorer limit, even if
the filesystem can allow up to 260.
Filesystems care about byte length, not character length, so treat
maxLength as the byte length limit and truncate accordingly.
This will also now remove entire emoji characters without corrupting
them.
If a file attached to an item with a URL wasn't found in the temp
directory, it would trigger an error that stopped the sync. (I'm not
sure how a file wouldn't exist.)
By changing to `mousemove` to start the tab title tooltip, the behavior matches
applications like Firefox more closely: you can always get the latest tooltip
back after changing state by nudging the mouse (without having to exit and
re-enter anything).
This hides tooltips (such as the tab title tooltip) whenever the tab bar state
changes, such as when adding or removing a tab, to ensure we don't leave any
tooltips behind that no longer match reality.
Fixes https://github.com/zotero/zotero/issues/2060
It's still possible to trigger a local import from a 1.18 database by
selecting the .sqlite file directly from the file option, but don't
offer it in the dialog.
E.g., if a sync is ongoing and there are multiple item saves that would
trigger auto-sync with the same options, only queue a single sync.
7ace5ea29e fixed the main cause of this, but in case some other
saves end up happening during a sync, this will prevent them from
triggering multiple sync loops with the same options.
An extra sync loop would be performed for every object downloaded, so a
download to an empty database could result in a huge number of
unnecessary loops. This was a regression from 52932b6eb, which started
queuing auto-syncs while a sync was in progress. The fix here is to skip
auto-sync for all objects saved from a sync download.
There are two new mechanisms involved:
- Event-level notifier options that get passed to passed to notify() at
the top level of extraData rather than being included with every
object (e.g., because `skipAutoSync` should apply to an entire save
transaction)
- The ability to pass event-level notifier options when initializing
a Zotero.Notifier.Queue, such as the one used for sync downloads
This hides the tab bar on Windows and Linux, where it currently takes up a lot
of vertical space below the menu bar. On macOS, the tab bar remains always shown
since we don't have the menu bar and can move tabs in the window there.
Fixes https://github.com/zotero/zotero/issues/2019
This dramatically speeds up Mendeley imports by avoiding UI updates.
Regular imports in fileInterface have done this for a while, but the
Mendeley importer used a fake translation object that didn't use the
passed queue.
After this change, a 10,000-item import goes from 9m30s to 2m45s, a 71%
decrease.
- Add "(online import)" and "(local import)" next to "Mendeley Referance
Manager" and "Mendeley Desktop", respectively
- Adjust size of OAuth window
- Use bound parameter instead of string literal for Fx78 compatibility
All annotations in all groups are fetched and hashes are compared to
detect annotations created on the same file while it was in a group
library. Annotations created by other users are filtered out.
Many DB statements that were being cached included embedded ids or temp
table names, so they would permanently use memory and never get reused.
During large imports, this could result in hundreds of megabytes of
extra memory usage.
This commit marks many more statements as `noCache`, adds `noCache`
support for column and value queries, adds a log line at DB shutdown in
source builds with the number of cached statements, and adds
Zotero.DB.getCachedStatements() for auditing of cached statements.
Addresses #1531
- Allow to format citations inside note-editor
- Allow quickFormat dialog to display and pick already cited items, even if an item no longer exists
- Watch and automatically update citation itemData in metadata container and re-format citations in body in opened notes
- Reorganize note metadata container handling and improve resistance to accidentally breaking it in further development
- Improve performance when typing in larger notes
- Rewrite note saving mechanism to support automatic note changes and reduce complexity for further development
- Cleanup and comment some core parts or note-editor as the preparation for further development
- Prepopulate quickFormat dialog with the currently opened PDF parent #1984 (doesn't include the currently scrolled page label yet)
Reduce timeout after an object change from 15 seconds to 3 seconds,
ecxept for individual notes. We should probably kick off an auto-sync
3 seconds after a note is blurred, but that's not implemented.
We also now skip file syncing and full-text content syncing altogether
unless an attachment has changed.
Reindexing an item now kicks off auto-sync, whereas before it didn't.
- Automatically upgrade all editable v1 notes when note is being opened
- Pull `itemData` from existing citations and annotations into metadata container attribute `data-citation-items`
- Strip `abstract` from `itemData`
- Fill `citationItem` (in citations and annotations) with `itemData` when passing an HTML fragment for further processing in `note-editor`
- Keep only `uri`, `text`, `color`, `pageLabel`, `position`, `citationItem` annotation properties
- Add Zotero logo
- Move most acknowledgements to the website, where they can be more more
easily updated and more comprehensive
- Increase font size
- Center window on screen
We weren't making actual upload requests after a quota error if the file
would exceed the quota, but we were still going through all attachments
to upload, which in some cases involves making stat() calls. We now just
stop the queue immediately after a quota error or when starting a new
background sync after a previous quota error.
Closes#1255
This adds a very basic reimplementation of the annotation widget for use
in the CR window. It's not pixel-perfect, but it's close enough that
most people probably won't notice. We'll want to replace this with a
real version that's shared between the PDF reader and the rest of the
codebase.
Image annotations currently show an "[image not shown]" placeholder.
Showing images is tricky: we don't have the remote cache image, so if
the remote position has changed, we could only show an image by
rendering it from the file, and only if the file itself hasn't changed.
Just for a better user experience, we could use the local image as long
as the position and file are both the same, but that would take some
rejiggering of the CR window.
Tags aren't shown because they're not shown for CR at all, though that
could be changed in the future.
And remove unused _removeNote() function
We prompt to delete in the items list to distinguish from collection
removals, but it's arguably not necessary here, since you can always get
the item out of the trash. Undo would be nice, though.
Using new PDF worker functionality
If you've previously imported, you should be able to import again to get
annotations in the new PDF reader.
Details:
- Text highlights will be processed to extract text
- Rectangle highlights will turn into image annotations
- Any extracted-annotation notes created by previous improts won't be
removed, but they're no longer created as long as the file exists.
- Show both sections even on search
- Add new note creation popups with an option to create from annotations
- Hide child notes section if no parent item
The PDF reader pref is now "Use Zotero PDF reader and new note editor
(beta, My Library only)". Toggling the pref prompts to restart, and
Zotero.isPDFBuild -- which currently controls the PDF reader, new note
editor, and tabs UI -- is set based on that pref at startup.
- Always show both sections
- Do not show empty sections when searching
- Collapse notes list when all tabs are closed
- Work around search input to take full width without breaking its stuff
Using new Zotero.Date.toFriendlyDate() function
- Time if today
- Day of week if earlier this week
- Date with two-digit year otherwise
We could consider adding 'Yesterday' as well.
While the code can technically disable various things (e.g., tab bar) to
behave like 5.0, other things (e.g., word processor plugins) would be
tricky to do conditionally.
Shows as a menu option when there's a single PDF attachment with
annotations and as a submenu containing titles when there are multiple
(even if there's only one attachment that actually has annotations)
Also removes "Create Note from Annotations" on attachment items for now.
(It might make sense to add that back, though "Add" would be a little
weird for creating a sibling note, while using a different label would
be confusing.)
- Show child notes at top of notes list, with separate headers for "Item
Notes" and "All Notes"
- Fix "New Child Note" option
- Add parent item title above note editor when editing child note
- Cleanup
TODO:
- Search on parent item title for child notes
Not sure if this can happen, but if there's any way for the schema
integrity check to run before the global schema is updated, use -1 for
the annotation itemTypeID.
- Remove item pane tabs
- Show all notes in notes pane, showing the parent title where
appropriate
- Show drop-down menu for "New Note" button in notes pane that allows
creating standalone or child notes
- Add some temporary styling for notes in the notes pane
TODO:
- Show child notes at top of notes list, with separate headers for "Item
Notes" and "All Notes"
- Fix "New Child Note" option
- Add parent item title above note editor when editing child note
- Search on parent item title for child notes
The page index needs to be per-person in group libraries, and it should
still work in read-only libraries, so it doesn't make sense to store it
on the item. This uses a synced setting in the user's library instead.
And use when opening PDFs in My Library from items list and
zotero://open-pdf
This also adds "Zotero" to the main PDF reader pref, which will be the
real way to set this, but that option is hidden for now so that group
library items will still open with the configured reader.