Commit graph

7320 commits

Author SHA1 Message Date
Dan Stillman
2b00a53e02 Accept headers and string path in Zotero.Utilities.Internal.saveURI() 2015-10-29 02:42:44 -04:00
Dan Stillman
3ff6626c12 Zotero.Attachments tweaks
Accept a file path from some functions and skip charset detection if
item already has a charset set
2015-10-29 02:41:01 -04:00
Dan Stillman
55c1f0d508 Zotero.HTTP.request() tweaks 2015-10-29 02:37:56 -04:00
Dan Stillman
7cfa857887 Make Zotero.Item::attachmentFilename work without file
And have getFilePath() return false instead of failing on unsaved items
2015-10-29 02:33:25 -04:00
Dan Stillman
90286d2a50 Make Zotero.Item::attachmentHash getter asynchronous 2015-10-29 02:30:27 -04:00
Dan Stillman
3fca0644ee Disable debug output from Notifier 2015-10-29 02:25:02 -04:00
Dan Stillman
ed33c6b712 Update Bluebird to 2.10.2 2015-10-29 02:23:22 -04:00
Dan Stillman
d70e9cf41b Add Zotero.File::zipDirectory() 2015-10-29 02:22:06 -04:00
Dan Stillman
7d8a1b2573 Make Zotero.DataObject#fromJSON() synchronous
When called on an identified object (i.e., one with an id or
library/key), loadAllData() must be called first. When called on a new
object (which is more common anyway), fromJSON() can be called
immediately.
2015-10-29 01:19:14 -04:00
Dan Stillman
5d8670db1d Fix additional causes of high CPU use from items list 2015-10-13 00:33:58 -04:00
Dan Stillman
493d37d1c7 Fix 100% CPU usage with pane open (since 9e356a7e6)
And make Zotero.Item.prototype.fileExists() check the file regardless of
whether there's a cached state.
2015-10-12 23:08:02 -04:00
Dan Stillman
3703bf0423 Move lastStorageSync to shared accessor code
And fix variable spelling
2015-09-29 13:06:58 -04:00
Dan Stillman
ba3d90eaf9 Make sure Zotero.Libraries.userLibrary doesn't get out of sync
b976c84a29 (commitcomment-13492424)
2015-09-29 13:06:58 -04:00
Dan Stillman
1b333be23f Add Zotero.Library.prototype.lastStorageSync 2015-09-29 04:42:13 -04:00
Dan Stillman
b976c84a29 Add Zotero.Libraries.userLibrary 2015-09-29 04:42:13 -04:00
Dan Stillman
691819bd32 Add Zotero.Library.prototype.libraryTypeID
Get the library-type-specific id for the library (e.g., userID for user
library, groupID for group library)
2015-09-29 04:42:13 -04:00
Dan Stillman
4b83d157b9 Add "use strict"; to test file 2015-09-29 04:42:13 -04:00
Dan Stillman
7633c7de30 Set test timeout in resetDB() instead of separate this.timeout() calls
'thisArg: this' should be passed to resetDB to have it adjust the
timeout
2015-09-29 04:42:12 -04:00
Dan Stillman
88627adcdb Update linked attachment base directory code
- Replace nsIFile and persistent descriptors with OS.File and string paths
- Add tests for base dir settings
2015-09-29 04:42:12 -04:00
Dan Stillman
9e356a7e63 Migrate relative/persistent descriptors to string paths [DB reupgrade]
Absolute paths have been stored as strings on all platforms for a while,
but old Mac persistent descriptors (Base64-encoded opaque alias records)
could still exist in the DB. Additionally, relative paths for stored
files were stored as Mozilla-specific opaque strings rather than UTF-8
strings.

This adds a schema step to convert those to strings paths in the DB.
Since Mac persistent descriptors aren't converted if the file isn't
found, we still handle and (convert) old-style persistent descriptors if
necessary when reading paths from the DB.

This also moves path string handling -- converting a path to a prefixed
string for stored or base-dir-relative files -- to the
Zotero.Item#attachmentPath setter instead of save() so that reading it
back immediately returns the correct value. One consequence is that the
attachment link mode must now be set before setting the path.

Zotero.Item#getFile() is now deprecated in favor of getFilePath() and
getFilePathAsync() (which checks file existence).

Zotero.File.directoryContains() now takes string paths instead of files.
2015-09-29 04:42:08 -04:00
Dan Stillman
80008fd13d Pass tabIndex param to pref window to select tab within specified pane 2015-09-29 04:11:21 -04:00
Dan Stillman
d9b5e17c9c Asyncify Zotero.Attachments.getNumFiles() and add hasMultipleFiles()
Latter is probably all that's needed
2015-09-22 04:11:31 -04:00
Dan Stillman
fc1137b769 Asyncify Zotero.Attachments.getTotalFileSize() 2015-09-22 04:11:30 -04:00
Dan Stillman
2df630e83c Fix hang in sync tests from library version changes 2015-09-22 04:11:30 -04:00
Dan Stillman
0965079842 Use correct property in Zotero.Libraries.getVersion/setVersion() 2015-09-22 03:52:46 -04:00
Dan Stillman
add9481c63 Adjust error and feed tests for access error on read-only libraries 2015-09-22 03:52:31 -04:00
Dan Stillman
8daef1fad0 Merge pull request #750 from aurimasv/api_syncing-feed_reader-data_layer
[Feed Reader] Data layer
2015-09-21 18:14:13 -04:00
Aurimas Vinckevicius
0a88032715 ZU.capitalize should not throw for empty string 2015-09-21 17:08:23 -05:00
Aurimas Vinckevicius
995bc9667b Open a window for syncRunner tests
For some reason setTimeout in waitForWindow sometimes does not fire without a window open.
2015-09-21 17:08:23 -05:00
Aurimas Vinckevicius
d122323dbf Fix fullText tests on Windows 2015-09-21 17:08:22 -05:00
Aurimas Vinckevicius
38b9bbc8c8 Fix Translate tests on Windows 2015-09-21 17:08:22 -05:00
Aurimas Vinckevicius
8900a83b7d Fix Zotero.DataObject.key test 2015-09-21 17:08:21 -05:00
Aurimas Vinckevicius
88ab129ffb Add Feed and FeedItem
Also:
* _finalizeErase in Zotero.DataObject is now inheritable
* Call _initErase before starting a DB transaction
* removes Zotero.Libraries.add and Zotero.Libraries.remove (doesn't seem like this is used any more)
2015-09-21 17:08:21 -05:00
Aurimas Vinckevicius
76511eca08 Fix stack formatting in unit testing output 2015-09-21 02:28:10 -05:00
Aurimas Vinckevicius
74863843f4 Tweak varDump to not use object property getter unnecessarily 2015-09-21 02:28:09 -05:00
Aurimas Vinckevicius
0320b08b05 Do not return lastInsertRowID for INSERT, REPLACE, and CREATE
Unreliable for async queries
2015-09-21 02:28:09 -05:00
Aurimas Vinckevicius
6cef123662 Don't allow trashing items in read-only or "no trash" libraries 2015-09-21 02:27:53 -05:00
Aurimas Vinckevicius
e5a5a8d303 Don't allow erasing objects from read-only libraries 2015-09-21 02:27:53 -05:00
Aurimas Vinckevicius
1621f5772b Fix deleting collection with items 2015-09-18 03:34:04 -05:00
Aurimas Vinckevicius
07ca00edd5 Use _canHaveParent property to determine if object can have parent 2015-09-18 03:34:04 -05:00
Aurimas Vinckevicius
87d5625bac Add Chai-as-Promised 2015-09-18 03:34:03 -05:00
Dan Stillman
b53892fe54 Fix various collection-dragging UI bugs
Fixes #823, hopefully
2015-08-08 17:26:42 -04:00
Dan Stillman
9fa53439ef Update hasChildCollections() when child moved to another collection 2015-08-08 16:45:51 -04:00
Dan Stillman
5a61ac4871 Don't try to select unselectable row on library tree row removal
(If deleting a group, don't select the header or separator before it.)
2015-08-07 16:36:53 -04:00
Dan Stillman
cbf4876173 Fix attachment renaming
Fixes #822
2015-08-07 15:36:46 -04:00
Dan Stillman
06867d886e Fix note loading 2015-08-06 22:49:21 -04:00
Dan Stillman
536cd867d7 Fix toJSON for attachment items 2015-08-06 15:55:37 -04:00
Dan Stillman
f963413170 Handle conflict resolution for remote item deletions 2015-08-06 06:03:45 -04:00
Dan Stillman
f8af231f1a Make CR wizard button assertions Mac-only for now
Wizard buttons are handled differently on Linux/Windows
2015-08-06 05:45:36 -04:00
Dan Stillman
51253fb933 Delete from sync cache when deleting object 2015-08-06 05:25:45 -04:00