Commit graph

6223 commits

Author SHA1 Message Date
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
a55852ea1c Log Zotero.alert() calls to the terminal 2017-05-31 00:43:57 -04:00
Dan Stillman
61452a835b Fix auto-restore of automatic backup on DB corruption error 2017-05-31 00:43:57 -04:00
Dan Stillman
013dc958b3 Restore cleaner error and item-selection button for note-too-long error 2017-05-31 00:10:00 -04:00
Dan Stillman
5d16352f57 Don't show "Remove Item from Collection" for child items
Test forthcoming once tests are working again
2017-05-27 18:38:28 -04:00
Dan Stillman
aa05920117 Don't break getLocaleCollation() in Firefox <54 (after a73b2403b) 2017-05-27 05:38:29 -04:00
Dan Stillman
d6c36ae9a3 Update help URLs and move to config file 2017-05-27 05:32:01 -04:00
Dan Stillman
a73b2403b0 Fix getLocaleCollation() in Firefox 54 2017-05-27 05:32:01 -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
7fc188b172 Fix crashing for some actions in duplicate items
Necessary after more strict error handling in c4411e1ad3
2017-05-24 18:24:26 -04:00
Dan Stillman
8bc76dd2db Restore logging of unhandled errors from Bluebird (since 9aa057edee) 2017-05-24 18:24:26 -04:00
Dan Stillman
aa321f3495 Add example async/await to test Babel transform 2017-05-24 00:59:45 -04:00
Dan Stillman
6afc58a629 Move require() into ZoteroContext and fix Bluebird module path 2017-05-24 00:58:41 -04:00
Dan Stillman
319edae7f2 Update citeproc-js to 1.1.169 2017-05-23 17:39:10 -04:00
Tom Najdek
9aa057edee Introduce a build system
* Add a multi-process, gulp-based build system to support es6 features,
  async/await, jsx and scss
* Add a package.json to support dependency management and allow starting
  the build process via npm
* Replace embedded Bluebird library with npm-installed one
* Add react, react-dom and web-library
* Introduce a custom require() loader in include.js as well as a minimal
  local require() implementation in various other places
2017-05-23 17:02:50 +01:00
Dan Stillman
e1fb28faa9 Convert some object ids from strings to integers after 4e1937680 2017-05-23 02:10:26 -04:00
Dan Stillman
4e1937680f Throw error if non-number is passed to Zotero.DataObjects.getAsync()
Previously, if an id was psased as a string and the id existed in the
cache, an error wouldn't be thrown, but if there id wasn't in the cache
(e.g., because it was in an unloaded library) it would. This requires an
integer in all cases.

Note that, among other things, any code that gets ids from object keys
will need to convert them to integers before passing to getAsync().
2017-05-23 02:04:58 -04:00
Dan Stillman
265df6d48c Skip edit check if skipAll is passed to object save 2017-05-22 17:29:56 -04:00
Dan Stillman
0ac37ab65a Firefox 54 compatiblity for locale service
Services.locale.getApplicationLocale() -> getAppLocale()
(nsILocaleService -> mozILocaleService)

It's possible this will fix some of the locale resolution problems in
Standalone:

"This is actually a meaningful change because the old one was actually
using OS locale for platforms other than Windows. The new one is using
the app locale for all platforms." [1]

[1] https://bugzilla.mozilla.org/show_bug.cgi?id=1346674#c0
2017-05-22 06:09:25 -04:00
Dan Stillman
1b8704f133 Firefox 54 compatibility: File.createFromFileName() returns a promise 2017-05-22 06:04:27 -04:00
Dan Stillman
a3eea03a38 Firefox 54 compatibility: rename "new" and "delete" XBL methods 2017-05-22 06:03:14 -04:00
Dan Stillman
ddc9989d82 Fix refresh when opening related-item box in note editor 2017-05-19 12:36:03 -04:00
Dan Stillman
1cbc2440ec Make a missing related item not fatal
Since item relations are synced with individual items, an item can exist
before the item it's related to has been downloaded.
2017-05-19 12:11:58 -04:00
Dan Stillman
fc4eb5308f Remove related-item relations when deleting item 2017-05-19 12:11:51 -04:00
Dan Stillman
8edd8830da Remove reference to 'publications' library type in URI.getLibraryPath() 2017-05-19 12:11:21 -04:00
Dan Stillman
90a27f8d4b Add Zotero.URI.getURIItemLibraryKeyFromDB()
Allows getting libraryID and key without relying on library data being
loaded (e.g., at startup)
2017-05-19 12:11:21 -04:00
Dan Stillman
5873e554f1 Allow functions for testing and repair in DB integrity checks
This can be used for things that can't be checked or repaired with SQL
alone, or that are too difficult to do that way.
2017-05-19 12:11:14 -04:00
Dan Stillman
caf61bec2f Use COUNT(*) > 1 for DB integrity check queries 2017-05-19 06:33:03 -04:00
Dan Stillman
cf125435fb Update citeproc-js to 1.1.167 2017-05-19 04:51:20 -04:00
Dan Stillman
05dcc11a8d Update localized string name
Most localizations still say "Firefox" for this string, so this will
clear those.
2017-05-17 21:41:40 -04:00
Dan Stillman
d9fbccca67 Add item sanity check to note editor
When refreshing the note editor, store the associated itemID on the
textbox, and check it when saving to make sure it's for the expected
note. This might prevent weird situations (which I can't reproduce, but
there was a report in the forums [1]) where something goes wrong and the
note doesn't refresh when selecting a new item, and then one note's
content is saved over another's.

[1] https://forums.zotero.org/discussion/65708/
2017-05-17 21:41:40 -04:00
Dan Stillman
c4411e1ad3 Crash app if there's an error selecting an item 2017-05-17 21:41:39 -04:00
Adomas Venčkauskas
182cf67a97 Fix wrong localization arg passing 2017-05-15 18:26:41 +03:00
Dan Stillman
7e95f8fc51 Use proper alerts for export errors 2017-05-14 05:07:18 -04:00
Dan Stillman
e1986b460e Fix failed export due to missing attachment path 2017-05-14 05:06:37 -04:00
Dan Stillman
eb42152c42 UI fixes for read-only notes
- Don't show toolbar in read-only note editor
- Get rid of "undefined" button in CR window
- Better padding/alignment in CR window
2017-05-12 20:01:47 -04:00
Dan Stillman
be7cc45c0e Better debug logging for CR error 2017-05-12 17:53:19 -04:00
Dan Stillman
a92d469466 Remove accidental 'false' in 20121b9b9 2017-05-12 06:16:29 -04:00
Dan Stillman
20121b9b97 Fix tag selector tests (broken in 5963c02db) 2017-05-12 06:13:02 -04:00
Dan Stillman
5963c02dbb Fix "Display All Tags in This Library" (broken in fe186333b) 2017-05-12 05:37:46 -04:00
Dan Stillman
9de6a55bce Better approach to opening files after on-demand downloads
Follow-up to 44507ce20b
2017-05-11 01:26:46 -04:00
Dan Stillman
b3acb12973 Don't show Modified if attachment is missing 2017-05-11 01:07:21 -04:00
Dan Stillman
44507ce20b Prevent conflicting file downloads on double double-click 2017-05-11 01:05:55 -04:00
Dan Stillman
60810ea0a0 Fix access date without time coming from sync 2017-05-11 00:44:37 -04:00
Dan Stillman
a207e388db Fix attachment download progress pies 2017-05-10 23:27:28 -04:00
Dan Stillman
5b5da4140b Display connection error when linking sync account 2017-05-10 02:32:21 -04:00
Dan Stillman
b60fdacd3f Fix whitespace and description in build_typeSchemaData.html 2017-05-08 18:51:50 -04:00
Adomas Venčkauskas
e1f09d4655 Remove unneeded connector files, update connectorTypeSchemaData.js
Addresses zotero/zotero-connectors#121
2017-05-08 14:38:03 +03: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
Adomas Venčkauskas
746171ab78 Fix doc.prefs.noteType handling with NaN values 2017-05-08 09:24:34 +03:00
Dan Stillman
c0a47713f3 Remove extra argument in removeAttribute() 2017-05-07 23:45:33 -04:00
Dan Stillman
4273f14fe1 Optimize items list refreshing
When refreshing, keep the previous list intact, removing only the items
that aren't in the new list and sorting only the newly added items.
2017-05-07 23:36:28 -04:00
Dan Stillman
e0e22225bc Fix entering date without time into Accessed
https://forums.zotero.org/discussion/65560/5-0-beta-accessed-field-changes-dates
2017-05-05 17:59:53 -04:00
Adomas Venčkauskas
b679adad45 Potential bugfixery for #1218 2017-05-05 14:53:55 +03:00
Dan Stillman
7a51f5e3cc Update citeproc-js to 1.1.165 2017-05-05 05:20:03 -04:00
Adomas Venčkauskas
b80cdb2915 A couple more changes to document prefs dialog 2017-05-05 11:19:34 +03:00
Dan Stillman
43d12ee3b7 Remove debugging 2017-05-05 03:27:15 -04:00
Dan Stillman
40da5f61a0 Still process downloads if uploads fail for a library 2017-05-05 03:26:29 -04:00
Dan Stillman
021cfa8b3b Better debug output for objects in sync queue skipped for uploading 2017-05-05 01:38:09 -04:00
Dan Stillman
2f0391fb9c Clean up some comments and debug lines 2017-05-05 01:06:00 -04:00
Dan Stillman
a1bd2bace5 Remove objects from sync queue if missing from response
While objects in the sync queue that fail to save should remain in the
queue, objects that just don't exist remotely need to be removed, or
else they'll be retried forever.
2017-05-05 01:04:16 -04:00
Dan Stillman
ad9c2ed36c Use coroutine() in Zotero.Sync.Data.Engine::_downloadObjects() 2017-05-05 00:30:00 -04:00
Dan Stillman
b30e168c21 Add Zotero.Utilities.pluralize()
This makes it a little easier to use the proper plural form of a word.
Currently this only supports English forms and is used only in debug
output. For proper plural form support, use PluralForm.jsm.
2017-05-05 00:21:30 -04:00
Dan Stillman
397ea5875a Use Set for arrayUnique 2017-05-05 00:18:35 -04:00
Dan Stillman
2eef1702e0 Prevent items in group libraries from being added to My Publications
And remove existing group items that have been added
2017-05-04 21:18:44 -04:00
Dan Stillman
3561864542 Ignore drags to tag selector background
This was causing tags to be created with the text of all tags.
2017-05-04 13:51:16 -04:00
Dan Stillman
697937a72c Make file sync timestamp comparison a little more lenient
There was a report [1] of slow file syncing that showed all file
timestamps being reported as ending with 020 (e.g., 1436492361020). The
previous code assumed that systems without millisecond precision would
report as whole seconds, so the timestamp checks weren't matching and it
was moving on to hash-based checks (which seemed to be taking a very
long time, but that's another matter). This changes the comparison so
that, as long as both timestamps floor to the same whole second, they'll
be considered equal.

[1] https://forums.zotero.org/discussion/65515/5-0-beta-sync-problem
2017-05-04 02:04:47 -04:00
Adomas Venčkauskas
8f19d1f826 Update citeproc instances in Integration on Styles.reinit
Closes zotero/zotero-word-for-windows-integration#34
2017-05-03 14:35:44 +03:00
Adomas Venčkauskas
37fa0c203f Write sessionID into the doc on new session creation 2017-05-03 14:34:00 +03:00
Adomas Venčkauskas
6336a30cb9 Remove obsolete styles related code 2017-05-03 14:00:17 +03:00
Adomas Ven
7d79865023 Merge pull request #1222 from adomasven/feature/document-preferences-cleanup
Document preferences cleanup
2017-05-03 13:09:49 +03:00
Dan Stillman
b2d91af90d Fix missing paren from 5b0b874435 2017-05-03 04:47:40 -04:00
Dan Stillman
2588a0a651 Simplify deleteCacheObjectVersions() query 2017-05-03 03:54:54 -04:00
Dan Stillman
5b0b874435 Purge old objects in sync cache after upload 2017-05-03 03:43:59 -04:00
Dan Stillman
aa1fc01b31 Fix syncing of related item removal 2017-05-02 20:15:54 -04:00
Dan Stillman
5f819b7baa Additional debugging for sync issue 2017-05-02 17:29:10 -04:00
Dan Stillman
4502b5e990 Debugging for sync issue 2017-05-02 16:56:55 -04:00
Adomas Venčkauskas
3c19bbffe4 Remove store references in document option. Closes #1216 2017-05-02 16:29:19 +03:00
Adomas Venčkauskas
5e3c7bf63d Fix test breakage from a76493f60 2017-05-02 15:09:12 +03:00
Adomas Venčkauskas
a76493f60d Fix noteType type issues when talking to js-ctypes libs
Reported https://forums.zotero.org/discussion/65496/zotero-5-185-bug-cant-insert-field
2017-05-02 14:45:06 +03:00
Dan Stillman
9e1533c32d Fix error with citations not in library (since f3ceb7f66) 2017-04-28 04:07:27 -04:00
Dan Stillman
fe88530120 Recover from a remotely missing parent collection 2017-04-28 03:18:50 -04:00
Dan Stillman
2db41b0adc Don't update various primary fields unnecessarily during save 2017-04-27 22:41:53 -04:00
Dan Stillman
7bd8f47dac Schema update step to remove linked files from My Publications 2017-04-27 15:33:25 -04:00
Dan Stillman
9bd01af2a5 Disallow inPublications for linked-file attachments 2017-04-27 15:33:24 -04:00
Dan Stillman
d715197b2f Don't show Show/Hide button in My Publications for linked files 2017-04-27 04:52:50 -04:00
Adomas Venčkauskas
8dacf4455d Revert accidental stopOnError change in 2bf53824 2017-04-27 11:46:35 +03:00
Adomas Venčkauskas
2bf5382431 Log errors from syncRunner concurrent caller 2017-04-27 11:40:30 +03:00
Dan Stillman
d527c340c6 Fix "text is not defined" error during full-text content sync 2017-04-26 02:44:01 -04:00
Dan Stillman
696e828a02 Merge pull request #1218 from adomasven/feature/JSON-pref-docs
Feature/json pref docs
2017-04-22 22:54:28 -04:00
Adomas Venčkauskas
7661f71d6c Fix broken integration test in a8d0110e 2017-04-21 11:12:02 +03:00
Dan Stillman
21a3bf8aa5 Fix indexing of synced full-text content 2017-04-21 02:59:24 -04:00
Adomas Venčkauskas
a8d0110e07 Add a deprecation warning to non-string params for #htmlSpecialChars
Revert change from ff74e0ff
2017-04-20 13:12:36 -04:00
Adomas Venčkauskas
bbec11e3eb Prepare 5.0 to handle JSON doc prefs 2017-04-20 18:03:15 +03:00
Adomas Venčkauskas
e272465f6c Fix DocumentData serialization hairiness due to #htmlSpecialChars
Add tests
2017-04-20 13:39:19 +03:00
Dan Stillman
d472752101 Collapse My Publications when first opened
Child items marked as visible are technically search matches, so we have
to take extra steps to keep the parents from being auto-expanded.
2017-04-19 21:56:38 -04:00
Dan Stillman
f3ceb7f66e Load object data when looking up integration items
Item data may not have been loaded for a library when requesting an item
from a document (e.g., for Refresh), so we need to load all data for
requested items to avoid unloaded-data errors. (Data isn't loaded if
it's already been loaded, so hopefully this doesn't slow things down too
much.)
2017-04-19 04:24:34 -04:00
Dan Stillman
ab2bedc0df Clear inPublications in PATCH JSON with false, not empty string 2017-04-19 03:18:05 -04:00
Dan Stillman
c03a0df226 Add settings table flag to auto-repair database on startup
This will allow the DB Repair Tool to only recreate the file and leave
schema knowledge to the client.

Addresses #895
2017-04-19 02:53:39 -04:00
Dan Stillman
698eb3358a Retry library sync on 409 error
Closes #928
2017-04-19 02:53:39 -04:00
Adomas Venčkauskas
ff74e0ff00 Do not return empty string for falsy arguments in Utilities.htmlSpecialChars 2017-04-18 16:21:49 +03:00
Dan Stillman
de7b56b8a1 Don't include items in My Publications in Unfiled Items 2017-04-17 21:34:08 -04:00
Dan Stillman
2160b1cb87 Remove stray console.log() calls in citeproc-js
This is breaking bibliography output for some citations.
2017-04-17 13:56:59 -04:00
Dan Stillman
8a7d405e4d Close #932, Disable file dragging into My Publications
Already disabled for collections pane, now for items pane
2017-04-16 03:35:02 -04:00
Dan Stillman
58f4dc3bb5 Unescape HTML in API upload errors 2017-04-14 23:14:22 -04:00
Dan Stillman
0920e25393 Make 404 handling for uploaded objects permanent
Related to https://github.com/zotero/dataserver/commit/aafda6d835
2017-04-14 23:14:22 -04:00
Dan Stillman
a2f11f5338 Update submodules 2017-04-14 23:14:22 -04:00
Dan Stillman
287a0b587b Update citeproc-js to 1.1.160 2017-04-14 23:14:22 -04:00
Adomas Venčkauskas
de269b3021 Make sure styles are loaded before opening doc-prefs dialog 2017-04-14 14:30:26 +03:00
Adomas Venčkauskas
49001572fd Remove dependency on zoteroIntegration.idl 2017-04-14 14:19:52 +03:00
Adomas Venčkauskas
0de22b132e Move document plugin interface description into integrationTests 2017-04-14 14:19:52 +03:00
Dan Stillman
e1c183b597 Fix link opening in standalone note windows 2017-04-13 05:51:52 -04:00
Dan Stillman
18bb18ba51 Update Zotero.Styles initialization to match translators 2017-04-13 05:51:52 -04:00
Dan Stillman
9b53570968 Fix bibliographyTest breakage after d5cf33a798
d5cf33a798 adds a `yield` to bibliography.js, which runs in modal
windows (e.g., Create Bib), but there's a weird interaction between
Bluebird and modal dialogs that can result in hangs -- presumably
something to do with things being queued on the event loop but the modal
dialog preventing other code from running? This was breaking
bibliographyTest, but it seemed to work fine for me in normal usage,
waiting properly for a running styles initialization to finish. It's
possible this problem is limited to tests, but in the past, at least, I
apparently decided that this was a general problem with `yield` in modal
dialogs [1]. (See also: [2].) In any case, calling `yield
Zotero.Styles.init()` from the Create Bib window was hanging the test,
so for now do a synchronous check for style initialization to avoid it,
and we should make sure that `yield` actually works in other contexts.

[1] https://github.com/zotero/zotero/commit/99dd1c069776
[2] https://github.com/zotero/zotero/commit/c2dd531cec4
2017-04-13 05:20:36 -04:00
Dan Stillman
ed3b18ba8c NodeList doesn't have forEach in Firefox 45 2017-04-13 01:21:36 -04:00
Dan Stillman
b7aab8b8d2 Don't break Zotero 2017-04-13 00:21:16 -04:00
Dan Stillman
6d18b46165 Fix test breakage after 5ff2a59f87
And remove all instances of `publicationsLibraryID`
2017-04-13 00:15:05 -04:00
Dan Stillman
5ff2a59f87 Move My Publications into My Library
Instead of My Publications being a separate library, have it be a
special collection inside My Library. Top-level items can be dragged
into it as before, and child items can be toggled off and on with a
button in the item pane. Newly added child items won't be shown by
default.

For upgraders, items in the My Publications library will be moved into
My Library, which might result in their being duplicated if the items
weren't removed from My Library. The client will then upload those new
items into My Library.

The API endpoint will continue to show items in the separate My
Publications library until My Publications items are added to My
Library, so the profile page will continue to show them.
2017-04-12 19:26:58 -04:00
Dan Stillman
e311279947 Remove obsolete quicksearch refresh in ItemTreeView::notify() 2017-04-12 19:26:58 -04:00
Dan Stillman
3c3ff32854 Better debug output when setting .synced on an item 2017-04-12 19:26:58 -04:00
Dan Stillman
b0140686f3 Add .regularOnly and .expandAll flags to ItemTreeView 2017-04-12 05:37:15 -04:00
Dan Stillman
6c1ba0aeee Don't wait for transaction when selecting item 2017-04-12 05:37:15 -04:00
Adomas Venčkauskas
7657c9044d Add Document.addEditBibliography to integration.js
See zotero/zotero-word-for-windows-integration#28 for background
2017-04-12 11:59:38 +03:00
Adomas Ven
2a5dbaa204 Merge pull request #1202 from adomasven/fix/doc-pref-window-unloaded-styles
Fix document preferences dialog failing when styles unloaded.
2017-04-12 11:52:58 +03:00
Adomas Venčkauskas
3e69da7e4c Prompt if style in document is not from official source 2017-04-12 11:47:57 +03:00
Adomas Venčkauskas
02c43c3643 Add integrationTests.js
Contains a dummy doc plugin, which is useful for:
- Testing integration.js functionality
- Serving as succint documentation for development of new integration
  plugins
2017-04-12 11:45:10 +03:00
Dan Stillman
747290be38 Don't show response text on HTTP error if empty 2017-04-11 04:18:10 -04:00
Dan Stillman
5d6478e507 429 and Retry-After support for API requests 2017-04-11 04:17:16 -04:00
Adomas Venčkauskas
269a250b4f Fetch a style if it is not installed on document preferences load 2017-04-10 11:24:22 +03:00
Adomas Venčkauskas
d5cf33a798 Fix document preferences dialog failing when styles unloaded.
Closes #1084
2017-04-10 11:24:22 +03:00
Dan Stillman
64414e49be Show UnexpectedStatusException response without prefix during sync 2017-04-07 23:36:06 -04:00
Dan Stillman
a64c6808e5 Always include server response in Zotero.HTTP.request() errors 2017-04-07 23:36:05 -04:00
Dan Stillman
3df66ccbe4 Fix duplicated error message when logging UnexpectedStatusException
Not sure what's causing this. (Bluebird?)

Also add stack to custom HTTP exceptions.
2017-04-07 23:36:05 -04:00
Dan Stillman
c0a2ec8a47 Promise cleanup in Zotero.Attachment.importFromURL()
Use `new Zotero.Promise` instead of `defer()` and `coroutine()` instead
of chained promises
2017-04-07 23:36:05 -04:00
Dan Stillman
4540edb622 Fix breakage from 406f50a3 2017-04-07 23:11:39 -04:00
Adomas Venčkauskas
5818935a32 Address file import bugs
I don't know why why, but wbp.saveDocument() destroys the
document object which is passed into it. This means that further access
of the document is impossible and raises errors, which we were not
handling properly and not returning on attachment saving.

I've added error handling and changed removed code which tries to access
the document after the Zotero.Utilities.Internal.saveDocument() call.

Addresses https://forums.zotero.org/discussion/64745/5-0-beta-apparently-stuck-at-saving-to
2017-04-07 14:35:49 +03:00
Adomas Venčkauskas
406f50a3fd Restore progress for attachments indication in connectors
78b1d2e regression
2017-04-07 13:25:20 +03:00
Dan Stillman
d8fed09578 Mark local collection as unsynced if missing remotely in item request
We should figure out when this happens, but in the meantime, recover
from it if it does.
2017-04-07 00:57:50 -04:00
Dan Stillman
172f36d050 Fix dragging in links on Linux 2017-04-05 14:25:04 -04:00
Dan Stillman
4867fc7e03 Fix onInit() in styled textbox if already initialized 2017-04-01 14:27:37 -04:00
Dan Stillman
4edcf5839b Don't show context menu on right-click on tag selector background 2017-04-01 11:24:01 -04:00
Dan Stillman
6174641cfa Reload primary data after tag rename instead of updating .synced
Follow-up to bb489a45c3 to mirror what Tags.removeFromLibrary() does
2017-04-01 03:13:26 -04:00
Dan Stillman
bb489a45c3 Upload modified items after tag rename
The web library will probably still display the old tag in addition to
the new one, at least until browser restart. We'll have to deal with
that separately.

Closes #1205
2017-04-01 02:54:24 -04:00
Dan Stillman
9bdb907751 Update submodules 2017-03-28 02:28:14 -04:00
Dan Stillman
cac01100a6 Avoid XML Parsing Error in Firefox console for ping requests 2017-03-28 02:17:15 -04:00
Dan Stillman
7b7b268727 Remove instance of legacy shorthand function syntax 2017-03-27 20:46:25 -04:00
Dan Stillman
3a8357cb95 Fix renaming and clearing of colored tags 2017-03-27 20:46:25 -04:00
Dan Stillman
fe186333be Drastically speed up tag selector refresh with many tags
When refreshing, if fewer than 100 tags to show, just create them from
scratch instead of updating the full set. Otherwise, remove the full set
from DOM and add it back in after updates to avoid reflows (from #1204).

There are various things that could be done to optimize this further
(avoiding unnecessary sorting during full refreshes, calculating a hash
of the full set and not updating it every time), but we should probably
just replace it with @tnajdek's React version first.

Closes #1204
2017-03-27 20:45:22 -04:00
Dan Stillman
8edd4b0523 Fix classic Add Citation dialog after 820755e15 2017-03-27 04:39:21 -04:00
Dan Stillman
bd287013fe Missing line from 499d4e3065 2017-03-27 02:12:58 -04:00
Dan Stillman
499d4e3065 Handle missing deleted.txt in unpacked source directory
Unpacked directories aren't actually supported anymore, but fix obvious
breakage if they were.
2017-03-27 02:08:16 -04:00
Dan Stillman
4477e42cf9 Remove fallback code for symlinked Standalone dev build
No longer possible
2017-03-27 02:07:14 -04:00
Dan Stillman
3a48439c1d Ignore clicks in tag selector not on tags 2017-03-26 18:11:23 -04:00
Dan Stillman
d357382dd1 Always invalidate items tree after sort 2017-03-26 05:20:10 -04:00
Adomas Venčkauskas
bc4afb6d85 Fixes report printing. Closes #1179.
Page Setup seems to have moved into the print dialog in Firefox a while
ago
2017-03-24 17:51:04 +02:00
Dan Stillman
edb53c31df Fix updating of tag selector after filtering the middle pane
Adds a 'refresh' event to libraryTreeView
2017-03-24 05:37:41 -04:00
Dan Stillman
820755e152 Rework libraryTreeView event handling
Changes `libraryTreeView::addEventListener('load')` and similar to
`libraryTreeView::onLoad.addListener(listener, once)`, etc. `once` is an
optional boolean that, when true, causes the listener to fire once and
then be removed. This is implicit for 'load'.

'load' maintains its special behavior of running immediately if the
treeview has already been loaded.

Also adds `waitForLoad()` and `waitForSelect()` functions that return
promises on event completion, since most uses of those events were just
resolving deferreds.
2017-03-24 05:23:56 -04:00
Dan Stillman
f4eb8ed3bb Pass chunk size to data generator
TODO: Add text fields for controlling number of items and chunk size

(Chunk size should be small for testing UI interactions and performance
but large for generating lots of data.)
2017-03-21 05:06:37 -04:00
Dan Stillman
d9b5fd78c9 Fix error from empty strings in data generator 2017-03-21 04:58:38 -04:00
Adomas Venčkauskas
dd921f340c Use data.detailedCookies in /connector/saveSnapshot 2017-03-16 17:06:01 +02:00
Dan Stillman
a3473896a5 Fix error showing some WebDAV verification errors 2017-03-13 16:02:34 -07:00
Dan Stillman
b732a82d55 Script to generate random item data
For building up a big library and testing UI interaction during writes

To use, load chrome://zotero/content/tools/data_generator.html in
Firefox (for now).

Could be improved a bit to add other kinds of data (collections,
child items, relations)
2017-03-09 04:02:09 -05:00
Dan Stillman
f9ea0af4cf Clean up a few data layer lines 2017-03-09 04:02:09 -05:00
Dan Stillman
b1fc6ac67c Fix (some) crashes switching collections while items are being added
The items list is generated from the database (via search), but new
items may have been added to the database but not yet been registered,
causing unloaded-data errors during sorting. Avoid that by not showing
unregistered items when generating the items list.

Additional protections are necessary -- it's still possible to get
errors, and maybe a crash, if an item has been registered but not yet
fully loaded -- but this addresses the most common one.
2017-03-09 04:02:09 -05:00
Dan Stillman
1711ba4dd4 Create temporary table for search without transaction 2017-03-09 04:02:09 -05:00
Adomas Venčkauskas
580cc32f6f Remove Promise.prototype.finally calls from translate.js not in ES6
We could monkey-patch a finally function in connectors as described in
this gist https://gist.github.com/jish/e9bcd75e391a2b21206b , but it
appears to silence propogation of unhandled rejections
and it could later come back to bite us in the butt.
Native and proper support for finally is, however, planned in ES7.
2017-03-07 12:38:36 +02:00
Dan Stillman
e9fd7f2dd1 Update Collection::getChildItems() when erasing item
Fixes #1188
2017-03-07 01:54:49 -05:00
Dan Stillman
dd5ae0f49c Fix Quick Copy drag with export format 2017-03-06 23:52:24 -05:00
Dan Stillman
9e59500619 Fix file sync error on Windows for old filenames containing colons
OS.Path.basename() stops at colons on Windows, so calling it on the full
path produces unexpected results.
2017-03-06 22:04:56 -05:00
Dan Stillman
59fb9d0226 Fix cross-library collection drag on Linux, probably 2017-03-04 16:38:00 -05:00
Dan Stillman
c180bce0f0 Check linked collections in both directions 2017-03-04 16:05:56 -05:00
Dan Stillman
d0d7aec4b0 Set 'copy' cursor feedback on cross-library collection drag 2017-03-04 04:17:51 -05:00
Dan Stillman
704e8ffeea Fix dragging collections between libraries 2017-03-04 04:17:25 -05:00
Dan Stillman
9ea82bb6cd Fix potential error dragging attachment with missing file 2017-03-03 16:40:28 -05:00
Dan Stillman
fe9fc8bc5a Asyncify various functions to fix cross-library drag-and-drop error
When dragging an item to another library, we have to check if there's a
linked item in the target library, but items might not yet be laoded in
the other library, so item.getLinkedItem() can fail with "Item [n] not
yet loaded].

Fixing required asyncifying the follow functions:

- Zotero.Item::getLinkedItem()
- Zotero.Collection::getLinkedCollection()
- Zotero.URI.getURIItem()
- Zotero.URI.getURICollection()
- Various integration functions
2017-03-03 16:40:28 -05:00
Adomas Venčkauskas
182b9a937b Fix (still) broken debug reporting for connectors (regression ef0d9afe8) 2017-03-03 15:02:33 +02:00
Dan Stillman
7c25093ca2 Fix various error propagation issues during translation
As noted in 27cb099c82, import translators should be rewritten to return
a promise from doImport() and wait for promises from successive
item.complete() calls. They should then be marked as minVersion: "5.0"
to be handled properly by this new code.

(But this tries to account, albeit with somewhat worse behavior, for
translators that haven't been rewritten and sandboxes without Promise
(which is currently the case with child sandboxes in the client).)

(Oh, and I haven't tested this at all in the connectors.)
2017-03-03 04:51:01 -05:00
Dan Stillman
7ccf781add Firefox 52 compatibility 2017-03-02 15:30:54 -05:00
Dan Stillman
8812fd4401 Add debugging for display error reported in forums
https://forums.zotero.org/discussion/64662/5-0-beta-no-items-displayed-in-center-pane
2017-03-02 15:30:54 -05:00
Adomas Venčkauskas
6539fc44e3 Don't allow setting 0 for feed item TTL 2017-03-02 17:53:58 +02:00
Dan Stillman
945dc2825b Don't restart until after clearing storage settings when changing user
Possible that this was working previously, but no particular reason to
think that quitZotero() shouldn't be synchronous.
2017-03-02 01:32:33 -05:00
Dan Stillman
3a5490a1ef If userID is set, migrate any item relations with local user key
DB update to go along with 0d8643087a
2017-03-02 01:32:33 -05:00
Dan Stillman
0d8643087a Update relations using local user key when first setting sync user
In case items are merged before the first sync
2017-03-01 23:38:45 -05:00
Dan Stillman
ba91a2ea52 Fix updating of notes list when child note is changed or moved to trash 2017-03-01 01:39:39 -05:00
Dan Stillman
82b789e083 Always show items-loading message switching collections in citation dialogs
Previously it only showed if library data hadn't been loaded, but
sorting can also take a little time when switching between collections.
2017-02-28 03:34:55 -05:00
Dan Stillman
737f54a70c Fix Edit Bibliography window 2017-02-28 03:34:55 -05:00
Dan Stillman
6c58389563 Fix translation error when firstName is null for fieldMode 1
Some translators (e.g., CrossRef) return firstName: null with fieldMode:
1, which was causing an error
2017-02-27 23:34:16 -05:00
Dan Stillman
d0a1ac9677 Fix potential incorrect placement of new subcollections
For one particular complicated collection structure, new collections
could be placed in the wrong place until a restart.
2017-02-27 04:51:04 -05:00
Frank Bennett
6b2bf34732 Probable typo in dataObject.js
This line just crashed on me during a sync operation in Juris-M 5.0. It looks like a typo.
2017-02-27 16:36:47 +09:00
Dan Stillman
fa680bbbf5 Fix startup error on Windows DB upgrades caused by b2b751e0a0 2017-02-26 06:14:01 -05:00
Dan Stillman
b2b751e0a0 Fix error when DB backup can't be opened 2017-02-25 18:09:15 -05:00
Dan Stillman
cb5e1fa431 Handle paginated results in Zotero.Sync.APIClient.getGroups() 2017-02-24 18:41:37 -05:00
Dan Stillman
a9dda10a7d Add Zotero.Sync.APIClient.getPaginatedResults()
Function that automatically follows Link headers and makes additional
requests as necessary, feeding the XMLHTTPRequest object from each
request to a reducer function.
2017-02-24 18:39:23 -05:00
Dan Stillman
57626101ac Fix incorrect tests due to the bug fixed in b21729edd1 2017-02-24 03:50:31 -05:00
Dan Stillman
0a1629e986 Fix typo in debug line 2017-02-24 02:36:18 -05:00
Dan Stillman
80a0826eb6 Add archived group handling to sync runner
- Archive remotely missing that user chooses to keep
- Ignore archived groups that don't existing remotely
- Unarchive groups that become available again
2017-02-24 02:36:18 -05:00
Dan Stillman
2fe756c1c9 Add collections pane context-menu option to remove archived libraries 2017-02-24 02:36:18 -05:00
Dan Stillman
9ac458e05c Add 'archived' property to Zotero.Library objects
Set when a user loses access to a library but chooses to keep it as a
read-only library.
2017-02-24 02:36:18 -05:00
Dan Stillman
88184b341b Setting a library's 'editable' to false should do same for 'filesEditable' 2017-02-24 02:36:18 -05:00
Dan Stillman
b21729edd1 Fix Zotero.Sync.Data.Local._libraryHasUnsyncedFiles()
Always returned true
2017-02-24 02:36:18 -05:00