The predicate name used as an object key was being converted to an id,
so if relations weren't reloaded properly, they would be broken after a
save.
Discovered while working on #5297
Extend scrollToRow in windowed-list.js to allow to
scroll the specified row to the top of the window
even if it is located below the current scroll window.
With this, when scroll position is restored in itemTree,
the same row remains at the top.
Fixes: #5233
* Show "Remove All Tags..." when right-clicking textbox
* Fix pasting multiple tags adding concatenated tag
* Remove unnecessary check
* Fix tag count changing when unsaved tag is removed
On Windows, after right-clicking on a title field.
this.querySelector('popupset') matched the popupset in the
collapsible-section head, not our own.
Fixes#5294
* citation dialog: interactive before io.getFields
- added io.allCitedDataLoadedPromise, which is resolved
when both io.fieldIndexPromise and io.citationsByItemIDPromise
are resolved. Resolved io.allCitedDataLoadedPromise essentially
means that calls to io.sort() and io.getItems()
will be fast because all necessary data is already loaded.
- citation dialog uses io.allCitedDataLoadedPromise to
not await for functions relying on io.sort() and io.getItems()
before the data is loaded, as it could take an arbitrary
amoung of time. Speicifcally, SearchHandler._getCitedItems() and
CitationDataManager.sort. As soon as allCitedDataLoadedPromise
is resolved, cited items will be sorted.
This means that when retrieving fields takes a long time, one can
still add new items, their bubbles will just not immediately
be sorted.
- this replaces earlier SearchHandler.loadCitedItemsPromise, which
was a special case of this handling.
- added a new test ensuring that bubbles can be added even
when io.allCitedDataLoadedPromise is not resolved yet
- cleanup for buildCitation function to remove handling
of io.citation.sortedItems, which is always empty on
load before io.sort() runs
- added a few Zotero.debug statements for future debugging
- Uses a dummy promise if no allCitedDataLoadedPromise
(e.g. to accomodate the note editor)
- replace objects with zoteroItem, citationItem, etc.
as the main representation of an entry in the citation
(CitationDataManager.items) with instances of a new BubbleItem class.
BubbleItem has two static methods to create
a new instance: BubbleItem.fromCitationItem() used
to create entries from io.citation.citationItem on load,
and BubbleItem.fromItem used to create entries from
Zotero.Item when a new item is being added into the citation.
BubbleItem.getCitationItem will return a citationItem
in a format that citeproc consumes. This streamlines
the flow of data, makes it easier to manage and avoids
unnecessary conversions between citationItem and Zotero.Item.
- This refactoring fixes the issue of added suffix/prefix
sticking to an item and persisting even if the bubble
is removed and re-added. Fixes: #5282
- add csl data to virtual item in io.customGetItem
to remain consistent with Zotero.Integration.Citation.loadItemData.
That way, csl data is always found on Zotero.Item
and we don't have to check citationItems.
Also:
- apply deduplication to cited items, so that a cited
item from the library that appears in selected or
opened section does not have a duplicate entry in
the cited section.
- added initial test suite for citation dialog
Use `uninstall: true` in `update_url` JSON `updates` that is valid
for the installed plugin to uninstall the plugin the next time it
checks for updates
This actually checks for a "primary" column, so if an extension hides the "title" column but provides its own "primary" column, the "title" column remains hidden.
Unhandled Enter keypress from inside of a panel will now close it.
Enter on "Omit Author" checkbox or on the inactive locator
label dropdown will close the item details popup.
Enter on "Keep sources sorted" checkbox of settings
popup will close it for consistency.
Fixes: #5277
- right-click on annotation rows in trash will display
"Delete Permanently" option, instead of an empty menu
- in trash and other non-editable collection rows, disable
"Add Note from Annotations" button in itemPane header
- remove ability to add tags to annotations and other
items by dragging them into tag selector from trash
- remove ability to add items to collections by
dragging them into collection tree from trash
- fix attachment row being removed from trash if
its child annotation row is erased
Also:
- fix contextPane in reader tab being editable for item in trash
- fix title being editable in attachmentBox for item in trash
Fixes: #5261
Do not update itemTree selection on each annotation row
removal when an attachment row is collapsed.
It causes a significant delay when attachment with
many annotations is collapsed if selection is on any
row below the attachment. It is also redundant because
the selection is updated at the end of _closeContainer anyway.
Fixes: #5255
- collapse all rows before removing them. It makes
sure that annotation rows will be cleaned up properly
when an attachment row is moved into another parent.
- refactor conditionals to handle changes of parent
regardless of whether the item is a container
(attachment with annotations) or not (a note).
- added tests for itemTree's handling of changing the
parent of attachments and notes, as well as ensuring
there are no leftover annotation rows in Unfiled Items.
Fixes: zotero#5246