Commit graph

7649 commits

Author SHA1 Message Date
Dan Stillman
2e50d37ebb Translator tester: reduce defer delay from 20s to 5s
This seems like it would be sufficient for most tests that need to wait
for a page to load and is much less annoying in Scaffold. We could
adjust for automated runs if those end up using a browser again.
2020-05-15 19:21:40 -04:00
Dan Stillman
4068dffc0f Scaffold: Use loadDocuments() for tests and honor defer: true
Previously, while updating a test used loadDocuments() (for a real
browser load) and honored `defer: true`, running a test did not.

This updates Zotero_TranslatorTester to use loadDocuments() when run in
Zotero. In other environments (translation-server, connector), it will
continue to use processDocuments(), which is based on XHR.

Fixes zotero/scaffold#96
2020-05-15 19:21:40 -04:00
Dan Stillman
0341b8e99a HTTP.loadDocuments(): Create cookie sandbox automatically if not provided
This prevents use of the internal cookie store.
2020-05-15 19:21:40 -04:00
Adomas Venčkauskas
d0db9cbadf Attempt to catch/log initialization errors for the citation dialog 2020-05-15 10:30:40 +03:00
Dan Stillman
6d2e843f50 Fix "params.join is not a function" in DB.queryAsync() error logging
If a query failed and `params` wasn't an array, the "params.join is not
a function" would be thrown rather than a proper error.
2020-05-12 03:50:43 -04:00
Dan Stillman
0199428c57 Fix error migrating Extra with empty author in citeproc-js cheater syntax
E.g., `{:author: }`

https://forums.zotero.org/discussion/83070/error-report-id-n-a-there-was-an-error-starting-zotero
2020-05-12 01:00:21 -04:00
Dan Stillman
849d52f1bb Update submodules 2020-05-09 03:20:53 -04:00
Dan Stillman
ac19cbbc40 Fix tag selector not showing child item tags in "Title, Creator, Year" mode
Regression from 5.0.83. This reverts 4290f26d7c.

https://forums.zotero.org/discussion/82564/tag-management
2020-05-03 20:07:14 -04:00
Dan Stillman
cece56af79 Warn when data directory is in Google Drive or OneDrive
In addition to Dropbox

There might be others we should add. (E.g., can we detect when
Desktop/Documents is in iCloud on a Mac?)

Closes #1373
2020-04-29 04:42:42 -04:00
Dan Stillman
7c3faeb58d Don't allow setting data dir to 'storage' or linked attachment base dir
If 'storage' (with a zotero.sqlite file above it) is chosen, offer to
use parent instead.

Addresses #538
2020-04-29 04:42:42 -04:00
Dan Stillman
40fe85b274 Prevent setting base directory within data directory
Addresses #538
2020-04-29 04:42:42 -04:00
Adomas Venčkauskas
30d40d6094 Add some temporary logging for Mac users getting empty citation dialog
https://forums.zotero.org/discussion/82697/empty-citation-dialog-after-clicking-add-edit-citation-on-an-existing-citation
2020-04-23 11:40:16 +03:00
Dan Stillman
2c046a227b Fix sync error on collection/search conflict
> Invalid data error for collection [key] in [library]: Unknown
> collection property 'dateAdded'"

Regression from 4b60c6ca27, probably
2020-04-23 03:56:14 -04:00
Dan Stillman
f531ac7b60 Fix error dialog display if attachment couldn't be renamed
Regression from 56dcd6da26 (2016)
2020-04-22 00:13:52 -04:00
Dan Stillman
53a1722a69 Throw explicit error if no type in itemFromCSLJSON() 2020-04-22 00:11:12 -04:00
Dan Stillman
81e2bee452 Fix 'false' filename after case-only rename on Macs
Zotero.File.move() now forces `overwrite` if the old and new filenames
differ only by case, since otherwise on a case-insensitive filesystem
OS.File.move() does an existence check and thinks that the target file
exists.
2020-04-22 00:01:28 -04:00
Dan Stillman
595ba396ef Fix invalid relations from copying invalid feed item to collection
Prior to fdfa8052d1, it was possible to create an item in a feed
library using Add Item by Identifier. If you did that, and then copied
it to a collection in your personal library, it would somehow end up
with an owl:sameAs relation to a `/users/local` URI (probably because
the URI functions don't work properly on a feed library).

This will clean up such relations in a schema update.
2020-04-17 05:42:21 -04:00
Dan Stillman
fdfa8052d1 Disable toolbar buttons properly in read-only views
Most importantly, don't allow Add Item by Identifier to create an item
in a feed library...

The other buttons didn't do anything but still showed an effect on
mousedown, which this prevents.
2020-04-17 03:07:25 -04:00
Dan Stillman
e406e04f5c Resolve schemaUpdatePromise even if repository returns 500 at startup
If repo.zotero.org returned a 500 during Zotero startup, translators and
styles wouldn't be initialized until a 200 was returned, and various
things that depended on translators or styles wouldn't work in the
meantime. Now a single retry is made after 5 seconds, and if that fails
the promise is resolved regardless.

Regression from dc60e5f840, which added automatic 5xx retrying to
Zotero.HTTP.request()
2020-04-17 02:11:27 -04:00
Dan Stillman
ad13313924 Don't change existing sync cache object on 'unchanged' response
Previously, if an object was uploaded but the API returned 'unchanged',
the uploaded data would be written to the sync cache, which, given that
most requests are patch requests, could result in an empty or mostly
empty object being saved to the sync cache. That would cause the next
sync to treat most/all local fields as changed and either upload them
unnecessarily or trigger a conflict instead of merging changes
automatically.
2020-04-14 05:07:50 -04:00
Dan Stillman
083588e211 Save correct data to cache when merging non-conflicting sync changes
When non-conflicting changes were automatically merged, the local object
would be correctly marked as unsynced, but the merged object rather than
the remote object would be saved to the sync cache. When the object was
then uploaded, it matched the cache version exactly, so an empty patch
object (other than an unchanged dateModified, which is always included)
would be uploaded and the local change wouldn't make it to the server.
The empty patch would result in an 'unchanged' response, which would
cause the empty patch object to be saved to the sync cache (which is a
bug that I'll fix separately). If the local object was modified again,
the patch would include all fields (since the cache object was empty)
and the local change would be uploaded, but there could also be
unnecessary conflicts due to it looking like all local fields had been
modified.

This patch causes the remote object to be saved to the sync cache
instead, so the local change looks like a local edit and is correctly
uploaded.
2020-04-13 03:42:28 -04:00
Dan Stillman
617564982c Include only related-item relations when duplicating items
Don't include linked-object or replaced-item relations. Previously, if
you duplicated an item, modified it to represent a different source, and
dragged it to another library where you had already copied the original
item, the new item wouldn't be transferred.

https://forums.zotero.org/discussion/comment/353246/#Comment_353246
2020-04-13 01:31:21 -04:00
Dan Stillman
c5a4871a6a Set freshwater-science to capitalize the first word of subtitles
https://forums.zotero.org/discussion/comment/352212/#Comment_352212
2020-04-13 01:31:06 -04:00
Dan Stillman
3d3c90215d Fix situation where all items list columns can become enabled 2020-04-10 15:56:37 -04:00
Dan Stillman
8a0e81d6f6 Properly require integrity check on nested collection detection
When expanding to a collection reveals an infinite loop

Bug in 0679809735
2020-04-09 02:17:37 -04:00
Dan Stillman
90b393ed79 Fix Shift-drag/Cmd-drag to tag selector to remove tags
Apparently we implemented this 5 years ago in #873 and then broke it
(with the move to React, I think) without ever announcing it as a new
feature in Zotero 5? Anyway, this restores it, using Cmd on macOS (the
same as for moving vs copying items, or files in Finder).
2020-04-08 03:58:10 -04:00
Dan Stillman
5bb2486040 Fix Shift-Tab in Title and Extra fields
Fixes #1806
2020-04-07 04:04:37 -04:00
Dan Stillman
ffa2a8d9be Don't crash when clicking on a note link with an unknown scheme 2020-04-06 04:52:37 -04:00
Dan Stillman
e9ea9ae171 Leave Event Place and Publisher Place in Extra on import
These CSL variables are both currently mapped to the Zotero Place field,
but that's imprecise and will change:

https://github.com/citation-style-language/zotero-bits/issues/6

So for now, don't convert these to a Place line or make them eligible
for migration to a real field (once we turn that on).

https://groups.google.com/d/msgid/zotero-dev/806a22e3-3d6a-4d86-8747-10c787291a93%40googlegroups.com
2020-04-04 04:17:51 -04:00
Dan Stillman
0e3d707576 Remove a couple redundant lines in Extra on RDF import
`publicationTitle`/`reporter` (and fields mapped to `publicationTitle`)
and `meetingName`/`conferenceName`

I assume these should just be base-field mappings, but since they're
not, they're not automatically deduplicated in `fromJSON()` and need to
be handled separately.

https://groups.google.com/d/msgid/zotero-dev/806a22e3-3d6a-4d86-8747-10c787291a93%40googlegroups.com
2020-04-04 04:17:27 -04:00
Dan Stillman
91ca6d2ba6 extraToCSL(): Fix "zoteroField[1] is undefined" on single-character field
E.g., "a:" on a line

https://forums.zotero.org/discussion/82286/new-line-in-extra-field-induces-error-during-bibliography-generation
2020-04-03 18:13:10 -04:00
Dan Stillman
c22b6ae68a Fix crash dragging open tag selector if closed at startup 2020-03-28 23:50:30 -04:00
Dan Stillman
97767278fb Load all item data types before migrating Extra fields on schema update
https://forums.zotero.org/discussion/82153/beta-startup-error
2020-03-27 02:00:28 -04:00
Dan Stillman
17d6181507 fromJSON(): Fix bug in 02c5510710 2020-03-24 18:25:53 -04:00
Dan Stillman
ad9604e267 Don't use 'dialog=no' or 'modal' for preferences window
Since at least 2009, for reasons unclear, we've used `dialog=no` when
`instantApply` is true (macOS/Linux) and `modal` (with implicit
`dialog=yes`) when false (Windows). `dialog=no` doesn't seem to have an
effect on macOS, and `modal` doesn't seem to have an effect on Windows
(at least with `openDialog()`), but on Linux `dialog=no` allows the
dialog to be resized, which it shouldn't be, and causes problems with a
tiling window manager. This change switches to the implicit `dialog=yes`
on all platforms. (On Linux, this also centers the dialog on the screen,
keeps it in front of other windows, and does a weird opening animation.)

https://forums.zotero.org/discussion/82050/zotero-preferences-window-issue-with-tiling-window-managers
2020-03-24 17:38:14 -04:00
Dan Stillman
0f212bdd76 Use modal dialog for import wizard and queue notifier updates
This should dramatically improve import speed for large imports by
delaying UI updates until the import finishes.

Additional Zotero.Attachments methods now support `saveOptions` to
support `notifierQueue`.
2020-03-24 16:02:17 -04:00
Dan Stillman
c62e725e2a Embed ids directly in Tags.getAllWithin() SQL to avoid parameter limit 2020-03-24 14:50:31 -04:00
Dan Stillman
679148d8d6 Don't store "Version Number" in Extra for books coming from RDF
The RDF translator assigns 'versionNumber' in addition to 'edition'.
2020-03-24 14:48:09 -04:00
Dan Stillman
02c5510710 Item.fromJSON(): Skip warnings for redundant invalid fields 2020-03-24 14:47:23 -04:00
Dan Stillman
0b7f5fef83 Re-enable Extra field migration on schema update 2020-03-24 14:13:21 -04:00
Dan Stillman
c03b9c2733 Leave ignored 'type:' in Extra (regression from 52d5b6856) 2020-03-23 19:06:49 -04:00
Dan Stillman
0278810cb5 Fix radioBroadcast/tvBroadcast CSL-JSON round-trip after 52d5b68564
'podcast' is now the first mapped type for 'broadcast', per
https://forums.zotero.org/discussion/comment/351113/#Comment_351113, so
we need to check for fields not available in 'podcast'. 'radioBroadcast'
will be converted to 'tvBroadcast' on re-import, but that was the case
before.
2020-03-23 17:22:45 -04:00
Dan Stillman
48e39d9bd8 Update submodules 2020-03-23 16:25:48 -04:00
Dan Stillman
52d5b68564 Update 'type:' handling when migrating Extra lines
- When changing type based on 'type:' line, move existing fields that
  are no longer valid to Extra
- Remove 'type:' line with CSL type if the item's existing type is one
  of the types mapped to it
2020-03-22 15:19:24 -04:00
Dan Stillman
9d330206ed Remove unnecessary part of 58c2e38ec2
getAllAddons() waits for extensions to be initialized, so the code in
Prefs::loadExtensionDefaults() to delete an extensions.json with an
AppTranslocation path should be sufficient, and it shouldn't be
necessary to check for it after showing the AppTranslocation startup
error.
2020-03-21 00:56:55 -04:00
Dan Stillman
58c2e38ec2 Fix invalid integration plugin installations on macOS
If a Mac user first starts Zotero from the disk image, Zotero
shows an error telling them to install the app in Applications, but the
integration plugins will have already be registered in extensions.json
with paths to the temporary AppTranslocation directory. This meant that
the next time the user restarted their computer (or sooner), the AppTranslocation
directory would be cleared and the integration plugins would no longer
be loaded.

This deletes extensions.json if it contains an AppTranslocation path for
an extension when the app is started from the disk image, which should
prevent this going forward. For existing users experiencing this, it
also checks installed extensions at startup for AppTranslocation paths
and deletes extensions.json if any appear.
2020-03-20 16:18:02 -04:00
Dan Stillman
e6453b2088 Parse single tab-delimited creator
And fix logged error when adding empty creator with just whitespace
2020-03-19 10:24:03 -04:00
Dan Stillman
c26ffedf9f Disable Extra field migration on schema upgrade for now
I enabled this by mistake in 3129f3580
2020-03-18 18:00:57 -04:00
Dan Stillman
8cd04e5d91 Temporarily disable the fix from 3247391914
Disable this until we figure out why it was running when migrating from
Extra.
2020-03-17 22:16:00 -04:00
Dan Stillman
3f2998bb6b Don't extract 'type: note' or 'type: attachment' from Extra 2020-03-17 13:50:45 -04:00
Dan Stillman
3247391914 Fix removal of creators when changing to item type without creators
This shouldn't actually be used currently, since only notes and
attachments lack creators and it shouldn't be possible to change regular
items into notes or attachments.
2020-03-17 13:14:58 -04:00
Dan Stillman
c4aad9a041 Better logging for Extra migration 2020-03-17 11:57:18 -04:00
Dan Stillman
dd9ec54c3b Don't try to migrate Extra fields in read-only libraries 2020-03-15 19:52:56 -04:00
Dan Stillman
23c936f016 Fix creator migration from Extra 2020-03-15 13:51:04 -04:00
Dan Stillman
982bcff357 Don't log "Unknown browser" for requests from Safari App Extension 2020-03-14 18:18:45 -04:00
Dan Stillman
c3e390eb5a Fix more breakage in 067980973 2020-03-14 03:29:56 -04:00
Dan Stillman
ad6c3f7a09 Fix test failures due to rapid attachment note initialization
81739c7a66 prevented new windows from working after a restart error,
and full-text tests (and possibly others) create attachments quickly in
a way that was causing init callbacks to receive a TinyMCE editor with
missing functions (possibly because they were already removed?). This
just ignores those errors, which isn't a great solution, but it probably
won't happen in real use, so let's see if it works.
2020-03-14 02:46:47 -04:00
Dan Stillman
440b65935e Fix breakage in 067980973 2020-03-13 22:06:10 -04:00
Dan Stillman
0679809735 Fix invalid collection nesting in DB integrity check
It shouldn't be possible to nest two collections inside each other, but
if it happens, fix it in the integrity check.

Also detect it from CollectionTreeView::expandToCollection() (used when
showing the collections containing an item) and crash Zotero with a flag
to run an integrity check after restart. Previously, this would result
in an infinite loop.

This may be the cause of some of the collection disappearances people
have reported. If parentCollectionID never leads to a null, the
collection won't appear anywhere in the tree.

TODO:

- Figure out how this is happening
- Detect and fix it automatically for people it's happened to
2020-03-13 18:07:20 -04:00
Dan Stillman
81739c7a66 Add Zotero.crash() to show restart message in every window 2020-03-13 17:47:01 -04:00
Dan Stillman
9175f9ade8 Don't use "Create Bib" locale for Quick Copy when no explicit locale set
If you'd never set a Quick Copy locale, the option would show as using
the current locale, but Quick Copy itself would use the last locale from
"Create Bibliography from Items". That was a side effect of behavior we
put in place in 2015 so that documents created before 4.0.27 that relied
on the removed bibliographyLocale pref would continue using the migrated
locale, but now that we've had an explicit locale option for years in
the document preferences I think we can stop doing that.
2020-03-13 17:06:29 -04:00
Dan Stillman
3129f35804 Limit HTTP status override to certain invalid HTTP responses
Only NS_ERROR_INVALID_CONTENT_ENCODING for now

For example, it shouldn't swap in a 403 on
NS_ERROR_PROXY_CONNECTION_REFUSED, as it was doing previously.

https://forums.zotero.org/discussion/81864/syncing-error
2020-03-11 08:53:13 -04:00
Dan Stillman
b0de59fe89 Fix OPML import (regression from 5.0.78) 2020-03-09 22:46:03 -04:00
Dan Stillman
2acec4184a Use process id instead of bundle identifier to activate Mac app
This prevents a second copy of Zotero from being launched if you're
running the Zotero beta and click on a word processor plugin button
while a dialog is already open.
2020-03-09 20:17:09 -04:00
Dan Stillman
6e38c36804 Don't update Extra field if missing in fromJSON()
Harmless regression from recent changes
2020-03-09 01:19:52 -04:00
Dan Stillman
d389a71280 Download remotely updated files in "as needed" file sync mode
Previously, files updated remotely wouldn't be downloaded in "as needed"
mode if a copy of the file already existed locally and could only be
re-downloaded by deleting the file via Show File.

This causes remotely modified files that exist locally to be downloaded
at sync time, even in "as needed" mode, by marking them as
"force_download". While this might not be ideal for people who use "as
needed" to limit data transfer, it's better for people who use it simply
to limit local storage, and ending up with an outdated file while
offline seems worse than a little bit of extra data transfer.

In the future, we'll likely also provide ways to explicitly download and
remove files, so keeping chosen files in sync makes sense.

Files modified remotely before this change (which were marked as
"to_download" instead of "force_download") won't be downloaded as sync
time in "as needed" mode, but they'll now be re-downloaded on open.

Fixes #1322
2020-03-09 01:19:52 -04:00
Dan Stillman
76a1535a60 Full-text indexing improvements
- Use full-text cache file from syncing if available when reindexing via
  info pane or Rebuild Index → Index Unindexed Items. Only discard it for
  full index rebuild. This allows Index Unindexed Items to be used to
  force immediate processing of queued content from syncing and avoids
  unnecessary syncing back of identical content. Previously, the cache
  file was used for a manual index only when the local file didn't exist.
- When rebuilding index, don't clear indexed items with missing local
  file that are missing stats due to a pre-411180ef bug.
- indexItems() now takes an 'options' object as its second parameter
- Minor code cleanup
2020-03-09 01:19:52 -04:00
Dan Stillman
411180ef83 Full-text indexing fixes
- Don't clear item's index stats (and show "Unknown") when an item is
  reindexed remotely and the content matches the local content
- Always update an item's state and its stats in the same query, to
  avoid incorrect feedback immediately after indexing
- Clean up `setItemContent()` tests
2020-03-06 03:11:16 -05:00
Dan Stillman
2645f0de12 Fix "extra is null" error (also fixed via API) 2020-03-03 00:23:38 -05:00
Dan Stillman
da5e8c549e Convert Zotero fields in Extra to CSL fields for citeproc-js 2020-03-02 01:38:10 -05:00
Dan Stillman
83cc65eea6 Fix parsing of CSL date fields in extractExtraField() 2020-03-02 01:34:27 -05:00
Dan Stillman
691d0ca9d1 Allow saved searches to be edited or deleted on error
E.g., "too many SQL variables"

Fixes #1734
2020-02-29 16:38:13 -05:00
Dan Stillman
8170cf09de Fix Editor sorting with >1 editor
Follow-up to eec0f00784
2020-02-26 14:45:48 -05:00
Dan Stillman
b7901ec8dc Add "English (Canada)" to locales menu
en-CA is now a valid locale after zotero-standalone-build@46f3da068
(though the use of ISO date strings is the only difference).
2020-02-23 21:35:56 -05:00
Dan Stillman
a9dee2f487 Item::fromJSON(): Remove invalid-for-type Type-mapped fields
"Type: [val]` in Extra means Item Type to citeproc-js, and Type values
from translators mostly aren't going to be useful if the item type
doesn't have a Type-mapped field.

https://forums.zotero.org/discussion/comment/348864/#Comment_348864
2020-02-17 11:39:35 -05:00
Dan Stillman
b2bf60e1d7 Item.fromJSON(): Dedupe invalid-for-type fields when storing in Extra
3de54455f6 removed redundant base-mapped fields when a valid-for-type
field was also set, but that still left duplicate fields in Extra when a
valid field wasn't set. This will happen until translators (most notably
Embedded Metadata) are fixed to stop setting redundant fields.

https://forums.zotero.org/discussion/81262/translator-error-sage-lots-of-extra-data-in-extra
2020-02-17 00:22:34 -05:00
Dan Stillman
b41734924d Further fixing of "Too many sync requests" error
Follow-up to 804a898c98

Addresses #1788
2020-02-16 18:05:45 -05:00
Tom Najdek
8f1acad2d8 Allow session history in a hidden browser
Allows loaded pages to use window.history object without triggering
NS_ERROR_FAILURE
2020-02-16 13:33:09 -05:00
Dan Stillman
804a898c98 Hopefully fix "Too many sync requests" after file upload 412
Addresses #1788
2020-02-16 13:06:49 -05:00
Dan Stillman
5c95d4e0ba Additional logging for "Item collection not found" error in toJSON() 2020-02-16 12:43:46 -05:00
Dan Stillman
a53f363b8d Additional fix for search crash with includeParentsAndChildren
Follow-up to 76081ab05
2020-02-11 13:09:54 -05:00
Adomas Venčkauskas
1db3fc0b49 Fix a benign citation dialog error when pressing ESC to quit 2020-02-11 15:24:41 +02:00
Adomas Venčkauskas
43a38d31a7 Fix locator strings (p123) not working when editing a citation with items present 2020-02-11 15:24:41 +02:00
Dan Stillman
76081ab05f Fix crash when search uses no-op condition and includeParentsAndChildren
E.g., a nonexistent saved search
2020-02-11 00:23:45 -05:00
Dan Stillman
61684d8899 Fix missing bottom border of toolbar on Windows 2020-02-10 22:24:27 -05:00
Dan Stillman
2a804d5d4a Fix zotero://open-pdf links on Windows if no handler is set in registry 2020-02-09 14:07:11 -05:00
Dan Stillman
4290f26d7c Don't search child items in "Title, Creator, Year" mode
They can't match, so there's no need to include them. This should speed
up "Title, Creator, Year" searches.
2020-02-05 09:27:06 -05:00
Adomas Venčkauskas
8fd83795e8 Remove MacWord plugin IPC pipe initialization
Moved to MacWord plugin codebase:
zotero/zotero-word-for-mac-integration#6adf8a7
2020-02-05 16:23:14 +02:00
Dan Stillman
86a5c46b1e Find Available PDF: Don't mark URLs that redirect as tried
https://forums.zotero.org/discussion/81182
2020-02-02 23:47:40 -05:00
Dan Stillman
eec0f00784 Fix sorting by editor in Creator column (since 5.0.78) 2020-01-29 13:39:59 -05:00
Dan Stillman
851af7f45b Don't save library catalog from translation if not valid for item type
Fixes #1781
2020-01-28 20:20:07 -05:00
Dan Stillman
4e11c7927d Don't skip creator lines in Extra in fromJSON
Regression in 3de54455f6
2020-01-27 22:01:25 -05:00
Adomas Venčkauskas
39d7f22981 Fix some drag and drop issue in the citation dialog
See https://forums.zotero.org/discussion/81063/beta-rearranging-citations-in-quick-citation-window
2020-01-27 11:54:22 +02:00
Dan Stillman
48741100a5 Don't try to pull retractions list from server at startup during tests
This causes problems with filtered test runs, since the request is
cancelled and the long response gets dumped to the console, making the
test result hard to find.
2020-01-26 03:29:23 -05:00
Dan Stillman
3de54455f6 Automatically save unknown/invalid fields to Extra in non-strict mode
This is a prerequisite for starting to use new fields in translators,
since otherwise switching from, say, storing originalDate in Extra to
using an originalDate field would cause the value to be lost in clients
without the newer schema.

Closes #1504
2020-01-26 03:29:23 -05:00
Dan Stillman
9ff88bdf6c Enable Norwegian Bokmål 2020-01-18 11:46:05 -05:00
Adomas Venčkauskas
23550f2951 More citation dialog locator fixes
Both typing 123 and typing p.123 adds the locator to the most
recently added node
2020-01-16 11:51:40 +02:00
Adomas Venčkauskas
75465e9096 Some more locator input and locking improvements when citations are resorted
See #1776
2020-01-16 11:40:18 +02:00
Adomas Venčkauskas
c70c07bb2e Fix a citation dialog error when the dialog contents are cleared 2020-01-16 11:07:42 +02:00
Adomas Venčkauskas
09dead3a2a Fix more ways that citation dialog textcursor can end up inside bubbles
See 5a1e3296, 5fa97957
2020-01-16 10:58:28 +02:00
Adomas Venčkauskas
c6961b26e4 Improve citation dialog locator experience with locator locking. Closes #1776 2020-01-16 10:35:09 +02:00
Adomas Venčkauskas
70d0dc8e14 Restore ability to type page numbers after search terms to set locator
Regression in 7c1845b3. Closes #1774
2020-01-13 13:22:45 +02:00
Dan Stillman
1a790c0c3f Update submodules 2020-01-06 16:04:57 -05:00
Dan Stillman
857c42c40b Allow additional characters in URL scheme for attachments/launchURL()
https://forums.zotero.org/discussion/comment/345977/#Comment_345977
2020-01-06 15:47:57 -05:00
Philipp Zumstein
066ec123d0 Update newWeb.js 2020-01-06 15:12:18 -05:00
Adomas Venčkauskas
7c1845b3af Citation dialog search improvements. Closes #1770. Closes #1499
Allows "p123" in addition to ":123" and "p.123" when specifying
the locator;
Allows searches with numbers only.
2020-01-06 14:23:41 +02:00
Adomas Venčkauskas
51792ba242 Fixes citation dialog locator string not working. Closes #1771
Regression in 5a1e329
2020-01-06 14:23:41 +02:00
Dan Stillman
3d2afa9c7f Additional adjustments to URL handling
Follow-up to df40ee7216

- Restore opening of non-HTTP URL schemes in link attachments
- Remove scheme whitelist for link attachments, since it's not enforced
  via the API anyway and we prompt before an external application is
  opened. Instead, just block a few schemes (e.g., 'javascript') from
  launching.

TODO:

- Provide some way to change/reset an application association if the
  user checks the box to automatically open that scheme.
- Show an error message if a link attachment with an invalid URL is
  double-clicked
2020-01-04 02:30:12 -05:00
Dan Stillman
8172f00941 Fix loading of reports and timelines
Regression from df40ee72
2020-01-04 02:29:52 -05:00
Dan Stillman
b9d5c33993 Allow setting a cookie sandbox for Zotero.Utilities.Internal.saveURI()
This isn't used or tested.
2020-01-04 02:29:52 -05:00
Dan Stillman
6070743ff0 Fix Nextcloud WebDAV syncing
Add Zotero.HTTP.CookieBlocker mechanism to block storing and sending
of all cookies for a given URL prefix, and use that for the configured
WebDAV URL.

https://forums.zotero.org/discussion/80429/sync-error-in-5-0-80
2020-01-04 02:29:52 -05:00
Dan Stillman
8c8140e74e Fix hiding of password in WebDAV error messages and debug output 2020-01-02 05:04:02 -05:00
Dan Stillman
d9be6c3ce2 Update login manager corruption error message for Fx60 files 2020-01-02 01:13:16 -05:00
Dan Stillman
bc7b2cb3d5 Fix extension installation failure message
And fix logged error when starting an extension installation

https://groups.google.com/d/topic/zotero-dev/rP42v7OF9N0/discussion
2020-01-01 23:22:12 -05:00
Adomas Venčkauskas
5fa979575e Fix quick format bubble drag-and-drop (see 5a1e3296) 2019-12-31 11:35:13 +02:00
Dan Stillman
991e542888 Fix broken autocomplete popup when editing a saved search
https://forums.zotero.org/discussion/comment/345646/#Comment_345646

This is probably the actual fix for what I was trying to fix in
360f034b5, and I couldn't reproduce it because it was about saved
searches.
2019-12-30 02:39:10 -05:00
Adomas Venčkauskas
5a1e329618 Fix being unable to place the cursor in between bubbles in the citation dialog
Regression in Fx60
2019-12-23 13:25:02 +02:00
Dan Stillman
0b9f463b9f Fix parsing of 'yesterday'/'today'/'tomorrow' in access date field
Regression from 5.0.78
2019-12-23 03:10:43 -05:00
Dan Stillman
9c380c362a Hopefully fix 503 from NextCloud (since 5.0.78)
https://forums.zotero.org/discussion/comment/344790/#Comment_344790
2019-12-22 16:32:36 -05:00
Dan Stillman
8fe33dc91c Fix loading of compressed global schema from DB on downgrade 2019-12-21 05:09:01 -05:00
Dan Stillman
f5d544bc15 Generate label if type/field name isn't available in global schema
E.g., show "Foo Bar" for field fooBar if not available

This could happen after downgrading if the global schema couldn't be
read from the DB for some reason.
2019-12-21 05:09:01 -05:00
Dan Stillman
fda5df9a82 Fix display of editors in Creator column in new databases
Regression in 5.0.78
2019-12-21 05:09:01 -05:00
Dan Stillman
85a3f03002 Fix display of pre-1000 dates in Year column and Quick Format
And avoid "0000" in Year column if date value but unparsed year
2019-12-19 03:23:51 -05:00
Dan Stillman
b7dc0d8b0a Fix parsing of pre-1000 years
If a leading zero (e.g., '068'), parse as actual year instead of
19xx/20xx.
2019-12-19 02:15:36 -05:00
Dan Stillman
6963016c91 Fixes #1761, Repeating of autocompleted tags
Regression in 5.0.78
2019-12-19 01:36:20 -05:00
Dan Stillman
df40ee7216 Adjust URL launching behavior
- Support launching plausible HTTP URLs without schemes from
  Zotero.loadURI(), and use that when launching from URL field
- Show correct cursor feedback on URL label -- only show pointer if the
  URL is launchable
- Don't launch non-HTTP URLs (e.g., zotero://) from URL field
- Don't open HTTP URLs in viewer when using ZoteroPane.launchURI()
2019-12-16 14:56:06 -05:00
Dan Stillman
537aa15842 Fix "Report Errors…" button in Utilities.Internal.errorPrompt() prompt
E.g., the button in an unknown WebDAV error dialog
2019-12-16 14:56:06 -05:00
Adomas Venčkauskas
88c4cd1a09 Doc integration: fix a rtf wrapper being added to html output 2019-12-11 10:44:24 +02:00
Dan Stillman
d2e14cfff4 Fix autocomplete in Advanced Search
Since 5.0.78
2019-12-10 23:34:16 -07:00
Dan Stillman
bbbd02444b Restore 'yesterday'/'today'/'tomorrow' parsing for dates in searches
Follow-up to a549a64de9, which removed it from strToDate()
2019-12-06 03:12:48 -07:00
Dan Stillman
c67e29adc7 Fx60: Fix text links in About pane and preferences 2019-12-05 17:58:47 -07:00
Dan Stillman
6b7b57da3c Remove accidentally committed files from 4077428b4 2019-12-04 02:56:42 -07:00
Dan Stillman
87c3ef6aca Fx60: Fix CSL 0.8 style import 2019-12-04 01:27:12 -07:00
Dan Stillman
381c5fc8d8 Adjust spacing of libraries-to-sync checkmark on Linux
Follow-up to 6af5732fca
2019-12-03 15:55:41 -07:00
Dan Stillman
6af5732fca Fix checkmark in libraries-to-sync window on Windows
And switch to Unicode green checkmark and red prohibited characters on
all platforms, which fixes #1675.

The treecol checkmark stopped working on Windows in Fx60.
2019-12-03 15:33:31 -07:00
Dan Stillman
f7d895ab52 Fix database after direct upgrade from Zotero 4 to 5.0.78-79 2019-12-03 14:03:22 -07:00
Dan Stillman
d9edf2965a Add IF EXISTS to DROP statements in schema update steps
https://forums.zotero.org/discussion/80291/zotero-standalone-wont-open-database-upgrade-error
2019-12-02 12:22:46 -07:00
Dan Stillman
222870d3c7 Don't update item type menus within transaction when updating schema
This caused an error reported here, though I can't reproduce it:

https://forums.zotero.org/discussion/80287/zotero-database-upgrade-error
2019-12-02 04:39:19 -07:00
Dan Stillman
61cebbd8f7 Fix display of a couple WebDAV verification errors
"spec is undefined"

Fixes #1745
2019-12-01 03:39:54 -07:00
Dan Stillman
4077428b4e Update locales from Transifex 2019-12-01 01:42:53 -07:00
Dan Stillman
76f1f9cae6 Use standard context menu in HTML input boxes
This fixes the context menu for text fields in the new React-based tags
box.
2019-11-30 00:43:42 -07:00
Dan Stillman
0fb9548326 Fix tags box context menu 2019-11-29 23:28:23 -07:00
Dan Stillman
fbb54a7621 Fix "string is undefined" export error
Regression from a549a64de9
2019-11-29 01:50:43 -07:00
Dan Stillman
4d7062fc43 Remove Zotero.Utilities.Internal.normalize()
It no longer works in Fx60, and String.prototype.normalize() has been
available since 2014, so that should just be used instead.
2019-11-26 23:18:17 -07:00
Dan Stillman
8c7677a009 Fix out-of-memory error syncing collections nested inside each other
It shouldn't be possible for collections to be nested this way, if it
happens, it shouldn't result in an infinite loop.

This removes one of the parent assignments at sync time.
2019-11-26 15:30:43 -07:00
Dan Stillman
8417ad7c80 Add extensions.zotero.reopenPanesOnRestart hidden pref
Closes #1752
2019-11-21 23:51:37 -07:00
Dan Stillman
98a0699f85 Properly disable React tags box in read-only mode 2019-11-15 04:06:21 -05:00
Dan Stillman
cc3f994207 Fix crash when clicking off an open tag to another item
Regression in React tags box
2019-11-13 05:33:16 -05:00
Dan Stillman
5ba5e70b9d Fix overflow issues in React tags box
- Properly truncate and ellipsize long tags
- Show scrollbar if tags go off the bottom of the pane

These both improve on the pre-React version, which didn't properly
truncate tags (at least in the current version, though I think it used
to) and scrolled the Add button off the top of the screen.
2019-11-13 05:31:12 -05:00
Dan Stillman
3e3e0b016d Move "Manage Attachments" to the Tools menu 2019-11-12 18:36:16 -05:00
Dan Stillman
a549a64de9 Remove 'yesterday'/'today'/'tomorrow' parsing from strToDate()
I don't think this ever should've been here. It was added in 2010 but
then added to itembox.xml a couple weeks later in d500b50e2, since
that's where the conversion should happen.

Closes #1749
2019-11-12 02:13:05 -05:00
Dan Stillman
b0eb048bce Fix New Item menu when tag pane is focused
Regression from 5791ffeb1
2019-11-12 01:37:57 -05:00
Dan Stillman
18d7e833c9 Fix open-in-library button in citation dialogs 2019-11-10 16:15:34 -05:00
Dan Stillman
ba92d244aa Add some missing license notices 2019-11-08 06:41:06 -05:00
Dan Stillman
5791ffeb16 Reactify item tags box
Improvements:

- Fixes autocomplete text remaining in field after selection in Fx60
- No more text or icon shifting on select (tested on macOS)

Changes:

- Tags are now selected on mousedown with no active state, as in web
  library

Regressions:

- Tooltip with tag type doesn't appear when hovering over icon
- Pressing Tab after modifying a tag loses focus
- Right-click in textbox shows custom menu instead of default text
  editing context menu (Cut/Copy/Paste)

To-do:

- Switch to this version for note tags box
- Style colored tags in autocomplete drop-down? Sort to top?
- Only show delete button on row hover, as in web library?
2019-11-08 06:41:06 -05:00
Dan Stillman
046637d76b Rename tag selector JSX files
Might as well stick to camel case for filenames
2019-11-08 06:41:06 -05:00
Adomas Venčkauskas
427044dfd2 Fixes UI artifacts in the progress window on macOS
This went unnoticed because the progress window is only ever displayed
in the Google Docs integration
2019-11-07 13:58:18 +02:00
Dan Stillman
6db1fbd13f Fix handling of app downgrade to lower global schema version 2019-10-28 06:12:10 -04:00
Dan Stillman
d96fe03fa2 Restart after migrating legacy locale prefs
DTDs are loaded based on the initial state of `intl.locale.requested`,
so if `intl.locale.matchOS` was false, we need to restart after
migrating that to keep part of the UI from being in the wrong locale.
(Before zotero/zotero-standalone-build@ced8a0fa63, it would've been
English. After it would probably be the OS locale.)

https://forums.zotero.org/discussion/79673/zotero-5-0-77-beta-has-no-localization-anymore
2019-10-27 03:49:48 -04:00
Dan Stillman
1a66f5e518 More locale detection fixes for Firefox 60
`intl.regional_prefs.use_os_locales` isn't actually equivalent to
`intl.locale.matchOS` -- an empty string for `intl.locale.requested` is,
and that's set by calling `setRequestedLocales(null)`.

Mozilla documentation:

https://firefox-source-docs.mozilla.org/intl/locale.html
2019-10-27 03:10:48 -04:00
Dan Stillman
7ebbc7a0ab Fx60: Fix "Set Up Syncing" link in intro pane 2019-10-27 03:04:41 -04:00
Dan Stillman
84c7c2f1d6
Merge pull request #1744 from bwiernik/extraToCSL-fix
Add 'type' to variables list for extraToCSL
2019-10-26 17:05:33 -04:00
Dan Stillman
c25fbe7c1c Remove all colored tags on selected items if 0 is pressed
Like Thunderbird
2019-10-26 16:45:04 -04:00
Dan Stillman
e64273fb93 Remove libraryID parameter from Zotero.Tags.toggleItemsListTags()
No longer used
2019-10-26 16:45:04 -04:00
Dan Stillman
d8b5f30504 Fix number key assignment of colored tag without any items
Fixes #1464
2019-10-26 16:44:55 -04:00
Brenton M. Wiernik
9f5e95a054 Add 'type' to variables list for
So that it can be stored in Extra as "Type:" instead of "type:"

Replaces https://github.com/zotero/zotero/pull/1688
2019-10-26 13:31:02 -04:00
Dan Stillman
e7d0e282e7 Fix some locale detection bugs after 513f7d6555
- When upgrading from Fx52, don't show "Automatic" for
  a manually selected locale.
- Make sure Zotero.locale is always set to a known language tag
- Fix inconsistencies between Zotero.Locale.availableLocales and
  chrome.manifest
2019-10-26 01:27:14 -04:00
Dan Stillman
5779b60418 Update new item type MRU menu for global schema
And fix a Zotero 5 regression in which the MRU menu wasn't updated when
changing the item type after using the new-item keyboard shortcut
2019-10-25 15:22:54 -04:00
Dan Stillman
c3fd958ed7 Fix keyboard shortcuts
Regression from 54b268fe01
2019-10-25 15:18:28 -04:00
Dan Stillman
d8508415b9 Update French locale 'issue' search condition hack for global schema 2019-10-25 13:43:29 -04:00
Dan Stillman
742d7793d1 Fx60: Fix keyboard handling in items list
nsIDOMWindowUtils::sendKeyEvent() was removed
2019-10-24 14:57:09 -04:00
Dan Stillman
ba15c2b53e Fx60: Mostly fix autocomplete
There's still a bug when autocompleting tags where the value remains in
the new text field.
2019-10-24 04:45:45 -04:00
Dan Stillman
81b1adcfd9 Restore reopening of closed collection and item panes on startup
When we added the View menu pane options in 3aeef69ad3, we removed
automatic reopening of the panes on startup, since the View menu is more
discoverable than the narrow collapsed splitters. Unfortunately we're
now getting many reports of people not knowing where their panes are.
It turns out the View menu pane options in 5.0.76 are actually broken,
so it's not a great test, but enough people are doing this by accident
and enough of them don't seem to be finding the View menu options
(broken or otherwise) that I think it's better to return to reopening
the panes. We can always add a hidden pref to change that behavior, but
no one has complained in years, so it's probably not necessary.
2019-10-24 01:44:47 -04:00
Dan Stillman
52fd91950d Fix deleted item fields reappearing on sync
This was a regression from 4b60c6ca27. The original plan for introducing
new fields was to have them save to the sync cache even if they weren't
supported by the current Zotero version and process them on upgrade, and
so I changed `DataObjectUtilities.patch()` to omit fields that didn't
exist locally when patching the sync cache JSON so they wouldn't be
wiped on the server. That caused this bug where locally deleted fields
were restored on every sync. It's also no longer necessary now that
we decided to just reject unknown fields from saving, so we can just
revert to the previous behavior of blanking out locally missing fields
(with the tweak that fields that are already false or empty in the base
version can be omitted).
2019-10-24 01:22:00 -04:00
Dan Stillman
513f7d6555 Fx60: Fix localization
Also fixes #1690 (at least on Catalina), and possibly other things

general.useragent.locale and intl.locale.matchOS are no longer used.
2019-10-23 19:08:13 -04:00
Dan Stillman
0061ffeb56 Fix Collection Pane and Item Pane toggles in View → Layout 2019-10-23 18:16:43 -04:00
Dan Stillman
df69f99d19 Force Lucida Grande in Quick Format dialog
Follow-up to 86d924df9e

See zotero/zotero-standalone-build@ed5d5efcc for details.
2019-10-21 23:00:19 -04:00
Dan Stillman
d4f682aa88 Merge branch 'fx60' 2019-10-21 21:44:01 -04:00
Dan Stillman
956813ac1f Fix "err is undefined" on 200 response for nonexistent WebDAV file
Fixes #1741
2019-10-20 15:03:18 -04:00
Dan Stillman
dee902c32c Fx60: Remove built_in_addons.json
Moved to zotero-standalone-build in
zotero/zotero-standalone-build@6bab158ea
2019-10-19 15:49:27 -04:00
Dan Stillman
944ff3485d File-not-found dialog improvements
- Include file path
- Show separate message for linked files mentioning Linked Attachment
  Base Directory
- Link to separate support page for linked files
2019-10-18 23:33:40 -04:00
Dan Stillman
eef25677bf Skip invalid on-demand download attempt if not yet synced
This could happen if an account was set up for syncing but Zotero was
pointed at a new DB and then you double-clicked on a missing attachment.
2019-10-18 18:08:42 -04:00
Dan Stillman
1710eb1c4b Don't store unknown/invalid fields in Extra in non-strict mode
And fix a couple things for if we turn it back on

This code came along with the type/field handling overhaul, but I think
it was originally intended for handling unknown fields during sync
before we decided on strict mode, so it wasn't finished and causes
various problems [1]. It could still be useful for preserving fields
from translators before they're available on items, but the better fix
there is just to add the missing fields, so I'm not sure if we'll end up
needing it.

[1] https://groups.google.com/d/msg/zotero-dev/a1IPUJ2m_3s/hfmdK2P3BwAJ
2019-10-18 03:37:24 -04:00
Adomas Venčkauskas
5913c53509 Proper fix to citation dialog artefacting on macOS. Closes #1720 2019-10-14 13:06:17 +03:00
Adomas Venčkauskas
a7ddb09615 Fix quick format reference panel extra space on Windows 2019-10-14 11:55:15 +03:00
Adomas Venčkauskas
371cef4035 Fx60: Fix quick format dialog artefacting on macOS. Closes #1720 2019-10-14 11:53:21 +03:00
Dan Stillman
6b2c3f2488 Friendlier error message for HTTP timeout, in case it's exposed
This should overridden in checkError() with a localized string,
but for now use a nicer default message.
2019-10-14 01:46:32 -04:00
Dan Stillman
b4121ee6bc Don't show error icon when file sync is cancelled 2019-10-14 01:28:11 -04:00
Dan Stillman
42d570e623 Remove timeout for file sync uploads
Regression from 50b65b3010, and a proper fix a9c10309f7
2019-10-14 00:52:03 -04:00
Dan Stillman
da690a45b1 Make sync upload timeout 60 seconds, not 60 milliseconds 2019-10-10 20:07:55 -04:00
Dan Stillman
af2b6207b2 Decrease batch size and increase HTTP timeout for sync uploads
Some write requests are taking > 30 seconds
2019-10-10 19:15:58 -04:00
Dan Stillman
89672ed0a4 Fix "c1 is undefined" sync CR error 2019-10-09 18:29:04 -04:00
Dan Stillman
4e63cfd40e Update submodules 2019-10-08 01:10:34 -04:00
Dan Stillman
efdc4bae19 Fx60: Fix parsing of some default preferences for extensions 2019-10-02 04:56:29 -04:00
Dan Stillman
01e988f07d Don't hard-code 'url' fieldID 2019-09-30 04:43:31 -04:00
Dan Stillman
a9c10309f7 Detect TimeoutException during ZFS S3 upload
We're not currently setting a timeout, so this shouldn't happen, but
someone [1] is getting a timeout error with undefined ms and
NS_BINDING_ABORTED from the channel. It also happened during a /fulltext
upload, so it's not limited to S3, but this fix should give a more
helpful error message for such errors during file syncing.

[1] https://forums.zotero.org/discussion/79286/
2019-09-29 04:18:03 -04:00
Dan Stillman
cf9e5f62f1 Fix test failure due to missing yield 2019-09-29 03:03:38 -04:00
Dan Stillman
8aeb6f7fe4 Mark fields as changed when migrating Extra fields
We're not migrating fields yet, but when we do, I think marking them as
changed will be the safer option. We'll just have to make sure that
conflicts without differences are resolved automatically on all
platforms.
2019-09-28 06:58:54 -04:00
Dan Stillman
96caed8453 More concise version of f827f1e04 2019-09-28 06:12:26 -04:00
Dan Stillman
f827f1e049 Fix error if no colored tags (regression from b310ccb04) 2019-09-27 13:48:28 -04:00
Dan Stillman
b310ccb04e Fix broken tag selector due to leading/trailing whitespace in colored tags
And sanitize colored tags in DB at startup
2019-09-25 17:33:36 -04:00
Dan Stillman
ac255634c5 Fix tag selection in read-only libraries
Reactification mistakenly disabled tag selection instead of just
disabling the context menu options.
2019-09-23 20:09:26 -04:00
Dan Stillman
86d924df9e Force Lucida Grande in Quick Format on non-Retina Macs for Catalina 2019-09-23 03:39:06 -04:00
Dan Stillman
5723683b3b Fix "attachmentSyncedModificationTime must be a number" sync error
https://forums.zotero.org/discussion/79011/zotero-error-report
2019-09-21 01:59:09 -04:00
Dan Stillman
4b7cdddb4a Change apply-to-all checkbox text for some conflicts
Say "Use the [local|remote] version for all remaining conflicts" for
everything instead of saying "Use [local|remote] fields for all
remaining conflicts" for some conflicts.

This also fixes a test failure after 54343c49fb.
2019-09-21 01:35:36 -04:00
Dan Stillman
54b268fe01 Add global parameter to Zotero.Prefs.registerObserver()
This allows Zotero.Prefs to be used instead of Services.prefs for pref
observing in plugins.

Zotero.Prefs.prefBranch was replaced by Zotero.Prefs.rootBranch.
2019-09-20 04:29:02 -04:00
Dan Stillman
82ce5d9742 Fx60: Read in default preferences for extensions
Default prefs are no longer read automatically, so we need to do it
manually. Preferences may not be read before extensions load, so they
should wait for Zotero.Schema.schemaUpdatePromise or
Zotero.uiReadyPromise before initializing.
2019-09-20 04:28:49 -04:00
Dan Stillman
72234e0cb2 Additional debugging for file sync error
"attachmentSyncedModificationTime must be a number"
2019-09-17 17:54:13 -04:00
Dan Stillman
7bcec02326 Remove code to prompt for Firefox extension updates on startup error
And change button from "Check for Update" to "Check for Updates"
2019-09-16 02:27:22 -04:00
Dan Stillman
4b60c6ca27 Type/field handling overhaul
This changes the way item types, item fields, creator types, and CSL
mappings are defined and handled, in preparation for updated types and
fields.

Instead of being predefined in SQL files or code, type/field info is
read from a bundled JSON file shared with other parts of the Zotero
ecosystem [1], referred to as the "global schema". Updates to the
bundled schema file are automatically applied to the database at first
run, allowing changes to be made consistently across apps.

When syncing, invalid JSON properties are now rejected instead of being
ignored and processed later, which will allow for schema changes to be
made without causing problems in existing clients. We considered many
alternative approaches, but this approach is by far the simplest,
safest, and most transparent to the user.

For now, there are no actual changes to types and fields, since we'll
first need to do a sync cut-off for earlier versions that don't reject
invalid properties.

For third-party code, the main change is that type and field IDs should
no longer be hard-coded, since they may not be consistent in new
installs. For example, code should use `Zotero.ItemTypes.getID('note')`
instead of hard-coding `1`.

[1] https://github.com/zotero/zotero-schema
2019-09-16 02:27:22 -04:00
Dan Stillman
d394db61e5 Change 'dontCache' option to 'noCache' in HTTP.request() 2019-09-16 01:28:57 -04:00
Dan Stillman
ddf2a6a116 Don't mock HTTP requests for resource:// or chrome:// URLs 2019-09-16 01:28:35 -04:00
Dan Stillman
cb11e5a3e0 Fix HTTP.request() status of 0 on connection interruption
`status` was being set to undefined instead of 0, likely in a regression
from b78212084.
2019-09-16 01:27:47 -04:00
Dan Stillman
50b65b3010 Set default HTTP.request() timeout to 30 seconds 2019-09-16 01:27:42 -04:00
Dan Stillman
7aa68a0f75 Update MIME.getMIMETypeFromURL() for non-Bluebird HTTP.request() 2019-09-16 01:27:36 -04:00
Dan Stillman
e8dd1f7824 Test updates for newer Sinon 2019-09-16 01:27:30 -04:00
Dan Stillman
ca7217cff7 Add HTTP cancellation support to sync runner 2019-09-16 01:27:26 -04:00
Dan Stillman
25e34b7b99 Update WebDAV request timeouts for HTTP.request() auto 5xx retry 2019-09-16 01:27:18 -04:00
Dan Stillman
dc60e5f840 HTTP.request() improvements
- Move 5xx retries and connection checking out of the sync API client
  and into HTTP.request() so that they apply to all requests. 429 handling
  remains in the API client, since not all callers necessarily want to
  handle that the same way. Callers can still handle 5xx themselves by
  including the relevant 5xx status codes in `successCodes` or by passing
  `errorDelayMax: 0`.
- Add `cancellerReceiver` option, which is a callback that receives a
  function that will cancel the request, whether it's an active request
  or an automatic delay before a 5xx retry.

This also updates Sinon to 7.3.2.
2019-09-16 01:26:34 -04:00
Dan Stillman
38d031ecbe Log stack trace from Zotero.warn() 2019-09-16 00:52:32 -04:00
Dan Stillman
f292d9c030 Clarify translator/style repository update modes 2019-09-16 00:51:33 -04:00
Dan Stillman
82b7cae69a Remove code to prompt for Firefox extension updates on startup error
And change button from "Check for Update" to "Check for Updates"
2019-09-16 00:48:34 -04:00
Dan Stillman
f04f186396 Add missing yield in sync code 2019-09-16 00:47:45 -04:00
Dan Stillman
54343c49fb Fix "getNote() can only be called on notes and attachments" CR error
This bug may be as old as the sync system itself. It could occur if
there were conflicts for both a note and a regular item in the same
batch.
2019-09-16 00:39:06 -04:00
Dan Stillman
725e6e779e Add debugParams option to DB.query() to disable parameter logging
Allow logging of queries without including very large parameter values
2019-09-16 00:38:18 -04:00
Dan Stillman
a85d707226 Fix double progress meter in DB upgrade overlay 2019-09-16 00:38:18 -04:00
Adomas Venčkauskas
c3c7f0a8ae Allow /connector/document/respond to take non-double JSON encoded data 2019-09-11 14:05:46 +03:00
Dan Stillman
3666da5b22 Additional debugging for file sync error
"attachmentSyncedModificationTime must be a number"
2019-09-11 00:13:52 -04:00
Dan Stillman
0bd04877bf Don't run detectWeb/doWeb in Scaffold if target doesn't match
Closes #1728
2019-08-30 01:02:12 -04:00
Dan Stillman
95a9ccae69 Update ACE to 17.06.19
Addresses #1727
2019-08-28 08:05:48 -04:00
Dan Stillman
f0e9c8bfba Fx60: Fix Scaffold
Fixes #1727
2019-08-28 07:44:35 -04:00
Dan Stillman
8a95ce34d8 Unify window opening from menu items 2019-08-27 19:37:39 -04:00
Dan Stillman
b08bd6849e Fx60: Update DB query onRow() behavior
onRow() handlers now get passed a cancellation function as a second
argument
2019-08-27 06:00:35 -04:00
Dan Stillman
61e976bd3a Fx60: nsIURI changes
- nsIURI is now immutable, so it's necessary to use nsIURIMutator via
  mutate() to change it
- .path is replaced with .pathQueryRef
- Only nsIURL has .fileName
2019-08-27 05:28:08 -04:00
Dan Stillman
fe30a11bde Fx60: Fix wrong cursor on tags splitter on Linux 2019-08-27 02:22:52 -04:00
Dan Stillman
b498a83787 Fx60: Fix empty Window menu on Linux (and maybe Windows) 2019-08-27 01:59:41 -04:00
Dan Stillman
79276edd14 Fx60: Fix styling of lookup engine manager window 2019-08-27 00:47:39 -04:00
Dan Stillman
a3668850eb Fx60: Add missing UA styles to styles page
For some reason the standard UA styles are no longer included in HTML
files loaded in a <browser> in Firefox 60.
2019-08-27 00:47:39 -04:00
Dan Stillman
dc8a45485c Fx60: Restore prefwindow bindings
The XBL prefwindow bindings are removed in Firefox 60, so this adds them
back, along with necessary styling, to allow the existing preferences to
work until the preferences are rewritten with React. The preferences.xml
file in the Mozilla source has platform ifdefs, but since this is a
temporary hack I've just duplicated the file for each platform with the
necessary lines included.

I haven't yet tested the styling on Windows/Linux.
2019-08-27 00:47:39 -04:00
Dan Stillman
9a49718638 Remove some old Zotero for Firefox code
In particular, remove code related to opening/closing the Zotero pane,
which affects tests. The pane is now opened by default in Firefox, which
brings its behavior closer to the main version.
2019-08-27 00:47:39 -04:00
Dan Stillman
5994e22359 Fx60: Shim XPathResult in translator sandbox
As of Fx60, XPathResult is no longer available as nsIDOMXPathResult in
XPCOM, so just shim its constants, which are all we need, when adding it
to the sandbox.
2019-08-27 00:47:39 -04:00
Dan Stillman
433794916a Fx60: Remove instances of nsILocalFile
nsILocalFile was merged into nsIFile, so either replace it with that or
switch to Zotero.File.pathToFile().
2019-08-27 00:47:39 -04:00
Dan Stillman
6f965251ed Add FilePicker module to replace nsIFilePicker
`nsIFilePicker::show()` is removed in Firefox 60 in favor of `open()`,
which takes a callback (and apparently has been preferred for a long
time).

There's no point switching to that, so this module is a version of
nsIFilePicker with an async `show()` that returns a promise and some
XPCOM-isms replaced (e.g., string paths instead of nsIFile).
2019-08-27 00:47:39 -04:00
Dan Stillman
c5d404df5e Fx60: Add-on window changes
Legacy/unsigned add-on warnings are now hidden via CSS in the Firefox
build, so remove the code that tries to do that, and instead add a class
to any other warnings so they can be selectively shown.
2019-08-27 00:47:39 -04:00
Dan Stillman
732bb23c33 Fx60: Fix attachment download 2019-08-27 00:47:39 -04:00
Dan Stillman
af7932e59b Fx60: Import Services in hiddenWindow.xul for globalOverlay.js 2019-08-27 00:47:39 -04:00
Dan Stillman
a9d142c83a Fx60: Replace Object.watch() in locateManager 2019-08-27 00:47:39 -04:00
Dan Stillman
3688564c69 Fx60: Fix errors related to Window menu on macOS 2019-08-27 00:47:39 -04:00
Dan Stillman
76978aa912 Fx60: Fix protocol handler
These will need to be redone for Electron, but this keeps them working
in the meantime.
2019-08-27 00:47:39 -04:00
Adomas Venčkauskas
a8a4d13b72 Fx60: Fix citation dialog height 2019-08-27 00:47:39 -04:00