Commit graph

6431 commits

Author SHA1 Message Date
Dan Stillman
10637ca9ea Switch to OS.File for most full-text file access 2017-07-26 22:16:01 -04:00
Dan Stillman
61f8a2c3c5 Fix various problems with fulltextContent searches
Including finding items in the wrong library and not finding any items
when paired with the checkboxes in ANY mode
2017-07-26 22:16:01 -04:00
Dan Stillman
36371630b5 Restore auto-expanding of search matches except in My Publications
Saved searches and the trash should automatically expand items to show
matching child items, but that was broken in d47275210.
2017-07-26 22:16:01 -04:00
Dan Stillman
46531a4c69 Remove non-matching parent items when deleting items from trash
Fixes #866, Trash doesn't refresh properly when emptying deleted
attachments
2017-07-26 22:16:01 -04:00
Dan Stillman
e475b22f1d Add intl.accept_languages from Mozilla language packs 2017-07-25 16:27:31 -04:00
Dan Stillman
d8b201487d Allow clearing global prefs 2017-07-25 15:44:49 -04:00
Dan Stillman
521f291b84 Fix PluralForm support
The library was using the plural rule defined in the built-in
intl.properties, but that was always en-US in the standalone app.
2017-07-25 15:20:23 -04:00
Dan Stillman
d01366a2f1 Remove line from Report Errors about messages possibly unrelated to Zotero 2017-07-25 03:01:45 -04:00
Dan Stillman
c2bb4ac10b Move debug output logging to the Help menu
Adds a submenu for quickly generating and submitting debug output, with
a button to copy the Debug ID to the clipboard and a one-click option to
restart with logging enabled. Debug output can also now be viewed in
real-time using the new debug output viewer window (previously available
only via a command-line flag).

The locale switcher has moved to the top of the Advanced prefpane (where
Debug Output Logging used to go) in a Miscellaneous section, and there's
a new "Advanced Configuration" section (mirroring Thunderbird) at the
bottom for "Config Editor".

Closes #1108
2017-07-25 03:00:39 -04:00
Dan Stillman
e3947e7b45 Debug output viewer tweaks
- Decrease font size
- Do a better job of pinning to bottom
- Disable submit button when clearing output
- Filter ANSI color codes from slow lines
2017-07-25 02:41:50 -04:00
Dan Stillman
a9594360cd Deprecate Zotero.Utilities.Internal.quitZotero() in favor of quit() 2017-07-25 02:29:26 -04:00
Dan Stillman
695dd4e65d Don't omit first line in debug output when submitting 2017-07-24 22:49:17 -04:00
Dan Stillman
6ae2b58d3f Update submodules 2017-07-24 08:59:23 -04:00
Dan Stillman
34d039ba48 Fix a whole mess of issues with data directory migration
- If an error occurred while moving the database file, the data
  directory could end up pointing to the new, empty directory after a
  restart
- The error message for a full failure was missing the second half that
  actually explained that you were supposed to move the data directory
- The check for different-drive migrations didn't work if the new
  directory didn't exist (at least on macOS), swallowed some errors, and
  interfered with manual migrations from the prefs
- The manual migration button would say that the new directory wasn't
  empty even if it just contained .DS_Store
- Don't show "Database migration in progress" after not restarting after
  a migration failure

Additionally, after a full failure the migration is now attempted on
every restart and displays a warning each time, since otherwise people
will never move their directories out of the Firefox profile (which is
when it's going to fail the most, due to security software).
2017-07-24 08:51:02 -04:00
Dan Stillman
05ea309e2e Use proper locale format for dates in items list
2addf6b27b fixed the date order used when automatic locale detection was
enabled, but this fixes the format (e.g., dots instead of slashes). It
should now match the item pane. I'm not sure why we weren't doing this
before, but hopefully we didn't have a good reason.
2017-07-23 15:12:09 -04:00
Dan Stillman
ef71a2c77c Use HTTPS for Google Scholar in Retrieve Metadata for PDF 2017-07-23 00:57:04 -04:00
Dan Stillman
225215842d Fix auto-syncing of unchecked groups after object change 2017-07-21 19:39:37 -04:00
Dan Stillman
6d2c72fb54 Fix revealing parent directory of missing file
Updates Zotero.File.getClosestDirectory() to take a path rather than an
nsIFile
2017-07-21 18:33:36 -04:00
Dan Stillman
b033dedddc Fix broken WebDAV orphaned-file purging after 39a8e8fb0c 2017-07-21 08:39:43 -04:00
Dan Stillman
faecefa375 Rename/reorganize Advanced prefs buttons
- Move csledit and cslpreview to a Tools section of the Cite pane as
  Style Editor and Style Preview
- Rename "Open about:config" to "Config Editor"
- Hide about:memory unless devtools.errorconsole.enabled is enabled,
  which isn't particularly appropriate and maybe we can find something
  better, but about:memory doesn't really need to be visible by default

Closes #1264
2017-07-21 07:53:50 -04:00
Dan Stillman
33b40829b8 Add locale switcher to Advanced prefs
Closes https://www.zotero.org/trac/ticket/1733 (!)
2017-07-21 07:51:57 -04:00
Dan Stillman
2addf6b27b Get Zotero.locale from loaded locale, not from pref
It was previously set from general.useragent.locale, but that's not used
by default, meaning that date interpretation and some other things might
have been incorrect for everyone who didn't set a locale explicitly and
toggle matchOS...
2017-07-21 07:51:57 -04:00
Adomas Venčkauskas
40c84ecbc0 Report automaticSnapshots pref to connector.
Part of zotero/zotero-connectors#151
2017-07-21 11:36:36 +03:00
Dan Stillman
39a8e8fb0c Send Content-Type: text/xml header for WebDAV PROPFIND 2017-07-21 04:05:12 -04:00
Dan Stillman
a7be5444ea Fix tag selector search (broken in 6de7fdedf) 2017-07-20 16:51:50 -04:00
Dan Stillman
6de7fdedf9 Take tag selector out of the tab order, for now
This restores the 4.0 behavior. It's not ideal, but neither is having to
tab through thousands of items to get to the items pane (unless you
toggle the tag selector closed first). Hopefully we can come up with a
better solution to make the tags accessible.
2017-07-20 03:46:56 -04:00
Dan Stillman
cbc05baf02 Fix error on connector ping before site-specific Quick Copy load 2017-07-20 03:46:56 -04:00
Adomas Venčkauskas
ece3491e21 Connector server: respond with collection editability status 2017-07-19 11:40:55 +03:00
Dan Stillman
a158e8a71b Alter Quick Copy preferences text
Closes #1022

Could try to explain site-specific settings, but it's somewhat
complicated (requires the Zotero Connector, uses the last active tab
regardless of drag destination), so maybe enough to explain on the
linked documentation page.
2017-07-19 03:57:39 -04:00
Dan Stillman
b3ce918dfb Sort export translators in Quick Copy settings drop-downs 2017-07-19 03:39:51 -04:00
Dan Stillman
6d265f448f Restore site-specific Quick Copy settings
Using the last URL passed by a connector

Closes https://github.com/zotero/zotero-connectors/issues/145
2017-07-19 03:39:27 -04:00
Dan Stillman
2928752d19 Clear attachment data change marker when loading primary data
Fixes a regression from ef7da3486a in which attachment data still shows
as changed after a save.
2017-07-18 18:50:28 -04:00
Dan Stillman
cff84a71ed Simplify an array check 2017-07-18 17:32:38 -04:00
Dan Stillman
df353bdc05 Optimistic updates for item tags box
Add/update/remove rows immediately and save after. If there's an error
during saving, reload the pane.
2017-07-18 17:32:38 -04:00
Dan Stillman
ef7da3486a New state-handling approach for item tag changes
If this works out I think we'll want to use this approach for
all data layer changes.

Previously, an unsaved change on an object would update its state
immediately, which was fine for synchronous code but breaks down if a
save involves multiple asynchronous calls, because modifying state after
the relevant data has been saved to the DB but before the `_changed`
object has been cleared would mean that new changes would be lost. Now,
changes are written to _changedData, and a get for the data first checks
_changedData before checking the state property (e.g., _tags) directly.
The changedData property is cleared as it's written, and once the object
is saved, the reload updates the state property with the new data.
2017-07-18 17:31:40 -04:00
Dan Stillman
09a859d7e3 Allow an array of strings in Zotero.Item::setTags()
New tags will all be of type 0 (manual)
2017-07-18 17:21:36 -04:00
Dan Stillman
3715c8da1b Fix use of multiple search translators
It was stopping after the first translator, which meant that some ISBN
lookups failed if the ISBN wasn't in Library of Congress.

Regression from 6da0845f4b, which hopefully didn't have a good reason
for this
2017-07-18 07:13:03 -04:00
Dan Stillman
5268060802 Move Tools -> Options to Edit -> Preferences on Windows
Closes #1167
2017-07-18 04:14:17 -04:00
Dan Stillman
76030d2c4a Fix tag selector font on Windows 2017-07-18 04:14:17 -04:00
Adomas Venčkauskas
6d7dcc44bc Add connector endpoint to retrieve proxies. Closes #1265 2017-07-18 10:25:54 +03:00
Dan Stillman
78dd1e132e Fix calculation of last WebDAV orphaned-file-purge time
Purging was happening after every download.
2017-07-17 16:53:11 -04:00
Dan Stillman
ba514b80d9 Add "Remove All Tags…" option to item tags box context menu 2017-07-17 16:34:52 -04:00
Dan Stillman
918ae23418 Increase default window size to 1000x600
(Plus a little, I think)
2017-07-17 16:34:52 -04:00
Adomas Venčkauskas
f829e4d6cc Fix an integration.js typo. Closes #1263 2017-07-14 13:40:44 +03:00
Dan Stillman
0f965b0de6 Fix collection context-menu options broken in 02774ac6f
E.g., selective sync
2017-07-14 01:06:57 -04:00
Dan Stillman
57881ff587 Fix restoring after closing from full-screen mode on macOS 2017-07-13 18:27:06 -04:00
Dan Stillman
ea513edf73 Prevent infinite loop if search points to itself 2017-07-13 18:07:58 -04:00
Dan Stillman
0c49350cdf Fix startup error from empty 'collection' search condition 2017-07-13 16:10:33 -04:00
Dan Stillman
df24917c2f Fix #1260, Windows Application (menu) key doesn't work in items pane 2017-07-13 03:26:28 -04:00
Dan Stillman
2d8132b6c8 Log URL for snapshot save timeouts 2017-07-13 02:33:28 -04:00
Dan Stillman
1247896d70 Fix crash from tag name collision with Object properties in tag selector 2017-07-13 01:19:15 -04:00
Dan Stillman
4ffbf6fca5 Use DOM_VK_* codes in itemTreeView keypress listener 2017-07-13 01:19:15 -04:00
Dan Stillman
dd5d3a8668 Fix blank window when opening ZotFile's zotero://open-pdf links
Fixes https://github.com/jlegewie/zotfile/issues/272
2017-07-12 18:25:49 -04:00
Dan Stillman
752e25e282 Fix id-not-an-integer warning from Show in Library 2017-07-12 15:44:49 -04:00
Dan Stillman
02774ac6fe Fix collection-menu selection via right-click->drag->release or keyboard 2017-07-12 15:43:20 -04:00
Dan Stillman
aad12db2ff Fix 'too many terms in compound SELECT' sync error 2017-07-12 04:21:52 -04:00
Dan Stillman
8f2508e167 Fix alignment of "What's New" in About window 2017-07-12 03:38:14 -04:00
Dan Stillman
fd2ba1d5b7 Fix file sync error on Windows from attachment paths with invalid characters
We filter these now, but upgraded databases with bad paths could still
exist and cause errors.
2017-07-12 02:58:25 -04:00
Dan Stillman
a62161dfc1 Add unused Zotero.Prefs.resetBranch()
I wrote this for account unlinking (since nsIPrefBranch.resetBranch()
isn't implemented) but decided we didn't want to delete all prefs for
that.
2017-07-12 01:20:55 -04:00
Dan Stillman
a7021f80ca Remove unused skipDefaultData property 2017-07-12 01:20:18 -04:00
Dan Stillman
efae7073f2 Avoid log message about json.collections being unknown after e683b2be0 2017-07-12 01:19:53 -04:00
Dan Stillman
d1d62184be Fix potential error loading support links
From ZOTERO_CONFIG not being defined. I can't reproduce this, but I've
seen it in the logs.
2017-07-12 01:18:41 -04:00
Dan Stillman
62fa86af82 Fix error on account unlink, and delete more files
Delete everything from data directory except for PDF tools
2017-07-12 01:16:25 -04:00
Dan Stillman
d2421825c9 Fix #1256, Report saving is broken 2017-07-11 06:14:21 -04:00
Dan Stillman
a982bd056d Zotero.Item::_collections is always an array 2017-07-11 04:46:09 -04:00
Dan Stillman
18f3c2cfb0 Fix "destFile is not defined" file sync error 2017-07-11 04:37:23 -04:00
Dan Stillman
375b4341a6 Remove debug lines 2017-07-11 04:29:36 -04:00
Dan Stillman
701a46ba84 Batch object deletions during syncing 2017-07-11 04:28:40 -04:00
Dan Stillman
fd7c2a6f6f Try harder to prevent sync-in-progress messages 2017-07-11 02:42:00 -04:00
Dan Stillman
c701f34aaa Fix array length check in Item.setType() 2017-07-11 02:41:41 -04:00
Dan Stillman
e683b2be07 Fix a potential sync error with child attachments
If a standalone attachment existed in a collection and then was added to
a parent (e.g., via Create Parent Item), and attachment metadata was
also changed at the same time (e.g., due to file syncing), the
'collection item must be top level' trigger could throw on another
syncing computer. To work around this, remove collections first, then
make changes to the parentItemID columns, and then add new collections.
2017-07-11 02:35:11 -04:00
Dan Stillman
3272387afe Increase snapshot save timeout to 30 seconds
We should maybe have a shorter timeout in the connector to show an error
and avoid showing the save-to-server dialog, but let's err on the side
of not cancelling saves.
2017-07-09 23:31:25 -04:00
Dan Stillman
32dedc6fb4 Cancel snapshot saves after 15 seconds
Otherwise a save could go on forever and the connector will never show
an error, and if you quit Zotero the connector will show the
save-to-server dialog (though the connector should have its own
timeout).
2017-07-09 23:17:30 -04:00
Dan Stillman
e551777989 Vacuum database automatically on successful integrity check
Firefox does this for Places, so we might as well too.
2017-07-09 18:17:15 -04:00
Dan Stillman
55b2dc39bf Fix Firefox 55 breakage (and remove unnecessary locale lookups)
We were manually looking up the current locale in various places and
passing it to nsIStringBundleService::createBundle(), but that hasn't
even been a supported argument for years. (I assume it was a long time
ago?)
2017-07-09 06:59:50 -04:00
Dan Stillman
59edca783e Allow dragging onto welcome text 2017-07-09 05:49:02 -04:00
Dan Stillman
a7e2e73e51 Update About dialog
- Replace Developers section with text that links to RRCHNM, the credits
page, and Get Involved.
- Remove dedicated zotero.org link
- Only show link underlines on hover
2017-07-08 19:11:45 -04:00
Dan Stillman
2ba773d612 Additional checks for stopped sync 2017-07-07 19:05:22 -04:00
Dan Stillman
de3b47fd78 Add "Delete Automatic Tags in This Library…" option to tag selector menu
I think it might be worth having a tag management window that lets you
view tags as a grid, sort by column (e.g., type), select ranges, delete,
consolidate, etc., but until then, this fulfills a popular request.
2017-07-07 18:19:12 -04:00
Dan Stillman
941ae5499c Use spread operator in flattenArguments 2017-07-07 18:19:12 -04:00
Dan Stillman
f2af77498b Allow single string in Zotero.Utilities.pluralize()
Zotero.Utilities.pluralize(5, 'tag') will produce 'tags' automatically
2017-07-07 18:19:12 -04:00
Dan Stillman
e2d7c7e999 Fix full-text sync tests after 1da18e4ca7 2017-07-07 06:23:27 -04:00
Dan Stillman
3b2d7eb970 Log errors from Zotero.serial()
And output errors in concurrentCaller if not otherwise logged
2017-07-07 05:31:37 -04:00
Dan Stillman
71fb054efe Update deprecated openPreferences() call 2017-07-07 05:31:37 -04:00
Dan Stillman
1da18e4ca7 Add "Stop Sync" button
Stops all syncing (not just file syncing like in 4.0) as soon as
possible.
2017-07-07 05:28:20 -04:00
Dan Stillman
b07fdc6335 Add intro text to middle pane when My Library is empty
This replaces the Quick Start Guide item in earlier versions.

Also increases size of My Publications intro text when the window is
wider.
2017-07-07 03:41:50 -04:00
Adomas Venčkauskas
1ddb38036e Moving Utilities.itemToServerJSON() to the connector codebase
See Zotero.Item.toJSON() for similar functionality
2017-07-06 13:38:00 +03:00
Dan Stillman
f7c1c56d7d Use 'async' configOptions property to indicate promisified translators
Instead of >"2017-07-05"

Addresses https://github.com/zotero/translators/issues/1353
2017-07-05 15:29:13 -04:00
Dan Stillman
5ff5ea88fb Fix error in export options window if translator has no options 2017-07-05 15:25:41 -04:00
Dan Stillman
53c3f62f1e Fix overlapping lines in attachment box with empty title 2017-07-05 11:33:24 -04:00
Dan Stillman
198bd70b59 Make 909b4b31c8 apply to search translators too, and fix tests
Addresses https://github.com/zotero/translators/issues/1353
2017-07-05 09:15:12 -04:00
Dan Stillman
909b4b31c8 Assume import translators updated after today are async
See https://github.com/zotero/translators/issues/1353 for details.

minVersion is problematic for various reasons, so this is safer.
2017-07-05 08:54:27 -04:00
Dan Stillman
d73fc63273 Do a manual check from the repo when enabling auto translator/style updates 2017-07-05 05:45:30 -04:00
Dan Stillman
d40822c540 Fix streaming server connection when auto-sync is on with no credentials 2017-07-05 05:45:00 -04:00
Dan Stillman
86cf7cbd07 Update translators/styles at startup and on push notifications
Previously, if a translator or style was fixed, people didn't get the
fix until their client checked the repository for updates, which could
take up to 24 hours. Now, in addition to checking once a day, we check
every time Zotero is started and also when we receive a notification
from the streaming server, which happens immediately after a translators
or style is updated on GitHub. To avoid DDoSing ourselves, the
notification includes a random delay (within a given period) before the
update is triggered by the client.

The streaming server connection is now made when either "Automatically
check for updated translators and styles" or "Sync automatically" is
enabled. It can be disabled via the extensions.zotero.streaming.enabled
pref.
2017-07-04 18:46:30 -04:00
Dan Stillman
c867b3bb85 Fix WebSocket reconnect delay
Only reset delay generator after regular message, not on connect,
because a subscription failure happens after a connect. Also cancel
reconnect if auto-sync is disabled during the failure delay.
2017-07-02 01:44:22 -04:00
Dan Stillman
2efd7121b8 Only skip retry for WebSocket errors between 4400 and 4499 2017-07-02 01:32:47 -04:00
Dan Stillman
dc89cfb3ba Clean up Sync -> Reset pane
- Hide radio buttons for now, since there's only one option in each
section
- Tweak text for file sync history reset
2017-07-01 06:58:56 -04:00
Dan Stillman
88088c68db Add Sync.Storage.Local.updateSyncStates()
This speeds up updating of sync states, particularly after resetting
file sync history.
2017-07-01 06:31:46 -04:00
Dan Stillman
b72f1c2a08 Don't calculate total file size for every uploaded attachment
This required checking the file size of every file (including auxiliary
snapshot files) in every attachment to be uploaded, and it was an
estimate anyway, because snapshots are compressed, so we kept track of
the compression ratio, but there was no particular reason to think later
files would have the same ratio... In any case, we're not currently
displaying file sync progress in 5.0 anyway, and while we should, we can
probably just show a count of attachments remaining.
2017-07-01 06:31:46 -04:00
Dan Stillman
9a3ff2d244 Add .contentType and .charset options for importFromFile()
And use them in new importTextAttachment() and importHTMLAttachment()
test support functions. These can be used to avoid needing a hidden
browser for determining the character set of the imported text
documents.
2017-07-01 06:31:46 -04:00
Dan Stillman
b633038bf9 Close directory iterator in Attachments.hasMultipleFiles()
This was leaving a file descriptor to the directory open during file
syncing.
2017-06-30 18:08:46 -04:00
Dan Stillman
22eab3e09d Don't leave file descriptor open in md5Async()
This could cause "Too many open files" errors during file syncing
2017-06-30 17:54:33 -04:00
Dan Stillman
536d7254fb Detect full disk during data migration on Windows (hopefully) 2017-06-30 16:59:33 -04:00
Dan Stillman
010bf3b8f9 Fix "not a directory" file sync error 2017-06-30 16:59:17 -04:00
Dan Stillman
aca774e132 Move connector install option to Tools menu
And rename from "Install Browser Connectors…" to "Install Browser Connector"
2017-06-29 04:08:32 -04:00
Dan Stillman
f6ac1732f2 "Install Browser Extensions" -> "Install Browser Connectors"
And change link from /extensions to /download/connectors
2017-06-27 16:26:13 -04:00
Dan Stillman
9b54ca9ca7 Show error and doc prefs if style can't be found or retrieved
Previously a 404 downloading the file would prevent opening the doc
prefs window.
2017-06-27 01:09:01 -04:00
Dan Stillman
a15261b3b3 Don't enforce Host header in translation server
Fixes #1251
Fixes zotero/translation-server#48
2017-06-26 19:04:24 -04:00
Dan Stillman
1d564970dc Add "Install Browser Extensions…" menu option 2017-06-26 18:49:31 -04:00
Dan Stillman
9372979fb5 Allow Zotero.Server requests with Host: localhost
Previously only Host: 127.0.0.1 was allowed. (The check prevents a DNS
rebinding attack.)

This allows requests to translation-server using localhost
(zotero/translation-server#48).

Fixes #125
2017-06-26 07:52:23 -04:00
Dan Stillman
df2216960b Fix permissions errors in child translators in translation-server 2017-06-26 07:21:18 -04:00
Adomas Venčkauskas
2414ec6472 Fix a debug log line 2017-06-26 09:49:41 +03:00
Dan Stillman
56f9f04340 Partial fix for CSL JSON export in translation-server
Zotero.Item doesn't exist in translation-server

Addresses zotero/translation-server#12
2017-06-25 04:38:50 -04:00
Dan Stillman
145a45e8e1 Support false as deprecated translate() argument 2017-06-24 19:24:29 -04:00
Dan Stillman
8f63a5e20d Check for Zotero.Prefs.getAsync() explicitly, not with isConnector
translation-server doesn't have Zotero.Prefs.getAsync() and isn't a
connector
2017-06-24 19:23:02 -04:00
Dan Stillman
2ab46d3697 Update citeproc-js to 1.1.171 2017-06-24 01:24:11 -04:00
Dan Stillman
d8f8d8a3f8 Fix infinite loop restoring from trash if item has itself as relation 2017-06-24 01:23:39 -04:00
Dan Stillman
e89778c1ab Remove some code that's unnecessary now that we're Fx52+ everywhere 2017-06-23 05:03:11 -04:00
Dan Stillman
f2cc2204c9 Fix for some child items not showing up
https://forums.zotero.org/discussion/66140/5-0-beta-missing-item-attachments
2017-06-21 06:50:35 -04:00
Dan Stillman
abf08deb9d Update broken string in ancient-database dialog 2017-06-20 22:54:05 -04:00
Dan Stillman
3259b63081 Fix error from f3b461ae1d when no duplicate items found 2017-06-20 05:58:12 -04:00
Dan Stillman
041f79379c Fix getAsync() integer warning when highlighting item collections 2017-06-20 05:48:38 -04:00
Dan Stillman
f3b461ae1d Don't use DB transaction when loading Duplicates Items
This should help avoid some timeouts when clicking into that view.
2017-06-20 05:48:38 -04:00
Dan Stillman
a2d874c8bc Don't schedule feed checks during tests
Tests create lots of fake feeds with invalid URLs, so auto-updating
would otherwise hang and block the explicit feed updates done by other
tests.
2017-06-20 05:48:38 -04:00
Adomas Venčkauskas
dcfddac519 Refactor Connector.callMethod calls to use the promisified form 2017-06-19 14:58:59 +03:00
Dan Stillman
7c020da594 Don't run feeds update until after schema update promise
And tweak feed scheduling in general
2017-06-19 01:25:03 -04:00
Dan Stillman
1372949523 Don't initialize DB backup idle observer until after schema init 2017-06-19 00:49:34 -04:00
Dan Stillman
b590c43edb Disable reset translators/styles buttons while in progress
We should have a better progress notification, but this is better than
nothing.
2017-06-19 00:43:24 -04:00
Dan Stillman
444d77958d Retry objects from sync queue on first sync of session and manual sync
Previously they were retried only on a backoff schedule and after a
client upgrade, but that would make it difficult to report errors
(because you'd see the error but it would then go away if you clicked
Sync again).
2017-06-18 15:37:26 -04:00
Dan Stillman
15a0f3bbe3 Add getKeys() method to API Client 2017-06-18 09:11:21 -04:00
Dan Stillman
47741e75fa Restore locally deleted collections and searches that changed remotely
Also restore items that were in the collections
2017-06-18 09:11:21 -04:00
Dan Stillman
6144c8f969 On missing data dir, remove "Restart Later" for "Use Default" option 2017-06-17 22:30:09 -04:00
Dan Stillman
13283b008d Missing data directory tweaks
- Fix "Locate" button
- Don't offer "Restart Later" option after selecting new location
- Show "Quit" instead of "OK"
2017-06-17 22:14:02 -04:00
Dan Stillman
859c506913 Never auto-select new groups, since they always come from syncs
Fixes test failure from 2e74cd7831
2017-06-16 05:59:44 -04:00
Dan Stillman
2e74cd7831 Don't select new feeds or groups during sync 2017-06-16 05:40:04 -04:00
Dan Stillman
c6cb46907e Disable full-text content processor during sync and on pref off
Turning off full-text content syncing now stops the background processor
2017-06-16 04:49:57 -04:00
Dan Stillman
2f93065986 Fix skipClientDateModifiedUpdate DataObject save option 2017-06-16 01:56:43 -04:00
Dan Stillman
8de0b024f0 Fix one cause of "operation timed out" during sync
Remove some unnecessary transactions in Sync.Data.Local
2017-06-16 01:53:55 -04:00
Dan Stillman
5c45652887 Try to reduce impact of full-text content processor
- Don't start checking for idle until UI is ready + 30 seconds
- Increase idle delay from 5 seconds to 30 seconds
- Increase interval from 100 ms to 200 ms
2017-06-15 18:22:51 -04:00
Dan Stillman
97bac9fadc Move start page URL to config 2017-06-15 02:39:34 -04:00
Dan Stillman
d9eb8ff3c3 Fix "o is undefined" sync error 2017-06-14 07:53:06 -04:00
Dan Stillman
1bb6217ec1 Disable debug output for Zotero.Date.strToDate()
Too messy, and unlikely that we need it in submitted output
2017-06-14 03:37:03 -04:00
Dan Stillman
4032edcf7d Ignore note markup conflicts without cache when text content matches 2017-06-14 03:37:03 -04:00
Dan Stillman
ccb30351c0 Fix incorrect purging of files on WebDAV 2017-06-14 03:20:23 -04:00
Dan Stillman
700aa5377b Don't repeat filenames in results from WebDAV _deleteStorageFiles() 2017-06-14 03:20:23 -04:00
Dan Stillman
db6e9841db Only purge orphaned WebDAV files if downloads completed successfully 2017-06-14 02:38:48 -04:00
Dan Stillman
d2d5896b0b Sort groups in Libraries to Sync window 2017-06-13 21:30:25 -04:00
Adomas Venčkauskas
a17b486e4b Don't auto-migrate data dir if target on a different drive
See https://forums.zotero.org/discussion/comment/277632/#Comment_277632
2017-06-13 17:17:34 -04:00
Dan Stillman
98544edde5 Better logging when revealing attachment in filesystem 2017-06-08 14:13:24 -04:00
Dan Stillman
8913178cf2 Better logging for getAsync() non-integer errors 2017-06-08 14:13:24 -04:00
Dan Stillman
b5424b4a71 Fix context menu options for multi-item selection (broken in 5d16352f57) 2017-06-07 11:50:06 -04:00
Dan Stillman
75ddd879bc Update citeproc-js to 1.1.170 2017-06-06 04:35:38 -04:00
Dan Stillman
b79ecfb5fe Temporarily disable test for non-integer getAsync() 2017-06-05 03:00:15 -04:00
Dan Stillman
71d636e8fb Make non-integer id passed to getAsync() non-fatal for now
Follow-up to 4e1937680f
2017-06-04 21:35:54 -04:00
Dan Stillman
4b0e2a9554 Fix separate note window (regression from 4e1937680f) 2017-06-02 10:36:44 -04:00
Dan Stillman
05ff16c17f Fix some breakage from 013dc958b3 2017-06-01 15:39:42 -04:00
Tom Najdek
506b35840e Add a shutdown hook in Zotero.Prefs to unregister observer
* Without this, preference change observers stack, triggering multiple
  times if Zotero is re-initialized multiple times within the same
  browser instance (like in tests)
2017-06-01 11:36:17 -04:00
Tom Najdek
14bf3184bb Fixes and tweaks to make tests work with babelized code
* Use mocha, chai & sinon from the npm. As of sinon 2.0
  sinon-as-promised is no longer required so it is removed
* Tweak code to re-use the same loader with the same environment
  throghout the code
* Introduce browserify step for testing tools that only provide
  node-compatible libraries (sinon, chai-as-promised)
* Introduce copy step for test data to resolve multiple issues with
  tests depending on files not being symlinks
* Re-introduce custom implementation of setTimeout to resolve issues
  with few tests
* Re-introduce custom Bluebird Promises config & monkey patch
2017-06-01 11:36:16 -04:00
Dan Stillman
a55852ea1c Log Zotero.alert() calls to the terminal 2017-05-31 00:43:57 -04:00
Dan Stillman
61452a835b Fix auto-restore of automatic backup on DB corruption error 2017-05-31 00:43:57 -04:00
Dan Stillman
013dc958b3 Restore cleaner error and item-selection button for note-too-long error 2017-05-31 00:10:00 -04:00
Dan Stillman
5d16352f57 Don't show "Remove Item from Collection" for child items
Test forthcoming once tests are working again
2017-05-27 18:38:28 -04:00
Dan Stillman
aa05920117 Don't break getLocaleCollation() in Firefox <54 (after a73b2403b) 2017-05-27 05:38:29 -04:00
Dan Stillman
d6c36ae9a3 Update help URLs and move to config file 2017-05-27 05:32:01 -04:00
Dan Stillman
a73b2403b0 Fix getLocaleCollation() in Firefox 54 2017-05-27 05:32:01 -04:00
Dan Stillman
d5a8a3420d Additional locale service updates for Firefox 54 compatibility
Follow-up to 0ac37ab65a
2017-05-26 01:37:54 -04:00
Dan Stillman
7fc188b172 Fix crashing for some actions in duplicate items
Necessary after more strict error handling in c4411e1ad3
2017-05-24 18:24:26 -04:00
Dan Stillman
8bc76dd2db Restore logging of unhandled errors from Bluebird (since 9aa057edee) 2017-05-24 18:24:26 -04:00
Dan Stillman
aa321f3495 Add example async/await to test Babel transform 2017-05-24 00:59:45 -04:00
Dan Stillman
6afc58a629 Move require() into ZoteroContext and fix Bluebird module path 2017-05-24 00:58:41 -04:00
Dan Stillman
319edae7f2 Update citeproc-js to 1.1.169 2017-05-23 17:39:10 -04:00
Tom Najdek
9aa057edee Introduce a build system
* Add a multi-process, gulp-based build system to support es6 features,
  async/await, jsx and scss
* Add a package.json to support dependency management and allow starting
  the build process via npm
* Replace embedded Bluebird library with npm-installed one
* Add react, react-dom and web-library
* Introduce a custom require() loader in include.js as well as a minimal
  local require() implementation in various other places
2017-05-23 17:02:50 +01:00
Dan Stillman
e1fb28faa9 Convert some object ids from strings to integers after 4e1937680 2017-05-23 02:10:26 -04:00
Dan Stillman
4e1937680f Throw error if non-number is passed to Zotero.DataObjects.getAsync()
Previously, if an id was psased as a string and the id existed in the
cache, an error wouldn't be thrown, but if there id wasn't in the cache
(e.g., because it was in an unloaded library) it would. This requires an
integer in all cases.

Note that, among other things, any code that gets ids from object keys
will need to convert them to integers before passing to getAsync().
2017-05-23 02:04:58 -04:00
Dan Stillman
265df6d48c Skip edit check if skipAll is passed to object save 2017-05-22 17:29:56 -04:00
Dan Stillman
0ac37ab65a Firefox 54 compatiblity for locale service
Services.locale.getApplicationLocale() -> getAppLocale()
(nsILocaleService -> mozILocaleService)

It's possible this will fix some of the locale resolution problems in
Standalone:

"This is actually a meaningful change because the old one was actually
using OS locale for platforms other than Windows. The new one is using
the app locale for all platforms." [1]

[1] https://bugzilla.mozilla.org/show_bug.cgi?id=1346674#c0
2017-05-22 06:09:25 -04:00
Dan Stillman
1b8704f133 Firefox 54 compatibility: File.createFromFileName() returns a promise 2017-05-22 06:04:27 -04:00
Dan Stillman
a3eea03a38 Firefox 54 compatibility: rename "new" and "delete" XBL methods 2017-05-22 06:03:14 -04:00
Dan Stillman
ddc9989d82 Fix refresh when opening related-item box in note editor 2017-05-19 12:36:03 -04:00
Dan Stillman
1cbc2440ec Make a missing related item not fatal
Since item relations are synced with individual items, an item can exist
before the item it's related to has been downloaded.
2017-05-19 12:11:58 -04:00
Dan Stillman
fc4eb5308f Remove related-item relations when deleting item 2017-05-19 12:11:51 -04:00
Dan Stillman
8edd8830da Remove reference to 'publications' library type in URI.getLibraryPath() 2017-05-19 12:11:21 -04:00
Dan Stillman
90a27f8d4b Add Zotero.URI.getURIItemLibraryKeyFromDB()
Allows getting libraryID and key without relying on library data being
loaded (e.g., at startup)
2017-05-19 12:11:21 -04:00
Dan Stillman
5873e554f1 Allow functions for testing and repair in DB integrity checks
This can be used for things that can't be checked or repaired with SQL
alone, or that are too difficult to do that way.
2017-05-19 12:11:14 -04:00
Dan Stillman
caf61bec2f Use COUNT(*) > 1 for DB integrity check queries 2017-05-19 06:33:03 -04:00
Dan Stillman
cf125435fb Update citeproc-js to 1.1.167 2017-05-19 04:51:20 -04:00
Dan Stillman
05dcc11a8d Update localized string name
Most localizations still say "Firefox" for this string, so this will
clear those.
2017-05-17 21:41:40 -04:00
Dan Stillman
d9fbccca67 Add item sanity check to note editor
When refreshing the note editor, store the associated itemID on the
textbox, and check it when saving to make sure it's for the expected
note. This might prevent weird situations (which I can't reproduce, but
there was a report in the forums [1]) where something goes wrong and the
note doesn't refresh when selecting a new item, and then one note's
content is saved over another's.

[1] https://forums.zotero.org/discussion/65708/
2017-05-17 21:41:40 -04:00
Dan Stillman
c4411e1ad3 Crash app if there's an error selecting an item 2017-05-17 21:41:39 -04:00
Adomas Venčkauskas
182cf67a97 Fix wrong localization arg passing 2017-05-15 18:26:41 +03:00
Dan Stillman
7e95f8fc51 Use proper alerts for export errors 2017-05-14 05:07:18 -04:00
Dan Stillman
e1986b460e Fix failed export due to missing attachment path 2017-05-14 05:06:37 -04:00
Dan Stillman
eb42152c42 UI fixes for read-only notes
- Don't show toolbar in read-only note editor
- Get rid of "undefined" button in CR window
- Better padding/alignment in CR window
2017-05-12 20:01:47 -04:00
Dan Stillman
be7cc45c0e Better debug logging for CR error 2017-05-12 17:53:19 -04:00
Dan Stillman
a92d469466 Remove accidental 'false' in 20121b9b9 2017-05-12 06:16:29 -04:00
Dan Stillman
20121b9b97 Fix tag selector tests (broken in 5963c02db) 2017-05-12 06:13:02 -04:00
Dan Stillman
5963c02dbb Fix "Display All Tags in This Library" (broken in fe186333b) 2017-05-12 05:37:46 -04:00
Dan Stillman
9de6a55bce Better approach to opening files after on-demand downloads
Follow-up to 44507ce20b
2017-05-11 01:26:46 -04:00
Dan Stillman
b3acb12973 Don't show Modified if attachment is missing 2017-05-11 01:07:21 -04:00
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