Commit graph

297 commits

Author SHA1 Message Date
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
Dan Stillman
360f034b51 Fix a report of broken autocomplete
I can't reproduce this, but the report has "Services is not defined"
from autocomplete.xml, triggered by zotero-autocomplete.js.

https://forums.zotero.org/discussion/comment/345190/#Comment_345190
2019-12-19 01:41:10 -05:00
Dan Stillman
53ff8eecd2 Limit autocomplete to 25 results
I'm not totally sure why we didn't do this years ago, but this fixes
performances problems in the new React tags box, and should improve
autocomplete performance generally in large libraries.
2019-12-03 16:05:04 -07: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
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
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
e50fda90ca Remove obsolete zotero://attachment and zotero://fullscreen 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
Dan Stillman
c771d9b046 Fx60: Fix devtools initialization 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
d551d1901f Fix zotero://select search selection 2019-08-01 22:11:03 -04:00
Dan Stillman
66f2d177a9 Load all files xpcom/ files as UTF-8
This fixes corrupted em dashes from citeproc-js:

https://forums.zotero.org/discussion/78327/dash-in-ama-is-producing-odd-characters-a%C2%80%C2%94
2019-07-25 07:39:32 -04:00
Dan Stillman
48580c49d1 Retraction Watch integration
- Check for retracted items using data from Retraction Watch
- Show an X next to retracted items in the items list, and show a
  scary message at the top of the item pane with more info and links.
- Lookup is done in a privacy-preserving manner using k-anonymity --
  the server is unable to determine the specific items that exist in
  the client, so people who don't sync don't need to share any library
  data (though the server doesn't log the lookups anyway).

TODO:

- Pop up an alert when new items are found
- Show a confirmation prompt when citing a retracted item
- Support items without DOIs or PMIDs
- Add a proper PMID field and expand DOI to more item types so these
  values don't need to be parsed out of Extra
- Clear the banner immediately when all possible fields are cleared
  instead of waiting a few seconds
2019-06-06 09:17:21 -04:00
Dan Stillman
ebda79a958 zotero://select improvements
- Support items within collections and searches:

zotero://select/library/collections/:collectionKey/items/:itemKey
zotero://select/groups/:groupID/collections/:collectionKey/items/:itemKey

- Fix the 'itemKey' parameter:

zotero://select/library/collections/:collectionKey/items?itemKey=:itemKey1,:itemKey2

- Select library root if collection/search not specified
2019-05-09 02:11:57 -04:00
Dan Stillman
945c413c42 Closes #1644, Allow selecting multiple items with zotero://select
This adds selectItems() to ZoteroPane and collectionTreeView and removes
the ancient, unused 'expand' argument to selectItem(), which didn't
really make sense there. It also includes a new
itemTreeView::ensureRowsAreVisible() that tries to scroll to an
appropriate place (or, better yet, not scroll at all) given the
specified rows and page size.
2019-02-23 17:35:09 -05:00
Adomas Venčkauskas
f5c4fb06e1 Ensure high-dpi icons are loaded in React components 2019-01-21 11:01:32 +02:00
Dan Stillman
bf6f1432c5 Move Utilities.Internal.escapeSQLExpression() to Zotero.DB 2018-12-16 02:10:15 -05:00
Dan Stillman
7d9b94c79e Fix autocomplete for tags beginning with _ or %
Addresses #1598
2018-11-25 00:36:04 -07:00
Dan Stillman
1e3608e82e Add zotero://select support for collections
zotero://select/(library|groups/:groupID)/collections/:collectionKey
2018-10-10 21:38:10 -04:00
Martynas Bagdonas
ae7ef109b7 Add universal progress queues (#1573) 2018-10-05 01:56:46 -04:00
Dan Stillman
b782120840 Add followRedirects: false option to Zotero.HTTP.request()
Currently only .status and .getResponseHeader() (for getting 'Location')
are available in the returned object, but we could make the body
available if necessary.
2018-09-22 04:03:25 -04:00
Dan Stillman
e48a1a2abb Remove lots of old Zotero for Firefox code
We still run tests in Firefox, so not everything can be removed.
2018-08-17 03:17:08 -04:00
Adomas Venčkauskas
51e181cb81 Fix some XPCOM Zotero breakage from previous commits 2018-08-06 12:24:17 +03:00
Sylvester Keil
38166d4e05
Add Zotero.intl namespace
Move `Zotero.getString()` and intl init code to `Zotero.intl` to make
it easier to re-use.

Link `Zotero.getString()` to `Zotero.intl.getString()`.

Do not expose `getStringFromBundle`, `pluralFormGet`, and
`pluralFormNumForms` because they are not used.
2018-07-28 21:31:20 +02:00
Adomas Venčkauskas
cb8280f0ff Move Zotero.Prefs into its own file 2018-07-11 15:53:46 +03:00
Sylvester Keil
06cb9aff98 Prefer use of Services.appinfo 2018-07-11 13:58:41 +03:00
Dan Stillman
0383f104dd Fix "Import into new collection" option when handling importable file 2018-06-14 16:41:33 -04:00
Dan Stillman
040e0a726a Simplify page path component parsing for zotero://open-pdf 2018-05-05 01:30:42 -04:00
Dan Stillman
60e0d79e01 Don't allow page path component for new-style zotero://open-pdf URLs
That's only necessary for ZotFile URLs.
2018-05-05 01:19:38 -04:00
Dan Stillman
609657a8e4 Add zotero://open-pdf handler to open PDF at a given page
This is loosely based on the same functionality in ZotFile, but it tries
to do the right thing based on existing Zotero settings: either the new
PDF handler setting in the prefs or the system-default app. The latter
can only reliably be determined on Windows (and this uses ZotFile's
function to read that from the registry), but this tries to figure it
out on macOS and Linux too using the Mozilla handler service. (The
handler service only gets you an app name, not a path, so on Linux we
can try reading mimetypes.list and the like in case someone is using a
system-default okular or evince not in /usr/bin, but that's not yet
implemented.)

This uses the new 5.0 URL format, and a 'page' query parameter instead
of a path component:

zotero://open-pdf/library/items/[itemKey]?page=[page]
zotero://open-pdf/groups/[groupID]/items/[itemKey]?page=[page]

It also accepts ZotFile-style URLs, though, so if you uninstall ZotFile
you should still be able to open those links. ZotFile will need to
accept the new format for new links to work when ZotFile is installed,
since it will override this handler.

This functionality will be necessary for annotation extraction (#1018)
and for imported annotations from Mendeley (#1451).
2018-05-05 00:55:22 -04:00
Adomas Venčkauskas
5e5b567782 Add a connector document integration endpoint
Specifically for google docs via the connector, but could potentially be
used for any integration via HTTP or connector.
2018-04-20 13:08:34 +03:00
Martynas Bagdonas
991a50d090 New PDF recognizer 2018-02-20 09:32:06 +02:00
Dan Stillman
9a43b53ebe Show file path instead of "(null)" when installing style via file open
And fix deprecation warning from passing an nsIFile

(Also updates the Zotero.Styles.install() documentation to note that the
first parameter's `file` property can be a string path.)
2017-12-08 00:42:03 -05:00
Dan Stillman
52bbb79fd0 Remove citeproc-prereqs, which isn't necessary anymore 2017-09-30 19:07:29 -04:00
Dan Stillman
e9439c978b Allow setting data directory via -datadir command-line flag
Can be an absolute path or 'profile' to use 'zotero' subdirectory of
profile directory as in earlier versions (but which won't be treated as
a legacy location eligible for migration)

Closes #1305
2017-09-11 03:52:51 -04:00
Dan Stillman
d8d9758f27 Filter stack displayed in startup error dialog 2017-09-11 03:52:51 -04:00
Dan Stillman
48778b5d50 Fix "undefined" for stack when a string is passed as Zotero.startupError 2017-09-11 03:52:51 -04:00
Dan Stillman
9652b9f553 Fix logged errors and debug messages in timeline 2017-07-29 22:17:08 -04:00
Dan Stillman
4c9f389aa8 Fix external zotero:// links 2017-07-29 17:13:46 -04:00
Dan Stillman
33b40829b8 Add locale switcher to Advanced prefs
Closes https://www.zotero.org/trac/ticket/1733 (!)
2017-07-21 07:51:57 -04:00
Dan Stillman
ae19ffcf9b Use getService() for another protocol handler call
Follow-up to dd5d3a8668 -- not sure if this one matters, but probably
can't hurt
2017-07-12 18:59:46 -04:00
Dan Stillman
55b2dc39bf Fix Firefox 55 breakage (and remove unnecessary locale lookups)
We were manually looking up the current locale in various places and
passing it to nsIStringBundleService::createBundle(), but that hasn't
even been a supported argument for years. (I assume it was a long time
ago?)
2017-07-09 06:59:50 -04:00
Dan Stillman
86cf7cbd07 Update translators/styles at startup and on push notifications
Previously, if a translator or style was fixed, people didn't get the
fix until their client checked the repository for updates, which could
take up to 24 hours. Now, in addition to checking once a day, we check
every time Zotero is started and also when we receive a notification
from the streaming server, which happens immediately after a translators
or style is updated on GitHub. To avoid DDoSing ourselves, the
notification includes a random delay (within a given period) before the
update is triggered by the client.

The streaming server connection is now made when either "Automatically
check for updated translators and styles" or "Sync automatically" is
enabled. It can be disabled via the extensions.zotero.streaming.enabled
pref.
2017-07-04 18:46:30 -04:00
Dan Stillman
ef1715e9ee Fix "Generate Report from Collection" when sorting by creator or date 2017-06-22 05:48:11 -04:00
Dan Stillman
653f041140 Fix report generation after 4e1937680f 2017-06-04 21:33:14 -04:00
Tom Najdek
14bf3184bb Fixes and tweaks to make tests work with babelized code
* Use mocha, chai & sinon from the npm. As of sinon 2.0
  sinon-as-promised is no longer required so it is removed
* Tweak code to re-use the same loader with the same environment
  throghout the code
* Introduce browserify step for testing tools that only provide
  node-compatible libraries (sinon, chai-as-promised)
* Introduce copy step for test data to resolve multiple issues with
  tests depending on files not being symlinks
* Re-introduce custom implementation of setTimeout to resolve issues
  with few tests
* Re-introduce custom Bluebird Promises config & monkey patch
2017-06-01 11:36:16 -04:00
Dan Stillman
d5a8a3420d Additional locale service updates for Firefox 54 compatibility
Follow-up to 0ac37ab65a
2017-05-26 01:37:54 -04:00
Dan Stillman
6afc58a629 Move require() into ZoteroContext and fix Bluebird module path 2017-05-24 00:58:41 -04:00
Dan Stillman
eaf8d36963 Adds a -debugger command-line flag to start the devtools server
Follow-up to https://github.com/zotero/zotero-standalone-build/commit/22cfe2404

The devtools must be included in the build by passing the -t flag to
build.sh in zotero-standalone-build.

After starting Zotero with the flag, connect from a Firefox instance
with remote debugging enabled by choosing "Connect…" from the Web
Developer menu and connecting to port 6100.
2017-03-17 17:12:12 -04:00