Commit graph

11247 commits

Author SHA1 Message Date
Dan Stillman
874c4044e5 Ace: Add commented-out language_tools lines in case we want them later
We may want this if we enable code completion, though it's a little
dumb. (It seems to show suggestions regardless of context.)
2020-12-24 02:55:00 -05:00
Dan Stillman
1040ba0b5e Run JavaScript: Detect await at the beginning of a line 2020-12-24 02:46:55 -05:00
Dan Stillman
018f04f369 Scaffold: Focus code editor when selecting tab 2020-12-24 02:46:19 -05:00
Dan Stillman
2ed4bb1c8f Ace: Config adjustments in Run JavaScript window
- Use the "Chrome" theme
- Hide the gutter
- Don't highlight the active line
- Remove default iframe borders
- Focus the editor on window open

Ace instances (e.g., Scaffold) are now responsible for setting their own
theme (to avoid a flash of Monokai before a lighter theme appears).
2020-12-24 02:45:37 -05:00
Dan Stillman
e095dbb031 Ace: Fix path to ace.html (#1930) 2020-12-24 02:41:51 -05:00
Dan Stillman
8b9d32c65b Update locales from Transifex and merge new English strings 2020-12-23 23:29:00 -05:00
Dan Stillman
f8b15766a6
Merge pull request #1936 from fletcherhaz/multiple-parents
Add back in ability to create multiple empty parent items
2020-12-23 23:19:37 -05:00
Dan Stillman
0f36f9a7c3 Remove ellipsis for "Create Parent Items", since no prompt 2020-12-23 23:16:30 -05:00
Fletcher Hazlehurst
a81b494ce1 Add back in ability to create multiple empty parent items
Closes #1934
2020-12-23 15:37:08 -07:00
Dan Stillman
37c73b441f Add line about zotero-dev to GitHub issue template 2020-12-23 16:29:58 -05:00
Dan Stillman
33abc76c88 Remove old unused (and broken) storage function 2020-12-22 23:54:34 -05:00
Adomas Venčkauskas
5798926093 Fix number inputs and adjust linux styling for the prefs pane 2020-12-21 12:20:17 +02:00
Dan Stillman
7a434df539 Disable creation of missing tables/indexes in Schema.integrityCheck()
Originally added in 5b9e6497a. We stopped running the integrity check
before userdata upgrades in c4cc44528 because this new behavior was
breaking upgrades, but it could still be run when coming from the DB
Repair Tool, which could cause problems if, say, you recovered a
database from a computer that had an older version of Zotero and ran the
DB Repair Tool on it. Disabling this for now until we have a better
solution.
2020-12-21 01:50:13 -05:00
Dan Stillman
43e6493997 Don't convert "Type: article" in Extra to Document item
CSL 1.0.2 clarified that type 'article' is meant for preprints and
working papers, so until we have a Preprint item type, just leave it in
Extra.

Discussion: https://github.com/zotero/translators/pull/2248#discussion_r492009958
2020-12-21 01:11:28 -05:00
Dan Stillman
aeceb67a07 Add Zotero.isBigSurOrLater, in case we need it later 2020-12-20 04:25:21 -05:00
Dan Stillman
e918b430b6 Fix Quick Format dialog appearance on Big Sur, and tweak on <=10.15
The Quick Format dialog's shape is based on the OS window corners, and
that changed on Big Sur, which resulted in whitespace along the bottom
edge and a misaligned search results box.

The tops of the citation bubbles were also cut off (at least for me) on
Catalina.
2020-12-20 04:23:38 -05:00
Dan Stillman
7b6b608de7 Update locales from Transifex and merge new English strings 2020-12-20 02:18:30 -05:00
Dan Stillman
44603d1ec6 Add localized strings for Word for Mac ARM warning (#26) 2020-12-20 02:07:58 -05:00
Fletcher Hazlehurst
0bb1588f22 Use Ace for Run JavaScript code editor
Closes #1928
2020-12-18 10:45:52 -07:00
Fletcher Hazlehurst
36d81e839c Use ace-builds NPM package 2020-12-18 10:45:38 -07:00
Dan Stillman
2b5a22c132 Add additional checks to test for HTTP.request() 5xx retry 2020-12-11 02:05:25 -05:00
Dan Stillman
87352822fa Delay properly on 429 response in syncAPIClient
ConcurrentCaller wasn't waiting properly if start() was called again
while it was pausing, so 429 caused an immediate retry, which is pretty
much exactly what you don't want a 429 to do.
2020-12-11 02:02:20 -05:00
Dan Stillman
31c928a3ff Don't let invalid translators break all translation
If a translator couldn't be parsed, `_translatorInfo` wouldn't be set,
and that would somehow cause the translator info for subsequent
detections to be out of sync with the code loading, and nothing would
work. Putting a try/catch around the eval() allows subsequent
translators to continue to work normally. (There might be a better fix,
but this seems to work.)

This was happening for Better BibTeX translators that were still
installed without the extension (which they need to be parsed properly),
causing all imports to break.

https://forums.zotero.org/discussion/86613/error-id-1093166052-upload-of-ris-and-bibtex-data-failed
2020-12-10 03:58:17 -05:00
Dan Stillman
558ad20ce6 Scaffold: Improve cookie handling
- Use cookies from browser pane when running detectWeb or doWeb
- Use cookies from document when running or updating tests

This should fix various cases where translators can't be properly
developed or tested in Scaffold (e.g., [1]).

[1] https://github.com/zotero/translators/pull/2296#issuecomment-739116620
2020-12-06 03:09:13 -05:00
Dan Stillman
01646f1f8f Fix regression in 84730e610c
Only switch item types in fromJSON() if one was actually parsed out of
Extra
2020-11-27 18:04:03 -05:00
Dan Stillman
a249cd1608 Update citeproc-js to 1.4.50 2020-11-27 17:50:20 -05:00
Dan Stillman
84730e610c Don't delete valid item/CSL type from Type in Extra on sync
After a local item change, Zotero uploads the JSON and then applies the
saved JSON returned from the API to the local object using `fromJSON()`,
the same as it would apply any other remote change.

`fromJSON()` is meant to migrate Extra lines into real types and fields
after future item type/field changes. It calls
`Z.Utilities.Internal.extractExtraFields()`, which looks for valid item
type or CSL type values in Type lines in Extra, handles the rest of
parsing accordingly, and passes back the parsed item type. `fromJSON()`
wasn't handling `itemType` in the response object, so the item type
didn't get applied and the Type line was stripped. This fixes that.

Since valid type values are now parsed, if you have a Journal Article
item with a Pages field and enter "Type: song" into Extra and sync, the
item will be converted to Audio Recording and `Pages: 123` will be
placed in Extra.

https://forums.zotero.org/discussion/comment/369221/#Comment_369221
2020-11-27 17:50:20 -05:00
Dan Stillman
17cafcb013 Update version 2020-11-27 17:50:20 -05:00
Adomas Venčkauskas
ddcbb47538 Fix number inputs and adjust linux styling for feed settings 2020-11-24 15:10:06 +02:00
Dan Stillman
c4cc44528c Fix error upgrading old databases after errors 5b9e6497af
Creating missing tables breaks schema update steps that assume those
tables don't exist, so we'll need another solution here. For now,
disable the automatic integrity check and make a couple recent schema
update steps more forgiving for people on the beta who already triggered
this.
2020-11-23 23:49:50 -05:00
Dan Stillman
304a38083c Update locales from Transifex and merge new English strings 2020-11-20 16:46:10 -05:00
Dan Stillman
75497e14c7 Item context menu: "Create Parent Item" → "Create Parent Item…"
Now that a dialog is displayed asking for further input

Follow-up to #1901
2020-11-20 16:35:29 -05:00
fletcherhaz
86b77cc45e
Add an option to create parent item from identifier (#1901) 2020-11-20 16:17:48 -05:00
Dan Stillman
f393a233e9
Merge pull request #1912 from tnajdek/js-sass-compiler
Switch to pure js sass compiler
2020-11-18 15:23:38 -05:00
Dan Stillman
07874d84bd
Merge pull request #1909 from fletcherhaz/snapshot
Update SingleFile for bug fixes
2020-11-17 16:02:13 -05:00
Dan Stillman
7c0cfd9420 Fix case of data dir not being created for new profile
If there was an existing ~/Zotero directory, another profile was already
pointing to it, and there was a Firefox profile pointing to a custom
data directory or with an embedded 'zotero' directory, the Firefox data
directory would be used instead of creating a new data directory named
after the new profile.

This skips the Firefox logic for new profiles when there's an existing
profile pointing at ~/Zotero and just creates the new data directory.
2020-11-17 15:57:16 -05:00
Dan Stillman
e575097e34 Missing line from 5b9e6497 to check schema integrity after crash 2020-11-17 01:26:46 -05:00
Dan Stillman
5b9e6497af Schema integrity check improvements
- Create userdata tables and indexes that are missing
- Delete tables and triggers that should no longer exist
- Run schema integrity check before user data migration
- Run schema integrity check after restart error

This is meant to address two problems:

1) Database damage, and subsequent use of the DB Repair Tool, that
   results in missing tables

2) A small number of cases of schema update steps somehow not being
   reflected in users' databases despite their having updated userdata
   numbers, which are set within the same transaction. Until we figure
   out how that's happening, we should start adding conditional versions
   of schema update steps to the integrity check.

This is currently only running the update check after a restart error,
which might not occur for all missed schema update steps, so we might
want other triggers for calling setIntegrityCheckRequired().
2020-11-16 18:13:48 -05:00
Dan Stillman
6bcc8af86b Add Zotero.DB.columnExists(table, column) 2020-11-16 17:50:52 -05:00
Dan Stillman
b0e065a4ae Don't return relative path from .attachmentFilename for linked files
https://forums.zotero.org/discussion/86139/zotero-item-attachmentfilename-should-only-return-filename
2020-11-13 11:43:00 -05:00
Dan Stillman
d5ac87648b Update submodules 2020-11-04 15:04:44 -05:00
Dan Stillman
b43bfcaca0 Update locales from Transifex 2020-11-04 15:02:42 -05:00
Fletcher Hazlehurst
a72ae14816 Fix bug with double saving of snapshots. 2020-11-02 17:24:14 -07:00
Fletcher Hazlehurst
c0ec91f26d Fix bug for empty title when a translator does not provide one. 2020-11-02 17:24:14 -07:00
Fletcher Hazlehurst
a2620b757d Update SingleFile and fix several bugs
- Using `sandboxPrototype` properly uses window as prototype
- This commit removes the need for our patch in babel-worker.js:
3d0bc4cf9f
- We properly inject into frames in the client if we ever include frames
2020-11-02 17:24:14 -07:00
Dan Stillman
367fea1847 Zotero.File.copyDirectory(): Fix copying of subdirectories on Windows
This fixes copying of the previous extracted SingleFileZ snapshots
between libraries.
2020-11-01 18:51:55 -05:00
Tom Najdek
67f4b5254c
Switch to pure js sass compiler 2020-10-30 13:15:30 +01:00
fletcherhaz
d16512c84f
Fix bug with async translate process never returning. (#1910)
When using `doImport` a promise is returned, but was lacking a catch a
statement to ensure completion.

This fixes #1882
2020-10-29 02:30:47 -04:00
Dan Stillman
7602ee68db Update Big Sur targeting in chrome.manifest 2020-10-27 02:42:22 -04:00
Dan Stillman
a0aef25de1 Update locales from Transifex and merge new English strings 2020-10-27 02:40:48 -04:00