Commit graph

7232 commits

Author SHA1 Message Date
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
371cef4035 Fx60: Fix quick format dialog artefacting on macOS. Closes #1720 2019-10-14 11:53:21 +03: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
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
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
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
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
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