Commit graph

5230 commits

Author SHA1 Message Date
Dan Stillman
d07756d68d Store API key in login manager, and add temp field in prefs 2015-11-02 03:22:37 -05:00
Dan Stillman
e03cf637b6 Fix 412 handling 2015-11-02 03:20:29 -05:00
Dan Stillman
7f43ca9503 Merge branch '4.0' 2015-11-01 21:22:13 -05:00
Dan Stillman
e0b5111442 Update some outdated Zotero.Libraries.getType()/getName() calls 2015-11-01 18:29:02 -05:00
Dan Stillman
3ad6e78d98 "Use"->"Keep" existing rights field for clarity in My Publications 2015-11-01 18:21:48 -05:00
Dan Stillman
53478f4752 Allow 412 when uploading deletions 2015-11-01 13:28:03 -05:00
Dan Stillman
110f637d1e Don't default to Creative Commons license for My Publications
Just share on zotero.org by default, and let user choose CC if desired.
2015-11-01 03:59:01 -05:00
Dan Stillman
7e3ba7bc61 Misc. debug tweaks 2015-11-01 03:59:01 -05:00
Dan Stillman
1e6c29766f Add deletion uploading to API syncing [DB reupgrade]
Tags deletions are not currently synced, and maybe don't need to be.
2015-11-01 03:58:54 -05:00
Dan Stillman
6b8e5bafc6 Don't show deleted items outside of trash 2015-11-01 03:36:23 -05:00
Dan Stillman
3692536770 Fixes #862, Trash Looks Empty
Broken by 3ff1ff88a9
2015-10-31 17:13:51 -04:00
Dan Stillman
532d485793 Delete older versions of processed objects in cache
And recover from "Sync cache had later version than remote" error, which
shouldn't actually happen...
2015-10-31 15:19:50 -04:00
Dan Stillman
6ccfed2488 Don't show item context menu until it's ready
With async generation, an incorrect menu was showing first before the
correct version appeared.
2015-10-31 03:46:47 -04:00
Dan Stillman
b06d93be50 Fix error syncing items in unloaded library 2015-10-31 01:39:36 -04:00
Dan Stillman
37b6a14f17 Fix attachment pane loading 2015-10-31 01:36:49 -04:00
Dan Stillman
c2ad4ceb0a Output 'deleted' as 1 instead of true in item JSON
Good idea? Not sure, but that's what the API does.
2015-10-30 19:07:12 -04:00
Dan Stillman
6993ca252c Fix download-on-sync mode for ZFS 2015-10-30 17:08:38 -04:00
Dan Stillman
73f4d28ab2 ZFS file sync overhaul for API syncing
This mostly gets ZFS file syncing and file conflict resolution working
with the API sync process. WebDAV will need to be updated separately.

Known issues:

- File sync progress is temporarily gone
- File uploads can result in an unnecessary 412 loop on the next data
  sync
- This causes Firefox to crash on one of my computers during tests,
  which would be easier to debug if it produced a crash log.

Also:

- Adds httpd.js for use in tests when FakeXMLHttpRequest can't be used
  (e.g., saveURI()).
- Adds some additional test data files for attachment tests
2015-10-29 04:38:27 -04:00
Dan Stillman
6d46b06617 Better debugging/errors in Zotero.DataObjects 2015-10-29 03:57:09 -04:00
Dan Stillman
1ce4cda384 Don't change 0 to null in Zotero.DataObjectUtilities.checkKey()
Not totally sure this function should allow falsy values to begin with,
but it does.
2015-10-29 03:57:08 -04:00
Dan Stillman
0803bb84e3 Don't set collections: "" in PATCH JSON when changing item to child 2015-10-29 03:57:08 -04:00
Dan Stillman
62e586073d concurrent-caller.js -> concurrentCaller.js 2015-10-29 02:49:31 -04:00
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
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
8997ba06c1 Update citeproc-js to 1.1.60
Closes #854
2015-10-05 20:06:51 -04:00
Dan Stillman
488c4eb72b Fix menubar/titlebar-less Standalone window issue in El Capitan
If Standalone is closed in full-screen mode in 10.11, 'sizemode' on the main
window is persisted as 'fullscreen'. On reopen, the window doesn't go into
full-screen mode, but it still lacks menubar or titlebar. This patch forces the
window into 'normal' mode if it was left in 'fullscreen'.

(Firefox appears to ignore 'fullscreen' without actually changing the value,
but I didn't find the code that handles that.)
2015-10-02 16:46:34 -04:00
Dan Stillman
7f8cf293d0 Fix child item drag on Windows in Firefox 41 2015-10-02 03:50:01 -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
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
Simon Kornblith
310ff1cf53 Merge branch 'connector' into 4.0 2015-09-28 20:28:38 -04:00
Dan Stillman
ce72b450bf Fix missing colored tag swatches on Windows/Linux
In Firefox 41, file: URIs can no longer be loaded (at least via Image)
from the hidden window on Windows/Linux, but chrome: URIs still work.
Not sure why I was using a file: URI to begin with.
2015-09-24 23:59:48 -04:00
Simon Kornblith
974a07bf73 Add addEditCitation command to Zotero 2015-09-24 23:44:19 -04:00
Dan Stillman
ec66d15a5f Update version and submodules 2015-09-24 22:13:35 -04:00
Dan Stillman
e4c5d86bc6 Update citeproc-js to 1.1.58
Closes #850
2015-09-24 22:02:35 -04:00
Dan Stillman
f60ded11e8 Fix additional login manager issues (after b55e6536) 2015-09-24 18:15:12 -04:00
Dan Stillman
2c25257e2b Don't scroll to containing collection if one is already visible
If multiple collections are highlighted and none are in view, scroll to
the first one in the list.

The logic could be improved here a little more to scroll to the closest
collection instead of the first one, and also to scroll to a few rows
above or below the target.

This also fixes what was probably an incorrect highlight if there were
multiple collections and some had to be expanded first.
2015-09-24 07:11:12 -04:00
Dan Stillman
a5eb5a5af5 Scroll collection into view on collection-containing-an-item 2015-09-24 06:46:02 -04:00
Dan Stillman
b55e6536ec Fix login manager (and syncing) breakage in Firefox 41 2015-09-23 05:02:40 -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
Aurimas Vinckevicius
0a88032715 ZU.capitalize should not throw for empty string 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
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
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
Dan Stillman
a547db134e Update locales and submodules 2015-09-13 23:38:42 -04:00
Dan Stillman
2a9119801c Merge pull request #834 from Juris-M/z4.0-bib-export-fix
Fix bug in Create Bibliography from Item w/Notes
2015-09-13 23:26:41 -04:00
Dan Stillman
d3c4689973 Add a couple comments 2015-08-27 18:00:16 +01:00
fbennett
47ff4e79dc Fix bug in Create Bibliography from Item w/Notes 2015-08-27 08:18:22 +09:00
simpzan
6051ef09d0 make items tree column focused when select a item by running
zotero://select/items/xxx.
2015-08-18 19:31:30 +08:00
Dan Stillman
4d354027b5 Fix Cmd/Ctrl-Down in Quick Format
Broken in f3daf6b4bc
2015-08-17 01:35:26 -04:00
Simon Kornblith
f3daf6b4bc Always capture up/down when QuickFormat reference panel is open
It was annoying if you pressed the up key too many times and the cursor
moved.
2015-08-13 19:48:23 -04:00
Simon Kornblith
21e51f771c Fix QuickFormat bubble updating when editing citation properties 2015-08-13 19:45:03 -04:00
Simon Kornblith
b62b479ae4 Silence some warnings in QuickFormat 2015-08-13 19:39:13 -04:00
Simon Kornblith
570e628679 Another non-Retina QuickFormat tweak 2015-08-13 19:25:08 -04:00
Simon Kornblith
547a5eea10 Tweak QuickFormat for non-retina 2015-08-13 19:21:07 -04:00
Simon Kornblith
8e40bde671 Make QuickFormat text bigger and border smaller on OS X 2015-08-13 19:14:53 -04:00
Dan Stillman
bb785df49f Merge pull request #828 from gracile-fr/fixedCol
Forbid "Attachments" column to be resized
2015-08-13 18:35:31 -04:00
gracile-fr
2920d9ff5e Forbid "Attachments" column to be resized 2015-08-12 21:15:18 +02: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
Simon Kornblith
50f695f298 Disable spell checking in quickformat
It basically underlines all the names, which is not useful
2015-08-08 16:38:39 -04:00
Simon Kornblith
668ca94f9e Make quickformat non-resizable 2015-08-08 16:38:17 -04:00
Simon Kornblith
6bce6b1d30 Alter quick format dialog appearance on OS X
Firefox no longer supports transparent windows because it made them do
extra preprocessing on a file to restore the drop shadow when the
Developer Edition theme was active:
https://bugzilla.mozilla.org/show_bug.cgi?id=1162649
2015-08-07 19:45:49 -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
1ecc53b099 Merge pull request #820 from aurimasv/csl-json
Fix issues with computerProgram citations
2015-08-06 18:29:06 -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
51253fb933 Delete from sync cache when deleting object 2015-08-06 05:25:45 -04:00
Dan Stillman
b5b99672db Remove some obsolete sync code 2015-08-06 04:19:53 -04:00
Dan Stillman
0aecaad761 Update conflict resolution for API syncing
This will appear much less frequently, since non-conflicting field changes on
both sides can be resolved automatically, but genuine field conflicts still
require manual conflict resolution.

The merge pane is no longer editable, since the itembox code to do that is
async and can't run in a modal window, but it's not really necessary,
particularly with conflicts happening less frequently.

TODO:

- Remote item deletions
- File conflicts
- Maybe handle some edge cases where the conflicted items fail to save
2015-08-06 04:14:49 -04:00
Dan Stillman
7b0c34a3ab Update submodules 2015-08-05 15:11:24 -04:00
Aurimas Vinckevicius
711b823552 Add tests for itemFromCSLJSON and make sure data round-trips 2015-08-04 15:22:35 -05:00
Aurimas Vinckevicius
c4cd7ce3e0 Fix import of computerProgram exported as CSL JSON 2015-08-04 15:19:33 -05:00
Aurimas Vinckevicius
bb15336fdb Fix season export in CSL JSON 2015-08-04 14:19:39 -05:00
Aurimas Vinckevicius
0fbae77456 Don't use for-in to iterate over arrays in itemFromCSLJSON 2015-08-03 16:15:24 -05:00
Dan Stillman
7075300a17 Fix hasChanged() bug related to 'synced' 2015-08-02 05:26:02 -04:00
Dan Stillman
f02a9aa95e Check remote delete log during full sync
If an object is marked as synced locally and doesn't exist remotely but
is in the remote delete log, delete it locally
2015-08-02 03:44:14 -04:00
Dan Stillman
67f4a467ea Consolidate object erase methods into DataObjects::erase() 2015-08-02 03:40:14 -04:00
Dan Stillman
4600318ad7 Support 'successful' property in upload response
Save uploaded data to cache, and update local object if necessary (which
it mostly shouldn't be except for invalid characters and HTML filtering
in notes)

Also add some upload and JSON tests
2015-08-01 05:28:42 -04:00
Dan Stillman
70d9b9870c Fix a few small data layer bugs, and tidy up a little
I don't think these were triggered by any client code, but I found them while
porting code to the server.
2015-07-31 04:09:24 -04:00
Dan Stillman
fc2574f7bf Update citeproc-js to 1.1.46 2015-07-30 15:52:26 -04:00
Aurimas Vinckevicius
fdd91affd9 Debugging code for checking manually modified citations
Re https://forums.zotero.org/discussion/50701/cant-insert-citationzotero-asks-to-modify-all-my-citations/
2015-07-28 22:59:32 -05:00
Aurimas Vinckevicius
1cbd7f71cf Parse author names in itemToCSLJSON 2015-07-27 18:37:45 -05:00
Dan Stillman
4e92b313c6 Update citeproc-js to 1.1.45 2015-07-26 19:11:04 -04:00
Dan Stillman
fb9109e837 Update versions and submodules 2015-07-26 18:33:04 -04:00
Simon Kornblith
125ad50698 Merge pull request #811 from zotero/sjk/810
Fix #810, memory leak
2015-07-26 17:59:17 -04:00
Simon Kornblith
954e60a83a Don't leak memory when showing the select dialog
Again, I'm pretty sure this shouldn't be necessary.
2015-07-26 14:07:04 -04:00
Simon Kornblith
51bcd2409d Fix #810, memory leak
I'm still not really sure what the problem was. But this seems to
eliminate the leak for me.
2015-07-25 14:38:27 -04:00
Dan Stillman
9000c9dcc7 Fix error saving PDF if Zotero pane hasn't been opened in window 2015-07-23 01:26:14 -04:00
Andrew Dunning
e6d1f31e46 Supply missing Œ/œ in diacriticsRemovalMap. 2015-07-21 18:08:16 -04:00
Dan Stillman
5fc2dd4d44 Fix a probably rare case of a file's not being uploaded
If a file existed locally but somehow ended up marked as to-download without
existing on the server, it was never uploaded. I'm not sure when this can
happen, but I saw it while messing around. Maybe switching between ZFS and
WebDAV?

This will still only check and upload if there's another computer syncing files
to the same library, but we'll check all files in 5.0.
2015-07-21 03:10:59 -04:00
Dan Stillman
33334d9c01 Fix excessive file sync mtime updates/checks, but for real this time 2015-07-21 02:59:12 -04:00
Dan Stillman
1fadf1150e Remove <=Fx24 file sync code 2015-07-21 02:53:17 -04:00
Dan Stillman
a452af6c3a Sort descendant collections alphabetically in advanced search window
https://forums.zotero.org/discussion/50679/
2015-07-21 00:45:30 -04:00
Dan Stillman
984789d304 API syncing megacommit
There's a lot more to do, and this isn't ready for actual usage, but the
basic functionality is mostly in place and has decent test coverage. It
can successfully upgrade a library last used with classic syncing and
pull down changes via the API. Uploading mostly works but is currently
disabled for safety until it has better test coverage.

Downloaded JSON is first saved to a cache table, which is then used to
populate other tables and later for generating PATCH requests and
automatically resolving conflicts (since it shows what was changed
locally and what was changed remotely). Objects with unmet dependencies
or unknown fields are skipped for now but don't block the rest of the
sync.

Some of the bigger remaining to-dos:

- Tests for uploading
- Re-do the preferences to get an API key
- File sync integration
- Full-text syncing integration
- Manual conflict resolution (though this already includes much smarter
  conflict handling that automatically resolves many conflicts)
2015-07-20 18:16:57 -04:00
Dan Stillman
b4a8083f2f Throw specific errors for missing objects or unknown fields
And add a bit more debugging info to other messages
2015-07-20 17:31:27 -04:00
Dan Stillman
258b70b455 Throw an error saving an empty item with no item type 2015-07-20 04:15:27 -04:00
Dan Stillman
cd4d084dd9 Support for automatically merging collections and searches 2015-07-20 02:12:14 -04:00
Dan Stillman
9d0d79c9c2 Take a promise-returning function in Utilities.Internal.forEachChunkAsync()
Instead of a promise-yielding generator
2015-07-20 02:12:14 -04:00
Dan Stillman
4f55f28e7d Honor .synced on data objects in all cases
Previously, if .synced was already true, setting it to true and saving
would result in .synced == false unless skipSyncedUpdate was passed. Now
the value assigned to .synced is always used on the next save. If the
value hasn't changed and no other values have changed, a save will be a
no-op.
2015-07-20 02:12:14 -04:00
Dan Stillman
93b5694420 Make editable/filesEditable required in Zotero.Libraries.add() 2015-07-20 02:12:14 -04:00
Dan Stillman
6c536fc784 Don't create Quick Start Guide item for new libraries
The default items cause problems with conflict resolution for existing
users (and not syncing them or ignoring conflicts for them is kind of
weird), and they require remote changes for new databases. I do like
there not being a completely empty library, but I think it's probably
better just to display a virtual welcome message with a link to the
Quick Start Guide somewhere else, such as in the right-hand pane. (A new
installation also opens the start page on zotero.org.)
2015-07-20 02:12:13 -04:00
Dan Stillman
d868f007e9 Don't select new groups in collections pane 2015-07-20 02:12:01 -04:00
Dan Stillman
da5e1272f7 Fix updating local files with long filenames via sync on Linux
6a687e8c40 was actually only OS X
2015-07-19 22:42:44 -04:00
Dan Stillman
5c523d8694 Merge branch '4.0' 2015-07-18 07:09:53 -04:00
Dan Stillman
7c9d25dad8 Fix excessive file sync mtime updates/checks?
Same as 1c2b2575f, but this time in code we actually still run
2015-07-18 04:58:10 -04:00
Dan Stillman
6a687e8c40 Fix "filename too long" sync error for missing files on OS X/Linux 2015-07-17 18:23:59 -04:00
Dan Stillman
a97e27a9f2 Fix CSS in snapshots of Reader View
Allow saving of CSS links over chrome://. We can scope this to
chrome://global/skin/aboutReader.css if anyone thinks of a reason why
this was disabled to begin with, but I'm not sure in what other
situations CSS it would apply.
2015-07-17 16:22:15 -04:00
rmzelle
d3ab296cf5 Check single items in selection window 2015-07-15 21:21:51 -04:00
Simon Kornblith
2c5bfd5d5a Disable disabling by reverse lookup on non-Mac/Windows/Linux
If this is the case, it's probably a BSD derivative, but I can't
guarantee the code won't segfault.
2015-07-13 19:28:37 -04:00
Simon Kornblith
f856df5222 Fix #460 using OS APIs 2015-07-13 19:24:26 -04:00
Simon Kornblith
7d87d70e92 Expose more integration pipe handling code
This should eventually reduce the amount of duplicated code needed to
handle Word 2016 for Mac
2015-07-12 13:46:55 -04:00
Aurimas Vinckevicius
d3bc1703c3 Update citeproc-js to 1.1.39
Re https://github.com/zotero/zotero/pull/794#issuecomment-120564983
2015-07-11 13:35:03 -05:00
Dan Stillman
bcef4819e8 Merge pull request #794 from aurimasv/citeproc-js-update
Update citeproc-js to 1.1.25
2015-07-10 19:53:09 -04:00
Dan Stillman
c72b112afd Use export.lastLocale before UI locale if none specified
This allows existing documents created before 4.0.27 with a
bibliographyLocale set to continue to use that value by default.

More details:

https://github.com/zotero/zotero/pull/795#issuecomment-120227051
2015-07-10 17:48:44 -04:00
Dan Stillman
b40c1d7e2e Remove redundant "Suppress Author" string
Refs #796
2015-07-10 15:56:25 -04:00
Aurimas Vinckevicius
9fcb87ca93 Remember style and locale when explicitly selected by the user 2015-07-09 23:38:25 -05:00
Aurimas Vinckevicius
b6c7ba6ea2 Fix saving style locale in documents 2015-07-09 23:38:25 -05:00
Dan Stillman
507ef011d8 Restore "without snapshot" option in Fx connector
Will be supported in upcoming Standalone release
2015-07-09 19:10:32 -04:00
Simon Kornblith
e92a54966c Restore ZoteroPane.destroy() on close
Seems like a good thing to do, if only because it ensures we persist
changes
2015-07-09 18:05:08 -04:00
Simon Kornblith
b931ca37d2 Undo accidental subproject commit change from 3420b4874a 2015-07-09 18:02:11 -04:00
Simon Kornblith
3420b4874a Tweaks for application menu on OS X
- Restore About Zotero item
- Fix Quit item
- Close Standalone when Standalone window is closed (we did this before,
  but apparently having our own hidden window breaks that mechanism)
2015-07-09 18:00:15 -04:00
Aurimas Vinckevicius
bf58de7e62 Update citeproc-js to 1.1.25
And split off Zotero additions
2015-07-09 16:31:57 -05:00
Simon Kornblith
b69e6fc3ab Fix Zotero menu on OS X, part 1
Create a hidden window with a menu bar, since it loads first
2015-07-09 16:52:04 -04:00
Aurimas Vinckevicius
3ca45be2c7 Add more debug logging for Recognize PDF 2015-07-08 12:50:10 -05:00
Dan Stillman
2a5b026f65 Wait for schema update before updating save icon
Technically rather than waiting for the schema update we should wait for
translator initialization, which should wait for the schema update
itself, but the schema update also needs to initialize the translators,
so avoiding a hang is tricky, particularly with the use of Zotero.lazy()
for Zotero.Translators.init(). For now, just wait for the schema update.
2015-07-07 17:39:06 -04:00
Dan Stillman
c590aa0eb4 Fix documentation for Zotero.DataObjects.getAsync() 2015-07-07 14:40:14 -04:00
Dan Stillman
5d9d8ae953 Fix passed 'window' property in Zotero.ProgressWindow
Though not currently used anywhere
2015-07-06 19:15:11 -04:00
Dan Stillman
b19cce1963 Fix issues with toolbar icons in multiple windows
Clicking the separate buttons would trigger actions in the first window
opened, and other things might not have been updating properly across
multiple windows.
2015-07-06 15:41:28 -04:00
Dan Stillman
238183a3fa Fix collapse library ("-") for collections
Broken in f5ce2d238e
2015-07-06 04:38:53 -04:00
Dan Stillman
41b772da4d Show the save button guidance panel again, now that it doesn't hide too easily 2015-07-06 00:49:35 -04:00
Dan Stillman
db991743cd Trigger forward action with click anywhere on guidance panel
Previously, clicking directly on a noautohide guidance panel closed it, even if
there was a forward nav button. (In the case of the main and save button
guidance panels, the save button would appear on the next Firefox restart, but
this ensures that the save guidance panel will be shown to new users even if
they click on the panel instead of the not-particularly-noticeable forward
button.)
2015-07-06 00:46:36 -04:00
Dan Stillman
41fc082f6d Fix too-large icons in secondary toolbars on Linux
Plus a few other icon tweaks
2015-07-05 15:37:11 -04:00
Dan Stillman
01716183d7 Prevent erroneous hiding of hideonpagechange guidance panels on complex pages 2015-07-04 17:09:26 -04:00
Dan Stillman
ebe08836e8 A little more Quick Copy safety 2015-07-03 23:53:43 -04:00
Dan Stillman
f07fe7184d Ignore trailing period in domain for Quick Copy
From @aurimasv
2015-07-03 23:46:39 -04:00
Dan Stillman
242581a270 Fix Quick Copy in tab mode, but for real 2015-07-03 22:06:12 -04:00
Dan Stillman
20f279043b Update submodules 2015-07-03 02:09:27 -04:00
Dan Stillman
9d2b097605 Fix toolbar icons in non-nav-bar toolbars on OS X and Windows
...which only required redoing the entire styling.

Not yet done on Linux
2015-07-02 05:50:57 -04:00
Simon Kornblith
50ee61545a Kill code to ensure that our pipe is open before we write to the other
In practice, this appears to be both unnecessary and harmful. Although
the first write happens effectively instantaneously, we can take
several hundred milliseconds to read the second write, and Standalone
can decide we are dead.

This apparently fixes #783 for @dstillman, although I was never able to
reproduce locally.
2015-07-01 20:40:28 -04:00
Simon Kornblith
d104e4b106 More debugging for #783 2015-07-01 20:01:00 -04:00
Dan Stillman
15a0a33ac1 Fix Quick Copy in tab mode 2015-07-01 19:36:16 -04:00
Simon Kornblith
9574de752d Debugging for #783 2015-07-01 14:46:06 -04:00
Dan Stillman
7ccc48b4ae Don't show "without snapshot" save option in Fx connector for now
Option requires a new Standalone build with ba53f256d
2015-07-01 02:38:15 -04:00
Dan Stillman
ba53f256d6 Quick hack to fix "without snapshot" save option in Z4Fx via Standalone
(I don't see any obvious reason I can't do this. We should probably clean this
up later, not call the endpoint "saveSnapshot", etc. Also, is there a reason it
doesn't follow the snapshot pref by default?)
2015-07-01 01:03:04 -04:00
Dan Stillman
39f2021576 Include web page save option in toolbar menu on every page
Closes #644 and #775
2015-06-30 23:41:47 -04:00
Simon Kornblith
43e1c5c123 Fix setCookiesThenSaveItems in Firefox connector 2015-06-30 19:20:16 -04:00
Dan Stillman
796fb87a9b Fix some toolbar icon issues on HiDPI Linux 2015-06-30 17:58:32 -04:00
Dan Stillman
6841be09a1 Fix large save icon on HiDPI Windows, hopefully 2015-06-30 17:08:45 -04:00
Aurimas Vinckevicius
5334a09ee0 Fix institutional author export to CiteProcJS 2015-06-29 23:22:09 -05:00
Simon Kornblith
48e6eb93de Merge pull request #779 from aurimasv/proper-to-proxy
Fix properToProxy converter functions
2015-06-29 22:27:15 -04:00
Aurimas Vinckevicius
b03dcd3686 Fix properToProxy converter functions
Regression from 82998e986e and 9450d0797f
2015-06-29 17:55:10 -05:00
Simon Kornblith
64ff0e8b4e Fix #774 2015-06-29 18:03:09 -04:00
Dan Stillman
6c416e7ad2 Get rid of middle border radius in combo button on Windows 2015-06-29 07:06:20 -04:00
Dan Stillman
a9c6feb380 Additional toolbar overflow tweaks for Linux
Follow-up from 1d6483e68
2015-06-29 06:35:23 -04:00
Dan Stillman
1d6483e68a Fix #773, Zotero combo icons dispersed under more tools
And fix save button hover height on Windows, which somehow got out of
whack again.

Might need further tweaking on Linux

Need to find a better way to do these buttons...
2015-06-29 05:59:19 -04:00
Dan Stillman
ddf3ff9ba9 Don't try to set lastLocale pref in doc prefs unless locale was changed 2015-06-28 17:16:33 -04:00
Dan Stillman
99dd1c0697 Merge branch '4.0'
Since modal windows (e.g., the Create Bib window and the Quick Copy site
editor window) can't use yield, style retrieval
(Zotero.Styles.getVisible()/getAll()) is now synchronous, depending on a
previous async Zotero.Styles.init(). The translator list is generated in
the prefs window and passed into the Quick Copy site editor, but it's
possible the translators API should be changed to make getTranslators()
synchronous with a prior init() as well.
2015-06-27 16:59:58 -04:00
Dan Stillman
3a5854f49f Update versions and submodules 2015-06-26 02:40:18 -04:00
Dan Stillman
4868095820 Guidance panel for new save icon
For new installations, a panel will show for the Z icon with a ">"
button to go to a second panel for the save icon. For existing
installations, a panel will show just for the save icon. In both cases,
the panels are non-auto-hiding but are dismissed if clicked on or when a
new content page is loaded.

There's also a new close button, but it's not enabled currently. Might
be useful for panels with embedded links where an accidental click on
the panel alone shouldn't close the panel (like the Firefox customize
mode wizard).
2015-06-25 22:51:05 -04:00
Dan Stillman
233b9991f5 Merge pull request #623 from rmzelle/locale-selector
Add drop-down menu for bibliographyLocale
2015-06-24 14:34:47 -04:00
Aurimas Vinckevicius
6ac0403049 Reorganize and improve locale drop-down code 2015-06-24 14:10:33 -04:00
Dan Stillman
dfb28ff3f6 File Issues: Greatest Hits, 2006-2015
- When relinking a missing stored file, copy it into the attachment's
  storage directory automatically
  - Previously, selecting a file outside the attachment subdir would
    just result in a missing attachment, since it only looks for stored
    files within the subdir
- Display an error message if a Windows shortcut (.lnk) is added via
  drag-and-drop or via a file dialog on non-Windows systems, until we
  can figure out how to determine the original file
  - Shortcuts can cause errors during syncing, for unclear reasons
  - Neither nsIFile::copyToFollowingLinks() nor nsIFile::target work for
    me to get the original file, even when nsIFile::isSymlink() returns
    true
  - Windows file dialogs seem to automatically resolve shortcuts, so
    it's only an issue there for drag-and-drop
- Disallow hidden files from being selected in relink dialog
  - I think some people on Windows with hidden files shown relink the
    .zotero* files that show up when they click Locate, which causes
    file sync errors. Which brings us to...
- Fix file sync errors for *.lnk and .zotero* files
- Ignore existing .zotero* attachment files, treating the files as
  missing instead to encourage relinking
- Strip leading period in getValidFileName() to prevent added files from
  being hidden
    - This allows hidden files to be added explicitly; they just won't
      stay that way in the storage directory

(These things should have tests, but that will have to happen on the 5.0
branch.)
2015-06-24 06:10:48 -04:00
Dan Stillman
0d1d4ee5cb Don't change selection unnecessarily when creating trashed item 2015-06-23 16:56:10 -04:00
Dan Stillman
27f6f018d3 Remove Zotero.suppressUIUpdates
Now handled by notifier flags
2015-06-23 16:31:40 -04:00
Dan Stillman
12bea4b7ea Notifier observer time logging 2015-06-23 16:03:05 -04:00
Dan Stillman
3ff1ff88a9 A couple search query optimizations
...which make very little difference, but they look better in the SQLite
query plan view.
2015-06-23 15:07:57 -04:00
Dan Stillman
33dedd1753 Tags overhaul [DB reupgrade]
- Simplified schema
- Tags are now added without reloading entire tag selector
  - On my system, adding 400 tags to an item (separately, with the tag
    selector updating each time) went from 59 seconds to 42. (Given that
    it takes only 13 seconds with the tag selector closed, though,
    there's clearly more work to be done.)
- Tag selector now uses HTML flexbox (in identical fashion, for now, but
  with the possibility of fancier changes later, and with streamlined
  logic thanks to the flexbox 'order' property)
- Various async fixes
- Tests
2015-06-23 05:21:58 -04:00
Dan Stillman
0511d37b07 Replace multiple spaces in platform names for full-text searches
Closes #770
2015-06-22 11:51:20 -04:00
Dan Stillman
a5403b7499 Always include 'note' property in item JSON for notes in 'new' mode 2015-06-19 16:00:51 -04:00
Dan Stillman
3f475f25b6 Include remotely added properties in relations diffs 2015-06-19 04:07:46 -04:00
Dan Stillman
2e76fd6584 Add Zotero.DataObjectUtilities.getTypes() 2015-06-19 04:04:56 -04:00
Dan Stillman
7ba54886a6 Add toJSON() for searches and make Collection::toJSON() async 2015-06-19 04:04:33 -04:00
Dan Stillman
79733c75f1 Throw error in Item::fromJSON() if itemType not provided and not set 2015-06-17 01:57:57 -04:00
Dan Stillman
e45aabd03c Special handling of objects class for SyncedSettings
(Though maybe it should just be renamed Zotero.Settings, since
non-synced settings aren't used much and are just handled via DB
queries.)
2015-06-17 01:57:42 -04:00
Dan Stillman
78d62b5c7c '@params' -> '@param' in comment 2015-06-17 01:57:41 -04:00
Dan Stillman
b491ea6516 Additional async updates to colored tag handling 2015-06-17 01:57:32 -04:00
Dan Stillman
b3067ac5c0 Add skipDeleteLog option when erasing objects
To be used by updated deletion listener in new sync code

Also adds explicit Zotero.SyncedSettings.clear() in place of
Zotero.SyncSettings.set() without a value
2015-06-17 01:57:31 -04:00
Dan Stillman
0d59bde186 Clean up DataObject erasing, and fix search unloading 2015-06-16 19:51:21 -04:00
Dan Stillman
4f155e3432 Fix group.fromJSON() with no 'admins' or 'members' arrays 2015-06-16 19:51:21 -04:00
Simon Kornblith
5cbb8de96b Re-enable import progress indicator 2015-06-12 17:06:07 -04:00
Simon Kornblith
6db380b132 Fix importing files and add a basic test
Still need to make the progress indicator work again. Also there may be
some performance to be gained by pooling item saves into a transaction
if one is already open.
2015-06-12 16:58:57 -04:00
Dan Stillman
526c5f8112 Don't break Dan Cohen's library
(Though if you think about it, all of our publications may indeed become
Dan Cohen's eventually.)
2015-06-12 03:30:08 -04:00
Dan Stillman
f7216298b4 Update character set handling
Restore prepopulated charset table, but this time with just the
encodings from the WHATWG Encoding Standard. Assigning a charset to
Zotero.Item::attachmentCharset runs the value through
Zotero.CharacterSets.toCanonical() automatically.

This migrates attachment charsets to the new canonical values, clearing any
that are unsupported.

Other legacy mappings could still be added back, as disussed in #760.
2015-06-12 02:46:02 -04:00
Aurimas Vinckevicius
5817a2d654 Store UTF-8 as charset for all snapshots 2015-06-11 18:30:57 -05:00
Aurimas Vinckevicius
1374cc911a Always save snapshots in UTF-8 encoding
Re https://forums.zotero.org/discussion/49897/thecreate-web-page-item-from-current-pageis-sometimes-not-working-correctly/
There is something wrong with the way nsIScriptableUnicodeConverter converts to gbk (maybe other formats too). The HTML of http://www.cmiw.cn/forum.php is truncated in the middle of an em tag. In general, ConvertFromUnicode is supposed to return an ACString (not AString), which is not something that JavaScript can handle well.
2015-06-11 18:27:13 -05:00
Aurimas Vinckevicius
16ab576a1c Add toCanonical and toLabel for Zotero.CharacterSets 2015-06-11 17:17:28 -05:00
Dan Stillman
c407675d6a Fix more Travis timeouts, hopefully 2015-06-11 16:06:00 -04:00
Dan Stillman
f8684cc9d8 Fix tag purging and Zotero.Tags.getName() 2015-06-09 16:47:04 -04:00
Dan Stillman
ac440b2b38 Don't reload collections list when sources are modified
Just update the row that changed, moving it if necessary.
2015-06-09 16:47:04 -04:00
Dan Stillman
1d45c6c882 Reselect the same row when an item is removed 2015-06-09 03:27:45 -04:00
Dan Stillman
33c19715a8 Avoid error when dragging over header row 2015-06-08 04:29:16 -04:00
Dan Stillman
9a45fa94bd Move transaction wait debug output to level 6, and strip Bluebird lines
This output is basically only useful when something hangs, so it can
stay off all other times.

For now, 6 can be the new only-use-when-something-is-actively-broken
level. At some point we may want to move DB activity to 4 and make this
sort of thing 5, because we don't have much that's 4 right now.
2015-06-08 04:14:47 -04:00
Dan Stillman
2d6143dce1 Clean up notifier debug output 2015-06-08 04:14:46 -04:00
Dan Stillman
f93e6706fa Don't refresh collections view when removing groups
Remove rows one by one
2015-06-08 04:14:46 -04:00
Dan Stillman
b43a735b93 Include libraryID in group.erase() notifier data 2015-06-08 04:05:47 -04:00
Dan Stillman
ec89a98f9d Add group.eraseTx() 2015-06-08 04:05:47 -04:00
Simon Kornblith
70f021f945 Use ISO 8601 accessDates everywhere
This uses ISO 8601 dates for generateAllTypesAndFieldsData (and
changes populateDBWithSampleData to use Item#fromJSON), and makes
translators expect ISO 8601 accessDates, although SQL accessDates are
still supported with a deprecation warning. Canonicalization happens in
Zotero.Translate, so I need to remember to update connectors as well.
2015-06-07 18:50:57 -04:00
Dan Stillman
8448203583 Expect ISO 8601 access dates in Zotero.Item::fromJSON()
This causes translator tests to fail, because the sample data currently
has SQL access dates instead.
2015-06-07 17:54:44 -04:00
Simon Kornblith
3fc38d750b Use Zotero.Item.fromJSON() for saving from translators
Also:
  - Move some canonicalization of items returned by translators to
    Zotero.Translate
  - Make Zotero.Translate#translate return a promise
  - Add tests
2015-06-07 17:30:41 -04:00
Simon Kornblith
ec5e20659b Improve error handling for attachment saving 2015-06-07 17:22:57 -04:00
Simon Kornblith
e27d907973 Throw an error if HTTP request yields non-OK in importFromURL() 2015-06-07 16:06:59 -04:00
Dan Stillman
6935310c75 Fix Zotero.Users.setCurrentUsername() 2015-06-07 15:50:07 -04:00
Dan Stillman
a22c4969e6 Move editable and filesEditable props to libraries table [DB reupgrade]
And add group.fromJSON(json, userID), which sets editable and
filesEditable properties based on the group JSON (libraryReading, role
lists, etc.) and the given user
2015-06-07 15:50:07 -04:00
Dan Stillman
53706d633a Make Zotero.HTTP exceptions instances of Error 2015-06-07 15:43:09 -04:00
Dan Stillman
16706ba481 Allow Zotero.HTTP.request() to be mocked
sinon.useFakeXMLHttpRequest() doesn't work in our case, but if
Zotero.HTTP.mock is set, Zotero.HTTP.request() will create new instances of
that object instead of the built-in XMLHttpRequest, so it can be set to
FakeXMLHttpRequest:

Zotero.HTTP.mock = sinon.FakeXMLHttpRequest;
var server = sinon.fakeServer.create();
server.autoRespond = true;
server.respondWith("GET", "/users/1",
  [200, {"Content-Type": "application/json"}, '{"userID": 1}']);
var userInfo = yield getUser();
Zotero.HTTP.mock = null;
server.restore(); // probably not necessary
2015-06-07 15:23:12 -04:00
Simon Kornblith
38eeab06a3 Some snapshot-related fixes 2015-06-07 14:02:20 -04:00
Aurimas Vinckevicius
3d4926923a Resolve relative URLs to absolute before trying to proxify them
Besides adding some debug logging, this currently makes no difference, but it will when we add support for de-proxifying URLs in #578.
2015-06-05 15:51:42 -05:00
Aurimas Vinckevicius
9450d0797f Don't double-proxy in properToProxy
Surfaced due to changes in 7f7fe90ad5
2015-06-05 15:51:42 -05:00
Dan Stillman
aa2e0a8582 Update Zotero.Relations.updateUser() for new relations schema
Also adds Zotero.DataObjects::getLoaded(), which returns an array of all
loaded objects of the given type. This is useful for selective
reloading, for example with item.reload(['relations'], true).
2015-06-04 20:38:49 -04:00
Dan Stillman
195a737049 Allow item.addRelatedItem() to work on unsaved item without libraryID
Production code should just assign a libraryID, but this is useful for
tests, and addCollection() does it.
2015-06-04 20:38:41 -04:00
Simon Kornblith
582799e428 Fix Zotero.Attachments.importSnapshotFromFile 2015-06-04 20:22:54 -04:00
Simon Kornblith
7253a2dd8c Map base fields to item-specific fields in Item#fromJSON() 2015-06-03 23:42:08 -04:00
Dan Stillman
20ca8edf87 Fix getContentsAsync() with invalid characters 2015-06-02 20:32:31 -04:00
Dan Stillman
424cae173b Fix getField/setField behavior/tests with regard to falsy values
In particular, 0 is kept as a value, and passing undefined to setField
now throws an error.

I'm not sure if we actually want to return an empty string in all cases
for missing/invalid fields, but that's what we do currently.
2015-06-02 19:09:58 -04:00
Dan Stillman
3ad15f7b59 Use Zotero.Utilities.Internal.exec() for PDF tool calls 2015-06-02 14:58:44 -04:00
Dan Stillman
77f12527aa Fix NS_BASE_STREAM_CLOSED error, for real
The input stream produced by asyncFetch is closed automatically at EOL,
so the available() call throws this for an empty file.
2015-06-02 14:58:43 -04:00
Dan Stillman
ef3bf8d596 Fix a few test failures/warnings
And simplify tree view load event handling, which may or may not have
been contributing to intermittent test failures, but is cleaner this way
regardless.
2015-06-02 03:51:09 -04:00
Dan Stillman
4f12c71e3e Fix intermittent NS_BASE_STREAM_CLOSED error? 2015-06-02 03:51:09 -04:00
Dan Stillman
dca29a06e3 Include params in DB error messages 2015-06-02 03:51:09 -04:00
Dan Stillman
1f643c1baa Fix skipNotifier option with DataObject::erase() 2015-06-02 03:51:09 -04:00
Dan Stillman
c5cfb6adfd Ignore 'synced' in Zotero.Item.fromJSON() 2015-06-01 22:45:13 -04:00
Dan Stillman
a740658452 Relations overhaul (requires new DB upgrade from 4.0)
Relations are now properties of collections and items rather than
first-class objects, stored in separate collectionRelations and
itemRelations tables with ids for subjects, with foreign keys to the
associated data objects.

Related items now use dc:relation relations rather than a separate table
(among other reasons, because API syncing won't necessarily sync both
items at the same time, so they can't be stored by id).

The UI assigns related-item relations bidirectionally, and checks for
related-item and linked-object relations are done unidirectionally by
default.

dc:isReplacedBy is now dc:replaces, so that the subject is an existing
object, and the predicate is now named
Zotero.Attachments.replacedItemPredicate.

Some additional work is still needed, notably around following
replaced-item relations, and migration needs to be tested more fully,
but this seems to mostly work.
2015-06-01 20:28:30 -04:00
Dan Stillman
b59fa1eed9 Store copy of changed object in _markFieldChange()
Otherwise a splice() on a stored array affects the calculation of what's
new.
2015-06-01 20:23:20 -04:00
Dan Stillman
5fc524bcb2 Generalize Zotero.CachedTypes.add(), and tweak item charset handling
.attachmentCharset on an item now requires a string, not a charsetID.
(It accepted a charset before but didn't quite work right.)
2015-06-01 20:23:20 -04:00
Dan Stillman
bf0d2a1bf4 Fix collectionTreeView::expandToCollection() 2015-06-01 15:31:57 -04:00
Simon Kornblith
9bb01d737c Merge branch '4.0' into sjk/659 2015-06-01 00:03:20 -04:00
Dan Stillman
5ba344516e Update PDF tool handling in tests
The test runner now downloads and caches the PDF tools for the current
platform within the test data directory and only redownloads them when
out of date, and it updates the download URL so that the full-text code
pulls from the cache directory via a file:// URL.

The installPDFTools() support function now installs the files directly
instead of going through the prefs, and a new uninstallPDFTools()
function removes the tools. Since the presence of the PDF tools can
affect other tests, tests that need the tools should install them in a
before() and uninstall them in an after(), leaving most tests to run
without PDF indexing.

This also adds a callback to the waitForWindow() support function. If a
modal dialog is opened, it blocks the next promise handler from running,
so a callback has to be used to interact with and close the dialog
immediately.
2015-05-31 23:50:26 -04:00
Dan Stillman
55d27273fb TextEncoder is no longer required for OS.File.writeAtomic() 2015-05-31 23:01:34 -04:00
Dan Stillman
4fd65fec4c Fix charset handling in Zotero.File.getContentsAsync()
Character sets are now populated on demand, so they can't be run through
Zotero.CharacterSets.getName() in getContentsAsync(), since they might
not exist. (I'm also not sure why this was being done anyway.)
2015-05-31 22:58:11 -04:00
Dan Stillman
1979efd8ce Fix Zotero.Fulltext.getTotalPagesFromFile() call 2015-05-31 22:57:34 -04:00
Simon Kornblith
e868c758b6 Fix library/locator engine lookup
Fixes #744, closes #747. Thanks to @zuphilip for tracking down the bug
2015-05-31 18:23:11 -04:00
Dan Stillman
b8d9504a4f Missed lines from 420985661 2015-05-31 17:07:59 -04:00
Simon Kornblith
673168ea7b Don't adjust accessDate for UTC and set version to 0 in Item#toJSON
Ref discussions:
https://github.com/zotero/zotero/pull/746/files#r31394225
https://github.com/zotero/zotero/pull/746#commitcomment-11445605
2015-05-31 17:02:20 -04:00
Dan Stillman
cc3d81da93 Add Zotero.DataObjectUtilities.generateKey()
For now, this just calls Zotero.Utilities.generateObjectKey(), but this
function makes more sense in DataObjectUtilities. It does need to be
accessible to the connectors, but if it's possible to add an alias in
Zotero.Utilities just for the connectors, it'd probably be better to do
that and use Zotero.DataObjectUtilities.generateKey() elsewhere.
2015-05-31 16:59:10 -04:00
Dan Stillman
420985661b Default to user library when assigning unsaved item to collection
And fix some issues setting the libraryID property on unsaved objects

Also return .deleted as false, not an empty string
2015-05-31 02:03:53 -04:00
Dan Stillman
ed1c0a4637 Fix updating of cached child collections/items, and make more efficient 2015-05-30 19:03:42 -04:00
Dan Stillman
807c40859f Missed lines from 2154673dd 2015-05-29 21:55:47 -04:00
Dan Stillman
2154673dd3 Return a Zotero.Item from all Zotero.Attachments methods
These previously returned an itemID, but now that new saved items can be edited
without a refetch, they should just return the new item.

(Possible I missed a few spots where these are called.)
2015-05-29 05:33:54 -04:00
Dan Stillman
5a2ec43de1 Add Notifier.queue()
Notifier.trigger() needs to be async, since if it actually runs it waits for
promises returned from observers. But the vast majority of trigger() calls are
in transactions where they just queue and can therefore be synchronous. This
replaces all such calls with Notifier.queue().

This should fix a race condition that was causing the emptyTrash() test to fail
intermittently.
2015-05-29 05:03:05 -04:00
Dan Stillman
15252623d7 Log the actual number of Notifier observers for a type 2015-05-29 03:37:29 -04:00
Dan Stillman
72e0124e4e Fix tag purging with stricter DB parameter checks
Should have failed without libraryID being passed
2015-05-29 01:15:04 -04:00
Dan Stillman
4e1dd6f5b6 Restore DB parameter checking and add tests
Some parameter situations also weren't being properly handled
2015-05-29 01:15:04 -04:00
Dan Stillman
1e7c822ab0 Fix linked file creation 2015-05-29 01:09:24 -04:00
Dan Stillman
a804efce67 Fix getAttachments()/getNotes() with no child items after save 2015-05-27 22:18:40 -04:00
Dan Stillman
7eaa57562f Fix Zotero.ItemFields.getBaseIDFromTypeAndField()
Closes #741
2015-05-27 05:01:48 -04:00
Dan Stillman
80d5b74cf3 Merge 4.0 up to 28301ea45f
Conflicts:
	chrome/content/zotero/preferences/preferences_export.js
	chrome/content/zotero/xpcom/proxy.js
2015-05-26 17:48:22 -04:00
Dan Stillman
8c64d8b410 Fixes #739, Item added to "My Publications" despite choosing cancel 2015-05-26 17:20:42 -04:00
Aurimas Vinckevicius
ec786bf15c For now, use Zotero item DB ids when passing items to citeproc
citeproc-js relies on this in several locations. Seems that Zotero passes these IDs to citeproc from the item picker. We also need to consider existing embedded items in Word/LO documents, but they do have embedded URIs, so it shouldn't be a problem.
CC @fbennett
2015-05-26 16:11:44 -05:00
Aurimas Vinckevicius
c84a16984b Map note excerpt to title in itemToCSLJSON
This way notes have some sort of user-friendly way of being traced from Word documents to Zotero items in the library
2015-05-26 16:11:44 -05:00
Aurimas Vinckevicius
de0b7ba181 ItemGetter shouldn't break with an empty DB 2015-05-26 16:11:42 -05:00
Aurimas Vinckevicius
9d5d8b525a Access date in Zotero.Item::toJSON should be in ISO-8601 format 2015-05-26 16:03:35 -05:00
Aurimas Vinckevicius
47bf9c38e9 Transition item Export Format to Zotero web API item JSON
* Enable legacy mode for export translators compatible with pre-4.0.27:
   * Add compatibility mappings, so that current translators don't break if they specify minVersion lower than 4.0.27. This does introduce non-compatible changes, specifically, "version" field in legacy mode is "versionNumber" in the new format. "version" in the new format corresponds to the "version" as specified for Zotero API JSON format. New translators should expect Zotero web API JSON format and should specify minVersion 4.0.27.
* Update CSL mappings to comply with new itemToExportFormat
* CSL JSON export translator needs to be updated to be compatible with 4.0.27 to export correct CSL JSON
* Use item URI for id in CSL JSON instead of item ID
* Fix note and attachment handling in itemToCSLJSON
2015-05-26 15:48:43 -05:00
Aurimas Vinckevicius
12db2e6c51 Don't throw if checking invalid field in ItemFields.isValidForType 2015-05-26 15:39:44 -05:00
Aurimas Vinckevicius
c6151f959d Fix relations serialization in Zotero.Item::toJSON() 2015-05-26 15:39:44 -05:00
Aurimas Vinckevicius
21cd15b068 Port Zotero.Item.toJSON from api_syncing branch
* Modified to use synchronous DB access
* Take patchBase argument as an option
* Update to conform to v3 API
2015-05-26 15:32:33 -05:00
Aurimas Vinckevicius
7445f81042 Port Zotero.Date.sqlToISO8601 from 755ead2119
Copy-pasted, no modifications
2015-05-26 15:32:33 -05:00
Dan Stillman
f71140da64 Remove Zotero.Item.prototype.addTags
Can use addTag() or setTags()

Addresses #735
2015-05-26 12:13:27 -04:00
Dan Stillman
8a0b4d92a6 Fix PDF tools installation on Linux 2015-05-26 04:44:02 -04:00
Dan Stillman
3d3b817724 Allow data to be set after save() on a new object without load() calls
After saving a new object and reloading primary data and any changed
data (which we can maybe reconsider at some point), mark all other data
types as loaded, since there's no other data we don't have. For example,
this allows for item.save() to be followed by item.setField() without
needing to call item.loadItemData() first.
2015-05-26 04:08:47 -04:00
Dan Stillman
5d530e4173 Don't load item data and collections for all items in the middle pane 2015-05-26 03:19:44 -04:00
Dan Stillman
41a68af1ae Remove debug line when loading collections 2015-05-26 03:19:44 -04:00
Dan Stillman
ea1573e1c3 Don't log warning when localized string for search condition not found
Falls back to item field strings, so not sure why I added logging for
this.
2015-05-26 03:19:30 -04:00
Dan Stillman
9f4b128c14 Remove header and footer from stack trace display 2015-05-26 03:15:04 -04:00
rmzelle
06e6168cb4 Implement locale drop-down menus 2015-05-26 00:12:04 -04:00
Dan Stillman
28301ea45f Center the site-specific Quick Copy and proxy editing windows
On OS X these show up as sheets, but on Windows without this flag they
appear in the top-left of the screen.
2015-05-25 23:36:24 -04:00
Dan Stillman
c152e81bed Merge pull request #732 from rmzelle/edit-button-quickcopy
Add Edit button for site-specific Quick Copy settings
2015-05-25 23:31:44 -04:00
rmzelle
5833d87169 Add Edit button for site-specific Quick Copy settings 2015-05-25 23:21:50 -04:00
Dan Stillman
6e4eb61694 Merge pull request #673 from sendecomp/optional-proxy-redirect-notification
Add an option to not show the proxy redirection notification
2015-05-25 21:57:16 -04:00
Dan Stillman
96f5bab3a1 Cancel relatedbox loading if binding disappears 2015-05-25 21:48:47 -04:00
Dan Stillman
31af26af08 Fix selection of new items 2015-05-25 21:48:47 -04:00
Dan Stillman
2bd246e2ea Fixes #728, Tag selector refreshing 2015-05-25 21:48:46 -04:00
LinuxMercedes
34c0e746f5 Add an option to not show the proxy redirection notification 2015-05-25 17:38:24 -05:00
Dan Stillman
cbbdebc5b7 Fix hang in collectionsTreeView::selectWait() if row is already selected 2015-05-25 01:43:07 -04:00
Dan Stillman
43762248a4 Fix trash emptying, and do it in batches of 50 2015-05-25 00:14:49 -04:00
Dan Stillman
87fa51849f Accept promise-yielding generators directly in forEachChunkAsync() 2015-05-24 22:56:44 -04:00
Dan Stillman
6933f64616 Fix reselection of trash after restart 2015-05-24 22:04:40 -04:00
Dan Stillman
dd52206b37 Don't show "Loading item data" when data is cached 2015-05-24 21:34:11 -04:00
Dan Stillman
e35575e6fd If last viewed collection is set but not found, default to My Library 2015-05-24 20:00:10 -04:00
Dan Stillman
2ed04eca26 Speed up translator initialization in source installs
updateBundledStyles() already has the contents of a new/updated
translator when it copies it into the data dir, so there's no need for
Zotero.Translators.reinit() to read it again from the just-copied file.
This passes the metadata from updateBundledStyles() to reinit() to avoid
the extra file read.

(Alas, this appears to make essentially zero difference on an OS X
system with an SSD, but maybe it will help elsewhere.)
2015-05-24 20:00:10 -04:00
Dan Stillman
bd9c53b29c Fix tag selector loading (broken by 6b87c641) 2015-05-24 20:00:10 -04:00
Dan Stillman
8a93250ca1 Fix "comment.split is not a function" in item box 2015-05-24 04:56:19 -04:00
Dan Stillman
19b8db590f Fixes #727, Duplicated items lose their creators 2015-05-24 04:55:54 -04:00
Dan Stillman
ff7919553c Collections data layer cleanup
Get rid of data_access.js, at long last. Existing calls to
Zotero.getCollections() will need to be replaced with
Zotero.Collections.getByLibrary() or .getByParent().

Also removes Zotero.Collection::getCollections(), which is redundant
with Zotero.Collections.getByLibrary(), and Zotero.Collections.add().
The latter didn't didn't include a libraryID anyway, so code might as
well just use 'new Zotero.Collection' instead.
2015-05-24 04:37:34 -04:00
Dan Stillman
ef57b4e016 Relations fixes and cleanup
Relations need a complete overhaul, but this makes them generally work
again.
2015-05-24 03:08:22 -04:00
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
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
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
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
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
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
Aurimas Vinckevicius
f7868be884 Consolidate _saveAttachment error and callback handling 2015-05-19 03:12:37 -05: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
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
Dan Stillman
fa039971e6 Fixes #714, Zotero.defineProperty() lazy mode doesn't work
Patch from @aurimasv
2015-05-13 13:43:55 -04:00
Dan Stillman
f376db0705 Remove duplicate Zotero.defineProperty() function
Ended up in two places somehow
2015-05-13 12:35:26 -04:00
Dan Stillman
27ab9869be Fix DB upgrading (broken in 14d435b8d) 2015-05-13 11:20:12 -04:00
Dan Stillman
3eed76698c clearUserPref no longer throws on an invalid pref 2015-05-13 11:20:12 -04:00
Dan Stillman
1f8b6fad61 Don't include collections in child item JSON export
But handle it in Zotero.Items.diff() if it's there for one item
2015-05-13 11:20:11 -04:00