Commit graph

7806 commits

Author SHA1 Message Date
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
Dan Stillman
1f320e1f5d Be more lenient about Extra field values than citeproc-js
Allow fields like "Original Date: 2018" and convert them to
"original-date: 2018" when sending to citeproc-js.

For reference:

http://citeproc-js.readthedocs.io/en/latest/csl-json/markup.html#cheater-syntax-for-odd-fields
2018-03-01 17:05:24 -05:00
Dan Stillman
e1e5178869 Shorten auto-renaming pref
So we now have autoRecognizeFiles and autoRenameFiles.
2018-03-01 04:09:17 -05:00
Dan Stillman
6e4d6a2820 Disable background full-text processing during tests 2018-03-01 03:45:58 -05:00
Dan Stillman
7e290b262c Fix bug in 97661539dc 2018-03-01 03:04:25 -05:00
Dan Stillman
0d4fd26be9 Merge new English string 2018-03-01 02:03:00 -05:00
Dan Stillman
00b2823612 Avoid repeating line in Zotero.Fulltext.indexItems() 2018-03-01 01:28:28 -05:00
Dan Stillman
b50b055e44 Wait for DB transaction to end before indexing string
This might help avoid timeouts during indexing.

Addresses #1284
2018-03-01 01:28:28 -05:00
Dan Stillman
1cfc90186f Serialize attachment indexing
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
2018-03-01 01:28:28 -05:00
Dan Stillman
26dcaad76a Don't show Reindex button for files that aren't PDFs or text files 2018-03-01 01:28:28 -05:00
Dan Stillman
97661539dc Automatically retrieve metadata when saving PDFs
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
2018-03-01 01:28:28 -05:00
Dan Stillman
081793f72f Disable auto_focus for TinyMCE
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).
2018-03-01 01:20:29 -05:00
Dan Stillman
3cc92fe1e9 Fix PDF recognition within collection (broken by f8b41c971c) 2018-03-01 01:20:29 -05:00
Dan Stillman
f99038fd37 Fix recognizer dialog with multiple tests
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.
2018-03-01 01:20:29 -05:00
Dan Stillman
757709cf43 Fix auto-rename after PDF recognition (wrong pref in f8b41c971) 2018-03-01 01:20:29 -05:00
Dan Stillman
da49f9900f Add 'window' getter to CollectionTreeView and ItemTreeView 2018-03-01 01:20:29 -05:00
Dan Stillman
aff2bef3f5 Fix scope of Zotero_RecognizePDF_Dialog
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>.
2018-03-01 01:19:30 -05:00
Dan Stillman
153ed728cb Update citeproc-js to 1.1.190 2018-02-28 04:31:22 -05:00
Dan Stillman
e03ecfae98 Update locales from Transifex and merge new English strings 2018-02-28 02:52:52 -05:00
Dan Stillman
1d367f0165 Fix await->yield in f8b41c971 2018-02-27 19:24:28 -05:00
Dan Stillman
f8b41c971c Automatic attachment file renaming changes
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
2018-02-27 18:45:03 -05:00
Dan Stillman
68879a0ffc Replace some nsIWindowMediator getService() calls with Services.wm 2018-02-27 18:44:51 -05:00
Dan Stillman
b0d9a9c82e Don't use hidden browser to download images 2018-02-27 16:05:35 -05:00
Dan Stillman
f5b1ee44f3 Add Zotero.File.rename() (extracted from Zotero.Item::renameAttachmentFile()) 2018-02-27 14:24:26 -05:00
Dan Stillman
c0b63e5928 Better handling of 403 for attachment metadata upload
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.
2018-02-23 17:59:32 -05:00
Dan Stillman
5ed10c6ba2 Make Esc in PDF recognizer window close rather than minimize if done 2018-02-23 02:38:01 -05:00
Dan Stillman
7c64666167 Use separate subdomain for recognizer requests for now 2018-02-22 02:01:05 -05:00
Dan Stillman
c28c8c820b Improved PDF recognizer and 1x PDF icons 2018-02-22 01:04:11 -05:00
Dan Stillman
3fbb4633a6 Update locales from Transifex and merge new English strings 2018-02-22 01:04:07 -05:00
Dan Stillman
9ce9502b76 Tweak recognizer strings 2018-02-22 01:04:00 -05:00
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