Commit graph

8069 commits

Author SHA1 Message Date
Dan Stillman
cdda572728 Support additional data from OA PDF lookup service
Handle an array of objects with 'url' and 'version' rather than just an
array of URLs.

Also:

- Don't throw an error from addOpenAccessPDF() if there's an error from
  getOpenAccessPDFURLs()
- Make addPDFFromURLs() a separate function so URL lookup can be done
  separately from download
2018-07-27 00:55:19 -04:00
Adomas Venčkauskas
c3bdf72f35 Misc nodejs environment compatibility 2018-07-25 17:45:06 +03:00
Adomas Venčkauskas
b62b1968cf Change string throws to Error throws (no stack trace with former) 2018-07-25 17:45:06 +03:00
Dan Stillman
2652fac24b Throw translation error on >=400 status code for doGet()/doPost()
Previously the handler would be called even on error pages, which often
meant that an import translator (e.g., BibTeX) would fail to find
anything on the page and the save popup would just close silently. The
popup will now show an error message as soon as the error occurs.
2018-07-23 07:05:44 -04:00
Sylvester Keil
dfe412d448
Remove legacy iterator protocol use in Zotero.DB 2018-07-19 12:21:01 +02:00
Dan Stillman
85667429a8 Fix 2x icon size in Edit Bibliography dialog 2018-07-18 13:15:09 -04:00
Dan Stillman
1f8cf22a35 Delete group files when deleting group
Fixes #1532
2018-07-15 23:09:34 -04:00
Dan Stillman
8390f30be9 Update citeproc-js to 1.1.210 2018-07-15 09:09:23 -04:00
Sylvester Keil
9737a4d974
Initialize Dates in Electron 2018-07-13 14:03:23 +02:00
Adomas Venčkauskas
28535ac64d Throw proper error in Prefs.get(). Use double-quotes in default prefs 2018-07-11 19:35:14 +03:00
Adomas Venčkauskas
856bbf49ab Remove redundant QueryInterface for PrefBranch2 2018-07-11 16:44:04 +03:00
Adomas Venčkauskas
cb8280f0ff Move Zotero.Prefs into its own file 2018-07-11 15:53:46 +03:00
Sylvester Keil
53522c2cbe Add Zotero.File.getResource for local resources
Use `getResource` in Zotero.Date.init (this turns it into a
synchronous function). Zotero.File.getResource makes it easier
to load local files on platforms that do not support the
`resource://` URLs.
2018-07-11 14:08:45 +03:00
Sylvester Keil
06cb9aff98 Prefer use of Services.appinfo 2018-07-11 13:58:41 +03:00
Sylvester Keil
b2a1977d5a Gecko 16 and later sets topic to 'active' 2018-07-11 13:58:41 +03:00
Sylvester Keil
e406ddc54b Prefer Services.jsm getters for common services 2018-07-11 13:58:41 +03:00
Sylvester Keil
3f026239f1 Remove unused methods
`.getAsyncStatement()` and `.executeAsyncStatement()` are not used
anywhere.
2018-07-11 13:58:41 +03:00
Dan Stillman
99a1ac62c7 Fix a couple cases of open item box field changes not being saved
When clicking directly from an open field to the creator delete button
or a creator type in the creator type menu
2018-07-09 14:54:50 +02:00
Dan Stillman
62e403bc55 Limit OA PDF lookup to dev builds 2018-07-07 13:12:33 +02:00
Brenton M. Wiernik
baafd49b8c Update link to import formats documentation (#1525)
The existing destination has never really been the appropriate page for this dialogue, as it has never actual listed the supported formats.
2018-07-04 21:09:45 +02:00
Dan Stillman
da9537c5e4 Mendeley import: Properly handle "Mendeley Ltd." folder with period
At some point Mendeley seems to have changed the default path to the
data directory on Windows to remove the period, and for people with the
old directory we were linking rather than storing attachment files from
"Downloaded".
2018-07-02 01:06:17 +02:00
Adomas Venčkauskas
c1a9735081 Fix citations updating even after user asks for them not to be updated 2018-07-01 14:23:49 +03:00
Dan Stillman
99584dc918 Import base-directory-relative linked files
Zotero RDF contained 'attachments:' paths when files weren't included
but they weren't imported properly
2018-06-30 09:19:09 +02:00
Brenton M. Wiernik
b4ee2fbd98 Add support for bear:// URI protocol (#1520)
https://forums.zotero.org/discussion/comment/310717#Comment_310717
2018-06-29 02:27:19 +02:00
Adomas Venčkauskas
5425c272b2 Update translation-server-v2 dependent files to be commonJS compatible
Also some minor misc changes to translate.js
2018-06-27 17:31:10 +03:00
Dan Stillman
3aefcdf2d9 Mendeley import: Import folders with parentId of 0 instead of -1
Top-level folders should have a parentId of -1, but at least in one user
report there's a folder with 0.
2018-06-27 02:19:00 +02:00
Dan Stillman
f715c02a66 Throw proper error when collection is moved into one of its descendents 2018-06-26 21:06:11 +02:00
Dan Stillman
3c1cdd57d2 Fix error with nested saved searches containing post-search filters
Addresses #1518
2018-06-26 00:48:08 +02:00
Dan Stillman
cbf63f4e72 Skip blank tags when importing from Mendeley 2018-06-24 20:04:37 +02:00
Dan Stillman
7785b8df14 Restore open-access PDF retrieval for Add Item by Identifier
This reverts commit faa310e0f0.
2018-06-20 17:19:39 -04:00
Dan Stillman
faa310e0f0 Temporarily disable Add Item by Identifier open-access PDF retrieval
Not going out in 5.0.52
2018-06-20 17:07:11 -04:00
Dan Stillman
a9cd47dc3f Avoid hang on invalid attachment during import
E.g., if a .pdf is really an HTML file, we try to load it in a hidden
browser (because we properly detect the content type), but then the .pdf
extension causes the hidden browser to launch it via the OS and the
hidden browser never finishes loading it. This adds a 5-second timeout
to abort the process.
2018-06-19 18:26:34 -04:00
Dan Stillman
2d6332212c Make attachment post-process failures non-fatal
This is generally just detecting the character set and/or indexing, so
it's not the end of the world if it fails.
2018-06-19 18:25:53 -04:00
Dan Stillman
2a7f31813e Disable JS in hidden browser when indexing HTML files without a charset
This could cause imports that linked to HTML files to hang, possibly
from network requests that failed.
2018-06-18 20:19:02 -04:00
Dan Stillman
9b9fe098d9 Fix display of error on corrupted DB 2018-06-17 18:08:33 -04:00
Dan Stillman
4554998798 Add Zotero.File.moveToUnique(), replacing Zotero.moveToUnique()
New function takes string paths instead of nsIFile instances
2018-06-17 18:08:03 -04:00
Dan Stillman
f3a62f5a63 Automatically download open-access PDFs via Add Item by Identifier
When the associated-files pref is enabled, Add Item by Identifier uses a
Zotero Unpaywall mirror to find available open-access PDFs. No details
about the contents of searches are logged.
2018-06-16 14:35:44 -04:00
Dan Stillman
72481b072e Clean up extra files from Mendeley imports
Follow-up to cdee741a6
2018-06-16 03:07:46 -04:00
Dan Stillman
cdee741a6d Mendeley import: Fix duplicate PDF copying for PDFs in Downloaded
For each PDF with an associated URL in the Downloaded directory, we were
copying all files in the directory (!) to the attachment's storage
directory. (Zotero imports always have files in separate directories,
and this was a function used to save both single files and HTML
snapshots.)

We'll clean up the extra files in a separate step.
2018-06-16 01:51:37 -04:00
Dan Stillman
0383f104dd Fix "Import into new collection" option when handling importable file 2018-06-14 16:41:33 -04:00
Dan Stillman
d38d55e2b4 Mendeley import: Don't use single transaction 2018-06-13 10:27:26 -04:00
Dan Stillman
5ddbe433b9 Fix Backoff and Retry-After header parsing 2018-06-12 15:17:46 -04:00
Dan Stillman
d4c201fbc0 Correct Mendeley data dir path on Windows 2018-06-12 07:04:32 -04:00
Dan Stillman
d4097d90f6 Update locales from Transifex and merge new English strings 2018-06-12 06:23:57 -04:00
Dan Stillman
e67db436c6 Mendeley import: Add link to support page on encrypted DB
Also localize the name of the collection created during import
2018-06-12 06:16:59 -04:00
Dan Stillman
cfbb3d3d47 Mendeley import: Fix "Collection undefined not found" error
If a folder appeared in the DocumentFolders table but not in
Folders/RemoteFolders, it caused an error.
2018-06-11 12:16:09 -04:00
Dan Stillman
bd5f2525dc Add star tag for favorite items 2018-06-11 09:44:01 -04:00
Dan Stillman
2831e8be3e Mendeley import: Fix "keys is undefined" error
An error would occur if a document existed in RemoteDocuments but not
Documents.
2018-06-10 02:50:52 -04:00
Dan Stillman
8547dedca9 Add debug output for unrecognized Mendeley DB issue 2018-06-09 02:26:12 -04:00
Dan Stillman
46fc28dc16 Remove unused conditional 2018-06-09 02:13:00 -04:00
Dan Stillman
06a819bf34 Fix Import from Clipboard breakage 2018-06-09 02:09:46 -04:00
Dan Stillman
7f64c6803a Update locales from Transifex 2018-06-08 06:21:46 -04:00
Dan Stillman
3c70dee5c1 Create import collection by default if there are non-trash items
Follow-up to 7494e4d88c, which only checked for collections
2018-06-08 05:57:20 -04:00
Dan Stillman
337144a5eb Mendeley import: Reuse existing collections
If "Place imported collections and items into new collection" is
unchecked, previously imported collections will be reused when they're
in the right place in the hierarchy rather than creating new ones.
2018-06-08 04:52:18 -04:00
Dan Stillman
7494e4d88c Don't create import collection by default if no collections in library
If the selected library doesn't have collections, "Place imported
collections and items into new collection" will be unchecked in the
import wizard.
2018-06-08 02:44:13 -04:00
Dan Stillman
2b49e94a61 Fix sync breakage from 78e87a351 2018-06-07 17:18:28 -04:00
Dan Stillman
854cb05883 Mendeley import: Support repeated imports without duplicating items
Existing items are overwritten with new data (or skipped in the case of
file attachments).

Addresses #1451
2018-06-07 06:37:50 -04:00
Dan Stillman
835bdf6941 Merge new English strings 2018-06-06 01:58:09 -04:00
Dan Stillman
d98e89cf26 Add import option for creating a new collection
Use the new wizard for all imports (even if no Mendeley DB), and add a
page with a "Place imported collections and items into new collection"
option. If deselected, collections are added to the library root.
2018-06-05 22:39:23 -04:00
Dan Stillman
4008848c64 Mendeley import: Create imported_url attachments when possible
If there's a single PDF file and a single PDF URL and the file exists,
make an imported_url attachment instead of separate file and linked_url
attachments.

Addresses #1451
2018-06-05 19:57:28 -04:00
Dan Stillman
024b428fe6 Mendeley import: Add "Other…" button for selecting another DB
E.g., for selecting a DB from a backup

Addresses #1451
2018-06-05 19:57:20 -04:00
Dan Stillman
17f2025c53 Fix import into selected library from wizard 2018-06-05 08:39:17 -04:00
Dan Stillman
6ac65373a3 Mendeley import: Look for Downloaded files relative to DB if not found
Addresses #1451
2018-06-05 08:30:14 -04:00
Dan Stillman
2939b3ae95 Merge branch 'mendeley-import' (#1451) 2018-06-05 07:52:12 -04:00
Dan Stillman
0f4e5ef508 Mendeley import
Accept Mendeley SQLite databases via File → Import… and perform a
direct import, including collections, timestamps, notes, attachments,
and extracted annotations.

When a Mendeley database is present, File → Import… shows a wizard that
lets you choose between a file and Mendeley for the source, and choosing
the latter shows a list of available databases in the Mendeley data
directory.

Known fields that aren't valid for a type are stored in Extra.

Files in the Mendeley 'Downloaded' folder are stored. Files elsewhere
are linked.
2018-06-05 07:52:01 -04:00
Dan Stillman
a894404ad3 Update locales from Transifex 2018-06-05 06:18:52 -04:00
Dan Stillman
c5ba2e55f3 Add a debug line before submitting output
This will help clarify whether the person waited to submit or just
submitted while stuff was happening.
2018-06-04 19:58:10 -04:00
Dan Stillman
f7e411d561 Add support for databases in other directories
Previously you could use Zotero.DBConnection to open another database in
the data directory, but not one stored elsewhere in the filesystem. This
allows an absolute path to be passed instead. Various operations
(backups, corrupt DB recovery, pragma commands) are disabled for
external databases.
2018-06-02 04:10:39 -04:00
Dan Stillman
603388c79d Add missing quote to error 2018-06-02 02:27:24 -04:00
Adomas Venčkauskas
547f1c29e3 Integration: Fix non-existent session errors preventing displayError from working 2018-06-01 23:26:24 +03:00
Dan Stillman
9220b2d9c2 Fix inconsequential bug in Zotero.MIME.sniffForMIMEType()
`undefined` was being passed as an argument to slice(), but 0 is the
only offset that's used anyway, and that's what happens if you pass
`undefined`.
2018-05-27 21:23:38 -04:00
Dan Stillman
7271fdf6b7 Add Zotero.Sync.Runner.delayIndefinite()
Delays syncing until the returned function is run
2018-05-27 21:23:38 -04:00
Dan Stillman
86b94ae713 Add optional 'db' parameter to Zotero.DB.tableExists()
To check attached databases
2018-05-27 21:23:38 -04:00
Dan Stillman
52737ec694 Set locking_mode=EXCLUSIVE only for main database in Zotero.DBConnection
Otherwise attached databases are also exclusive
2018-05-27 21:23:38 -04:00
Dan Stillman
6ff51103f5 Make Zotero.ItemFields.getFieldIDFromTypeAndBase() work on non-base fields
This previously returned false if a non-base-mapped field was passed,
even if the field was valid for the given item type. It now returns the
passed field as long as the field is valid for the type, which matches
the behavior for base fields.
2018-05-27 21:23:38 -04:00
Dan Stillman
44fd598699 Load creators if needed to update display title in Items._loadItemData() 2018-05-27 21:23:38 -04:00
Dan Stillman
a714f06670 Use Zotero.warn() for item.setCreator() warning 2018-05-27 21:23:38 -04:00
Dan Stillman
78e87a351c Handle relations property in collection fromJSON() 2018-05-27 21:23:38 -04:00
Dan Stillman
3241faf503 Fix tag saving for intercepted imports from connector
Save tags in intercepted files as automatic tags
2018-05-23 21:16:18 -04:00
Adomas Venčkauskas
2f620c5f91 Fix corrupt bibliography handling. Closes #1503 2018-05-22 13:28:13 +03:00
Dan Stillman
763d7dec75 Allow Link header for translation-server responses via CORS 2018-05-15 21:17:45 -04:00
Dan Stillman
4acd178819 Fix user-agent handling for faked UAs from connector 2018-05-15 20:18:41 -04:00
Adomas Venčkauskas
6960b7f86e Fixes the refresh error after style reinstall. Closes #1500 2018-05-15 14:14:07 +03:00
Dan Stillman
81ab8f7b20 Allow header object instead of just content type in server responses 2018-05-13 04:27:27 -04:00
Dan Stillman
05843bb093 Fix base fields in connectorTypeSchemaData.js 2018-05-10 02:26:44 -04:00
Dan Stillman
5751838a3d Update submodules 2018-05-09 04:20:41 -04:00
Dan Stillman
20dd81729b Update locales from Transifex 2018-05-09 04:18:23 -04:00
Dan Stillman
4a7aad03c4 Fix text() brokenness, and remove change warning fo attr()/text()
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.

Fixes zotero/translators#1647
2018-05-08 20:33:13 -04:00
Dan Stillman
90677ae158 Add tick@2x.png 2018-05-08 19:17:35 -04:00
Adomas Venčkauskas
23224f6093 Fix 'idx is undefined' error in integration missing item handler 2018-05-07 15:23:07 +03:00
Martynas Bagdonas
9165a0247f Fix PMID and arXiv identifiers extraction (#1498) 2018-05-07 06:04:11 -04:00
Dan Stillman
e6dbd1ed92 Add PDF Expert support to zotero://open-pdf
Requested here: https://github.com/jlegewie/zotfile/issues/352#issuecomment-386896327
2018-05-06 14:07:23 -04:00
Dan Stillman
5a85d1ac9e Update citeproc-js to 1.1.206 2018-05-05 03:28:59 -04:00
Dan Stillman
9ebe4037a4 Update locales from Transifex 2018-05-05 02:48:08 -04:00
Dan Stillman
7dbfd5ce29 Remove some extraneous lines in Zotero.OpenPDF 2018-05-05 01:54:49 -04:00
Dan Stillman
609657a8e4 Add zotero://open-pdf handler to open PDF at a given page
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).
2018-05-05 00:55:22 -04:00
Adomas Venčkauskas
5b595122b7 Fix inproper cleanup of legacy API word processor plugins 2018-05-02 09:39:08 +03:00
Dan Stillman
81b876a5b2 Don't prompt to upgrade source version of connector 2018-04-29 20:29:01 -04:00
Dan Stillman
17b4c2e98e Show upgrade prompt for connector pings from below a certain version
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).
2018-04-29 04:53:00 -04:00
Dan Stillman
1649cae956 Update locales from Transifex 2018-04-29 03:54:10 -04:00
Dan Stillman
41590741ba Add level: 0 for libraries in target list for connector 2018-04-27 18:59:11 -04:00
Dan Stillman
a0d85c0673 Don't switch libraries when uneditable in /getSelectedCollection
Follow-up to d0e42a1186
2018-04-27 18:58:12 -04:00
Dan Stillman
d0e42a1186 Automatically switch to My Library on connector save in noneditable view 2018-04-27 18:27:06 -04:00
Dan Stillman
c55b355548 Add "Firefox/[version]" to user agent
Some sites didn't render properly, both in snapshots and in Scaffold,
due to browser sniffing.
2018-04-27 01:38:41 -04:00
Dan Stillman
a4cd45ceb4 Exclude note prefix and suffix when searching
This avoids having "1" match all notes (though really we should be
searching on a plain-text string stored in a separate column).
2018-04-26 02:15:13 -04:00
Dan Stillman
6fb99d2d90 Filter logged server responses
- Limit size to 1500 characters
- Remove collection names in /getSelectedCollection response
2018-04-25 16:02:11 -04:00
Adomas Venčkauskas
6cf11f083b Add a sendToBack connector endpoint for macOS integration window management 2018-04-25 15:42:41 +03:00
Adomas Venčkauskas
ac24ffe636 Always center the integration progress window 2018-04-25 15:42:41 +03:00
Adomas Venčkauskas
aad29a5469 Use XPCOM DOMParser in http integration client to avoid addon conflicts 2018-04-25 15:42:41 +03:00
Adomas Venčkauskas
f69c7d2e2d Fix a http integration client conflict with zotero addons 2018-04-25 14:07:55 +03:00
Adomas Venčkauskas
8b36f33513 Ensure the progress bar is hidden if session initialisation fails 2018-04-24 12:54:08 +03:00
Dan Stillman
e31d706ee4 Date.strToDate: Only check for date.* localized strings in client
Zotero.getString() now exists in the connector, but the expected strings
aren't defined (or needed), so an error is logged.
2018-04-24 05:08:27 -04:00
Dan Stillman
d573a5b639 Merge pull request #1476 from adomasven:feature/connector-doc-integration
Doc Integration Endpoint for the Connector
2018-04-24 01:37:48 -04:00
Adomas Venčkauskas
390b8b2c86 Fix quickformat early dismisal error 2018-04-24 01:37:10 -04:00
Adomas Venčkauskas
387109c1da Don't needlessly regenerate citation IDs 2018-04-24 01:37:10 -04:00
Adomas Venčkauskas
593153eebe Adds a progress bar for non quick-format integration actions
The progress percentage is based on the most recent transaction
(or undeterminate if this is the first session transaction)

Fix undefined function call error
2018-04-24 01:37:10 -04:00
Dan Stillman
1c5e0475f5 Update locales from Transifex 2018-04-23 03:34:07 -04:00
Dan Stillman
33f8fcfafb Fix syncing of saved search changes
Condition changes were only uploaded after every other change + sync
2018-04-22 17:27:33 -04:00
Adomas Venčkauskas
5e5b567782 Add a connector document integration endpoint
Specifically for google docs via the connector, but could potentially be
used for any integration via HTTP or connector.
2018-04-20 13:08:34 +03:00
Dan Stillman
7c093b4fb0 Update locales from Transifex 2018-04-19 04:46:29 -04:00
Martynas Bagdonas
00efd01aaf Ask for description when reporting metadata (#1488) 2018-04-19 04:35:03 -04:00
Dan Stillman
6450d39933 Throw async error from _loadTranslator() 2018-04-19 02:59:41 -04:00
Dan Stillman
3bc08ba10c Change overwritten translator message from error to warning 2018-04-19 02:59:41 -04:00
Martynas Bagdonas
0b4e1f9360 Use the extracted arXiv identifier when recognizing PDF (#1487) 2018-04-19 02:35:20 -04:00
Dan Stillman
b22e496b05 Allow setting CORS allowed origins for translation-server 2018-04-18 16:15:26 -04:00
Dan Stillman
16c2f6602a Update locales from Transifex 2018-04-18 13:42:51 -04:00
Dan Stillman
653343149a Add "arXiv IDs" to Add Item by Identifier text 2018-04-18 13:25:09 -04:00
Martynas Bagdonas
fa0576a4dd Add arXiv identifier support (#1486) 2018-04-18 13:03:10 -04:00
Dan Stillman
bf26c230be Update submodules 2018-04-16 14:58:37 -04:00
Dan Stillman
8474c7b52a Update locales from Transifex 2018-04-16 14:57:00 -04:00
Dan Stillman
3835bc9110 Assign merge-tracking relations properly when merging >2 items
https://forums.zotero.org/discussion/71459/incorrect-document-refresh-after-three-item-merge
2018-04-15 17:05:55 -04:00
Dan Stillman
8853f8ca47 Allow higher local object version during full sync
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.
2018-04-14 16:50:41 -04:00
Dan Stillman
794d3880e7 Set 'control' attribute for item box fields
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
2018-04-14 13:25:31 -04:00
Dan Stillman
0cc3e64b8a Restore proper incompatible DB message
Fixes #1446
2018-04-14 11:38:54 -04:00
Dan Stillman
0e3071576b Show "Export Collection…" if there are items in subcollections
And generate collection context menu asynchronously

Closes #1482
2018-04-14 11:33:16 -04:00
Dan Stillman
460a423df3 Don't let an progress window block shutdown
Closes #1485
2018-04-14 10:28:00 -04:00
Dan Stillman
71f7ec5207 Avoid invalid-field warning for parentItem in fromJSON() after 6f1833f936 2018-04-14 10:27:40 -04:00
Dan Stillman
ce834fc5f3 Don't focus previous row when choosing autocompleted creator
https://forums.zotero.org/discussion/71310/
2018-04-14 10:27:40 -04:00
Frank Bennett
94271325d7 Asyncify Zotero.Relations.getByObject(), called only from item merge. (#1480)
Use getAsync() to acquire subject in Zotero.Relations.getByObject()
2018-04-14 10:26:16 -04:00
Dan Stillman
ceb9749937 Avoid invalid-field warning in Item::fromJSON() after 6f1833f936 2018-04-14 00:06:27 -04:00
Dan Stillman
6f1833f936 Remove items from trash and My Publications when removed via sync
Zotero.Item::fromJSON() wasn't properly accounting for missing 'deleted'
or 'inPublications' properties.
2018-04-13 23:36:59 -04:00
Dan Stillman
4248e59eeb Add log line when trying to drag already-linked collection 2018-04-13 16:12:24 -04:00
Dan Stillman
7da17ab63e Update strings from connector 2018-04-13 16:12:19 -04:00
Dan Stillman
42bbcabdfe Update locales from Transifex 2018-04-13 14:06:02 -04:00
Dan Stillman
ff2e8c9047 Add localizable strings from connector 2018-04-13 13:15:10 -04:00
Adomas Venčkauskas
029c9fc251 Don't refresh citations when citation delaying is enabled via doc prefs 2018-04-12 14:00:28 +03:00
Adomas Venčkauskas
ea8003c541 Fix an invalid variable reference 2018-04-12 14:00:28 +03:00
Dan Stillman
9a304b6699 Better handling of remotely changed items in locally missing collections 2018-04-07 17:04:35 -04:00
Dan Stillman
17f7bcbbad Target selector: Increase recents to 7 2018-04-06 07:36:13 -04:00
Dan Stillman
eeadeaa1b1 Target selector: Fix recents handling 2018-04-06 07:32:24 -04:00
Dan Stillman
222bb5bad4 Target selector: Don't lose recent targets when saving to same target
A target could fill up the list from different sessions, pushing other
recents out.
2018-04-06 04:27:58 -04:00
Adomas Venčkauskas
7d424f6d12 Return notes from /saveItems connector endpoint 2018-04-05 15:27:02 +03:00
Dan Stillman
bddb5ed243 Target selector: Fix moving translated items between certain libraries
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").

Fixes zotero/zotero-connectors#235
2018-04-05 05:41:45 -04:00
Adomas Venčkauskas
ac180c2324 Fix initial integration action requiring a slow citeproc (re)load
(Regression 9c7271c6)
2018-04-04 13:52:33 +03:00
Dan Stillman
d4fce3c855 Update citeproc-js to 1.1.201 2018-04-04 03:34:24 -04:00
Dan Stillman
3b17681db3 Update citeproc-js to 1.1.200 2018-04-03 18:41:40 -04:00
Dan Stillman
13f788f3f1 Update locales from Transifex 2018-04-03 00:10:06 -04:00
Dan Stillman
4f9847da04 Save parent item to correct library when recognizing PDF without DOI 2018-04-02 15:34:22 -04:00
Dan Stillman
a8d199967e Fix crash if item field invalid for new type is open on type change
https://forums.zotero.org/discussion/71200/bug-when-changing-item-type-report-id-607330517
2018-04-01 15:34:44 -04:00
Dan Stillman
8d0dc359b4 Move prefs.js parsing to Zotero.Profile.readPrefsFromFile(prefsFile) 2018-04-01 13:44:10 -04:00
Dan Stillman
7f81e62bc8 Automatically create new data directories for additional profiles
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
2018-04-01 13:36:00 -04:00
Dan Stillman
0b384abe66 Fix DST display bug in Accessed and a few other date fields
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.
2018-04-01 08:17:06 -04:00
Dan Stillman
350b47364e Allow library switching in target selector
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
2018-03-31 08:26:40 -04:00
Dan Stillman
9e955bde99 Add Zotero.Item.prototype.moveToLibrary()
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.
2018-03-31 08:26:36 -04:00
Dan Stillman
bc141ce36b Add .allowsLinkedFiles property to Zotero.Library objects 2018-03-31 08:26:36 -04:00
Dan Stillman
20df18636d Keep track of recent save targets for target selector
Addresses zotero/zotero-connectors#220
2018-03-31 08:25:39 -04:00
Dan Stillman
37e850c67b Reopen targeted collection on window open if closed at save time (macOS) 2018-03-30 01:55:04 -04:00
Dan Stillman
5a08d22dbf Fix attachment save failure on macOS with window closed
Use hiddenDOMWindow if no other window
2018-03-30 01:47:54 -04:00
Dan Stillman
fe5af63277 Update citeproc-js to 1.1.199 2018-03-29 18:27:52 -04:00
Dan Stillman
52c1249523 Fix weird test failure after c5cd38b4a5
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.
2018-03-29 08:29:37 -04:00
Dan Stillman
c5cd38b4a5 Additional comments and cleanup for target selector handler 2018-03-29 07:44:44 -04:00
Dan Stillman
9b9773db16 Skip items in save session that no longer exist
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
2018-03-29 07:44:41 -04:00
Dan Stillman
a4aabd9f3e Don't select items in trash on target selector change
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
2018-03-29 07:44:37 -04:00
Dan Stillman
00d85fb6da Update parent item from target selector if item was made a child item
This is necessary for automatic PDF recognition.

Addresses zotero/zotero-connectors#220
2018-03-29 07:44:25 -04:00
Dan Stillman
0f6b712963 Return proper text for 409 errors from HTTP server 2018-03-29 07:11:35 -04:00
Dan Stillman
46eb84e859 Add Zotero.Item.prototype.parentItem getter 2018-03-29 07:11:15 -04:00
Dan Stillman
38330e4c13 Support target selector sessions for /connector/import 2018-03-28 08:46:13 -04:00
Adomas Venčkauskas
bff7cee374 Add a test case for copied citations (for 9c7271c6) 2018-03-28 14:55:46 +03:00
Adomas Venčkauskas
9c7271c606 Fix citations copied from other documents causing citeproc errors
Might slow down the initial interaction with a document in
automatic updates mode.
2018-03-28 14:42:38 +03:00
Dan Stillman
9ae582e345 Fix non-HiDPI tag swatches when item type image is low-res 2018-03-28 01:24:05 -04:00
Dan Stillman
3c5bc44ddf Fix potential upgrade error from c96363746b
If a related item was defined using both an old userID and the current
one, the schema upgrade step could fail.
2018-03-27 10:42:01 -04:00
Dan Stillman
3db915516a Update locales from Transifex 2018-03-27 10:34:51 -04:00
Dan Stillman
24b9612a56 Force empty storage filenames to '_'
Hopefully fixes https://forums.zotero.org/discussion/71039/sync-error-empty-path-for-item
2018-03-27 10:27:23 -04:00
Adomas Venčkauskas
4e977f91cc Ensure citation fields are properly initialized (regression 3445519) 2018-03-27 12:45:04 +03:00
Adomas Venčkauskas
3445519714 Fix citationByIndex[i].sortedItem errors during citation insertion
Caused by inproper handling of copy-pasted citations in documents
2018-03-26 15:31:26 +03:00
Dan Stillman
32aebd388b Fix upgrade error in c96363746b if no related items 2018-03-26 04:48:32 -04:00
Dan Stillman
c96363746b Fix related-item relations pointing to a previous user account
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.)
2018-03-26 02:12:20 -04:00
Dan Stillman
43692ee564 Use HiDPI icons in related-items box 2018-03-26 02:12:20 -04:00
Martynas Bagdonas
39ed2217cd Return pdfMaxPages to search preferences (#1475) 2018-03-26 02:12:05 -04:00
Dan Stillman
2effad4f6a Add function to delay syncs, and connector server endpoint to trigger it
This will allow the connector to delay syncs while the target selector
window is open, and it can probably be used for imports and other
things.
2018-03-25 05:15:36 -04:00
Adomas Venčkauskas
b9837c690d Fix item URLs not unproxifying when saving from the connector
Regression from zotero/zotero-connectors#b7a0872
2018-03-22 15:36:52 +02:00
Dan Stillman
67b34b1482 Create automatic (not manual) tags when retrieving PDF metadata by ISBN
https://forums.zotero.org/discussion/71003/metadata-problem
2018-03-21 12:58:20 -07:00
Dan Stillman
447659cdab Update locales from Transifex 2018-03-21 09:13:01 -07:00
Dan Stillman
8782eaf507 Merge new English strings 2018-03-20 15:41:46 -07:00
Dan Stillman
dabd7c1055 Update locales from Transifex 2018-03-20 15:31:58 -07:00
Adomas Venčkauskas
3e39cb33d9 Shows original and modified citation in warning prompt. Closes #1468 2018-03-20 11:57:09 +02:00
Dan Stillman
d44cc05c3d Use 1.25dppx for HiDPI icon threshold
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.
2018-03-19 13:46:50 -07:00
Adomas Venčkauskas
a12b997b8a Fix corrupt citation prompt going into recursive loop 2018-03-19 11:37:07 +02:00
Adomas Venčkauskas
8d3e893aec Fix alert not displaying after failed style install 2018-03-19 11:37:07 +02:00
Philipp Zumstein
0bb2bdcbe3 Replace p tag with two line breaks in ZU.cleanTags (#1465) 2018-03-18 23:35:49 -07:00
Adomas Venčkauskas
a659c6c6ff Fix edited citation prompt not displaying (regression 25d8898) 2018-03-17 21:47:36 +02:00
Adomas Venčkauskas
749faabb46 Fix [(j-1)].sorteditems.slice(...)[0] is undefined integration error
Caused by empty citations being present in the document (i.e. without
any cited items and placeholder text like {Citation}).
2018-03-17 21:39:21 +02:00
Martynas Bagdonas
7b8f2e1dfe Use language field returned from recognizer-server 2018-03-16 11:23:41 -07:00
Dan Stillman
cf12f1e9cc Update citeproc-js to 1.1.193 2018-03-15 10:13:41 -07:00
Dan Stillman
da08d7f078 Update locales from Transifex and merge new English strings 2018-03-15 00:23:42 -07:00
Dan Stillman
06e17fd76d "Choose File Handler" -> "Choose Application" for PDF viewer
(And potentially others in the future)
2018-03-15 00:13:04 -07:00
Dan Stillman
d145cff000 Update locales from Transifex and merge new English strings 2018-03-14 10:23:24 -07:00
Adomas Venčkauskas
e3648dfda0 Ensure delayed citation prompt strings are localizable 2018-03-14 19:08:38 +02:00
Adomas Venčkauskas
25d8898ab0 Ensure that document refresh doesn't perform needless text writes 2018-03-14 15:27:10 +02:00
Adomas Venčkauskas
92346c8fb9 Clarify location of refresh button in delayed citation copy 2018-03-14 13:21:22 +02:00
Adomas Venčkauskas
6f6e18b406 Increase citation delay prompt timeout to 15 seconds
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.
2018-03-14 09:22:00 +02:00
Adomas Venčkauskas
6c5aa06d6b Fix integration delayed citations popup timer. Closes #1461 2018-03-12 14:52:46 +02:00
Dan Stillman
c04b85e746 Use all DOI translators for metadata retrieval
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.
2018-03-11 18:16:19 -04:00
Dan Stillman
71bee9cfe7 Update locales from Transifex 2018-03-11 03:01:21 -04:00
Dan Stillman
877ff972a9 Select created items when importing RIS/BibTeX from connector 2018-03-11 01:20:40 -05:00
Dan Stillman
137a0ebbfd Don't delete automatic tags after web translation
Regression from c8cf9b9e6f, probably
2018-03-10 11:18:44 -05:00
Dan Stillman
3dcdd7f2ba Safer fix for external note focus issues
Follow-up to 96e96c0348 and 07efe0304e
2018-03-09 15:15:18 -05:00
Dan Stillman
07efe0304e Fix separate-window button for child notes (broken by 96e96c0348) 2018-03-09 15:01:33 -05:00
Dan Stillman
efe5d8669c Update locales from Transifex 2018-03-09 14:35:41 -05:00
Dan Stillman
96e96c0348 Focus correct note window when multiple note windows are open
Probably broken by dcfaa5521e
2018-03-09 14:26:18 -05:00
Dan Stillman
6745ea9868 Fix multiple-item context menu (broken by 7e3bad7390) 2018-03-09 06:58:46 -05:00
Dan Stillman
6c8cf71c9a Select parent item after metadata retrieval if only PDF was selected
TODO: select all parents
2018-03-09 06:57:43 -05:00
Dan Stillman
16ad422e89 Fix cut-off top line of search bar on Windows 2018-03-09 06:35:22 -05:00
Dan Stillman
da30f9e25c Restore attachment title and filename when undoing Retrieve Metadata 2018-03-09 01:07:57 -05:00
Dan Stillman
f5a2534169 Update locales from Transifex 2018-03-08 22:03:59 -05:00
Dan Stillman
81a75d79be Keep PDF handler menulist the right size 2018-03-08 22:03:59 -05:00
Adomas Venčkauskas
f871da17c8 Don't hide the automatic citation updates option in doc prefs 2018-03-08 22:23:59 +02:00
Dan Stillman
2f7c93a4e6 Merge new English strings 2018-03-08 04:07:01 -05:00
Dan Stillman
23ebdedf48 Allow a day for undo/report for metadata retrieval, not an hour 2018-03-08 04:06:30 -05:00
Dan Stillman
7e3bad7390 "Undo Retrieve Metadata" and "Report Inaccurate Metadata"
New context menu options for items that were recognized in the last day
and that haven't been modified
2018-03-08 03:53:39 -05:00
Adomas Venčkauskas
cc5c17a6e1 Fix embedded items not showing up in the citation dialog.
Regression in 2ad0dc00d, bad fix in 553d2b00. Closes #1448
2018-03-08 10:25:00 +02:00
Dan Stillman
438d9669c1 Fix font size scaling of tag selector tags on macOS and Linux 2018-03-07 22:16:18 -05:00
Dan Stillman
ea569b8b1a Prevent note font size pref from being cut off 2018-03-07 04:52:52 -05:00
Dan Stillman
37eb26df36 Merge new English strings 2018-03-07 04:52:52 -05:00
Dan Stillman
647463cc61 Reorganize file prefs and add UI for choosing PDF handler
- 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
2018-03-07 04:52:51 -05:00
Adomas Venčkauskas
079cb258f4 Fix unloaded citation items being serialized with string IDs 2018-03-06 11:46:49 +02:00
Dan Stillman
b25d99c241 Only show Quick Copy menu option when appropriate 2018-03-06 04:38:45 -05:00
Dan Stillman
c4a64216ce Reduce idle CPU use to ~0%
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
2018-03-06 04:19:01 -05:00
Dan Stillman
da09a3bb96 Allow custom handler for PDF files
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
2018-03-05 19:36:50 -05:00
Dan Stillman
f6926ccda6 Additional debugging lines for connector sessions 2018-03-05 18:10:17 -05:00
Dan Stillman
de4aa4c240 Update locales from Transifex 2018-03-05 18:08:22 -05:00
Dan Stillman
23bbb5a1e5 Make atob() available in translator sandbox
Addresses zotero/translators#1576
2018-03-05 18:08:22 -05:00
Dan Stillman
87efe75e24 Fix blue toolbar background on Windows with DWM compositor
Applies to Windows 7 with Aero effects and later Windows versions
2018-03-05 17:18:12 -05:00
Adomas Venčkauskas
381351b433 Fix an error being logged when window to activate is gone on Linux 2018-03-05 14:28:07 +02:00
Adomas Venčkauskas
13766e1f6c Show delayed citations checkbox in doc prefs dialog after initialization
Closes #1458
2018-03-05 14:26:57 +02:00
Adomas Venčkauskas
5a1cf3ab02 Fix dead integration field object function calls 2018-03-05 13:46:59 +02:00
Dan Stillman
3f905be77e Reduce delayed-citations timeout to 3 seconds
5 seconds is too long
2018-03-05 02:16:55 -05:00
Dan Stillman
44632e2218 Make the Windows UI somewhat less unpleasant
- 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
2018-03-02 20:28:51 -05:00
Dan Stillman
724329d948 Prevent Undo from clearing existing note
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).
2018-03-01 22:41:33 -05:00
Dan Stillman
bf122add81 Remove special handling of Cmd-Shift-Z in notes
No longer relevant in standalone app
2018-03-01 22:41:33 -05:00