Commit graph

14 commits

Author SHA1 Message Date
Dan Stillman
bbb6434524 Add test for short DOI parsing
Follow-up to #1356
2017-11-07 16:53:31 -05:00
Dan Stillman
01c71fd970 Add cleanDOI() tests
In advance of #1356

We're not properly handling DOIs in parentheses or brackets (which would
require non-regex logic), so those tests are skipped for now.
2017-11-07 15:29:32 -05:00
Adomas Venčkauskas
dbeecb9b0a Make itemFromCSLJSON independent of Zotero.Item existance.
Addresses !zotero/zotero-connectors#121"
2017-05-08 09:24:34 +03:00
Dan Stillman
e397d12d42 Update whitespace chars in cleanISBN/cleanISSN tests for Firefox 52+
Farewell, Mongolian Vowel Separator
2017-04-14 23:14:22 -04:00
Adomas Venčkauskas
bf1c52a5fd Get a better last name if current guess starts with weird symbols 2017-02-18 18:12:24 +01:00
Dan Stillman
9ffab20a09 Add option to Zotero.Utilities.ellipsize() to truncate at word boundary 2016-12-29 04:01:00 -05:00
Dan Stillman
eb1aa43da2 Remove test for Extra field parsing after 30f7ef093 2016-09-28 11:45:18 -04:00
Dan Stillman
21d3ca298b Merge branch '4.0' 2016-09-18 18:39:18 -04:00
Dan Stillman
208d470531 Fix test failures 2016-03-07 17:13:30 -05:00
Dan Stillman
daf4a8fe4d Deasyncification 🔙 😢
While trying to get translation and citing working with asynchronously
generated data, we realized that drag-and-drop support was going to
be...problematic. Firefox only supports synchronous methods for
providing drag data (unlike, it seems, the DataTransferItem interface
supported by Chrome), which means that we'd need to preload all relevant
data on item selection (bounded by export.quickCopy.dragLimit) and keep
the translate/cite methods synchronous (or maintain two separate
versions).

What we're trying instead is doing what I said in #518 we weren't going
to do: loading most object data on startup and leaving many more
functions synchronous. Essentially, this takes the various load*()
methods described in #518, moves them to startup, and makes them operate
on entire libraries rather than individual objects.

The obvious downside here (other than undoing much of the work of the
last many months) is that it increases startup time, potentially quite a
lot for larger libraries. On my laptop, with a 3,000-item library, this
adds about 3 seconds to startup time. I haven't yet tested with larger
libraries. But I'm hoping that we can optimize this further to reduce
that delay. Among other things, this is loading data for all libraries,
when it should be able to load data only for the library being viewed.
But this is also fundamentally just doing some SELECT queries and
storing the results, so it really shouldn't need to be that slow (though
performance may be bounded a bit here by XPCOM overhead).

If we can make this fast enough, it means that third-party plugins
should be able to remain much closer to their current designs. (Some
things, including saving, will still need to be made asynchronous.)
2016-03-07 17:03:58 -05:00
Dan Stillman
72c927c840 Fix Zotero.Utilities tests, which were being skipped accidentally
Unfortunately this will need to be partly redone, since retrieveItem(), and
therefore itemToCSLJSON(), and therefore itemToExportFormat(), need to be
synchronous. The item data load statements in itemToExportFormat() will
probably need to be performed earlier, when they can be async, and made
available to the session for retrieval by retrieveItem(), but I'll let someone
more familiar with the citation infrastructure do that.

This restores some code in retrieveItem() that may have been accidentally
removed in a merge, though it probably won't be useful anymore anyway.

Addresses #529
2016-02-04 04:05:46 -05:00
Dan Stillman
7f43ca9503 Merge branch '4.0' 2015-11-01 21:22:13 -05:00
Simon Kornblith
9bb01d737c Merge branch '4.0' into sjk/659 2015-06-01 00:03:20 -04:00
Dan Stillman
ac12d5891a Rename remaining files to *Test.js
Closes #701
2015-05-19 14:46:17 -04:00
Renamed from test/tests/utilities.js (Browse further)