Commit graph

6431 commits

Author SHA1 Message Date
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
Dan Stillman
f7074a75b5 Fix error deleting selected library 2017-02-24 02:36:17 -05:00
Dan Stillman
1633a73c3e Fix renaming attachment from right-hand pane 2017-02-23 20:17:40 -05:00
Dan Stillman
9073239292 Fix file sync error if local item version is greater than remote item
This can happen because objects are uploaded in batches, but the version
number from the last batch is used for all objects (since
APIClient.uploadObjects() handles batching internally).
2017-02-23 18:07:03 -05:00
Dan Stillman
6329e22a20 Show the right HTTP method in WebDAV errors
Could probably QI UnexpectedStatusException.channel to nsIHTTPChannel
and get requestMethod, but this is easier.
2017-02-23 15:21:45 -05:00
Dan Stillman
bb38c974bf Fix error importing from file (regression from 32bebeb1cd) 2017-02-22 21:46:06 -05:00
Dan Stillman
383eac4657 Use same directory for OS.File.moveAtomic() temp file
Using the main temp directory was causing writes to fail when storage
was on another filesystem.
2017-02-22 19:53:48 -05:00
Dan Stillman
32bebeb1cd Fix importing from clipboard
Since there's no filename to show in the progress popup, show the
translator label (e.g., "BibTeX") instead.
2017-02-22 05:22:13 -05:00
Dan Stillman
0964277a37 Use OS.File.move() for data-dir migration on Windows, and make automatic
Previously on Windows, where we don't have /bin/mv, we were recursing
into the data directory and copying files individually, which is very
slow, so automatic migration was disabled. Instead, try moving
directories with OS.File.move() with the `noCopy` flag. Moving
directories is technically unsupported by OS.File, but probably only
because of the possibility of a cross-volume copy (which is only
implemented for some platforms), and using `noCopy` hopefully prevents
that. If someone does have their data directory or storage directory on
a different volume, the migration might be quite slow, but leaving a
data directory behind in the Firefox profile directory (where it can be
easily misplaced with a seemingly unrelated Firefox reset) is worse.
2017-02-22 04:56:49 -05:00
Dan Stillman
1ff1fabb31 Fix dragging attachment onto item on Linux (since 1a49018bd) 2017-02-21 18:17:05 -05:00
Dan Stillman
3c5912f68d Merge pull request #1180 from adomasven/fix/savePage-no-translator 2017-02-21 16:40:33 -05:00
Adomas Venčkauskas
01df8f59e5 Default to first translator for /connector/savePage if not provided 2017-02-21 16:40:10 -05:00
Dan Stillman
333675d8ea Don't select sibling on attachment removal if attachment was unselected
Fixes #1173
2017-02-21 01:21:07 -05:00
Dan Stillman
60b2e16746 Fix "Item collection [n] not found" error after deleting collection 2017-02-21 00:38:00 -05:00
Dan Stillman
90603c33b4 Remove unused properties 2017-02-21 00:04:53 -05:00
Dan Stillman
64d73cf2d0 Fix handling of old-style 'condition'/'savedSearch' conditions
Strip library id prefix in addCondition() and _loadConditions(), so the
internal code can always expect just a key.
2017-02-21 00:04:53 -05:00
Dan Stillman
e465cf058e Allow opening multiple URLs via View Online 2017-02-20 18:49:35 -05:00
Dan Stillman
5c50bb00cf Don't save full-text cache files for linked files to linked directory
Regression from 80f888f374. Not entirely sure what I was trying to fix there.
2017-02-20 17:51:37 -05:00
Dan Stillman
bb0fa73899 Fix old-style 'collection' condition for My Library in saved searches 2017-02-18 14:19:30 -05:00
Dan Stillman
07ea9dae84 Merge pull request #1172 from adomasven/fix/clean-authors
Get a better last name if current guess starts with weird symbols
2017-02-18 12:52:45 -05:00
Adomas Venčkauskas
bf1c52a5fd Get a better last name if current guess starts with weird symbols 2017-02-18 18:12:24 +01:00
Dan Stillman
058a4b1593 On 404 from ZFS upload, mark attachment item for upload
This shouldn't happen, but reported here:

https://forums.zotero.org/discussion/64386/5-0-beta-persistent-sync-errors

Possibly the same cause as this:

https://forums.zotero.org/discussion/64438/5-0-beta-persistent-sync-error
2017-02-16 20:11:05 -05:00
Dan Stillman
34c90fd156 If parent item is missing remotely, mark as unsynced and add to queue
This shouldn't happen, but there've been some reports of it.
2017-02-16 18:05:48 -05:00
Dan Stillman
cbed716424 Fix format of object data added back to upload queue after failure 2017-02-16 18:00:13 -05:00
Dan Stillman
ddb7d3107d Include 'skipNotifier' in 'skipAll' when saving objects 2017-02-16 17:58:52 -05:00
Dan Stillman
bb665a56b6 Fix firstCreator for unsaved items
Necessary when editing embedded citations that don't exist in library
2017-02-15 23:15:00 -05:00
Dan Stillman
3830aa1125 Mark trashed items as unsynced and update parents (including note list)
Regression from 3a0e0cb088
2017-02-15 14:22:34 -05:00
Dan Stillman
469d689f37 Fix emptying from trash (broken in 7ede52355d)
Zotero.Items.eraseTx() doesn't exist -- use Zotero.Items.erase() instead
2017-02-10 14:11:10 -05:00
Dan Stillman
3a0e0cb088 Drastically speed up moving items to the trash
E.g., moving 3,600 items to the trash now takes 4 seconds instead of 62

Instead of saving each item, update internal state and database directly
(which is more brittle but worth it). Also avoid unnecessary sorting
after removing an item from the items tree.
2017-02-08 23:42:55 -05:00
Dan Stillman
58edb3143e Update ProgressWindow constructor call after c00db272f 2017-02-08 21:23:36 -05:00
Dan Stillman
ed047f06df Don't select items added via import 2017-02-08 21:19:32 -05:00
Dan Stillman
a4572c9442 Make sure 'collections' passed to Translate is an array 2017-02-08 14:58:03 -05:00
Dan Stillman
27cb099c82 Allow asynchronous item saving in import translators
This allows for imported items to be saved individually instead of being
saved in a batch after processing the entire imported file (which for
large imports would hang the UI, even if the actual saving was
asynchronous). This also fixes the progress meter during asynchronous
saves.

To take advantage of this, import translators will need to return a
promise when available (using the native Promise object) from doImport()
and wait for optional promises from item.complete().

The logic here can probably be streamlined further. (E.g., we might be
able to say that item.complete() always returns a promise.) It's
complicated by the fact that, at the moment, Promise isn't available in
child sandboxes, though this can probably be fixed.

Tests forthcoming, but they require a translator that supports this,
which needs to be committed separately.

View with -w for a cleaner diff.
2017-02-08 14:56:44 -05:00
Dan Stillman
3e35764405 Allow altering text in a ProgressWindow line in OO mode
And fix progress meter display
2017-02-08 14:32:07 -05:00
Dan Stillman
12ad749087 Fix additional file sync error with no remote stored hash
Follow-up to c9694e93b0
2017-02-08 14:12:16 -05:00
Dan Stillman
55e9a0ee35 Update empty state of parent collection when deleting subcollection 2017-02-03 01:18:00 -05:00
Dan Stillman
a57ea28d42 Fix csledit
Closes #1149

(There's an additional change in #1149, but as far as I can tell it's
not necessary for csledit.xul.)
2017-02-03 00:53:43 -05:00
Dan Stillman
3a2fb2938d Remove temporary debugging buttons in prefs 2017-02-03 00:07:16 -05:00
Dan Stillman
1a49018bdc Fix moving items between collections
`mozSourceNode` seems to no longer be set in `dataTransfer` objects
during drags, so we now store it in `Zotero.DragDrop`.
2017-02-03 00:07:16 -05:00
Dan Stillman
76bc61e882 Don't unload object on save error if not new 2017-02-03 00:07:16 -05:00
Dan Stillman
79a07cad9e Return array copy in ItemFields.getItemTypeFields()/getTypeFieldsFromBase() 2017-02-03 00:07:16 -05:00
Dan Stillman
7ede52355d Require DB transaction in Zotero.Collection.prototype.removeItems()
For consistency with Zotero.Collection.prototype.addItems()
2017-02-03 00:07:16 -05:00
Dan Stillman
f98de97e4d Don't select last item in list when item is removed from collection 2017-02-03 00:07:16 -05:00
Adomas Venčkauskas
9ecfc31fd4 Fix translation error reporting in connectors
Closes zotero/zotero-connectors#101
2017-02-02 16:16:22 -03:00
Dan Stillman
0b9b758029 Don't localize "OpenURL" 2017-02-02 02:01:06 -05:00
Adomas Venčkauskas
ef0d9afe8e Address debug reporting in connector (zotero/zotero-connectors#97) 2017-01-31 19:46:20 -03:00
Adomas Venčkauskas
21a7a49a1b Fix broken date class (regression 38b0fb2) 2017-01-31 19:02:30 -03:00
Adomas Venčkauskas
38b0fb2650 Zotero.Promise.coroutine not supported in connector shared code (broken ef1ff8b) 2017-01-31 19:00:15 -03:00
Adomas Venčkauskas
c4d39ba79f Update translate error report with promisified info (broken c3dcaf9) 2017-01-31 18:23:19 -03:00
Dan Stillman
26eebcfc44 More report note fixes
Restore handling of plaintext notes from before 835003dd6d, and search
for a wider set of HTML indicators to avoid showing markup when no <p>
tags.
2017-01-31 13:56:45 -05:00
Dan Stillman
4871374673 Don't modify options object passed to DataObject.save() 2017-01-31 01:25:51 -05:00
Dan Stillman
835003dd6d Parse note content in reports as HTML instead of XML
And remove raw-markup fallback when not XML
2017-01-31 01:25:51 -05:00
Dan Stillman
ae47ae28bd Fix #1163, Unable to open zotero urls from tinymce 2017-01-30 14:01:04 -05:00
Dan Stillman
b073c3e680 Fix mangled output from Zotero.Utilities.getAsyncInputStream()
Proper fix (as opposed to 5236d01791) for
https://forums.zotero.org/discussion/64022/5-0-beta-generate-report-is-often-garbled
2017-01-30 13:33:23 -05:00
Dan Stillman
10111dbd98 Ensure modified item stays visible
There seems to be a bug here where, if the item is off-screen when
modified, it doesn't become visible, but it now does stay visible when
it's on-screen to begin with.
2017-01-29 09:18:16 -05:00
Dan Stillman
48a81e3b46 Fix 412 after choosing local file on file conflict 2017-01-29 07:50:46 -05:00
Dan Stillman
c00db272fa Add option to Zotero.ProgressWindow to not close on click
ProgressWindow now takes an options object instead of a window (which is now an
available option, along with 'closeOnClick')
2017-01-27 21:05:41 -05:00
Dan Stillman
4d56191f0c Fix importing of files using relative paths 2017-01-27 20:51:12 -05:00
Dan Stillman
22d460312c Make ZFS file syncing always enabled for publications library for now
At least until we have a better interface for setting library-specific
sync settings

Previously, if My Library file syncing was disabled or set to WebDAV, My
Publications files wouldn't be uploaded.
2017-01-27 14:14:33 -05:00
Dan Stillman
27974791b0 Fix error in recursiveCollections mode with huge number of subcollections 2017-01-27 12:00:28 -05:00
Dan Stillman
31ed9bd70b Fix misplaced line in e23452363b 2017-01-26 18:30:18 -05:00
Dan Stillman
aec9b2a531 Automatically use remote version when two items in trash are in conflict 2017-01-26 18:07:01 -05:00
Dan Stillman
e23452363b Handle auto-hyphenated ISBN during item conflict
Always keep the hyphenated version, and don't consider it a visible conflict
2017-01-26 15:08:34 -05:00
Dan Stillman
3a1bec1ab3 Fix "Show in Library" in item context menu 2017-01-26 02:57:14 -05:00
Dan Stillman
3415aae908 Fix error generating reports
9b247ebba7 follow-up
2017-01-24 15:42:28 -05:00
Dan Stillman
50b7dd39a0 Don't show incorrect instructions for adding Locate engines
Not currently possible in 5.0

https://github.com/zotero/zotero-connectors/issues/92
2017-01-24 03:54:30 -05:00
Dan Stillman
cfa15a3e3c Rename "Full Sync" to "Reset Data Sync History", and don't start sync
This allows generating debug output for full sync of a single library.

Also clarify some dialog text
2017-01-24 03:38:21 -05:00
Dan Stillman
c3ba7340c6 Update submodules 2017-01-24 02:51:18 -05:00
Dan Stillman
edb08e179c Fix item key search (broken by a01f2765e4) 2017-01-23 08:46:42 -05:00
Dan Stillman
a01f2765e4 Fix quick search and quick format bar (broken in 9b247ebba7)
As evidenced by majorly failing tests
2017-01-23 08:40:18 -05:00
Dan Stillman
249f9c6495 Temporary prefs buttons to debug slow DB issue 2017-01-23 07:20:36 -05:00
Dan Stillman
41413b1ab2 Fix push sync for group libraries 2017-01-23 07:01:41 -05:00
Dan Stillman
cddc84ffe3 Make sure translator file ends with newline when saving
Fixes https://github.com/zotero/scaffold/issues/37
2017-01-23 05:57:18 -05:00
Dan Stillman
c9694e93b0 Fix file upload error when remote attachment has no stored hash 2017-01-22 15:30:18 -05:00
Dan Stillman
b3c28dc79e Fix item keys in report ids 2017-01-21 06:36:28 -05:00
Dan Stillman
9b247ebba7 Fix error trying to generate report for many items
When adding many search conditions (e.g., when matching many items with the
`key` condition), the query can fail due to either the bound parameter limit or
the expression tree size limit.

To avoid this, add support for an 'inlineFilter' property on search conditions
when using the 'is' or 'isNot' operator. 'inlineFilter' is a function that
returns a quoted value suitable for direct embedding in the SQL statement, or
false if not valid. Multiple consecutive conditions for the same 'inlineFilter'
field are combined into an `IN (x, y, z)` condition.
2017-01-21 03:38:36 -05:00
Dan Stillman
cc516005c0 "Import"/"Import from Clipboard" shortcut key changes
- Add Cmd/Ctrl-Shift-I for "Import…"
- Cmd/Ctrl-Shift-V apparently pastes without formatting, so don't override it.
  Instead, add a shortcut key to the menu option, defaulting to
  Cmd-Option-Shift-I/Ctrl-Alt-Shift-I
- The I in both is now localizable
2017-01-19 15:28:27 -05:00
Dan Stillman
362e18c747 Fix attachment content search
And always convert ids from GROUP_CONCAT() to integers in search code.
2017-01-19 13:32:29 -05:00
Dan Stillman
c95e42240f Fix #1157, Note content lost when typing during sync
Someday, I will say this is fixed and it actually will be fixed.
2017-01-19 12:27:18 -05:00
Dan Stillman
e0d92ecd94 Update submodules 2017-01-19 05:48:46 -05:00
Dan Stillman
318f6656f4 Skip a case of item selection during syncing 2017-01-19 03:47:56 -05:00
Dan Stillman
57b44287f8 Don't allow deleting libraries other than feeds with Cmd/Ctrl-Delete 2017-01-17 21:48:56 -05:00
Dan Stillman
b62139ed0a Fix a couple issues with bundled file timestamps 2017-01-17 21:48:56 -05:00
Dan Stillman
2237c71dcb Fix test for invalid id passed to DataObjects.getAsync() 2017-01-17 04:18:39 -05:00
Dan Stillman
33deefbf74 Limit depth to 1 when outputting data objects
This prevents descending into the global object cache that's accessible
from every data object.
2017-01-17 02:58:47 -05:00
Dan Stillman
1cf2585b41 Add Zotero.isClient
To replace Zotero.isStandalone
2017-01-17 02:58:22 -05:00
Dan Stillman
786f5efa30 Add maxDepth as the third argument to Zotero.debug()
varDump(), which is used by Zotero.debug(), defaults to 5
2017-01-17 02:31:10 -05:00
Dan Stillman
a017fe6666 Fix Zotero.Date methods within translator sandbox
Only a few methods are imported, so some of the changes in 7bdcc17ed
have to be reverted.
2017-01-17 02:23:15 -05:00
Dan Stillman
b00d1366b0 Fix more info link in update prompt 2017-01-17 01:35:03 -05:00
Dan Stillman
aa783878de Fix error refreshing document with item replaced by merge 2017-01-15 16:47:01 -05:00
Dan Stillman
e5ba7612bc About pane updates
- Make version copyable
- Include "What's new" link to changelog
- Update some links and descriptions

To-do:

- Replace dev credits with a nice statement like in the Firefox About pane
2017-01-15 15:29:02 -05:00
Dan Stillman
23f84d796f Fix CSL Preview pane
CSL Editor is being fixed in #1149
2017-01-15 02:46:03 -05:00
Dan Stillman
008bcff8a0 Fix debug output logging (broken by f44264cd4) 2017-01-14 18:39:04 -05:00
Dan Stillman
3d569f1173 Compatibility fixes for Bluebird >=3.4.2
Before 3.4.2, `yield` in a Bluebird `coroutine()` released Zalgo if an
already-resolved promise (e.g., from `Promise.resolve()`) was yielded,
continuing immediately instead of on the next turn of the event loop. We
apparently relied on that broken behavior in a few places, particularly from
`Zotero.DB.waitForTransaction()`. All the transaction-queueing stuff probably
needs to be reevaluated in general, but for now, mirror the previous possibly
ill-advised behavior by checking explicitly for a transaction before yielding
on `waitForTransaction()` (as well as the result of a 'load' event from
`libraryTreeView`).
2017-01-14 18:01:51 -05:00
Dan Stillman
7e30afb2a5 Use coroutine() for Zotero.Schema::_updateSchema() 2017-01-14 17:20:48 -05:00
Dan Stillman
56d9372146 Throw clearer error if invalid type is passed to File.getContentsAsync() 2017-01-14 17:20:48 -05:00
Dan Stillman
f2440eb826 Fix passing file: URI to Zotero.File.getContentsAsync() 2017-01-14 17:20:39 -05:00
Dan Stillman
f44264cd4d Add HTML-based console viewer for easier real-time debug output
Since 1) debug output logging via the prefs isn't necessarily possible
for startup errors in Standalone, 2) real-time output is prohibitively
slow and has a miniscule scrollback buffer on Windows unless you use a
Cygwin or Git terminal, and 3) copying/pasting/emailing was annoying
anyway, make -ZoteroDebug open a popup window that shows errors and
debug output and allows submitting straight to the server with a Debug
ID.

This should replace the existing debug output viewer as well, but that's
less of a priority.

-ZoteroDebugText or the debug.log pref can still be used to dump to the
terminal.
2017-01-14 17:20:12 -05:00
Dan Stillman
12de04607b Don't connect to streaming server until UI is ready 2017-01-13 02:47:47 -05:00
Dan Stillman
bc034089a6 Fix startup error loading Zotero service
https://forums.zotero.org/discussion/63869/5-0-beta-standalone-blank-ui-upon-restart
https://forums.zotero.org/discussion/63865/5-0-beta-library-wont-load

Adding include.js to hiddenWindow.xul in 66549f9e6d seems to have
created a race condition in which the Zotero service would fail on the
third startup after the JS cache was cleared (e.g., on a new version,
-purgecaches, or other changes in the profile). So, don't do that.

Hopefully this isn't caused by other uses (e.g., in plugins) of
include.js and was only happening because the hidden window is launched
concurrently with standalone.xul on macOS.
2017-01-13 02:47:42 -05:00
Dan Stillman
2011a61223 Don't focus note editor when pressing Shift-Tab on note in middle pane
Reverts redundant code from 7e39e4608 (#1136) and fixes the much earlier
9d7cc849 (#151)
2017-01-12 02:41:21 -05:00
Dan Stillman
740795f249 Expand draggable area of splitters on macOS while preserving 1px width
(Borrowing a technique from Thunderbird.)

This only affects the splitters in standard view. The splitter between the top
and bottom panes in stacked view still has a 1px draggable area.

We can probably do a similar thing to slim down splitters on Windows, as
planned in #367.
2017-01-12 02:22:33 -05:00
Dan Stillman
66549f9e6d Fix opening preferences (broken in cbcfb6b92) 2017-01-11 06:24:17 -05:00
Dan Stillman
cf2318ec5a Move feeds below groups 2017-01-10 23:53:04 -05:00
Dan Stillman
cbcfb6b92e Fix missing Options menu on Windows/Linux 2017-01-10 21:44:03 -05:00
Dan Stillman
c631bc4257 Default to creatorType: "author" if missing
Apparently in 4.0 we defaulted to 'author' if a creatorType wasn't
passed. To avoid lots of errors like the one fixed in
dd0094893a,
add a similar fallback for 5.0 and log a warning (though not with the
translator name, unfortunately).
2017-01-10 18:04:54 -05:00
Dan Stillman
ef1ff8bc42 Fix #64, Non-English month parsing doesn't work in Standalone
Month values from the Firefox language packs are included in a
JSON file used by `Zotero.Date.getMonths()`. `getMonths(true)` includes
English months as well.

The JSON file should be bundled with the connectors as well, and
Zotero.Date.init() should be updated to populate the month data from
that.
2017-01-09 04:47:23 -05:00
Dan Stillman
7bdcc17ed0 Convert some private Zotero.Date methods to privileged 2017-01-09 04:20:10 -05:00
Dan Stillman
5dbe677f25 Fix localization of Edit menu 2017-01-09 03:08:37 -05:00
Adomas Venčkauskas
74d358bd19 Remove tmp-* directories when attachment download fails. Closes #1128 2017-01-09 00:10:55 -05:00
Dan Stillman
43dad62150 Only set browser.dom.window.dump.enabled in client 2017-01-07 17:42:19 -05:00
Tom Najdek
abd3054308 Fix non-standard syntax 2017-01-07 13:51:45 -05:00
Dan Stillman
1b3dfe1aea Update submodules 2017-01-06 03:44:40 -05:00
Adomas Venčkauskas
2682d01016 Remove use of deprecated Date.toLocaleFormat 2017-01-06 09:58:30 +02:00
fbennett
4d8d4bcdbc Preserve formatting on Hide/Show editor 2017-01-04 23:39:35 -05:00
fbennett
2538e258b6 Accept variations in spacing, and single-quoted XML serialization 2017-01-04 23:39:35 -05:00
fbennett
2a2e5e4e39 Preserve format tags and entities in bibliography editor
- Fixes errors in previous commits 55bfe54a and 9431e0de, to wit ...
- Apply unescapeHTML after RTF tag and entity conversions
- Remove high-bit character escape from entity converter,
  and apply separately after remaining HTML entities are
  decoded by unescapeHTML
2017-01-04 23:39:35 -05:00
Dan Stillman
53d2aa43d6 Allow showing the Tools -> Error Console menu option via a pref
If devtools.errorconsole.enabled is true, the option will be shown.
2017-01-04 19:14:07 -05:00
Dan Stillman
56b6a0d021 Set browser.dom.window.dump.enabled to true if debug output enabled
dump() works regardless within XPCOM (which is how Zotero.debug()
works), but not on window objects without this pref
2017-01-04 17:28:46 -05:00
Dan Stillman
612066d749 Allow setting global prefs from Zotero.Prefs.set()
Pass true as third argument
2017-01-04 17:28:18 -05:00
Dan Stillman
42a72fe8aa Don't leave document corrupted if error in doc prefs window
And recover by showing the doc prefs window if it is corrupted (at least
with an empty fieldType, which is what was happening previously)
2017-01-04 01:46:00 -05:00
Dan Stillman
4ff5323acd Increase DB timeout to 30 seconds
Though it would be real nice to avoid situations where this might be necessary
2017-01-03 15:50:33 -05:00
Adomas Venčkauskas
1756b8d242 Make itemPane white on linux 2017-01-03 13:48:28 -05:00
Adomas Venčkauskas
ac959dd6b5 Fix black tab borders on Standalone (regression 53d1bca36)
It appears we do not have ThreeDHighlight in Standalone.
Relevant bug https://bugzilla.mozilla.org/show_bug.cgi?id=1261068
2017-01-03 19:13:40 +02:00
Adomas Venčkauskas
53d1bca36f Fixes a few UI styling issues for Ubuntu 16.10 (GTK 3.20)
- Tabs missing styling
- Preferences: Notes font menulist dropmarker missing (left border still
  missing, could not find any CSS to help that out)
- Preferences: Numberbox background gray

For the tabs styling issue see
https://bugzilla.mozilla.org/show_bug.cgi?id=1306425
2017-01-03 17:54:16 +02:00
Dan Stillman
6096d1ea62 Fix hang on sync restart 2017-01-03 04:40:18 -05:00
Dan Stillman
5d67656ea8 Use Zotero.DBConnection instance everywhere instead of Zotero.DB
Fixes #1141
2017-01-03 04:21:11 -05:00
Dan Stillman
5523dd5c37 Fix pressing "-" and "+" buttons in Styles pane from keyboard 2016-12-30 01:22:58 -05:00
Dan Stillman
0757109c16 Allow direct install from styles page in viewer
When "Get Additional Styles…" is clicked, open a stripped-down version
of the Zotero styles page in a window. When a style is clicked on,
install it and close the window.

I'm going to say that this closes #767, but as Aurimas notes there, if
you know the style you're looking for, being able to just type the name
in a dialog would be faster, so further improvements could be made. But
as it stands, this is much better than clicking through to a browser
(and hoping that it's one with the new connector with style installation
support).
2016-12-30 01:11:06 -05:00
Dan Stillman
c21d6c9700 Allow Cmd-R/Ctrl-R to reload page in basic viewer 2016-12-30 00:58:28 -05:00
Dan Stillman
fb7f9698d3 Move ZoteroStandalone.openInViewer() to Zotero.openInViewer() 2016-12-30 00:56:28 -05:00
Dan Stillman
a076edc836 Update some deprecated function calls 2016-12-29 21:50:33 -05:00
Dan Stillman
2beb2c514c Push-based sync triggering
Immediate sync triggering on remote library change using WebSocket API.
Currently kicks off a normal sync process for the modified library --
actual object data isn't pushed.

(This might not stay enabled for 5.0 Final.)
2016-12-29 21:50:32 -05:00
Dan Stillman
7fd3a8c5d1 Fix New Item MRU list, which apparently has only ever updated on startup 2016-12-29 07:04:12 -05:00
Dan Stillman
8a9986da47 Reduce initial visible creators to 5-7 (from 10-15) 2016-12-29 04:01:00 -05:00
Dan Stillman
9ffab20a09 Add option to Zotero.Utilities.ellipsize() to truncate at word boundary 2016-12-29 04:01:00 -05:00
Dan Stillman
516fedc2fe Fix right alignment of search bar 2016-12-29 04:01:00 -05:00
Dan Stillman
c0f40fac81 Item pane tweaks
- Remove colons after labels
- Non-bold labels
- More padding at top of pane
- Increase space between label and field
2016-12-29 04:01:00 -05:00
Dan Stillman
82292eef77 Hide Actions menu in Standalone
Leave it in place in Firefox for now for development
2016-12-29 04:01:00 -05:00
Dan Stillman
e282a5643f Fix dragging external files onto library root 2016-12-29 04:01:00 -05:00
Adomas Venčkauskas
b01487dccc Make Zotero.Translator shareable with connector 2016-12-28 17:25:38 +02:00
Dan Stillman
4a765aacfa Fix selecting item and scrolling into view when editing a citation 2016-12-26 18:50:08 -05:00
Dan Stillman
5100cd31ed Add collectionTreeView::selectItem()
This moves most selection logic from ZoteroPane.selectItem() into
collectionTreeView::selectItem() so that it can be used in the
edit-citation dialog.

Unlike itemTreeView::selectItem(), which only selects within a given
items tree, this function automatically switches to a library root if
necessary. ZoteroPane.selectItem() remains and does a little bit extra
(unminimizing Zotero, focusing the items pane) in addition to calling
collectionTreeView::selectItem().
2016-12-26 18:44:39 -05:00
Dan Stillman
437c55b286 Object.values() polyfill for <Fx47 after 269e2f8b
Zotero for Windows is still built with Fx45, so we need a polyfill for
Object.values().
2016-12-26 15:26:21 -05:00
Dan Stillman
6d1946ee0a Prevent data loss if objects change locally during sync upload
If an object was uploaded but was changed locally during the upload (e.g., the
user typing in a note), the local changes would be lost when the remotely saved
version was applied. Instead, watch for modifications to objects during the
upload and don't apply the remote versions of those objects or mark them as
synced.
2016-12-26 03:18:13 -05:00
Dan Stillman
6c260bc9c9 Localize TinyMCE
Automatically use a language pack for the current locale if one is
available
2016-12-26 03:17:48 -05:00
Dan Stillman
8af73f9983 Add a notifier event for sync start 2016-12-25 23:20:19 -05:00
Dan Stillman
0a2330b79f Fix error adding top-level attachments in collections 2016-12-25 23:20:19 -05:00
Dan Stillman
653f26d4fb Fix alignment of "Format" in export dialog 2016-12-25 23:20:19 -05:00
Dan Stillman
dc04a1231c Upgrade to TinyMCE 4.5.1
- New flat theme (with padding tightened a bit from the default to fit
  in right-hand pane)
- Adds search/replace within notes
- Adds URL autolinking
- Image pasting/dragging is now properly disallowed (though TinyMCE 4
  has hooks that may allow us to actually support this by automatically
  creating attachments)
- New blockquote style with color bar
- Replaces custom context menu on link click with built-in version

 To-do:

- Fix display of pop-ups, which are now modal dialogs within the note
  frame instead of pop-up windows, to stay fully within the frame
- Localize (more important now that there are tooltips)
- Support image dragging
- Update elements list for HTML5, for better drag-and-drop?
- Move directionality control to context menu instead of taking up
  toolbar space?
- Evaluate other plugins for potential inclusion
- Show additional controls in separate note window?
- Fix opacity of text in tooltips

Closes #451, closes #421
2016-12-25 23:19:49 -05:00
Dan Stillman
ab959cd858 Fix "Reset File Sync History" 2016-12-22 10:00:40 -05:00
Dan Stillman
cf686c520a Don't start auto-sync until UI is ready 2016-12-22 06:58:24 -05:00
Dan Stillman
bd9501218e Apply UI font size change immediately
And change "Changes take effect in new windows" to "Changes take effect
after restart"

(The note font size still requires a restart, as do the shortcut keys in
the Advaned pane.)
2016-12-22 06:58:02 -05:00
Adomas Venčkauskas
bd943ffe85 Add a friendlier GET request message for /connector/ping 2016-12-22 13:14:04 +02:00
Dan Stillman
455f23df4b Show stack for more startup errors 2016-12-21 08:30:06 -05:00
Tom Najdek
d4dc86c975 Remove use of syntax where curly brackets are omitted in function defs 2016-12-21 08:06:17 -05:00
Tom Najdek
39bc5398c9 Remove use of non-standard list comprehension syntax 2016-12-21 08:04:57 -05:00
Tom Najdek
03b1b75bfb Fix non-strict syntax for octal number literals 2016-12-21 08:04:55 -05:00
Tom Najdek
269e2f8bff Replace legacy syntax for each...in with for...of 2016-12-21 08:04:09 -05:00
Dan Stillman
b445283f4e Closes #974, Unreachable code after return statement 2016-12-21 07:48:39 -05:00
Dan Stillman
7e39e46085 Focus note editor when pressing Tab is pressed on note in middle pane
Closes #1136
2016-12-21 06:15:05 -05:00
Dan Stillman
084f5a72df Make API server configurable with extensions.zotero.api.url
Needless to say, use of this pref is unsupported.

Closes #901
2016-12-21 05:52:55 -05:00
Dan Stillman
3b6b6aa36b Remove tab mode
Closes #1135
2016-12-21 05:11:21 -05:00
Dan Stillman
405f41f4c2 Disable connector switching
And so it begins...

Closes #1134
2016-12-21 05:11:21 -05:00
Adomas Venčkauskas
8e083c688a Fix connector translator caching from repo and standalone 2016-12-20 17:05:38 +02:00
Dan Stillman
2f65c7d29c Better error logging for https://forums.zotero.org/discussion/63029/ 2016-12-20 03:33:04 -05:00
Dan Stillman
c1035958d4 Fix for child attachments being saved if prefs off (from 8c2c097c6) 2016-12-19 04:19:18 -05:00
Dan Stillman
8c2c097c6b Fix attachment handling during translation
Synchronously determine whether attachment saving should be attempted and only
start attachment progress if it can
2016-12-18 09:07:57 -05:00
Dan Stillman
6994c63a0e Tweak recognizePDF fix, add test coverage, and enable manual tests
Still disabled in Travis until we mock the remote services
2016-12-17 08:05:33 -05:00
Dan Stillman
e34bf4d5cb Prompt to try manual data dir migration again if Firefox is open 2016-12-17 07:42:03 -05:00
Dan Stillman
6b0e3ac2d2 Fix PDF metadata retrieval after 78b1d2ee35 2016-12-17 06:17:37 -05:00
Dan Stillman
b7daef6bf4 Update submodules 2016-12-16 03:31:06 -05:00
Dan Stillman
5950bfd963 Add menu option for opening Error Console in Standalone, commented out
Not sure we want to expose this, particularly since there are tons of
spurious warnings in current builds due to a chrome registration issue,
but it can be handy for debugging some issues.
2016-12-16 03:23:12 -05:00
Dan Stillman
04941f23db Fix switching out of full mode when started in connector mode
Previously, if Standalone was open and Firefox was opened in connector
mode, ZoteroOverlay.onLoad() was never run, which meant that, among
other things, the before-reload handler that closed the Zotero pane when
switching out of full mode was never added.
2016-12-16 03:16:48 -05:00
Dan Stillman
3d117c4135 Fix upgrade prompt after incompatible DB in Standalone
Since 693c0286e, probably
2016-12-15 05:44:52 -05:00
Dan Stillman
50df62a0e7 Remove debug line and tweak whitespace/style 2016-12-15 00:30:37 -05:00
Adomas Venčkauskas
cff74484be Pass failure response to Connector.callMethod callbacks 2016-12-14 16:02:37 +02:00
Adomas Venčkauskas
deb8503863 Remove coroutine from translate.js not supported in connector
From 7fc352b9
2016-12-14 15:28:06 +02:00
Adomas Venčkauskas
a853bb0661 Fix removed translator handling in connectors 2016-12-14 14:18:20 +02:00
Dan Stillman
c5527a82fb Generate new saved search names within libraries, not globally 2016-12-14 03:37:56 -05:00
Dan Stillman
2c9c057360 Fix related items box after 8a4c8d2be0 2016-12-14 03:36:18 -05:00
Dan Stillman
0be67dbda5 Don't allow data dir migration via prefs if directory exists
And treat an existing non-empty directory as a failure during the
migration, since it should now never happen

Also suggest manually moving on Windows if more than 100 attachments
2016-12-14 02:14:56 -05:00
Dan Stillman
58f554a930 Throw if invalid object id passed to Zotero.DataObjects::getAsync() 2016-12-14 02:02:35 -05:00
Dan Stillman
8a4c8d2be0 Classic citation dialog fixes
- Fix loading for libraries that haven't yet been loaded (including if
  the Zotero pane hasn't yet been opened)
- Show a loading message over the items tree
- Fix item selection when editing citation (except if library data
  hasn't yet been loaded, but that doesn't happen in Standalone)
2016-12-14 02:02:21 -05:00
Adomas Venčkauskas
ead9eaf1a0 Align advanced feed settings dropmarker on OSX 2016-12-13 18:16:38 +02:00
Dan Stillman
5862aa5ea5 Don't bother deleting from sync cache when deleting feed items 2016-12-13 09:46:15 -05:00
Adomas Ven
d6d4e4b33e Saner feed database management (#1131)
* Mark feedItems read in a single batch SQL update
* Automatically remove old feed items
* User-facing preference globally and per-feed for feed item expiration
2016-12-13 09:07:43 -05:00
Dan Stillman
7fc352b9b7 Fix "Add Item by Identifier" (broken by 78b1d2ee3)
And make lookup tests run when not on Travis, though we should still mock the
HTTP requests.
2016-12-13 05:23:21 -05:00
Dan Stillman
69430d74b2 Maybe fix race condition when updating translators manually at startup
If you got the timing just right, you could wipe out all your
translators (though standard ones would be reinstalled on restart).
Hopefully that's fixed?
2016-12-13 02:15:53 -05:00
Adomas Ven
747c11c917 Improves proxy support (#1129)
Improves proxy support

- Automatically detect and dehyphenise https proxies which use EZProxy
  HttpsHyphens
- Web translators now pass around Zotero.Proxy instances which can
  proxify/deproxify urls passed to `translate.setLocation()` before calling
  `translate.getTranslators()`/ translate.detect()`. The proxy passing is
  done within connector background/injected processes and between
  standalone and connectors.
- Proxy protocol unified with connectors. Connectors can now pass
  proxies to `/connector/save_items`. The proxies will be used to resolve
  true item and attachment urls when saving.

Closes zotero/zotero#578, zotero/zotero#721

Relevant zotero/zotero#34, zotero/zotero#556
2016-12-12 14:29:59 +02:00
Dan Stillman
c2ebcc9dbc Fix failures on Travis due to broken isDir 2016-12-12 06:57:42 -05:00
Dan Stillman
80f888f374 Fix replacement of existing item storage directories
- Make Zotero.Attachments.createDirectoryForItem() delete existing
  directory instead of moving it to orphaned-files; also now returns a
  string path instead of an nsIFile
- Use above function during file sync instead of
  _deleteExistingAttachmentFiles(), which was partly broken
- Fix throwing on errors when saving some attachment types
2016-12-12 04:06:01 -05:00
Dan Stillman
60ed6d447e Show "Loading…" in Quick Copy drop-down before list is loaded
Styles and translators have to be loaded before the list is displayed,
so there can be a delay if the prefs are opened right at startup.
2016-12-12 02:05:17 -05:00
Dan Stillman
425838e2ec Fix potential translator initialization problem after 04516af552 2016-12-12 02:04:18 -05:00
Dan Stillman
2ead95b39a Don't include child items in imported-item count 2016-12-11 03:00:10 -05:00
Dan Stillman
4d77977a29 Select items after importing from clipboard
And wait for async switch to My Library if in a non-editable view
2016-12-11 02:30:34 -05:00
Dan Stillman
bb246e5514 Scroll first selected row into view in itemTreeView::selectItems()
Separate out the enhanced ensureRowIsVisible() logic from selectItem()
and call it from selectItems() as well on the first item in the set.
2016-12-11 02:30:34 -05:00
Dan Stillman
142694ca0f Fix opacity of lines in progress popup when using addLines()
Lines default to 50%, but addLines() doesn't provide a mechanism for
updating the opacity, so all the callers that used addLines() showed as
gray. Instead, just default to 100% when using addLines().
2016-12-11 02:30:34 -05:00
Dan Stillman
78b1d2ee35 Import translation improvements
- Don't block the UI with a progress meter during imports. Instead, show
  a popup in the bottom right when the import is done that shows how
  many items were saved.
- Fix hang when importing some files
- Fix various problems with asynchronous operations/transactions
    - Use the save queue for imports instead of creating concurrent
      transactions that can time out
    - Wait for the save to finish before returning from the translate()
      promise. All save modes now use the save queue, so code that
      handled the non-save-queue process can probably be removed.
    - Serialize child attachments instead of running them concurrently.
      This might make multi-attachment saves a little slower, since they
      can't download at the same time, but it avoids problems with
      concurrent transactions. We might be able to improve this to allow
      concurrent downloads, or allow concurrent saves for a limited
      number of items (e.g., from web saving) if not for larger imports.
- Change collection handling during import, since UI is now active
  - Select the root collection at the beginning of the import
  - Assign items and collections to the root during the import instead
    of at the end
  - Don't select other collections
- Change a few ItemSaver functions to use promises and remove
  unnecessary callbacks. (This includes some connector code that needs
  to be tested.)
- Change some `parentID` variables in ItemSaver to `parentItemID` for
  clarity, since collections are now handled in more places

To-do:

- Save items in smaller batches instead of doing all in the same
  transaction
- Show progress meter in a bottom-right popup during the import
2016-12-11 02:30:34 -05:00
Dan Stillman
c61a9dc5f3 Localized plural form support for Zotero.getString()
Zotero.getString() now takes a third parameter, `num` (which should also
appear in `params`) to use when determining which plural form of the
string to use. Localized strings should include all forms in the order
specified in [1], separated by semicolons.

[1] https://developer.mozilla.org/en-US/docs/Mozilla/Localization/Localization_and_Plurals
2016-12-11 02:30:34 -05:00
Dan Stillman
9836f33d41 Add .collections support to Zotero.Attachments.linkFromURL() 2016-12-09 06:30:39 -05:00
Dan Stillman
0e72ee3305 Sort translators in import filepicker drop-down 2016-12-09 06:30:38 -05:00
Dan Stillman
04516af552 Stop using Zotero.lazy() for Zotero.Translators.init()
It makes things too complicated with some of the logic necessary for bundled
file updating.
2016-12-09 06:30:38 -05:00
Dan Stillman
98720462fe Fix multi-tag insert mode 2016-12-08 06:57:05 -05:00
Adomas Venčkauskas
eaa758870e Octal literals invalid in strict mode, replacing with hexadecimal
Relevant in connectors
2016-12-08 13:28:33 +02:00
Dan Stillman
fbd21bae16 Don't update feeds after syncs during tests
This reverts commit 60befe52e4 and adds a
better fix that leaves the notifier event in place. Feeds just don't
need to update after syncs during tests.
2016-12-08 05:58:46 -05:00
Dan Stillman
2b9ef26c61 Fix renaming linked attachment files 2016-12-08 03:57:49 -05:00
Dan Stillman
021f8e1476 Bypass cache when requesting .prop file from WebDAV
This might not be necessary, but it's an attempt to troubleshoot
https://forums.zotero.org/discussion/63439/attachments-not-syncing,
which might be a caching issue.
2016-12-06 08:40:19 -05:00
Dan Stillman
73e1fd07b0 Fix error exporting standalone notes 2016-12-06 08:17:45 -05:00
Dan Stillman
99cd11e793 Exclude feeds from Quick Format searches
Addresses #1126
2016-12-06 07:14:16 -05:00
Dan Stillman
5866a76312 Fix reading settings from other-app profile 2016-12-06 05:20:55 -05:00
Dan Stillman
c08354eced Don't show migration message in a popup in Standalone
Apparently this was happening sometimes, though I'm not sure how.
2016-12-06 05:10:48 -05:00
Dan Stillman
88096ac76a Fix context menu auto-selection bug
A context-menu entry was being selected automatically when the click
target was near the bottom of the screen.
2016-12-05 21:34:36 -05:00
Dan Stillman
c54af7a5ae Remove redundant _addToolbarIcon() calls at startup 2016-12-05 05:17:03 -05:00
Dan Stillman
d19732ba5f Fix item-not-loaded error resetting data in unloaded library 2016-12-05 05:05:09 -05:00
Dan Stillman
302efb0854 Fix User-Agent header handling for endpoints updated in b5bc18c7ed 2016-12-05 03:05:11 -05:00
Dan Stillman
b5bc18c7ed Add new init(options) signature for server endpoints
An endpoint can now take a single object containing 'method', 'pathname',
'query', 'headers', and 'data' and return an integer, an array containing
[statusCode, contentType, body], or a promise for either. This allows the
handlers to use the HTTP method and headers and removes the need for callbacks
when some handlers already use coroutine().

If init() returns a promise, it now has to use the new single-parameter
signature (because the check is done with Function.length, and combining
promises and callbacks doesn't make sense anyway).
2016-12-05 02:55:32 -05:00
Dan Stillman
57603427e3 Fix clicking Choose to select custom data dir when already set 2016-12-04 14:18:43 -05:00
Dan Stillman
ee798dde16 Fix Firefox connector breakage after 69ab4b0b1
This also makes a few changes to `callMethod`:

- Removes the deprecation warning when a string is passed and removes the
  `httpMethod` `options` property. Any call that passes a string and includes
  `data` can just remain as a POST. If `data` is null or undefined, a `GET`
  will be sent. (If we find ourselves needing other methods, we can reevaluate.)
- Renames `httpHeaders` to `headers` for consistency with other code (and in the
  absence of `httpMethod`)
2016-12-03 05:01:10 -05:00
Dan Stillman
44e06eec08 Update deprecated URL to Console.jsm 2016-12-02 17:32:17 -05:00
Dan Stillman
cbcf9cb3de Color long time intervals red in debug output to terminal
Defaults to 250 ms. The threshold can be changed with
extensions.zotero.debug.slowTime. Set to 0 to disable.
2016-12-02 17:28:39 -05:00
Dan Stillman
f55c2f51ee Remove extensions.zotero.debug.time and always show interval in output 2016-12-02 17:28:39 -05:00
Dan Stillman
f3fd7e7a10 Don't load bundled files in Standalone until UI is ready 2016-12-02 17:28:39 -05:00
Dan Stillman
8c48b2f806 Additional debugging for https://forums.zotero.org/discussion/63363/ 2016-12-01 16:01:35 -05:00
Dan Stillman
6900a5ccf8 Removed unnecessary localized string for style installation error
Would only be used for an external request that didn't pass along a
filename or origin, so "null" (or whatever it shows up as) is fine
2016-11-30 21:23:09 -05:00
Dan Stillman
1472781ce4 Debugging for https://forums.zotero.org/discussion/63363/ 2016-11-30 21:18:31 -05:00
Adomas Venčkauskas
45c944e731 Fix server_connector tests broken in 69ab4b0b
Don't display error prompt in standalone when style install fails.
Fixes an import bug when import input is invalid.
2016-11-30 14:58:43 +02:00
Dan Stillman
1b67ed071e Skip auto data dir migration if target dir exists and is non-empty 2016-11-30 02:09:07 -05:00
Dan Stillman
cba2c0c58b Fix display of extended character in file sync debug output 2016-11-30 02:09:07 -05:00
Adomas Ven
69ab4b0b1d Add server_connector endpoint to import styles and import translatable resources (#1120) 2016-11-29 14:59:58 -05:00
Adomas Venčkauskas
117ce8408b Fix connector saving via standalone 2016-11-29 13:40:12 +02:00
Dan Stillman
8f0ed56ae2 Test fixes after 5bceebf56c 2016-11-29 03:52:07 -05:00
Dan Stillman
c7bbde3c4f Add default pref for quicksearch mode to avoid recreating during tests 2016-11-29 03:28:49 -05:00
Dan Stillman
30d0858ebf Travis debugging 2016-11-29 01:42:15 -05:00
Dan Stillman
66f6ce715b Another Travis isDir workaround 2016-11-28 16:16:54 -05:00
Dan Stillman
a735d5dd41 Remove Travis debugging 2016-11-27 20:02:53 -05:00
Dan Stillman
45a8178fe0 Add another DirectoryIterator entry.isDir workaround for Travis 2016-11-27 20:00:10 -05:00
Dan Stillman
837ae0444d Travis debugging 2016-11-27 19:51:48 -05:00
Dan Stillman
a6cfe6cd9a Remove export charset checkbox in prefs
Instead, just always show the (greatly shortened, after 0609b62a) menu
on export when the translator supports it (which probably fewer
translators actually need to do).

This leaves the pref in place, but it can be removed eventually (and
changing the default for a while I believe will cause the existing pref
line to be removed for anyone who has it set to true already).
2016-11-27 17:11:05 -05:00
Dan Stillman
0ad4598128 Fix DB backup (broken by 5a6f1eef6) 2016-11-27 15:42:07 -05:00
Dan Stillman
0609b62a39 Show only UTF-8, UTF-8 w/o BOM, and Western for export charsets
See https://forums.zotero.org/discussion/comment/263644/#Comment_263644

We might want to consider removing the export charset checkbox in the
prefs and either always showing the charset option for translators or
always showing it for BibTeX (where "Western" really means "ASCII") but
nothing else.

Fixes #1124
2016-11-27 15:41:13 -05:00
Dan Stillman
5a6f1eef63 Update deprecated uses of Zotero.getZoteroDirectory()/getZoteroDatabase()
The Zotero.DataDirectory equivalents return string paths instead of nsIFile
instances, so some of these calls now just use Zotero.File.pathToFile(), which
can be removed when the surrounding code is updated to OS.File,
2016-11-27 00:17:56 -05:00
Dan Stillman
4c0abb6816 Point other profiles to new data dir after migration (+ code reorg)
Look for other profiles, from both apps (Firefox and Standalone), that
point to the data directory being migrated and update prefs.js in those
profiles to point to the new location.

Also reorganize code into Zotero.Profile and Zotero.DataDirectory
namespaces
2016-11-27 00:17:56 -05:00
Dan Stillman
412a7990b1 Don't perform automatic migration if there's an existing pipe
This prevents us from moving the data directory if the other app
(Firefox or Standalone) is running from the same directory.

Also clean up stub code in migration tests
2016-11-26 23:09:24 -05:00
Dan Stillman
678fe77fbb Move auto-migration checks into checkForDataDirectoryMigration() 2016-11-24 01:18:25 -05:00
Dan Stillman
a4ab84eed3 Avoid CustomizableUI errors in test output 2016-11-23 00:41:22 -05:00
Dan Stillman
56d64af186 Remove Travis debugging 2016-11-23 00:41:14 -05:00
Dan Stillman
cb300005cd More Travis debugging 2016-11-22 20:55:27 -05:00
Dan Stillman
84bb61ab7b Fix test timeouts caused by Quick Copy initialization
When an export translator is selected for Quick Copy, Quick Copy
initialization triggers translator initialization a few seconds after
startup, because the translator code needs to be available synchronously
for drag/drop. A Quick Copy test was changing the setting to BibTeX,
which was resulting in random timeouts after subsequent resetDB() calls
due to slow translator loading. This change skips initialization in test
mode. This might actually fix a lot of timeouts on Travis in the second
half of the tests...

This also resets the Quick Copy pref in those tests so that it's left at
the default, though really we should automatically reset all prefs after
all test groups and in resetDB().
2016-11-22 20:31:58 -05:00
Dan Stillman
935d48013b Travis debugging 2016-11-22 19:35:30 -05:00
Dan Stillman
a22d996aab Revert to new default if legacy data dir set in pref is missing 2016-11-22 18:46:55 -05:00
Dan Stillman
a4afb8c0c3 Wrap another showZoteroPaneProgressMeter call in a try/catch for safety 2016-11-22 03:41:15 -05:00
Dan Stillman
8383c5cda8 Ignore failure trying to show data dir migration status message
I saw this once in Standalone but haven't been able to reproduce it. (It
will now manifest as a progress bar without a status message.)
2016-11-22 03:32:16 -05:00
Dan Stillman
ef3e098586 Migrate data directory automatically on macOS and Linux
If data directory is within the profile directory and we can move the
subdirectories instantaneously with /bin/mv, just do it silently at startup.
2016-11-22 02:33:05 -05:00
Dan Stillman
288d0c7c06 Create 'profile' and 'Zotero' directories in temp dir for tests 2016-11-22 01:45:07 -05:00
Dan Stillman
98e3a9addf Allow immediate retry on partial data dir migration failure
A common cause of this on Windows will likely be open attachment files,
so suggest closing those and make retrying the default action.
2016-11-21 05:19:18 -05:00
Adomas Venčkauskas
0668faa584 Update connector ItemSaver constructor and misc refactoring
(should have been updated along with 3fc38d750)
2016-11-21 11:45:34 +02:00
Dan Stillman
e8d8f4a0a3 Use spinner instead of items pane message for search
Fixes #1116, and is generally more pleasant
2016-11-21 02:59:31 -05:00
Dan Stillman
335c3d0b98 Fix error creating context menu for independent save button 2016-11-20 03:04:38 -05:00
Dan Stillman
aeaa0d12c7 Avoid console error if page closed before translators are available
Was showing up in some test runs
2016-11-20 01:31:47 -05:00
Dan Stillman
d89da85606 Fix error when overwriting translation with some filename 2016-11-19 17:15:46 -05:00
Dan Stillman
ebc01db446 Fix "Zotero.Libraries.get(…).filesEditable is not a function"
Since da7da749
2016-11-18 04:54:42 -05:00
Dan Stillman
ef2a403d7b More data dir fixes (after f2163b3433 and bc3386ff9d)
Fixes error creating a new Standalone profile
2016-11-18 01:44:01 -05:00
Dan Stillman
162c7198d3 Fix console error in Standalone trying to load toolbar icon 2016-11-16 12:42:08 -05:00
Dan Stillman
65a39417bf Closes #1112, Show "Upgrading database…" message 2016-11-16 12:41:49 -05:00
Dan Stillman
a1710c3307 Fix hang running tests (since d88cfc6c5f) 2016-11-16 11:07:58 -05:00
Dan Stillman
bc3386ff9d Tweak existing data directory detection
Fixes some issues after f2163b3433
2016-11-16 09:51:46 -05:00
Dan Stillman
4863670104 Display "Migration in progress — do not interrupt…" during migration
Would be nice to have a determinate progress meter on Windows, but that
will require enumerating all files, which maybe would just make things
slower. Might be safer, though, by discouraging people from
force-quitting.
2016-11-16 01:07:26 -05:00
Dan Stillman
062ff18596 Don't clear Zotero pane progress meter message by default
If showZoteroPaneProgressMeter() is called with the first argument
undefined, don't clear any existing message. To clear, pass
null/false/"". The message is also cleared when the progress meter is
hidden.
2016-11-16 01:06:54 -05:00
Dan Stillman
06ad369368 Create database when new data dir location is set in pref
Regression from new data directory handling
2016-11-16 00:38:58 -05:00
Dan Stillman
d88cfc6c5f Make Zotero.Styles/Translators.init() wait until bundled files are updated
Fixes #1123, Quick Copy error in console with new data directory
2016-11-15 03:38:27 -05:00
Dan Stillman
c6a2057340 Fixes to hasAttachments column
- Fix #1121, sorting of hasAttachments column -- doesn't work if
  hasAttachments is the active sort column on startup, since file states
  have to be cached, but works for subsequent clicks on the column
- Don't sort linked URL attachments as missing
- Use hiDPI icon in all cases
2016-11-14 03:08:41 -05:00
Dan Stillman
d70ebce108 Show Styles tab before Word Processors in Cite preferences 2016-11-14 02:23:52 -05:00
Dan Stillman
62177e208d Check DB lock before checking for restore-from-server marker 2016-11-13 04:55:51 -05:00
Dan Stillman
ce6a0ecb01 Tell connector to reinit after moving data directory 2016-11-13 04:55:51 -05:00
Dan Stillman
cfc7f36829 Don't send lockReleased on Standalone restart
This prevents Zotero for Firefox from starting up and shutting down when
Standalone is just restarting.
2016-11-13 04:55:51 -05:00
Dan Stillman
79700969e1 Data directory migration
This adds a new button to the Advanced prefs to migrate the data directory to
$HOME/Zotero. The button only appears if the data directory is set to the
default location within a profile directory (including the other program from
the one running, even though that's technically stored as a custom data
directory).

On Mac/Linux, directories within the data directory are moved with /bin/mv.  On
Windows, or if that fails, they're copied recursively using OS.File.move()
(which annoyingly doesn't reliably support directory moving). The former should
be instantaneous on most systems (unless the data directory or 'storage' were
on a different filesystem from $HOME).

If the database fails to transfer, migration fails and the data directory
setting remains on the old directory. If the database transfers but other files
fail, the data directory setting is updated. In both cases, the user is
encouraged to migrate remaining files manually with a button that reveals the
directories and quits the program.

This isn't yet tested on Linux or Windows, and migration isn't yet suggested
automatically.

Adds Zotero.File.reveal(), Zotero.File.directoryIsEmpty(), and
Zotero.File.moveDirectory().
2016-11-13 04:55:51 -05:00
Dan Stillman
cfe76a6f83 Add Zotero.test, which is true during tests
(Zotero.automatedTest is only true in Travis)
2016-11-13 04:54:57 -05:00
Dan Stillman
4082ff9e8c Simplify assignment of init options 2016-11-13 04:52:58 -05:00
Dan Stillman
0f19e5c89b Use coroutine() on Zotero.init() 2016-11-12 16:55:55 -05:00
Dan Stillman
b22850efed Update data dir prefs for new default location
- Show "Default (<path>)" for default option unless set to profile directory
- Don't try to restart on selection if location hasn't changed
2016-11-12 16:44:34 -05:00
Dan Stillman
a5b222edac Convert dataDir pref to string path and remove lastDataDir
.persistentDescriptor now appears to return (and parse) a string path anyway on
macOS, which is the only place where it didn't use a string path to begin with,
so this will only affect earlier users.
2016-11-12 16:44:34 -05:00
Dan Stillman
f2163b3433 New data directory handling
- Use $HOME/Zotero if zotero.sqlite exists, and set it as a custom data
  directory so that 4.0 uses it if loaded (resulting in a
  newer-db-version error instead of an empty database)
- Don't prompt whether to use data directory from the other version's
  profile directory (i.e., Firefox or Standalone) -- just do it
2016-11-12 16:44:34 -05:00
Dan Stillman
f00a50bf5a Better handling of startup errors
- Show toolbar icon on startup error (fixes #742)
- Don't show DB upgrade error message for other startup errors
- Fix some cases of a startup error not being logged/presented
- Show actual error in error dialog for more errors
2016-11-10 02:20:13 -05:00
Dan Stillman
2ad537e4c6 Fix console error trying to add toolbar icon more than once
This was appearing a lot in tests.
2016-11-10 02:20:13 -05:00
Adomas Venčkauskas
091c5c279c Pass the import url over to the standalone on /connector/saveItems.
Should address some issues related to translating via a proxy like this one
https://forums.zotero.org/discussion/63057/zotero-not-downloading-pdfs

Addresses zotero/zotero-connectors#3
2016-11-09 11:57:11 +02:00
Dan Stillman
1ae71c3830 Merge branch '4.0' 2016-11-03 17:40:58 -04:00
Dan Stillman
fabf801fdb Fix some locate engines (e.g., Google Scholar) 2016-11-03 17:35:21 -04:00
Dan Stillman
6e21bb4b57 Update citeproc-js to 1.1.139 2016-11-03 10:11:54 -04:00
Adomas Venčkauskas
7179712909 Change padding-left to margin-left property for hanging indent
Intended to fix at least Google Docs. Even the newest versions of MS Office
appear to ignore both padding and margin properties
2016-11-03 13:54:42 +02:00
Dan Stillman
2c014a9af1 Debugging for https://forums.zotero.org/discussion/62942/ 2016-10-31 02:29:53 -04:00
Dan Stillman
da7da74986 Update some deprecated function calls 2016-10-26 02:27:31 -04:00
Dan Stillman
ff9e822bd3 Fix errors filtering filenames of synced file downloads 2016-10-26 02:15:56 -04:00