Commit graph

7039 commits

Author SHA1 Message Date
Dan Stillman
b21e07d700 Fix group saving and copying attachments between libraries 2015-05-23 21:10:07 -04:00
Dan Stillman
5e1c25f4b5 Async Zotero.File.copyDirectory() 2015-05-23 21:08:11 -04:00
Dan Stillman
e1355cef2f Show only "Export Files..." in context menu for My Publications 2015-05-23 19:07:14 -04:00
Dan Stillman
0f519dc757 Post-merge cleanup in fileInterface.js
(Though not enough to actually get it working)
2015-05-23 18:35:28 -04:00
Dan Stillman
aa730bb3bd Merge branch '4.0'
Conflicts:
	chrome/content/zotero/fileInterface.js
	chrome/content/zotero/xpcom/translation/translate_item.js
	chrome/content/zotero/xpcom/utilities_internal.js
	chrome/content/zotero/zoteroPane.js
2015-05-23 18:26:32 -04:00
Dan Stillman
ebe41ac51a Fixes #724, PDF indexing binaries not downloading
And adds Zotero.File.download(uri, path)
2015-05-23 18:03:25 -04:00
Dan Stillman
6b87c641d9 Experimental approach to cancelling unnecessary promises
If a view or other resources are destroyed while a promise is being
resolved, subsequent code can fail. This is generally harmless, but it
results in unnecessary errors being logged to the console.

To address this, promises can use a new function,
Zotero.Promise.check(), to test whether a value is truthy or 0 and
automatically throw a specific error that's ignored by the unhandled
rejection handler if not.

Example usage:

getAsync().tap(() => Zotero.Promise.check(this.win));

If this.win is cleaned up while getAsync() is being resolved, subsequent
lines won't be run, and nothing will be logged to the console.
2015-05-23 04:43:37 -04:00
Dan Stillman
3fc09add3a Attachment fixes
Change all attachment functions to take parameter objects, including a
'collections' property to assign collections. (Previously, calling code
assigned collections separately, which required a nested transaction,
which is no longer possible.)

Fixes #723, Can't attach files by dragging
2015-05-23 04:43:37 -04:00
Simon Kornblith
6e2d1f683a Get translation at least partly working
I'm pretty sure I've only scratched the surface here, but at least
basic things work.
2015-05-22 22:24:46 -04:00
Dan Stillman
61cb01b7c2 Collection/item tree selection improvements
Wait for the pane's collectionSelected() to finish before returning from
collectionTreeView select methods (e.g., selectLibrary()), and wait for
previous items view to finish loading before creating a new one in
collectionSelected(). This ensures that the items view has been created (though
not loaded) before returning from a select. The tree can still get a bit
confused switching between collections, but I think we're getting closer to
fixing that.

Also switch the items tree to use the same pattern.

This also fixes dragging items to collections (#731).
2015-05-22 19:22:00 -04:00
Dan Stillman
a2d4b05064 Add group test 2015-05-22 16:04:40 -04:00
Dan Stillman
23e4e54c29 Add extra newline between lines in error reports 2015-05-22 16:03:06 -04:00
Dan Stillman
f164fef3d2 Skip Quick Copy until #520 is done 2015-05-22 16:00:22 -04:00
Dan Stillman
22e0ba3a22 Fix hangs related to data object purging 2015-05-22 15:59:15 -04:00
Dan Stillman
cf010d7748 Fix collection collapse/expand issues
Fixes #722, Everything disappears
2015-05-22 14:43:09 -04:00
Dan Stillman
432d89af24 Group data layer fixes 2015-05-22 14:41:59 -04:00
Dan Stillman
32abbe7c25 Load groups at startup, and make Zotero.Groups functions synchronous
Groups were already being loaded for the collections list, so we might
as well just store them initially and let Zotero.Libraries.getName() be
a synchronous call.
2015-05-22 04:52:05 -04:00
Dan Stillman
f0b44b2047 Update Travis badge for master branch 2015-05-22 03:00:58 -04:00
Dan Stillman
260a638dfb Increase resetDB() timeout to 60s, though this seems untenable
Still failing intermittently on Travis at 45s, though other times it
takes 13 seconds.
2015-05-21 23:50:58 -04:00
Dan Stillman
f4446e268d Use more concise 1-line format for SQL logging
SELECT * FROM foo WHERE bar=? AND qux=? ['foo', 1]

Not sure why I didn't do this years ago...
2015-05-21 23:44:10 -04:00
Dan Stillman
ada657fcb8 Functions to modify 'version'/'synced' efficiently, plus some other fixes 2015-05-21 23:44:10 -04:00
Dan Stillman
cf3eed5f14 Add missing yields in tests 2015-05-21 23:44:09 -04:00
Dan Stillman
8f5d976479 Test saved version via property as well as getField() 2015-05-21 23:44:09 -04:00
Dan Stillman
a3f4fe181f More data layer changes
- Moved ::_get() and _set() from Collection/Search into DataObject, and
  disabled in Item
- Don't disable new items after save. We now put new objects into the
  DataObjects cache from save() so that changes made post-save are
  picked up by other code using .get().
- Added 'skipCache' save() option to avoid reloading data on new objects
  and adding them to the cache. (This will be used in syncing, where
  objects might be in another library where they're not needed right
  away.) Objects created with this option are instead disabled to
  prevent reuse.
- Modified some tests to try to make sure we're reloading everything properly
  after a save.
- Documented save() options
2015-05-21 23:39:00 -04:00
Dan Stillman
8352934009 Merge pull request #671 from gracile-fr/localize-locators-labels
Add localized locator labels
2015-05-21 02:19:16 -04:00
Dan Stillman
4792b7cd48 Data layer fixes
- Fixes some saving and erasing issues with collections and searches
- Adds Zotero.DataObject::eraseTx() to automatically start transaction,
  and have .erase() log a warning like .save()
- Adds createUnsavedDataObject() and createDataObject() helper functions
  for tests
2015-05-20 23:16:18 -04:00
Dan Stillman
e8a04dffd0 Relations support for Z.DataObjectUtilities.diff() and applyChanges() 2015-05-20 23:16:18 -04:00
Dan Stillman
c9aed60acd Rename error/warning icons 2015-05-19 22:42:43 -04:00
Dan Stillman
0e73b1cc61 Remove code to check for changes after note reselection
No longer necessary, since items aren't reselected on change, and the
dateModified check was insufficient
2015-05-19 22:34:49 -04:00
Dan Stillman
3ac22b6242 Merge locales from Transifex 2015-05-19 17:28:40 -04:00
Dan Stillman
5f8552ce63 Merge pull request #716 from rmzelle/doi-menu
Add DOI-field context-menu
2015-05-19 17:10:08 -04:00
Dan Stillman
8cfca53b48 Register itembox and noteeditor with notifier and refresh on update
Since selected items are no longer reselected, the boxes now need to
refresh themselves.
2015-05-19 17:08:45 -04:00
rmzelle
4bdef75074 Add DOI-field context-menu 2015-05-19 16:25:02 -04:00
Dan Stillman
ac12d5891a Rename remaining files to *Test.js
Closes #701
2015-05-19 14:46:17 -04:00
Dan Stillman
4ed15ddfc3 Increase resetDB test timeout to 45 seconds
It takes <1.5 seconds on my system, but it's taking over 30 seconds on
Travis. Might not be worth running it there, since almost anything that
would cause that to fail would cause the initialization to fail in the
first place.
2015-05-19 14:44:53 -04:00
Dan Stillman
f74d591883 Merge pull request #717 from aurimasv/api_syncing-677
[api_syncing] Merge 849803473a
2015-05-19 13:59:45 -04:00
Aurimas Vinckevicius
f7868be884 Consolidate _saveAttachment error and callback handling 2015-05-19 03:12:37 -05:00
Dan Stillman
05efaea918 Reenable Travis testing 2015-05-19 04:07:45 -04:00
Dan Stillman
0e33d1ef46 Disable spuriously failing test
waitForItemsLoad() isn't waiting for the item pane message to be updated, so
this test fails.
2015-05-19 04:00:06 -04:00
Aurimas Vinckevicius
ed734bfdf3 Merge 849803473a into api_syncing
Fixes #677
2015-05-19 02:41:03 -05:00
Dan Stillman
eee0e22bf6 Add 'version' to sync cache primary key
The sync cache will have pristine copies of the existing versions of
local objects for better conflict resolution, but downloads will get
saved to the sync cache first before processing, so the cache needs to
be able to hold more than one version.
2015-05-19 01:25:31 -04:00
Dan Stillman
ab4320df07 Add Zotero.Libraries.getAll() 2015-05-19 01:20:12 -04:00
Dan Stillman
e0ea3ca99b Don't show "[object Object]" in varDump() output 2015-05-19 01:17:12 -04:00
Dan Stillman
3b0b2c59b7 Always show HTTP request resolution, even without debug flag 2015-05-19 01:17:12 -04:00
Dan Stillman
abaa4da5ab Much better data object change detection
Replace Z.DataObjects::diff() with Z.DataObjectUtilities.diff(). Instead
of just returning two objects with the differing fields, the new diff()
generates a changeset with operations to apply with applyChanges(),
including at the array member level for collections and tags. This,
combined with cached pristine copies of objects, will allow for vastly
better conflict resolution, with automatic merging of non-conflicting
changes.

Creators currently don't show granular changes, and ordering might make
it too tough to do so. Relations diffing isn't yet implemented.
2015-05-19 01:17:12 -04:00
Dan Stillman
daad18c1b5 Include running function in current count in ConcurrentCaller log line 2015-05-15 01:47:20 -04:00
Dan Stillman
f727b224e7 Fix tag diffing 2015-05-15 01:47:20 -04:00
Dan Stillman
7a93b132b3 Merge pull request #715 from rmzelle/proxylist-editbutton
Add Edit button to proxy list
2015-05-14 13:10:20 -04:00
rmzelle
bd8db988f3 Add Edit button to proxy list 2015-05-14 09:26:38 -04:00
Dan Stillman
3f4eebe51c Set 'synced' to false automatically on save, unless value is changed
And add 'skipSyncedUpdate' option to leave untouched

Also move some save logic into Zotero.DataObject.prototype._saveData(),
and call that first.
2015-05-13 19:32:53 -04:00