There were a few problems causing the incorrect behavior:
1. Rows were being removed only if they had no non-deleted children, which
wasn't the right check. We want to remove all rows with no *deleted*
children.
2. Children of the removed rows weren't being removed with them.
3. We weren't invalidating the tree (which _removeRows() doesn't do).
Also:
* Erase trashed annotation after getAnnotations() test
Because ItemTree#notify() doesn't yet correctly handle refresh events on
parent items that are themselves children (three-level nesting: item ->
attachment -> annotation), this test was causing a failure in
itemTreeTest.js.
We don't usually want an async detectWeb, since HTTP requests should only be
used there in very exceptional cases. We do usually want an async scrape (and we
were already - mistakenly - awaiting it).
Expose annotation tags in tag selector and match parent attachments when
filtering/searching
This also fixes searching for annotation text or comments when using
Everything quick search.
This is temporary until we display annotations in the items list
directly.
Application menu items, contrary to the comment I added in a654ad291f,
actually *do* belong in hiddenWindow.xhtml so that they still work when
zoteroPane.xhtml is closed. They just can't be split between there and
zoteroPane.xhtml. This commit moves all of them to hiddenWindow.xhtml and
reimplements openPreferences() in a non-Zotero-object-dependent way.
Fixes#2738
We can do it because it was only used to create a note from annotations.
No need to update schema version in Zotero client, unless using new
features when creating a note from annotations.
Part of zotero/zotero-connectors#394
When saving an item (e.g. on arxiv) with a site translator, the
translator may add a custom snapshot attachment URL which does not match
the translation URL (the URL in the browser where translation was
initiated) in which case Zotero handles snapshot saving. Zotero loads
the page in a background browser. By default images are not loaded in
this browser. SingleFile due to CORS restrictions has to refetch all
resources that are not from the same domain or subdomain, but uses
pre-loaded resources (images) from the same domain. Before this change
any images that were from the same domain as the saved website were not
saved in the snapshot. This commit fixes that.
Date columns start in descending order, so put empty rows at end
Also remove a seemingly unnecessary exception for Title when not the
primary sort and just always sort it with empty rows first
Because regex is built using a template string, \s* is actually escaped
into s*, i.e. literal "s" appearing 0 or more times. In most cases this
would mean that output can have spacing slightly off. In extreme case,
when identifier starts with letter "s", this could this could lead to
identifier being stored incorrectly.
Also adjusted tests to be more strict and mock data to cover this case.
* Detect wizard cancel/close and interrupt import. This will still
have to wait for current fetch (file or metadata) to complete but will
then advance to the cleanup stage
* Advance progress bar during metadata fetch
* Add some extra logging
Previously we had a structure that also created folders in temp dir,
that has since changed but code in cleanup phase to remove containing
dir has been accidentally left unremoved.
This adds a space after the the number in some numeric styles ("[1]" in
IEEE style, "1." in Nature) when pasting bibliography entries into a
plain-text editor.
Some styles (ACS, AMA, Vancouver) will need to be updated to remove
their hard-coded spaces to avoid double spaces after this change.
Patch from @zepinglee
Fixes#2633
Emoji such as ⭐️ that began as text-based Unicode characters and depend
on Variation Selector-16 to display the emoji presentation weren't being
properly detected.
PDF-handling code from `ZoteroPane.viewAttachment()` predates
`Zotero.OpenPDF` and didn't handle page numbers for external PDF
readers, so when called from "Show on Page" in a note (via
`ZoteroPane.viewPDF()`) it just launched the file itself in the
specified handler or via the OS.
For now, change to use `Zotero.OpenPDF.openToPage()` when there's a page
number. Later we should use `Zotero.OpenPDF` for everything, but that
code is more complicated than just using `launchFile()`, so we'll need
to do some testing (particularly on Linux) to see what's best.
(Note that "Show on Page" with an external reader doesn't make a ton of
sense, since you can't actually see the annotation, but opening the
right page is better than nothing.)
Fixes#2612
And remove all references to old id
We can do this because plugins will use new mechanisms for install and
update manifests that don't use the id (which also means it's now only
used internally).
We'll want to update the rest of the instances of "extensions" or
"add-ons" to say "plugins" (unless we think we might support themes, in
which case we can keep "add-ons").
_getFieldValue() and _setFieldValue() were using `.value` instead of
`.textContent`, so the few places that use it were getting/setting ignored
fields on divs.
fbc25834 messed up the tab index logic, shifting the responsibility for
preserving _lastTabIndex across refreshes: originally, the default was to throw
it away, and the caller was responsible for saving and restoring it if the
refresh was caused by tabbing between fields. The bad commit reversed the
situation and made the item box *remember* the _lastTabIndex by default,
meaning that a refresh caused by the notifier, for example, would focus the
last focused field even if it had been closed by the user in the meantime.
That bad change was a misguided attempt to fix the Tab key cycling infinitely
between Item Type, Title, and creators and never reaching further fields. The
actual fix was just to add `, textarea` to the query on line 1459.
All already being handled by CSS (besides the exact character length limits, but
it's not clear that we really need those - we just ellipsize if it visually
overflows now, which seems fine).
Plugins are ZIPs containing at least these two files:
- manifest.json: A WebExtension MV2 manifest with basic metadata
properties and `applications.gecko` with `id` and `update_url`
- bootstrap.js: A bootstrap file, similar to old bootstrapped extensions,
with `installed()`, `startup()`, `shutdown()`, and `uninstalled()`
The fieldMode attribute of the input was being set by the call to
switchCreatorMode(), but it didn't carry over to the label that replaces it on
line 1997.
Also removed a debug line and cleaned up a bit.
Not the exact same sizing as Fx60, because that relied on some quirks
of the Mozilla box model that I can't reproduce with flexbox, but still
works about as well.
Hasn't done anything since in-browser viewing of certain file types in
Zotero 4 for Firefox. Perhaps we'd bring it back at some point, but
disable for now.
Hasn't been relevant since the Firefox NPAPI days, but was returning
true for `application/pdf` (possibly due to the bundled pdf.js in
Firefox still being included in our builds, which we should remove if
so), which was causing "Open in External Viewer" to appear, even though
it just opened the internal reader.
Fixes an error that prevents changing the join mode from having an effect
after clearing the search when a join mode was already set. Bug also
present on master, not introduced with fx102.
This fixes the dictionary manager and various other places where a XUL
element was being created with createElement(), and also simplifies a lot
of createElementNS(HTML_NS, ...) calls.
This might cause some minor regressions but everything tested has
worked. Not touching preferences (#2659) or bindings.
And fix magic numbers for content-type sniffing, which wrongly used the
Unicode replacement character (which likely just meant we were falling
back to file-extension-based detection)
Use the new PageData mechanism for character set detection, don't try to
index HTML files directly without properly detecting the charset, and
generally simplify the indexing code.
HTML files are now considered cached files that require indexing and
won't be indexed automatically in Zotero.FullText.findTextInItems(),
which breaks certain expectations, including in some tests. This will
need to be addressed.
Remove Zotero.Browser and add HiddenBrowser.jsm. Post-Fission, web/file
content loads in a separate process, so it's not possible (as best as I
can tell) to directly access the contents of a hidden browser -- it just
appears as about:blank in the parent process. We now use Mozilla's
JSWindowActor mechanism [1] to get page data, including character set
and body text for full-text indexing. We'll have to evaluate other uses
of hidden browsers to see how to handle them.
This also adds include.jsm for loading the Zotero object into a JSM.
[1] https://firefox-source-docs.mozilla.org/dom/ipc/jsactors.html
The test runner now uses the Zotero executable from
`zotero-standalone-build/staging` rather than the Firefox from
`zotero-standalone-build/xulrunner`. Along with testing the actual
program, this restores visible UI updates during tests, which should
make debugging various things easier. We can also now remove anything
related to Zotero being an extension.
Many tests are still broken, but this at least lets us start running
them.
- Widths are now correct
- Rows are a little too tall
- Field value vertical alignment is off
- Platform styling isn't done and some styles might be redundant
- Still can't scroll vertically
- Creator name inputs still displayed wrong
Not working:
- Web tests (hidden browser is broken)
- Test Updated status text
- Various platform menu things (code copied from ZP and will use whichever
approach we settle on there)
- Add links-box component (inside noteEditor.js).
- Add related-box component and fix related pane.
- Use tagsBox.jsx instead of tagsbox.xml in note editor links box popup.
- Remove CSS styles and bindings for noteeditor, relatedbox and tagsbox.