Commit graph

8695 commits

Author SHA1 Message Date
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
1a4b7121d3 Move waitForTagSelector() into support.js 2017-03-24 00:51:25 -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
8bc5d37dd1 Update word plugin status after installation. Closes #1200 2017-03-20 19:23:37 +02:00
Adomas Venčkauskas
2d93b07220 Replace old-style object properties in word-processor-plugin-installer 2017-03-20 17:24:16 +02: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
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
640aaa1557 Add loadPrefPane(paneName) support function
E.g., loadPrefPane('sync') to open the prefs and select the
'zotero-pane-sync' pane
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
1b81004a93 Remove errant HTML tag 2017-03-03 16:40:28 -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
3d0c7d3c43 Update locales from Transifex 2017-03-02 03:49:28 -05: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
a35d903e77 Increase size of browser window during tests
Makes it easier to manually increase Zotero pane before a timeout while
debugging (though the page should just be made bigger by default)
2017-02-27 04:54:11 -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
Dan Stillman
18877a9748 Additional test for updateSynced()
Addresses #1187
2017-02-27 03:11:09 -05:00
Dan Stillman
e7ef1b4b1f Merge pull request #1187 from fbennett/patch-1
Probable typo in dataObject.js
2017-02-27 03:00:42 -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
3ba2b40c4c Remove obsolete Zotero.Libraries.isFilesEditable test after 88184b341 2017-02-24 03:29:50 -05:00
Dan Stillman
0a1629e986 Fix typo in debug line 2017-02-24 02:36:18 -05:00