Commit graph

7790 commits

Author SHA1 Message Date
Dan Stillman
a8312acfe0
Merge pull request #1420 from mrtcode/recognizer
New PDF recognizer
2018-02-21 13:59:50 -05:00
Dan Stillman
9cb2b8167d Throw actual error if file open fails in md5Async() 2018-02-21 10:22:59 -05:00
Dan Stillman
164fea0cec Updated journal article icon with fixed transparency 2018-02-20 12:19:43 -05:00
Martynas Bagdonas
991a50d090 New PDF recognizer 2018-02-20 09:32:06 +02:00
Dan Stillman
ce0dd5cc5e Update citeproc-js to 1.1.186 2018-02-19 07:23:38 -05:00
Dan Stillman
55b30dd08c Update locales from Transifex and merge new English strings 2018-02-18 16:11:07 -05:00
Dan Stillman
7fed34fa30 Hide Accessed row in attachment box when provided
If, say, a link without an access date is created via an import
2018-02-18 15:24:28 -05:00
Dan Stillman
30b59ebc95 Show full URL in tooltip when hovering over attachment URL 2018-02-18 15:24:08 -05:00
Dan Stillman
2200badef2 Nicer, localized messages for various field-too-long sync errors
Closes #351
Closes #1177
2018-02-18 15:21:13 -05:00
Dan Stillman
63f206c80e Hard-code strings and tweak styling for disabled word processor plugins
This will hopefully be both temporary and rare, so let's not bother
localizing htem.
2018-02-16 06:43:48 -05:00
Adomas Venčkauskas
628bc536a0 Add a button in preferences to enable word plugins if some are disabled 2018-02-16 11:39:48 +02:00
Adomas Venčkauskas
00e52ae62b Improves citation processing speed
Prevents from unnecesarily sending the same citation to citeproc
multiple times
2018-02-15 12:26:50 +02:00
Dan Stillman
bb925723fd Automatically set Referer for external attachment downloads
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 fix zotero/translators#523 (SSRN) if the translator
allowed it.

Closes #1375
2018-02-15 02:13:49 -05:00
Sean Takats
081f6bc77d
New tag selector colors. 2018-02-14 13:59:37 +01:00
Sean Takats
d0aaa7165c
Adds 10 more HiDPI itemType icons. 2018-02-14 11:56:49 +01:00
Sean Takats
a8c19b4d8b
Probably adds HiDPI/Retina icon for thesis. 2018-02-14 09:58:16 +01:00
Dan Stillman
942b8b91f3 Simplify error logging in translator architecture
Hopefully the previous stuff is no longer necessary
2018-02-13 19:26:10 -05:00
Dan Stillman
542584eed3 Make no-results error for search translation available as a property
This allows translation-server to return a specific error code when
there were no results.

Also clarify the debug logging for search translation.
2018-02-13 19:26:10 -05:00
Dan Stillman
4fdfdd341b Fix hang for invalid DOI in translation-server /search 2018-02-13 19:26:10 -05:00
Dan Stillman
a937c99f09 Return "Not Implemented" from server for 501, not "Method Not Implemented" 2018-02-13 19:26:10 -05:00
Dan Stillman
aedd361569 Fix startup error in new PDF code if application directory is read-only
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()`.
2018-02-13 19:26:10 -05:00
Adomas Venčkauskas
e72da417c0 Fix citeproc errors upon first interaction with the doc 2018-02-12 11:35:24 +02:00
Adomas Venčkauskas
8e2c47933a Fix noteIndex not being passed to citeproc. Closes #1439 2018-02-12 10:58:46 +02:00
Adomas Venčkauskas
966c293dea Add a pref to always show doc integration automatic updates option 2018-02-12 10:47:16 +02:00
Dan Stillman
f04a8c3736 Fix "channel is undefined" for invalid HTTP response during WebDAV sync
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).
2018-02-11 01:07:16 -05:00
Dan Stillman
4bbae6e17a Better handling of invalid HTTP responses
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
2018-02-10 22:18:45 -05:00
Dan Stillman
1aade0f268 Fix detection of WebDAV settings changes when clicking Verify Server
onchange() weirdly isn't called when clicking off the textbox to a button

Fixes #1291
2018-02-10 07:29:18 -05:00
Adomas Venčkauskas
9ed1792d9e Fix citation text editor (regression 09ceaa953) 2018-02-09 16:15:12 +02:00
Dan Stillman
e9a3f9b0e0 Show "More Information…" button on WebDAV SSL cert error
(Though the button takes you to to
https://www.zotero.org/support/kb/ssl_certificate_error rather than
https://www.zotero.org/support/kb/incomplete_cert_chain, since the error
comes from Zotero.HTTP.)
2018-02-09 02:39:34 -05:00
Dan Stillman
84d8bb4020 Fix "msg is not defined" on HTTP connection failure 2018-02-09 02:34:52 -05:00
Dan Stillman
ad53b3311e Update locales from Transifex and merge new English strings 2018-02-08 03:23:16 -05:00
Dan Stillman
bd7e1b222d Wait for any DB transactions to finish before starting sync
purgeDataObjects(), which runs at the beginning of the sync process,
uses transactions, and those can fail after the default wait timeout if
there's another active transaction. Instead, check explicitly for
another transaction and, if there is one, display a nice message and
wait for it to finish. This isn't foolproof, but it should reduce the
frequency of "operation timed out" sync errors. (Avoiding all long
transactions would be a better solution.)
2018-02-08 03:06:06 -05:00
Dan Stillman
3f6ecc0021 Fix "Can't queue event outside of a transaction"
If a transaction took over 30 seconds and another transaction timed out
waiting for it, the second transaction would reset the notifier queue,
but if the first transaction then tried to queue an event, it would fail
with this error and roll back. (It would be nice to figure out why
transactions are taking over 30 seconds, though.)
2018-02-08 02:07:44 -05:00
Dan Stillman
80cfd609ea Add sessionID option to translate() that gets passed to the ItemSaver
This will allow the connector to send a sessionID with a save request.
2018-02-07 04:04:37 -05:00
Dan Stillman
c8cf9b9e6f Support for connector-based save target selection
- Updates /saveItems and /saveSnapshot to take a sessionID
- Provides a list of editable collections in the current library
- Adds an /updateSession method that takes a sessionID and updates the
  collection and tags of any items saved via that operation (and changes
  the currently selected collection)

Cross-library changes are not yet supported
2018-02-07 04:04:37 -05:00
Dan Stillman
45ddf9827c Reset PDF tools path for tests in resetDB()
And include path on error when running PDF tool
2018-02-07 04:04:37 -05:00
Dan Stillman
06fb74aafd Use rowid to clean invalid entries from translatorCache
Since in truly weird cases [1] fileName might not exist

https://forums.zotero.org/discussion/comment/300558/#Comment_300558
2018-02-06 23:46:17 -05:00
Adomas Venčkauskas
46854b6b23 Amend comment regarding citationsByIndex keys sort order 2018-02-06 16:08:06 +02:00
Adomas Venčkauskas
4add3ec44c Fix field type changes triggering citation modified prompts 2018-02-06 15:19:08 +02:00
Adomas Venčkauskas
09ceaa953b Fix some more citation update bugs 2018-02-06 15:09:20 +02:00
Adomas Venčkauskas
edc18a4fe4 Remove LibreOffice specific setText() calls (addressed within plugin) 2018-02-05 14:15:51 +02:00
Dan Stillman
38411fb56c Allow dragging parent items to collection if children are selected
This is a simplified version of the fix from #872. Unlike the proposal
in #36, this doesn't require all child items to be selected, since in a
search some children might be grayed out. If the child of an unselected
parent item is included, the drag isn't allowed.

Closes #36
2018-02-03 04:15:09 -05:00
Adomas Venčkauskas
948a4dda64 Fix citation preview citeproc error. Closes #1430 2018-01-31 14:13:32 +02:00
Adomas Venčkauskas
97a045fe0f Fix slow display of citation dialog on first interaction with doc 2018-01-31 12:59:54 +02:00
Dan Stillman
b7a24a58fb Use temp directory for recognizePDFCache.txt 2018-01-31 05:35:13 -05:00
Dan Stillman
31f0f0d210 Fix "Retrieve Metadata for PDF" with bundled PDF tools 2018-01-31 05:34:22 -05:00
Dan Stillman
2d43518ef2 Reduce minimum width of Zotero pane to 670px
We could potentially do more, but this is the narrowest the pane can be
with the left pane collapsed without starting to hide toolbar icons, so
let's try this. (This will still hide the sync icon if the left pane
isn't collapsed.)

Closes #675
Closes #1183
2018-01-30 19:12:05 -05:00
Dan Stillman
e4a399671a Don't show Title in column picker, because hiding it doesn't make sense 2018-01-30 19:11:47 -05:00
Dan Stillman
2219bd9861 Update locales from Transifex 2018-01-29 17:38:56 -05:00
Dan Stillman
eca9d82aa2 Update submodules 2018-01-29 17:22:35 -05:00
Dan Stillman
4a41f219d8 Update citeproc-js to 1.1.183 2018-01-29 17:21:16 -05:00
Dan Stillman
5b46735204 Fix test breakage from d67c654245 2018-01-26 04:24:34 -05:00
Dan Stillman
c5fa1303e3 Prompt to reset local group files on 403 for file attachment upload
And reset modified file attachments when resetting files
2018-01-26 03:37:57 -05:00
Dan Stillman
d67c654245 Add version option to toResponseJSON() 2018-01-26 03:37:57 -05:00
Dan Stillman
3390f2405b Warn about version 0 when saving to sync cache
This should be an error, because the API will never return 0, but most
tests don't currently set the version properly in the response JSON.
2018-01-26 03:37:57 -05:00
Adomas Venčkauskas
d857a813b9 Fix integration test errors. Closes #1426 2018-01-25 12:48:12 +02:00
Adomas Venčkauskas
fe4b75758d Fixes index is not defined error. Closes #1422 2018-01-25 12:39:50 +02:00
Adomas Venčkauskas
2523bca659 Fix slow citation dialog initialization
Report: https://forums.zotero.org/discussion/69929/beta-delay-citation-feature
2018-01-25 12:35:02 +02:00
Adomas Venčkauskas
8544618445 Fix footnote edit crashing in MacWord 2018-01-24 16:00:24 +02:00
Dan Stillman
0bb0912a7b Enable 2x PDF icon 2018-01-24 06:15:23 -05:00
Adomas Venčkauskas
d41c8d6489 Fix an integration error when bibl present without citations 2018-01-22 13:26:43 +02:00
Adomas Venčkauskas
553d2b00d8 Fix 'id must be a positive integer' integration error
Report: https://forums.zotero.org/discussion/comment/298804#Comment_298804
2018-01-22 13:25:11 +02:00
Dan Stillman
2194dff7a4 Fix startup hang if note is null in database 2018-01-19 12:57:57 -05:00
Martynas Bagdonas
5815088586 Fix PDF tools usage in tests 2018-01-18 12:23:27 +02:00
Martynas Bagdonas
77ffc6ad5d Deleted strings that are no longer in use 2018-01-17 13:33:18 +02:00
Martynas Bagdonas
0d5ea8520a Use the bundled PDF tools 2018-01-17 13:33:18 +02:00
Dan Stillman
d662a828d1 Update locales from Transifex and merge new English strings 2018-01-16 13:25:23 -05:00
Dan Stillman
48757f08ff Add missing spinners from 87cf336e2 2018-01-16 12:53:31 -05:00
Dan Stillman
17d4515002 Tweak padding in doc prefs 2018-01-16 12:53:31 -05:00
Dan Stillman
e4cc28ac60 Tweak wording of delayed-citations mode
"Delay citation updates until manual refresh" would be fine in the doc
prefs, but "until manual refresh" is a bit too awkward for the prompt.
Instead, go with @rmzelle's suggestion from #1242 of referring to
"automatic citation updates", and invert the checkbox.
2018-01-16 12:53:12 -05:00
Dan Stillman
cc9efde843 Fix translator architecture hangs on bad JSON in translatorCache 2018-01-16 11:31:34 -05:00
Dan Stillman
2b8311d3d7 Start sync icon spinning before purging data 2018-01-16 09:12:14 -05:00
Dan Stillman
0cd50b5560
Merge pull request #1242 from adomasven/feature/delay-updating-citatations
Refactor integration and delay citation updates
2018-01-16 09:11:21 -05:00
Adomas Venčkauskas
2b27e40308 Refresh citation text upon citation insertion 2018-01-16 14:04:13 +02:00
Adomas Venčkauskas
b985ef8a53 Ensure delayed citation styling is removed upon proper update
Ensure delayed citation styling is removed upon proper update
2018-01-16 14:04:10 +02:00
Dan Stillman
fec3fa2a72 Update locales from Transifex 2018-01-11 20:23:13 -05:00
Dan Stillman
09fc3c2b1c Update submodules 2018-01-11 20:20:32 -05:00
Dan Stillman
7cb95f4129 Automatically rename dragged file attachments from parent metadata
Rename happens if only one file is dragged and the parent item has no
existing file attachments.

Closes #1405
2018-01-10 00:39:47 -05:00
Dan Stillman
ea2feadbff Add spacing between icon and search field in Quick Format window 2018-01-08 01:08:44 -05:00
Dan Stillman
87cf336e22 Cancel active Quick Format search if another one starts
This fixes inconsistent results (#1349) from async searches finishing
out of order.

Also adds spinner when search is active
2018-01-08 01:08:28 -05:00
Dan Stillman
7d41047a9d Blacklist spurious warnings about word processor plugin update manifests 2018-01-08 00:02:47 -05:00
Dan Stillman
3f6ef7fb01 Allow "now" in Accessed field to use current time
Closes #1340
2018-01-05 03:41:08 -05:00
Dan Stillman
5847388862 Add schema update step to remove dc:isReplacedBy relations
These should've all been replaced with dc:replaces relations in a schema
update step, so any that exist were likely synced down from the API
(since fixed) and should be obsolete/redundant.
2018-01-05 02:53:27 -05:00
Dan Stillman
4ac368e052 Add "Publication" to top level of search condition drop-down 2018-01-04 22:59:23 -05:00
Dan Stillman
fdb9e20076 Clear parentKey change marker after save
Fixes #1325, Field editor closes during auto-sync of newly created
parent item
2018-01-04 19:10:41 -05:00
Adomas Venčkauskas
4b78ebcd72 Pause the document update timer during warning dialogs 2018-01-03 14:27:16 +02:00
Adomas Venčkauskas
47744e4ccd Simplify field handling
Don't use field.writeToDoc(), because it prevents from optimizing
libreoffice text writes
2018-01-03 14:27:16 +02:00
Adomas Venčkauskas
2ad0dc00da Add session.getItems in preparation for document collections 2018-01-03 14:27:16 +02:00
Adomas Venčkauskas
f8f403eca4 Display a refresh notice instead of bibliography when citing delayed 2018-01-03 14:27:16 +02:00
Adomas Venčkauskas
2827f70daa Option to delay updating citation in document.
The checkbox in doc prefs is hidden until an update takes 5s or longer
after which the user is prompted to enable delaying.
2018-01-03 14:27:16 +02:00
Adomas Venčkauskas
6d05c3472b Add more integration tests 2018-01-03 14:27:16 +02:00
Adomas Venčkauskas
5805c7e562 Integration refactor megacommit
- Removed obsolete logic for citation.properties.deleted, which is no
  longer set anywhere
- Introduced a bibliography class
- BibliographyEditInterface no longer edits state
- Fields._processFields() now has linear flow because:
- Exception handling for missing items and corrupt fields reworked to be
  handled in relevant Field classes, so that the flow remains linear
- Document modifying functions (i.e. Fields.updateDocument()) now only
  called in Zotero.Integration.Interface functions instead of all over
  the place
- document.setDocPrefs() now called after every execCommand() since
  the cost is trivial, but that simplifies a bunch of logic
- Misc code cleanup

TODO at some point in the future:
- Move Integration.(init/delete)Pipe out
- Decouple references and clarify functions in Integration.Fields and
  Integration.Session
2018-01-03 14:27:16 +02:00
Adomas Venčkauskas
f44d563a15 Add Zotero.Integration.Citation
- Moves a bunch of citation related processing from Integration.Session
- Replaces missing item handling with a function instead of exception
- Solves some really confusing flow issues in _processFields
2018-01-03 14:27:16 +02:00
Adomas Venčkauskas
a1acbd4038 Make current session globally available
Decoupling! Sessions can be instantiated without
Zotero.Integration.Interface
2018-01-03 14:27:16 +02:00
Adomas Venčkauskas
54b4ec6f5c Fix bugs for style-switching and footnote citations 2018-01-03 14:27:16 +02:00
Adomas Venčkauskas
4159c63a3b Refactor CitationEditInterface
This is the first really big change that detangles UI stuff from
directly changing state. io.citation is no longer tied to the citation
loaded in the session in any way and CitationEditInterface does not
write anything to session or document. All writes are handled in
Fields.addEditCitation()
2018-01-03 14:27:16 +02:00
Adomas Venčkauskas
41db61ecb9 Move citation unserialization
Using new es6 class syntax because getters/setters don't
retain `this` context with Zotero.extendClass and we're building
with at least FX45 on every platform now where the syntax is supported
2018-01-03 14:27:16 +02:00
Adomas Venčkauskas
52fd0d992d Add a wrapper class for citation and bibliography fields 2018-01-03 14:27:16 +02:00
Adomas Venčkauskas
41c93ab034 Rename Integration.Document to Integration.Interface 2018-01-03 14:27:16 +02:00
Adomas Venčkauskas
18e4e37b32 Remove integration plugin version checks 2018-01-03 14:27:16 +02:00
Adomas Venčkauskas
430f58d3c4 Moves utilities code away from Zotero.Integration 2018-01-03 14:27:16 +02:00
Dan Stillman
2baa537542 Don't close clicked field when clicking away from changed field
Fixes #1401

The item box badly wants to be redone in React.
2018-01-03 02:33:36 -05:00
Dan Stillman
374eefada1 Additional try/catch to fix NS_ERROR_UNEXPECTED from tree select
Follow-up to 7cd1439928
2018-01-02 20:20:01 -05:00
Dan Stillman
2bc44dddd1 Add attr()/text() to translator sandbox
The current document is automatically used (but can still be provided as
the first argument to avoid accidental bugs during the transition).

Closes #1323
Addresses zotero/translators#1277
2017-12-27 18:26:51 -05:00
Dan Stillman
5350931617 Update locales from Transifex 2017-12-27 17:13:51 -05:00
Dan Stillman
c4fde7ebbf Fix undo in notes to not restore changes from another note
Fixes #1398
2017-12-27 17:13:39 -05:00
Dan Stillman
5fcac10db9 Update locales from Transifex 2017-12-20 21:48:36 -05:00
Dan Stillman
a1c96f1db1 Fix deletion of tags across libraries
https://forums.zotero.org/discussion/comment/296384/#Comment_296384
2017-12-20 21:48:36 -05:00
Dan Stillman
7cd1439928 Hopefully fix intermittently broken items pane
https://forums.zotero.org/discussion/69226/papers-become-invisible-in-the-middle-pane

I can't reproduce this, but it seems like if the tree disappears (due to
a collection change?) while the tree is refreshing, the toggleSelect()
in the rememberSelection() call can fail and break the tree.
2017-12-18 02:55:24 -05:00
Dan Stillman
fa33eb72b2 Fix some UI issues with storage settings
- Enable/disable download mode drop-down for groups separately from user
  library
- Fixing hiding of terms of service message when Zotero storage isn't
  selected
2017-12-18 00:34:55 -05:00
Dan Stillman
6acf208a36 Disable "Check Database Integrity" button while running 2017-12-14 23:49:08 -05:00
Dan Stillman
a85ea18fd9 Update locales from Transifex 2017-12-14 23:31:50 -05:00
Dan Stillman
0ad439395e Log skipped libraries 2017-12-14 23:20:57 -05:00
Dan Stillman
1a46196080 Use numbered placeholders for new localized strings 2017-12-14 02:18:32 -05:00
Dan Stillman
aefeb1f613 Update locales from Transifex 2017-12-13 21:05:01 -05:00
Dan Stillman
05eb3a340c Fix cursor reset while typing in attachment notes
If you started typing just as auto-save was kicking in (i.e., 1 second
after stopping typing), any additional characters could be removed and
the cursor could jump back to the beginning of the note.

Fixes #1336, probably
2017-12-12 03:33:37 -05:00
Dan Stillman
8f5903f5eb Wrap URLs and DOIs in HTML output
Closes #1387
2017-12-11 23:24:43 -05:00
Dan Stillman
9ca40890a9 Update citeproc-js to 1.1.182 2017-12-11 17:34:17 -05:00
Dan Stillman
392687f9ee Tweak a couple font sizes in Sync -> Reset pane 2017-12-11 17:34:01 -05:00
Dan Stillman
341d4f169f Updates locales from Transifex and merge new English strings 2017-12-11 03:58:07 -05:00
Dan Stillman
6051c245b4 Fix auto-focusing of notes in external window 2017-12-11 02:39:22 -05:00
Dan Stillman
dcfaa5521e Don't show note in right-hand pane when editing in separate window
- When a child note is opened in a separate window, the parent window is
  selected. (This used to work but was broken in 5.0.)
- When a top-level note is opened (via double-click), the right-hand pane
  changes to show "Editing in separate window".
- If a note that's currently open in a separate window is clicked on,
  the right-hand pane shows "Editing in a separate window".
- If a note window is closed and the item is selected, the note editor
  reappears in the right-hand pane after the note is saved.

This will avoid unnecessary UI updates and data loss bugs from the two
notes getting out of sync (and is just generally cleaner).

Also:

- General cleanup of note display code
2017-12-11 02:25:05 -05:00
Dan Stillman
b2c9a42103 Prevent Add Item by Identifier button from flashing on textbox click
Nesting the panel in the toolbarbutton seems to cause the button to
appear as if it were clicked on any click/right-click in the textbox,
and I couldn't find a way to prevent that with event.stopPropagation().

Also cleans up this code in general
2017-12-10 23:16:01 -05:00
Dan Stillman
383f8d2219 Fix context-menu paste into Add Item by Identifier
The context menu was triggering onpopuphidden, which was clearing the
textbox.
2017-12-10 17:20:13 -05:00
Dan Stillman
df38f4ded7 Avoid upload retry loops
- Don't try uploading an object more than 5 times
- Don't retry a child item if the parent item failed too
2017-12-10 03:45:08 -05:00
Dan Stillman
c723e1ebe4 Select text in search bar when using Find menu option (or shortcut)
https://forums.zotero.org/discussion/69305
2017-12-10 02:23:39 -05:00
Dan Stillman
f353b7ca61 API-based "Restore to Online Library"
Restores the "Restore to Zotero Server" functionality, now using the
API:

1. Get all remote keys and send `DELETE` for any that don't exist
   locally.
2. Upload all local objects in full (non-patch) mode using only library
   version so that the remotes are overwritten.
3. Reset file sync history, causing all files to be uploaded (or, more
   likely, reassociated with existing remote files).

Since these are treated as regular updates on the server, they'll sync
down to other clients normally. Unsynced changes by other clients might
still trigger conflicts.

This and Reset File Sync History can also now be run on group libraries,
with a library selector in the Reset pane (which I forgot to do with
React).

The full sync option is now removed from the Reset pane, since there
wasn't ever really a reason to run it manually.

We should be able to reimplement Restore from Online Library (#1386)
using the inverse of this approach.

Closes #914
2017-12-08 00:42:03 -05:00
Dan Stillman
885ed6039f Add comment regarding strToDate()'s month handling in retrieveItem() 2017-12-08 00:42:03 -05:00
Dan Stillman
e01cb38c5d Avoid deprecation warning in recognizePDF 2017-12-08 00:42:03 -05:00
Dan Stillman
9a43b53ebe Show file path instead of "(null)" when installing style via file open
And fix deprecation warning from passing an nsIFile

(Also updates the Zotero.Styles.install() documentation to note that the
first parameter's `file` property can be a string path.)
2017-12-08 00:42:03 -05:00
Dan Stillman
045f1fbb7e Add utility functions for building drop-down library lists
A XUL one for the current use in Advanced Search and an HTML one for
future uses. Sets the value to libraryID and adds data attributes for
editable/filesEditable on the HTML one.
2017-12-08 00:42:03 -05:00
Dan Stillman
816fb52b76 Update locales from Transifex 2017-12-03 15:24:42 -05:00
Dan Stillman
4c337e5294 Show friendlier error on setDates() failure during file sync download 2017-12-02 04:14:47 -05:00
Dan Stillman
6941f96a5a Clear Windows read-only attribute when storing file 2017-12-02 04:11:35 -05:00
Dan Stillman
c3df3fcebf Fix "Access is denied" file sync error with read-only files
If the read-only file is set on a file in the 'storage' directory, it's
added to the ZIP for snapshot/WebDAV syncing, and when extracted the
setDates() call was failing. This clears the read-only attribute (and
system and hidden) when extracting all files.
2017-12-02 04:09:52 -05:00
Dan Stillman
2c47b6403d Missed image files for 2x grippy dimples from 640846961a 2017-12-02 01:51:35 -05:00
Dan Stillman
cdaf73b3d0 Fix sync error after resetting read-only group
If an item needed to be erased, it would fail with "Cannot edit item in
read-only library", because the deletion didn't skip the edit check.
2017-12-02 01:35:23 -05:00
Dan Stillman
640846961a 2x grippy dimple 2017-12-01 13:09:06 -05:00
Dan Stillman
fb74fe76b7 Update citeproc-js to 1.1.181 2017-12-01 02:10:05 -05:00
Dan Stillman
b397ee2281 Show sync error about embedded images in notes for attachment notes too 2017-11-30 23:51:36 -05:00
Adomas Venčkauskas
6970556dbd Clone feed items if translation returns no items. Closes #1377 2017-11-30 11:39:34 +02:00
Dan Stillman
9b9af65f8a Don't show Firefox profile access message on empty 'zotero' dir
But maybe do show in cases where it didn't show before, since we were
using exists(), which can return false for inaccessible directories.
2017-11-29 03:57:09 -05:00
Dan Stillman
e2eef779c5 Fix localized sorting of creator types
Don't just rely on "Author" being first
2017-11-29 00:28:05 -05:00
Dan Stillman
76b96a8b07 Fix error selecting item with item type without creator types
https://forums.zotero.org/discussion/69118/
2017-11-29 00:27:27 -05:00
Dan Stillman
45b0c3ab19 Update locales from Transifex 2017-11-27 20:48:24 -05:00
Dan Stillman
575968929c Skip auto-sync on stream notification if library version is up to date
This avoids an extra no-op sync after an upload when the notification
for the change comes back down from the streaming server.
2017-11-27 20:48:24 -05:00
Dan Stillman
baeb846b5c Simplify quick search handling in itemTreeView notify() 2017-11-27 20:48:24 -05:00
Dan Stillman
7bbb4a8e2d Avoid logged deprecation warning in external note editor 2017-11-27 19:56:14 -05:00
Dan Stillman
202192bc72 Restore use of beginUpdateBatch/endUpdateBatch in itemTreeView notify()
Not sure why this was disabled, but it prevents flashing of child items
when a child item is modified.
2017-11-27 19:56:14 -05:00
Dan Stillman
ae21b3113e Avoid unnecessary item map refreshes during sorting 2017-11-27 19:56:14 -05:00
Dan Stillman
a854ce9dce Filter stack in debug output when using debug.stackTrace pref 2017-11-27 19:56:14 -05:00
Dan Stillman
a70a517f7e Don't start transaction to clear search temp table
This might fix loss of item focus when editing a note in a search,
possibly starting with fbf2fbe0c6.
2017-11-27 19:56:14 -05:00
Adomas Venčkauskas
da387874a2 Temporarily restore double text setting in LibreOffice for footnotes
Regressions from 921b21c3. Footnotes in LibreOffice lose styling
2017-11-27 17:24:42 +02:00
Dan Stillman
8241149079 Fix sync error if item with no content type somehow was indexed
https://forums.zotero.org/discussion/68954/mimetype-is-undefined-error

Not sure how this could happen.
2017-11-22 04:22:08 -05:00
Dan Stillman
d45a9c22c5 Merge locales from Transifex 2017-11-22 03:18:32 -05:00
Dan Stillman
dfea8b5a6a Localize "Verify Server" 2017-11-22 03:15:37 -05:00
Dan Stillman
4a6922ba48 Check for lost legacy data directory after migration
The check only does anything if we're using the default location, and
otherwise if we migrate the wrong directory (say, because somebody
opened Standalone 4.0 before upgrading to 5.0) we won't prompt until the
next restart.
2017-11-22 03:15:37 -05:00
Adomas Venčkauskas
921b21c3e1 Remove the additional setText() call for libreoffice plugin
Possible since zotero/zotero-libreoffice-integration@2deea6bd46
2017-11-21 11:36:56 +02:00
Dan Stillman
88a6e4f79f Don't send inPublications=false in 'full' mode for group items 2017-11-20 16:27:45 -05:00
Dan Stillman
f0b7a212e5 Skip migration on error checking whether dataDir is on different drive 2017-11-20 11:38:15 -05:00
Dan Stillman
f546fbda99 Remove ellipses from toolbar button labels 2017-11-19 22:27:46 -05:00
Dan Stillman
d072c6233e Update locales from Transifex 2017-11-19 21:33:18 -05:00
Dan Stillman
10a5d8d02e Check for Firefox profile access at startup and show warning
f40b7ae6ac didn't help with people who've already upgraded, so check at
startup and show a warning if the profile is inaccessible until 1) the
profile has been accessed once or 2) the user checks "Don't show again"
in the warning dialog.

Also fix Zotero.Profile.getDefaultInProfilesDir() to properly throw an
error if it can't access the default directory.
2017-11-17 22:49:57 -05:00
Dan Stillman
f40b7ae6ac Show warning on Firefox profile access error after installation
https://www.zotero.org/support/kb/data_missing_after_zotero_5_upgrade
2017-11-17 09:36:35 -05:00
Adomas Venčkauskas
9bf4bac292 Reduce spacing in collection pane on Linux. Closes #1369
The collections pane height change in bf36a98 made the linux
collection pane vertical spacing very big. This resets it to previous spacing
2017-11-17 13:19:09 +02:00
Dan Stillman
04a730da7f More complete fix for invalid creator row error at startup
Follow-up to 7d3311679e
2017-11-17 02:56:20 -05:00
Dan Stillman
7d3311679e Add creator fix to integrity check, and run at startup if necessary 2017-11-16 06:43:18 -05:00
Dan Stillman
1cb49cc5d3 Fix DB integrity check when there's only one of a given problem 2017-11-16 05:54:59 -05:00
Dan Stillman
810e0a3239 Add Zotero.getStringFromBundle()
The same as Zotero.getString(), but takes an nsIStringBundle as the
first parameter. Extensions could use this to get the same getString()
features with their own properties files.
2017-11-16 01:18:42 -05:00
Dan Stillman
c7fd46e6b4 Don't ignore whitespace when sorting
Intl.Collator's ignorePunctuation ignores whitespace too, so stop using
it, since it produces much weirder results than sorting on punctuation does.
2017-11-16 01:17:24 -05:00
Dan Stillman
20ad57a368 Update submodules 2017-11-12 18:47:32 -05:00
Dan Stillman
cd90cfd388 Update locales from Transifex 2017-11-12 18:46:15 -05:00
Dan Stillman
fbf2fbe0c6 Fix extremely slow tag query with some SQLite databases
Reverts a80f13099, "Avoid temporary table when getting tags for current view",
fixes a couple things, and removes the unused Zotero.Tags.getAllWithinSearch().

Fixes #1290
2017-11-11 04:11:30 -05:00
Adomas Venčkauskas
08eefeaf57 Don't send translator error from connectors reports in private-browsing mode 2017-11-10 14:20:40 +02:00
Dan Stillman
6b031249ac Fix HTTP breakage in bb1cbdff26 2017-11-08 02:18:33 -05:00
Dan Stillman
bb1cbdff26 Fix responseCharset parameter in HTTP methods
Setting `contentCharset` on the channel doesn't seem to work anymore, so
use `overrideMimeType()` instead like we do in the connector. As noted
in the comment, we should probably have a `responseContentType`
parameter instead, since that's what XHR actually allows. For the moment
we just use `text/plain`.
2017-11-07 16:53:14 -05:00
bwiernik
e935001586 Support short DOIs in cleanDOI() and update DOI copyAsURL prefix (#1356) 2017-11-07 16:48:12 -05:00
Adomas Venčkauskas
24507a73f6 Save to current collection from /connectors/savePage.
Closes #1351
2017-11-06 12:57:01 +02:00
Adomas Venčkauskas
8012829992 Ignore translator browserSupport in connectors except bookmarklet
Addresses zotero/zotero-connectors#197
2017-11-06 12:35:30 +02:00
Dan Stillman
16175912ca Update to citeproc-js 1.1.80 2017-11-05 02:23:27 -05:00
Dan Stillman
a3e711b7b5 Fix feed item read shortcut, and delay 1 second before marking as read
This allows keyboard navigation without marking all items in between as
read.
2017-11-03 04:36:42 -04:00
Dan Stillman
c40e321c4b Add 2x version of creator type menu dropboxmarker 2017-11-01 14:41:39 -04:00
Dan Stillman
0f743e55c7 Fix "Rename File from Parent Metadata" if target filename exists
Add a unique numeric suffix to the filename, before any extension
2017-11-01 01:06:20 -04:00
Dan Stillman
14ecf88ad4 Don't return unparsed Mac persistent descriptor from Item.getFilePath()
And auto-convert to path, not filename
2017-10-31 22:04:42 -04:00
Dan Stillman
676ab7852b Fix date parsing from Atom feeds
Use Atom namespace when getting fields, and use `<updated>` date before
`<published>`. (The dates are also available on the nsIFeedContainer
(`feedEntry`), but we're getting them directly from the fields for some
reason.)
2017-10-31 02:21:21 -04:00
Dan Stillman
6150a08dc1 Fix logged error clicking below list in "Choose Libraries…" window 2017-10-30 16:02:36 -04:00
Dan Stillman
33bf3b2e12 Activate "Set Up Syncing" button on context-menu paste or drag and drop 2017-10-27 20:22:33 -04:00
Dan Stillman
196e45c849 Fix file conflict resolution after f0770fa84d
merge.xul now returns an object with .data and .selected instead of
returning .data directly
2017-10-27 04:07:35 -04:00
Dan Stillman
e22d7a8459 Fix some property access issues
- Return `undefined` instead of throwing an error trying to access
  `libraryTypeID` on a Zotero.Feed -- this fixes a test failure with
  the latest Chai, which annoyingly runs inspect() on an object passed
  to .include() regardless of whether the test succeeds
- Make some deprecated properties non-enumerable to avoid unnecessary
  logging when the object is dumped
2017-10-27 03:25:08 -04:00
Dan Stillman
f0770fa84d Fix various conflict resolution bugs
Among other things, when choosing the local side for a conflict, the
remote version could still end up being saved.
2017-10-27 01:08:38 -04:00
Dan Stillman
5901a3c7af Fix possible skipped group download when another group is archived 2017-10-26 19:05:46 -04:00
Dan Stillman
14f40218a9 Fix potential restart error switching to first note of session 2017-10-26 01:23:10 -04:00
Dan Stillman
1deba232fa Fall back to en-US sorting if we can't parse the locale 2017-10-26 00:54:05 -04:00
Dan Stillman
7de192cd3a Update locales from Transifex 2017-10-25 23:55:12 -04:00
Dan Stillman
d08db42f7b Additional debugging for group sync issue
https://forums.zotero.org/discussion/68299/group-library-not-showing-up-report-id-198634382
2017-10-25 23:51:25 -04:00
Dan Stillman
73d88421bb Fix items list problems when adding item with a search entered
When an item is created, an active quick search is cleared, but that's
now an async operation. We weren't waiting for that, which meant that
new items weren't selected and depending on a race condition could even
show the welcome pane despite there being items in the library.
2017-10-25 23:51:13 -04:00
Dan Stillman
1a779bb7aa Fix "item._changed.creators is undefined" error at startup
This could occur if creator indexes needed to be corrected for an item.
2017-10-23 03:21:02 -04:00
Dan Stillman
e35b035224 Separate identifer parsing from Add Item by Identifier and search translation
- Move identifier detection to `Zotero.Utilities.Internal.extractIdentifiers()`
  so that it can be used for things other than Add Item by Identifier
  (e.g., translation-server)
- Add a `Zotero.Translate.Search::setIdentifier()` function that takes an
  identifier object produced by `extractIdentifiers()` (`{ DOI: "10/..." }`),
  converts that to the search format expected by translators, and calls setSearch()
2017-10-21 03:32:28 -04:00
Dan Stillman
4e717a0934 Fix dropmarkers on Linux after 2x upgrades 2017-10-20 18:15:27 -04:00
Dan Stillman
677b2edd51 Throw a proper error if item.relations isn't an object 2017-10-20 17:42:11 -04:00
Dan Stillman
2ecfff6681 Improve idle detection for full-text content processor
It was previously possible for a return-from-idle to not properly stop
active processing.
2017-10-20 04:04:55 -04:00
Dan Stillman
9c5a3ad820 Fixed 2x note column icon size 2017-10-19 02:54:19 -04:00
Dan Stillman
223c427888 Add missing 2x Mac collection/search icons and fix 2x sync icon size 2017-10-18 06:05:51 -04:00
Dan Stillman
30ae61d60e More 2x icon fixes
Follow-up to 5b2af4845b
2017-10-18 04:09:10 -04:00
Dan Stillman
16792df11d Update locales from Transifex 2017-10-17 21:05:15 -04:00
Dan Stillman
5b2af4845b Toolbar button and icon overhaul
- New 2x toolbar button shapes and other icons from @johanneskrtek --
  this HiDPI-ifies basically all graphics other than a few remaining item
  type icons
- Use the Mac search dropmarker for all menu buttons, since it's wider
  and more pleasant. Reduce menu button padding slightly to compensate.
- Better toolbar button state for inactive window and pressed state
- Fix dropmarker overlap in tag selector icon

Closes #347, Better/retina-style OS X toolbar icons
Closes #1339, Create new button PNGs for macOS
2017-10-17 20:53:43 -04:00
Dan Stillman
1f5639da42 Fix #1335, Item drag and drop is unreliable
Regression from e62433edfb

Load a locale file once via nsIConverterInputStream and cache it for
subsequent retrieveLocale() calls. I'm not sure if using a stream
instead of synchronous XHR is actually necessary now that there's
caching, but it can't hurt.
2017-10-09 23:07:47 -04:00
Dan Stillman
68b5ac456f Add note input event debugging via extensions.zotero.debugNoteEvents 2017-10-08 18:00:28 -04:00
Dan Stillman
8f3909713f Save note on forward-delete when text is selected
This doesn't generate a keypress event for some reason, even though it
does when no text is selected.
2017-10-08 17:59:40 -04:00
Dan Stillman
4fb8f44d01 Fix rebuilding of full-text index 2017-10-08 16:58:06 -04:00
Dan Stillman
08d322932d Fix sync error from invalid link mode in database
And add cleanup step to DB integrity check
2017-10-08 04:42:42 -04:00
Dan Stillman
773a93f55d Fix item selection that requires switching to library root
Broken in c7639f328f
2017-10-07 05:05:34 -04:00
Dan Stillman
d4569d3640 Remove unnecessary condition 2017-10-07 03:45:58 -04:00
Dan Stillman
982719bf83 Fix data-dir-not-found error on first run with no legacy dataDir 2017-10-07 03:45:58 -04:00
Dan Stillman
352cf310b4 Update locales from Transifex 2017-10-05 19:00:20 -04:00
Dan Stillman
492e7917b6 Fix breakage in the connector from 365e58249d 2017-10-05 17:18:43 -04:00
Dan Stillman
7d14da3a8c Fix translator test mismatches due to 5.0 tag format 2017-10-05 17:18:43 -04:00
Dan Stillman
ffcf608de1 Don't show "Running handler" for 'debug' handler during translation 2017-10-05 17:18:42 -04:00
Dan Stillman
9209edd081 Use object for translate() in translator tests 2017-10-05 17:18:42 -04:00
Dan Stillman
23cf6bd007 Use new HTTP.processDocuments() in translatorTester 2017-10-05 17:18:42 -04:00
Dan Stillman
d5261841be Allow substrings when filtering translator tests 2017-10-05 17:18:42 -04:00
Dan Stillman
c44af1c7bd Fix import translators in translation-server 2017-10-05 17:18:42 -04:00
Dan Stillman
819be60796 Switch to XMLHttpRequest for processDocuments()
processDocuments() now uses an XHR 'document' request, wrapped to
provide a 'location' property, and uses promises for a simpler call
signature (though the old one will continue to work, for existing
translators). 'done' and 'exception' can now be handled via promises,
and in the translator sandbox an optional noCompleteOnError argument
instructs it not to automatically cancel the translation process with an
error (e.g., for supplementary materials).

Since we do need a hidden browser in some situations (e.g., for saving
snapshots), the old hidden-browser-based processDocuments() is still
available as Zotero.HTTP.loadDocuments().

This hopefully also fixes various problems with document property access
in translation-server.
2017-10-05 17:18:42 -04:00
Dan Stillman
5f9dc05956 Increase size of page logged for invalid PDF download 2017-10-04 21:36:28 -04:00
Dan Stillman
ff798d332b Avoid double item save when adding attachment 2017-10-04 21:35:59 -04:00
Dan Stillman
fcc366a176 Fix #1272, Different-account warning with same username
If you swapped in a database with a different sync account from the
stored one and then opened the prefs, it would update the username to
match the username from the API key, and then when you synced it would
warn you using the new username for both accounts.

This stops the prefs from updating the username in the DB, so it only
happens during a sync.

(This behavior was put in in 77a95b5e6d, I guess so that if you open the
prefs twice before a sync it won't briefly show a missing/outdated
username after the first time, but that's not a big deal.)
2017-10-03 02:02:00 -04:00
Dan Stillman
dc11b37ced Log warning if key not passed to getByLibraryAndKey() 2017-10-01 22:05:40 -04:00
Dan Stillman
531170353b Fix bidirectional relations on Duplicate Item 2017-10-01 22:04:11 -04:00
Dan Stillman
c0143300c4 Fix additional refresh bug when Advanced Search window is open
Follow-up to 89babf8832
2017-10-01 00:23:37 -04:00
Dan Stillman
699d5634e9 Add deprecation warning for itemTreeView::saveSelection() 2017-09-30 23:46:43 -04:00
Dan Stillman
4eb18e5eba Make missing row in itemTreeView::getSelectedItems() non-fatal
This might help avoid the search bar brokenness that people are seeing
(and that we can't reproduce), though the same problem might just cause
a later error.
2017-09-30 23:45:00 -04:00
Dan Stillman
f75d7313dd Update locales from Transifex 2017-09-30 19:33:30 -04:00
Dan Stillman
dec6b864c9 Revert Create Bib/Doc Prefs font size change from db496e13c2
The font size is already controlled by the main font size pref, so this
was just making the font disproportionally bigger.
2017-09-30 19:08:05 -04:00
Dan Stillman
52bbb79fd0 Remove citeproc-prereqs, which isn't necessary anymore 2017-09-30 19:07:29 -04:00
Dan Stillman
e62433edfb Fix citeproc-js in Firefox 56
Our retrieveLocale() implementation was broken by
https://bugzilla.mozilla.org/show_bug.cgi?id=1319111
2017-09-30 04:01:28 -04:00
Dan Stillman
89babf8832 Fix refresh problems when Advanced Search is open, and maybe other times 2017-09-29 04:24:49 -04:00
Dan Stillman
48d4d2d5a5 Standardize connector server behavior for saves to read-only libraries
Return a 500 for read-only libraries for all save modes. Read-only views
within editable libraries will save to the library root.

Addresses #185, RIS/BibTeX interception to read-only view behaves
differently from save button
2017-09-27 17:39:18 -04:00
Adomas Venčkauskas
7a062a7493 Remove connector proxy code
Observing requests, auto-redirecting and learning proxies no longer
relevant on this codebase (and interferes with Scaffold).
2017-09-25 14:57:02 +03:00
Dan Stillman
da21c9c47b Remove old archive.org relations
These aren't allowed by the API and were breaking syncing (and haven't
been exposed anywhere for years anyway).
2017-09-22 16:58:16 -04:00
Adomas Venčkauskas
42e2f229c0 Apply linux tab fixes to all tabs (e.g. tabs in zotero plugins) 2017-09-22 13:10:27 +03:00
Dan Stillman
19447e7b90 Fix RIS/BibTeX import errors when in library root 2017-09-22 04:12:21 -04:00
Dan Stillman
a455a72534 Remove invalid relations mangled during import
Not sure if this occurred for our own translators, but it addresses
items created from #1282.
2017-09-22 01:22:33 -04:00
Dan Stillman
0d3d4323b5 Fix relations import via translators
Fixes #1282
2017-09-22 01:02:50 -04:00
Dan Stillman
10cae22c55 Restrict relation predicates to letters and colons for now 2017-09-22 01:01:52 -04:00
Dan Stillman
241e596680 Update citeproc-js to 1.1.178 2017-09-21 15:47:41 -04:00
Dan Stillman
d81e2a5cf0 Fix sync errors from remote item referencing deleted local collection 2017-09-20 05:33:44 -04:00
Dan Stillman
85d7c01c85 Fix getAsync() integer warning when clicking on related item 2017-09-20 03:36:16 -04:00
Dan Stillman
c7639f328f Fix editing in classic citation window (broken by 2901174ba3)
This is (hopefully) a better fix for selection issues than 2901174ba3. A
reference to the collectionTreeView is stored in a `view` property on
the collectionTreeRow, and when an itemTreeView is initialized and
passed a collectionTreeRow it assigns itself to an `itemTreeView`
property on the row's view.
2017-09-20 03:36:16 -04:00
Dan Stillman
365e58249d Check for invalid certificate in Zotero.HTTP.request()
We were checking for this in the sync API client, but that didn't apply
to Amazon S3 for ZFS.
2017-09-20 00:49:10 -04:00
Dan Stillman
a858368642 Revert "Use eraseTx() instead of erase() when deleting saved search"
eraseTx() isn't actually valid in this context.

This reverts commit 103c16a563.
2017-09-19 23:47:03 -04:00