1) text() wasn't handling the index property.
2) This removes the warning that attr()/text() no longer no require a
document as the first argument, because there's no reason to prevent
translators from being able to pass an element. It would require
rewriting various translators unnecessarily and make certain patterns
more verbose (because you'd need to match based on global scope in each
selector).
It won't be necessary to pass a Document once we remove 4.0 support and
the global attr()/text() are always available, so we can add a warning
for that then.
Fixeszotero/translators#1647
This is loosely based on the same functionality in ZotFile, but it tries
to do the right thing based on existing Zotero settings: either the new
PDF handler setting in the prefs or the system-default app. The latter
can only reliably be determined on Windows (and this uses ZotFile's
function to read that from the registry), but this tries to figure it
out on macOS and Linux too using the Mozilla handler service. (The
handler service only gets you an app name, not a path, so on Linux we
can try reading mimetypes.list and the like in case someone is using a
system-default okular or evince not in /usr/bin, but that's not yet
implemented.)
This uses the new 5.0 URL format, and a 'page' query parameter instead
of a path component:
zotero://open-pdf/library/items/[itemKey]?page=[page]
zotero://open-pdf/groups/[groupID]/items/[itemKey]?page=[page]
It also accepts ZotFile-style URLs, though, so if you uninstall ZotFile
you should still be able to open those links. ZotFile will need to
accept the new format for new links to work when ZotFile is installed,
since it will override this handler.
This functionality will be necessary for annotation extraction (#1018)
and for imported annotations from Mendeley (#1451).
Shows a prompt once per restart or once per day, whichever is longer,
with an option to not show again for a month. Can be disabled completely
by setting extensions.zotero.showConnectorVersionWarning to false.
Currently prompts for connector versions below 5.0.35.
This is a temporary solution for #1489 until the connector checks and
warns on its own when it's outdated and most people are on a version
that does that (particularly Safari users, who don't auto-upgrade).
The progress percentage is based on the most recent transaction
(or undeterminate if this is the first session transaction)
Fix undefined function call error
Local object versions can be higher than remote versions, because we
upload in batches and only record the version from the last batch.
This could cause trouble if an object failed to upload during a Restore
to Online Library, causing it to be retried later with version 0 (unlike
during a restore when the version is omitted), causing the library to be
reset, causing any local objects with higher local versions to be
redownloaded.
Set 'control' to the id of either the value label or the textbox,
depending on whether the field is being edited. This causes NVDA to read
the label associated with the textbox, but seemingly only the first time
it's selected.
Unfortunately NVDA also does some other unpleasant things, like reading
a description from the duplicate-merging pane, which isn't the active
element in the deck, and reading the entire text, including all field
labels, of the item box) I'm not sure how much we can improve this until
we're on Electron.
VoiceOver doesn't read the textbox's label either, even though it does
so in the bookmarks window in Firefox. Maybe things have improved since
Firefox 52, so we can text again after upgrading to Firefox 60.
Addresses #1411
Moving a translated item from a non-filesEditable library to a
filesEditable library would fail (because the endpoint handler was named
"SaveItem" instead of "SaveItems").
Fixeszotero/zotero-connectors#235
E.g., if you have a main profile using ~/Zotero and create a second
"Work" profile, a "~/Zotero Work" data directory will be created
automatically and set as a custom data directory
If you entered a date that was in DST (including the current date at
00:00:00) but you were in standard time, the previous day was displayed.
Since access dates for saved items include explicit timestamps and most
people don't work between the hours of midnight and 3 a.m., this didn't
come up very often, and it was easy to miss when it did, since you'd be
unlikely to notice it for previously entered dates. (Someone noticed it
today because DST ended in Australia.)
This only affected the item pane, so citations were unaffected.
If switching from a filesEditable library to a non-filesEditable
library, files are removed. If going the other direction (including if
the original save was to a non-filesEditable library), the save is
performed again from the beginning in order to include attachments. If
switching between two filesEditable libraries, the storage directory is
just moved.
Addresses zotero/zotero-connectors#220
Move an item and its attachments to another library. Attachments are
removed as necessary if linked files or all files aren't supported in
the target library.
The change in c5cd38b4a5 seems like it shouldn't have had any effect,
but creating an empty Set before yielding somehow avoided a race
condition with the subsequent updateSession call.
Ideally I guess the entry would be removed from the save popup in the
connector and a second button click would do a fresh save rather than
reopening the popup, but for now just avoid an error.
Addresses zotero/zotero-connectors#220
Items in the trash will still be updated properly (since they can still
exist in collections and have tags), but the collection selected in the
target selector should remain selected in the client.
Addresses zotero/zotero-connectors#220
If somebody switched accounts in a previous version, it was apparently
possible for related items to end up pointing at an item URI with the
old userID, which could cause a 403 on sync.
https://forums.zotero.org/discussion/70989/report-id-477331252
(5.0 deletes data when switching accounts to avoid exactly this sort of
bug.)
On some laptops, scaling settings might cause the DPI to drop between
96 (1x) and 144 (1.5x), and downscaled icons are probably better than
upscaled ones.
By prompting after 3 seconds we catch a lot of people who click through
the prompt without bothering to read or figure out what it does and then
come to the forums report the citing "bugs". An increased timeout will
catch less people and those who are caught are possibly more likely to
figure out how delayed citing updates work since they would greatly
benefit from it.
The old recognizer code only used CrossRef, and the new code copied
that, but I think the old code simply predated additional DOI
translators and was never updated.
- Add a File Handling section to the General pane of the preferences,
and move several prefs from Miscellaneous to there
- Add a UI to that section for choosing the PDF handler
- Update Zotero.launchFileWithApplication() to use /usr/bin/open on
macOS if the handler is an .app (which it will be if set through the
chooser, since it's limited to Mac applications, though an executable
can still be set via the hidden pref if desired for some reason)
- Move prefs for style/translator updates and translator error reporting
(which isn't particularly relevant anymore in the client) to Advanced
By default the PDF handler chooser says "System Default", which isn't
the nicest thing, and there's probably a way to get/guess the system
default, since Firefox seems to know it (at least on macOS), but I
couldn't quickly find a way to do it.
Addresses #1450
Various animated things (search spinner, progress meters) were using CPU
even when hidden, either because they weren't properly hidden
(equivalent of `display: none` rather than `visibility: hidden`) or
because of bizarre Firefox bugs with progress meters on Linux.
Addresses #1455
Configurable via extensions.zotero.fileHandler.pdf hidden pref for now,
though we'll probably make it a visible pref.
We also appear to have been doing blocking launches when launch()
failed, which may have been causing UI hangs when opening files on some
Linux installations. (I'm not sure if that's an issue with recent
Firefox builds. launch() works on Ubuntu 17.10.) All launches are now
async.
This is a rewritten version of PR #1450 by @ehhc.
Closes#1450
- Get rid of the hideous blue effect in the menubar and toolbar
- Slim down splitters
- Get rid of awful grippies except when collapsed (and make them
slightly less ugly in the collapsed state)
- Reduce spacing of tags in tag selector
- Tweak twisty spacing
- Get rid of stray line to the right of item pane tabs
We may still want to get rid of the menubar (#366), and we can do better
than the ugly gray backgrounds (#365), but this is a start.
I'm not sure if everything will look the same on all Windows versions,
so this will need a little testing.
Closes#367
When loading the first note of a session in the right-hand pane or when
loading a note in the separate window, if you made a change and then
pressed Undo twice (or maybe only once in some situations), it could
undo to empty (though you could usually Redo to restore it).
Add newly added attachments to a queue, start processing it after five
seconds have passed since the last attachment was added, and process
another every half second after that unless another is added.
This queue won't survive a restart, so the queue should really be in the
DB, but this should avoid problems when adding multiple attachments at
once.
Addresses #1284
Applies to dragging to the collections pane or the items pane, adding
via New Item menu, or saving via the connector server
If the renaming pref is enabled, the PDF is renamed after recognition.
Can be disabled in the preferences
Closes#917
TinyMCE triggers a focus on the window itself, which means that the
window steals focus when an attachment is created even if another Zotero
window is in front. Instead, do a manual focus in the external note
window, which is the one place I could find where we rely on it (though
there might be others).
Do cleanup on 'unload' rather than 'close' (which is limited to a click
on the close button and doesn't get called for win.close()) and clear
the queue after each test.
When Window is accessed from another scope (e.g., ItemTreeView), the
`let` somehow prevents Zotero_RecognizePDF_Dialog from showing up on the
Window object like all the other objects loaded via <script>.
Automatic renaming is now done for dragging of an external file onto an
item (as added in 7cb95f41) as well as dragging as a linked file,
dragging a non-native (not text or HTML) URL, "Attach Link to File…",
"Attach Stored Copy of File…", and "Retrieve Metadata for PDF". It only
applies if a single file is being added and if the parent item has no
non-HTML attachments. By default, the renaming only applies to PDFs, but
this can be changed with the renameAttachmentFiles.automatic.fileTypes
hidden pref.
A new General pref, "Automatically rename attachment files using parent
metadata", controls whether the renaming happens.
Files saved via web translators are renamed regardless of this pref,
because they would often be gibberish otherwise.
Closes#113
Check file-editing access for the group from the API before offering to
reset, update the filesEditable setting properly, and restart the sync
automatically after resetting.
Rather than requiring translators to explicitly set a referrer, as
proposed in #772 and #1375, this simply sets it to the URL where the
save button was triggered. This fixes the Project Euclid example
in #772. It's possible it won't fix all cases, since the translator might
build the URL manually or via an intermediate page, but hopefully it
will fix the majority of cases.
I guess there's a possibility that this would break something that
currently works, but it's hard to imagine a site would block based on
the wrong referrer from the right site and not block on no referrer.
Unlike #1375, this doesn't bother with the referrer for native downloads
(e.g., snapshots or images). The former probably don't need it, and the
latter should probably be switched to use `saveURI()` anyway.
This might also fixzotero/translators#523 (SSRN) if the translator
allowed it.
Closes#1375
In Firefox 52, `FileUtils.getFile()` tries to create the path to the
file even if the path array is empty. (In later versions (maybe in 54,
which we're using on macOS) it only does this if more than one path
component is provided.) We only need the special directory anyway, so we
can just use `getDir()`.
Follow-up to 4bbae6e17
We're now using Zotero.HTTP.request(), which does its own checking for
security errors, so there's no need to do WebDAV-specific checks (though
we could consider checking for Zotero.HTTP.SecurityError and showing
more specific messages, since a self-signed certificate is more likely
in the case of WebDAV).
If a server returns an invalid HTTP response (e.g., Content-Encoding:
gzip with a plaintext body, a.k.a. NS_ERROR_INVALID_CONTENT_ENCODING)
but we can still parse a 4xx or 5xx HTTP response code, use that for the
XHR status, since it might be enough for what we need to do (e.g.,
verify a 404 from a WebDAV server). This fixes a current problem with
Box [1].
Also fix a "msg is not defined" error when the XHR status is 0 but the
SSL connection is fine and include the channel and response status on
the UnexpectedStatusException object (though both of these would now
only happen on an invalid 2xx response, when the XHR status would remain
as 0).
[1] https://forums.zotero.org/discussion/comment/301014/#Comment_301014