Commit graph

8666 commits

Author SHA1 Message Date
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
7c8aed2a34 Update locales from Transifex 2019-10-28 06:12:10 -04:00
Philipp Zumstein
bd1d9dbbf0 Use the label Prog. Language for Computer Program (#1743) 2019-10-28 05:38:55 -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
b94be726bd Update locales from Transifex 2019-10-21 22:38:38 -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
02eef477ff Update locales from Transifex and merge new English strings 2019-10-19 02:53:08 -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
1fe3b6df22 Update locales from Transifex 2019-10-14 01:40:19 -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
220c9e7cbb Update locales from Transifex 2019-10-08 00:54:04 -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
e25786e74c Update locales from Transifex and merge new English strings 2019-09-16 01:20:56 -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
Dan Stillman
8fa4cc9387 Fx60: Update Zotero.File.iterateDirectory() signature
StopIteration is no longer supported in Firefox 60, so instead of taking
a generator function that might throw StopIteration for the second
parameter, take a function that is passed to iterator.forEach() that
receives an OS.File.DirectoryIterator.Entry for each directory entry. If
the function returns a promise, it's waited for.

Also update other direct uses of OS.File.DirectoryIterator to remove
StopIteration use.
2019-08-27 00:47:39 -04:00
Dan Stillman
f26b1592a3 Fx60: Clear built_in_addons.json file
Though it's not being properly read anyway
2019-08-27 00:47:39 -04:00
Dan Stillman
210c2fcea6 Fx60: Remove obsolete CSS properties 2019-08-27 00:47:39 -04:00
Dan Stillman
77d1c6cf74 Fx60: Fix CSL locale loading 2019-08-27 00:47:39 -04:00
Dan Stillman
8c59df435f Fx60: Fix snapshot filenames
nsIURL doesn't seem to work anymore, so add Zotero.Utilities.parseURL(),
which uses the `url` package from NPM and adds fileName, fileExtension,
and fileBaseName.
2019-08-27 00:47:39 -04:00
Dan Stillman
c07379fe33 Fx60: Fix "path is undefined" in cookie sandbox
getCookiesForURI() seems to now get an nsIURL that won't query to
nsIURI, so look for `filePath` in addition to `path`.
2019-08-27 00:47:39 -04:00
Dan Stillman
6fd879fc16 Fx60: Switch to new XMLHttpRequest() 2019-08-27 00:47:39 -04:00
Dan Stillman
c0da6c0427 Fx60: Add built_in_addons.json file
fetch_xulrunner.sh updates the built-in path to point to this file, but
it's not currently being read properly for some reason (and I'm not sure
it does anything we need).
2019-08-27 00:47:39 -04:00
Dan Stillman
0678f13e96 Use Services for an nsILoginManager initialization 2019-08-27 00:47:39 -04:00
Dan Stillman
8f844251c8 Fx60: Fix access to translator object in sandbox
There's almost certainly other sandbox breakage
2019-08-27 00:47:39 -04:00
Dan Stillman
9ca1014f5b Fx60: Update old-style shorthand function definitions 2019-08-27 00:47:39 -04:00
Dan Stillman
15a7a812f6 Fx60: += operator no longer works on nsIURI spec 2019-08-27 00:47:39 -04:00
Dan Stillman
186d2b0883 Fx60: nsILocalFile -> nsIFile 2019-08-27 00:47:39 -04:00
Dan Stillman
331522b106 Fx60: Update pref handling
- getStringPref/setStringPref are now used for strings instead of
  getComplexValue/setComplexValue
- Remove nsIPrefBranch2 reference
- If there was a pref failure during initialization, nothing was logged
  to the terminal
2019-08-27 00:47:39 -04:00
Dan Stillman
d4b10f1c1e Fx60: Don't try to override toString() on an object 2019-08-27 00:47:39 -04:00
Dan Stillman
0ad308f5f6 Fx60: Update nsIInputStreamPump init() calls 2019-08-27 00:47:39 -04:00
Dan Stillman
78e9db9523 Fx60: Fix issues with JS code modules
- The Mozilla CommonJS loader is no longer available, so bundle the
  Fx52 version of it
- Strict mode is enforced
- `this` is only defined as a global object in .jsm files, not .js files
- `this` can't be converted to a string for BackstagePass test, so check
  for presence of Components.utils.import instead
- The return value from import() is no longer available
2019-08-27 00:47:39 -04:00
Dan Stillman
f7854bfcae Fx60: Remove versioned JavaScript 2019-08-27 00:47:39 -04:00
Dan Stillman
8f00fa2603 Fix missing checkboxes in View menu on Windows (and maybe Linux) 2019-08-22 00:29:29 -04:00
Dan Stillman
17cf605020 Fix empty row in item context menu (regression from bb59429664) 2019-08-22 00:29:29 -04:00
Dan Stillman
26ee0e294b Update locales from Transifex and merge new English strings 2019-08-19 05:00:50 -04:00
Dan Stillman
bb59429664 Add "Convert Linked Files to Stored Files…" menu option
In new File → Manage Attachments submenu

Closes #1637
2019-08-19 05:00:32 -04:00
Dan Stillman
eca2822651 Update locales from Transifex and merge new English strings 2019-08-12 16:41:29 -04:00
Dan Stillman
3aeef69ad3 Add View menu
The menu includes all user interface options from the General
preferences (now removed from the preferences), toggles for the
collections pane, item pane, and tag selector, and, at long last, a
toggle for recursive collections ("Display Items from Subcollections").

The collections pane and item pane no longer reopen automatically when
restarting Zotero. People might still close them by mistake and not find
this menu, but we'll see how it goes.

Closes #1372
2019-08-12 16:31:31 -04:00
Dan Stillman
6f721098f8 Use Symbol for pref observer deregistration
Zotero.Prefs.registerObserver() now returns a Symbol that can be passed
to Zotero.Prefs.unregisterObserver().
2019-08-12 13:21:18 -04:00
Dan Stillman
eb50067a41 Just use new Date() to parse ISO 8601 dates
This should fix a weird bug where ISO dates were being parsed as a year
earlier.
2019-08-10 08:58:44 -04:00
Adomas Venčkauskas
5216f11885 Replace the XPCOM sandbox with an unsafe eval sandbox 2019-08-10 08:58:44 -04:00
Dan Stillman
1c6840f9a5 Scaffold: Load translator on double-click 2019-08-10 08:40:24 -04:00
Adomas Venčkauskas
1199059612 Fix imported citations with modified text not resetting the text 2019-08-08 11:25:36 +03:00
Dan Stillman
e1adbafeb0 Support Cmd-= for zooming in Scaffold code editor
In addition to Cmd-+
2019-08-07 01:03:45 -04:00
Dan Stillman
d898022ada Update Scaffold UI based on font size pref 2019-08-06 21:00:08 -04:00
Dan Stillman
53e5abc6cb Maybe fix NS_ERROR_FILE_NAME_TOO_LONG sync error on eCryptfs on Linux
When the filename limit isn't 255 on Linux, it's probably because of
eCryptfs, but we were checking the character length instead of the byte
length before shortening the filename to 143 bytes.
2019-08-06 06:55:10 -04:00
Dan Stillman
2b748edaca Add ACE to About pane 2019-08-05 05:34:03 -04:00
Dan Stillman
4cbefca7eb Tweak text of Scaffold setup prompt 2019-08-05 05:16:11 -04:00
Dan Stillman
7d7afc2b46 Add Style Editor to Developer menu 2019-08-05 05:05:57 -04:00
Dan Stillman
77467b94da Fix item tree crash on Cmd-left-arrow under certain conditions
If a parent item was expanded and all items in the tree, including the
item's child items, were selected, Cmd + Left Arrow would break the
items tree until restart.

This will cause a conflict and need to be applied to the new tree.

(Worth noting that collapseSelectedRows() is currently only called on
Cmd-left-arrow because the XUL tree seemingly swallows a regular
left-arrow (and only applies the collapse to the last-selected row). The
comment in the keypress listener where collapseSelectedRows() is called
suggests that that was meant to be used for all left-arrow keypresses,
but either that stopped working at some point or it only ever worked for
Cmd + Left Arrow because it bypasses the normal tree handling of left-
arrow. In any case, it would be better if left-arrow always collapsed
selected rows, with or without Cmd.)

https://forums.zotero.org/discussion/78515/bug-collapsing-all-items-in-a-collection-breaks-display-of-items-in-all-collections
2019-08-04 01:48:36 -04:00
Dan Stillman
871a275090 Add Help button to Run JavaScript window to open documentation 2019-08-02 07:00:43 -04:00
Dan Stillman
66bfcf382d Update locales from Transifex and merge new English strings 2019-08-02 07:00:43 -04:00
Dan Stillman
7e7ec07170 Remove "Show developer tools" checkbox and show menu by default
Everybody's a developer now
2019-08-02 07:00:43 -04:00
Dan Stillman
2b6fb73b57 Add Scaffold as a built-in developer tool 2019-08-02 07:00:39 -04:00
Dan Stillman
00c159a1b4 Fix incorrect top padding in tag selector if first tag doesn't fit 2019-08-02 03:13:47 -04:00
Dan Stillman
2a3c4a3555 Add "Show developer tools" option to Advanced prefs
And move Error Console and Run JavaScript to a Developer menu that's
shown in Tools if that option is enabled.

The Memory Info button is now behind its own undefined
extensions.zotero.debug.memoryInfo pref.
2019-08-02 02:56:26 -04:00
Dan Stillman
fda002ec34 Beginning of tests for zotero://select 2019-08-02 02:29:08 -04:00
Dan Stillman
d0002736cd Add 'begins with' operator to field search conditions 2019-08-01 23:40:52 -04:00
Dan Stillman
d551d1901f Fix zotero://select search selection 2019-08-01 22:11:03 -04:00
Dan Stillman
f776156fbd Revert subtitle capitalization for AMA (added in 5.0.70)
https://forums.zotero.org/discussion/comment/337093/#Comment_337093
2019-08-01 17:26:27 -04:00
Dan Stillman
3af8f56c35 Fix server error if User-Agent isn't set
https://forums.zotero.org/discussion/78502/http-user-agents-that-dont-identify-fail-for-zotero-v5-0-71
2019-08-01 16:55:21 -04:00
Dan Stillman
3e3804741f Maybe fix translator deletion?
This caused an error after 9b82373f70 but possibly meant that deleted
translators weren't being properly removed.
2019-07-24 04:32:40 -04:00
Dan Stillman
9b82373f70 Add ability for Scaffold to provide alternative translators
Zotero.Translate::setTranslatorProviderMethods(methods) can be used to
provide custom 'get' and 'getAllForType' methods that override the
default Zotero.Translators methods.
2019-07-24 04:31:11 -04:00
Dan Stillman
3544c3bd86 Update locales from Transifex 2019-07-23 15:12:14 -04:00
Adomas Venčkauskas
768759ccb1 Fix being unable to remove uncited bibliography entries 2019-07-23 09:39:16 +03:00
Dan Stillman
1968d75814 Fix startup errors due to missed schema update steps for retractedItems
I don't know how this is happening -- people are ending up with an
updated DB version but missing schema changes, despite the DB version
being updated after the schema updates and in the same transaction --
but until we figure it out, apply the schema update steps in
Zotero.Retractions.init() if necessary.
2019-07-22 06:33:12 -04:00
Dan Stillman
768ceda881 Update locales from Transifex 2019-07-21 21:45:43 -04:00
Dan Stillman
8edab3d628 Update citeproc-js to 1.2.18
This fixes Title/Short Title case alignment
2019-07-20 01:59:09 -04:00
Dan Stillman
8c7e47495e Remove Transform Text submenu and put options directly in context menu 2019-07-19 23:13:25 -04:00
Dan Stillman
7d5f6cdbfd Transform Short Title case as well when transforming Title 2019-07-19 23:12:51 -04:00
Dan Stillman
640887f30d Merge new English strings 2019-07-18 06:28:53 -04:00
Dan Stillman
7f8ec82ba2 Update wording of document import prompt 2019-07-18 06:10:00 -04:00
Dan Stillman
9020566de1 Fix "no such table: retractedItems" error from skipped schema update
I'm not sure what's going on, but schema update steps aren't working
properly for a small number of people:

https://forums.zotero.org/discussion/78272/urgent-database-connector-upgrade-error
2019-07-18 05:19:18 -04:00
Dan Stillman
a41e610e6c Fix display of original string length in debug output for ellipsize() 2019-07-17 21:32:51 -04:00
Dan Stillman
686b51df38 Revert "Temporarily disable document-export button for 5.0.71"
This reverts commit 7b7ccea31a.
2019-07-17 19:03:30 -04:00
Dan Stillman
7b7ccea31a Temporarily disable document-export button for 5.0.71 2019-07-17 18:17:52 -04:00
Dan Stillman
79540ac794 Update locales from Transifex 2019-07-17 17:18:01 -04:00
Dan Stillman
024645bc98 Update locales from Transifex 2019-07-17 03:18:35 -04:00
Dan Stillman
2caa8fdb1e Updates locales from Transifex and merge new English strings 2019-07-16 02:38:05 -04:00
Dan Stillman
fd12eb08b1 Adjust document-export wording
"Export" is too confusing, since you also have to export and import the
file itself.
2019-07-16 02:21:33 -04:00
Dan Stillman
b899e5694a Update citeproc-js to 1.2.17 2019-07-16 02:03:07 -04:00
Dan Stillman
5dd64a5f4c Fix a couple connector server endpoint init() response values 2019-07-16 00:58:39 -04:00
Dan Stillman
7b9d404c42 Allow browser-based access to connector server ping page 2019-07-15 10:06:42 -04:00
Dan Stillman
1cd4e50b59 Don't protect test endpoints 2019-07-15 08:11:56 -04:00
Dan Stillman
2603373b86 Additional protections for HTTP endpoints
Reject browser-based requests that don't require a CORS preflight
request [1] if they don't come from the connector or include
Zotero-Allowed-Request: 1

[1] https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS#Simple_requests
2019-07-15 07:30:12 -04:00
Dan Stillman
fd09d3ef4a Revert "Temporarily disable "Export Document…" button for 5.0.70"
This reverts commit f8927812e9.
2019-07-13 02:26:25 -04:00
Dan Stillman
fd8d6bad0d Updates locales from Transifex 2019-07-12 20:34:09 -04:00
Dan Stillman
f8927812e9 Temporarily disable "Export Document…" button for 5.0.70 2019-07-12 20:28:05 -04:00
Dan Stillman
708b8798c2 Check for X-Zotero-Connector-API-Version header in /connector/import 2019-07-12 02:08:55 -04:00
Dan Stillman
2964021661 Update citeproc-js to 1.2.13 2019-07-09 03:04:12 -04:00
Dan Stillman
5ab0239bdf Fix footnotes style in RTF Scan
Not sure when this broke
2019-07-09 02:12:53 -04:00
Dan Stillman
1424fd9a0e Fix updating of the styles page in the RTF Scan dialog
There were various errors due to changes in integrationDocPrefs.xul
since RTF Scan was last worked on.
2019-07-09 01:46:34 -04:00
Dan Stillman
e8a8358a83 "citation" -> "item" in citation warning checkbox
The checkbox now applies to the item globally, so "item" is more
appropriate.
2019-07-04 22:24:09 -04:00
Dan Stillman
c0fe471db3 Fix retraction warning remaining after item deletion until next selection
Regression from something recent, I think
2019-07-04 22:05:18 -04:00
Adomas Venčkauskas
cd14a536dc Add retracted citation warning tests. Fix a bug with embedded prompts 2019-07-04 15:16:26 +03:00
Dan Stillman
e1e5039111 Make retraction reasons in info pane selectable
And prevent text cursor on other text
2019-07-04 07:24:10 -04:00
Dan Stillman
b0240417fa Update locales from Transifex and merge new English strings 2019-07-04 07:23:49 -04:00
Dan Stillman
eedc066d41 Allow hiding of retraction warning for replaced works
This is unfortunate, but some journals are abusing (what should be)
unique identifiers.

https://forums.zotero.org/discussion/comment/335113/#Comment_335113
2019-07-04 07:11:53 -04:00
Adomas Venčkauskas
2186e939a9 Set the retracted flag for retracted items even if no prompt is required 2019-07-03 23:10:30 +03:00
Adomas Venčkauskas
9efd7cc07d Retracted item citation warning changes
Allows the user to suppress the item retraction warnings from the
citation dialog and makes the retraction warning suppression global.
See #1710
2019-07-03 15:18:41 +03:00
Adomas Venčkauskas
0f9b073073 Ensure retracted item suppression is saved on any integration operation 2019-07-03 13:55:16 +03:00
Dan Stillman
0beddb9680 Add flags to disable retraction warnings
Separate flags for hiding the retraction altogether and for hiding
citation warnings for it

New functions:

Zotero.Retractions.hideRetraction(item)
Zotero.Retractions.shouldShowCitationWarning(item)
Zotero.Retractions.disableCitationWarningsForItem(item)

Addresses #1710
2019-07-03 01:23:02 -04:00
Dan Stillman
f49d5805cd Apply subtitle capitalization to additional styles
This also fixes a style initialization error when the style id is
invalid, which was a regression in a0be2da42c.
2019-07-01 22:39:12 -04:00
Dan Stillman
d13ffcd9a3 Revert "Temporarily disable "Export Document…" button for 5.0.69"
This reverts commit a6e9d76c41.
2019-06-25 23:53:47 -04:00
Dan Stillman
fb101e8fe6 Fix hanging indent in HTML output after citeproc-js 1.2.2 (5.0.57)
The patch in 0036e0a1e for the change in citeproc-js behavior was
incomplete.
2019-06-25 23:36:57 -04:00
Dan Stillman
317983fc7a Update locales from Transifex 2019-06-24 22:43:06 -04:00
Dan Stillman
a6e9d76c41 Temporarily disable "Export Document…" button for 5.0.69 2019-06-24 21:22:34 -04:00
Dan Stillman
aba37b31e4 Fix error from retractions notifier handler on group modification 2019-06-23 20:01:26 -04:00
Dan Stillman
d0f976f6bd Update locales from Transifex 2019-06-22 05:45:16 -04:00
Dan Stillman
99613b0cbe "Restore to Online Library" → "Replace Online Library"
Without an accompanying "Restore from Online Library" option, which
doesn't currently exist, "Restore to Online Library" can be interpreted
two ways. It's clear if you read the text below or the confirmation
prompt, but if you don't you might accidentally do something very bad.

This was almost certainly also translated in misleading ways in other
locales.
2019-06-22 05:44:50 -04:00
Dan Stillman
ead93b6ccc Stop uploading files on quota error until next manual sync or restart 2019-06-22 05:29:47 -04:00
Dan Stillman
94795095f2 Fix potential error on retracted item modification
If a retracted item was in the trash at startup or when detected and
there were no other retracted items in the library, an error would occur
if the item was modified.
2019-06-20 18:18:10 -04:00
Dan Stillman
c1ab361c92 Revert "Temporarily disable "Export Document…" button for 5.0.68"
This reverts commit f38ae94259.
2019-06-20 16:25:41 -04:00
Dan Stillman
f38ae94259 Temporarily disable "Export Document…" button for 5.0.68 2019-06-19 17:24:34 -04:00
Dan Stillman
288ad93422 Fix startup error due to missing retractedItems table
This shouldn't be possible, but there've been a couple reports of people
ending up on version 103 without the table, so create it again with IF
NOT EXISTS. This is obviously a bad fix, but until we know how this
happened it's the best we can do.
2019-06-19 17:06:05 -04:00
Dan Stillman
50a4308514 Remove retraction flag from items that no longer match 2019-06-19 06:41:33 -04:00
Dan Stillman
48c3fc33df Update locales from Transifex 2019-06-19 02:17:53 -04:00
Dan Stillman
8589aae7bc Fix retracted items in unloaded libraries not being flagged correctly 2019-06-19 02:11:37 -04:00
Dan Stillman
7306fe910d Fix updating of Next button in RTFScan (regression from 269e2f8bff)
And fix a logged warning
2019-06-16 02:33:24 -04:00
Dan Stillman
e3e6b8ef9c Revert "Temporarily disable "Export Document…" button for 5.0.67"
This reverts commit 487d675783.
2019-06-16 02:33:24 -04:00
Dan Stillman
e06f531dae Update locales from Transifex 2019-06-14 11:26:28 -04:00
Dan Stillman
dc670938a4 Update submodules 2019-06-14 11:18:04 -04:00
Dan Stillman
487d675783 Temporarily disable "Export Document…" button for 5.0.67 2019-06-14 11:16:14 -04:00
Dan Stillman
75712ed42d Remove "Move to Trash" button in item retraction banner
There can be situations where people legitimately want to keep the item,
so encouraging deletion is a bit presumptuous.
2019-06-13 12:22:54 -04:00
Dan Stillman
afd5b2f993 Update locales from Transifex and merge new English strings 2019-06-13 00:09:04 -04:00
Dan Stillman
ae7a262592 Don't switch to Retracted Items for single item from banner View button
Only for multiple items
2019-06-13 00:09:04 -04:00
Dan Stillman
45f6492494 Adjustments to citation retraction warning (#1704)
- Fix don't-show-again checkbox for non-DB items
- Tweak warning text
- Don't show comma after year if year is missing (which it shouldn't be)
- Remove redundant try/catch
2019-06-13 00:08:49 -04:00
Adomas Venčkauskas
4337362a1b Add a checks and prompts for retracted items within an existing doc 2019-06-13 00:57:56 +03:00
Dan Stillman
b4b19c4811 Add Zotero.Retractions.getRetractionsFromJSON()
Addresses #1703
2019-06-12 01:05:49 -04:00
Dan Stillman
d353439980 Add retractions.enabled hidden pref to disable retraction checking 2019-06-11 21:24:17 -04:00
Dan Stillman
e69786bd69 Fix error and show File Not Found dialog opening attachment with empty path 2019-06-11 06:46:46 -04:00
Dan Stillman
ccc4dccffd Fix error copying attachment without path to another library 2019-06-11 06:46:09 -04:00
Dan Stillman
f7f55f05ad Percent-encode " character in DOIs when opening/copying as link
I'm not sure a double-quote actually appears in any DOIs, but it's
technically valid and would result in an invalid URL.

Follow-up to 782c2a1d1

Addresses #295
2019-06-10 17:06:59 -04:00
Dan Stillman
5e1beed6fd Update locales from Transifex 2019-06-10 15:52:20 -04:00
Dan Stillman
d7417af83e Update submodules 2019-06-10 15:00:55 -04:00
Dan Stillman
782c2a1d15 Don't URL-encode most characters in DOIs when opening/copying as link
Only #, ?, and % are now encoded.

Addresses #295
2019-06-10 14:56:28 -04:00
Dan Stillman
98d2b69020 Update locales from Transifex and merge new English strings 2019-06-10 02:50:47 -04:00
Dan Stillman
5c03813d81 Add Retracted Items virtual collection
Shown automatically when retracted items are detected
2019-06-10 02:38:42 -04:00
Dan Stillman
502f5fe491 Run notifier observers in tests after all others
This ensures that main functionality will have already run if a test
waits on the same event.
2019-06-10 02:20:11 -04:00
Dan Stillman
e807f98e02 Retracted items: Fix "Move to Trash" button not appearing 2019-06-10 02:18:49 -04:00
Dan Stillman
cf8d383027 Add "Show Item in Library" button to retracted citation warning 2019-06-07 23:05:25 -04:00
Dan Stillman
368b057104 Use toJSON() if available when running Zotero.debug() on objects 2019-06-07 21:22:52 -04:00
Dan Stillman
b793c0c406 Hard-code short PMID to avoid sending
The PMID prefix length is 5 and there are no other PMIDs under 5 digits,
so a 3-digit PMID would be identifiable.
2019-06-07 10:20:33 -04:00
Dan Stillman
4939dd49a8 Update locales from Transifex and merge new English strings 2019-06-07 08:45:06 -04:00
Dan Stillman
47164edea6 Retraction improvements
- Fix list download logic
- Close bar when clicking "View Item"
- Don't show "Move to Trash" if item isn't editable
- Download new list if cached version differs from client
- Reduce height of notification bar
- Switch to a slightly darker red
2019-06-07 08:21:15 -04:00
Adomas Venčkauskas
75b38caf6f Add a warning when citing a retracted item 2019-06-07 12:59:42 +03:00
Dan Stillman
30849303a4 Remove unnecessary title for retracted-item cite warning 2019-06-07 04:33:02 -04:00
Dan Stillman
d0412e1fbb Add "Move to Trash" button in item retraction header 2019-06-07 04:20:55 -04:00