Commit graph

6631 commits

Author SHA1 Message Date
Dan Stillman
610dce7c1f Update citeproc-js to 1.1.131 2016-09-20 18:34:24 -04:00
Dan Stillman
dc0bb68f04 Merge pull request #1091 from adomasven/fix/connector-translation-support
Fixes overriden Zotero object in connector sandboxes
2016-09-20 14:18:07 -04:00
Adomas Venčkauskas
e83bbbad4e Fix getTranslatorCode bugs
- /connector/getTranslatorCode used to respond with empty content
- CodeGetter froze connectors by issuing hundreds of simultanious XHR
  requests
2016-09-20 15:55:58 +03:00
Adomas Venčkauskas
38df733a37 Fixes overriden Zotero object in connector sandboxes
Occurs when not using `with` statement, which is highly discouraged and
unsupported in strict mode.
2016-09-20 15:53:55 +03:00
Dan Stillman
745c67d42f Remove duplicate condition
Fixes #1095
2016-09-19 14:01:13 -04:00
Dan Stillman
520220a69a Fix #1094, dataObjectUtilities.equals() misdescription 2016-09-19 01:01:01 -04:00
Dan Stillman
21d3ca298b Merge branch '4.0' 2016-09-18 18:39:18 -04:00
Dan Stillman
c8dbe26abe Update citeproc-js to 1.1.130 2016-09-17 13:48:30 -04:00
Sebastian Karcher
9101cb487f Parse DOI: prefixed DOI from Extra (#1089) 2016-09-14 01:31:26 +02:00
Dan Stillman
4c64634134 Update citeproc-js to 1.1.121 2016-09-07 18:36:24 -04:00
Dan Stillman
3741a75b1d Update locales from Transifex 2016-09-06 19:32:07 -04:00
Dan Stillman
eac8e41d77 Remove OpenOffice.org/NeoOffice from error message 2016-09-06 19:16:31 -04:00
Dan Stillman
474420620e Add "Manage Styles…" link to Create Bib and Doc Prefs windows
Clicking it cancels the current window, opens the Cite pane of the
prefs, and selects the Styles tab. (This will be more useful once we
have inline style installation from that pane.)
2016-09-06 19:15:01 -04:00
Dan Stillman
0828d4d5e9 openPreferences() updates
- Move openPreferences() to Zotero.Utilities.Internal
- Add support for opening windows when there's no active browser window
- Allow selecting prefpane tab by id via 'tab' property
- openPreferences() now takes an object as its second argument with a
  'tab', 'tabIndex', or 'action' property
2016-09-06 19:13:50 -04:00
Dan Stillman
5bcce8ba82 Merge branch '4.0' 2016-09-06 18:57:05 -04:00
Dan Stillman
5107d40ff5 Update citeproc-js to 1.1.119 2016-09-06 18:51:39 -04:00
Dan Stillman
6dfef4daed Removed another unused undeclared variable
Follow-up to 42ef98bb89
2016-09-06 12:17:42 -04:00
Adomas Venčkauskas
42ef98bb89 Remove unused undeclared variable causing an error in safari 2016-09-06 15:01:05 +03:00
Dan Stillman
ca833f54fc Fix noWait translation mode (broken by e3a9c6779b) 2016-09-06 02:17:20 -04:00
Dan Stillman
3ef9b93573 Fix errors with deferred translator tests
In translation-server, the test timeout is overridden to 30 seconds, which was
also the deferred test delay, so there was a race condition that could cause
deferred tests to fail. This sets the deferred delay to 20 seconds.
2016-09-06 01:37:17 -04:00
Dan Stillman
e3a9c6779b Restore connector mode functionality in Firefox
Non-Zotero for Firefox connector code will probably need to be updated
to handle these changes.
2016-09-05 23:08:08 -04:00
Dan Stillman
b18c580dac Revert "Disable connector switching for 5.0 beta"
This reverts commit 317b1dfa0f.
2016-09-05 19:52:13 -04:00
Adomas Ven
5859dd6956 Compatibility fixes for shared connector code (#1082)
Safari does not support generators yet. Removes coroutines
and removes the requirement for bluebird, which should
improve script injection performance.
2016-09-05 19:49:23 -04:00
Dan Stillman
f68ee60524 Follow-ups to getAPIKey() changes in 008321bb89
Addresses #1086
2016-09-05 04:00:55 -04:00
Dan Stillman
008321bb89 Generate API key during auto-sync after upgrade
Fixes #1086, Sync settings/auto-sync glitch after Standalone upgrade
2016-09-05 03:21:49 -04:00
Dan Stillman
43bd1b7082 Collect incremental results for a run within Zotero_TranslatorTesters
This requires provo and translation-server updates.
2016-09-04 01:37:28 -04:00
Dan Stillman
7f5e57f606 Fix error in translator tester when only one translator is whitelisted 2016-09-02 02:43:25 -04:00
Dan Stillman
88e12f617c Fix document property access errors in translation-server
For some reason, in the Fx48 translation-server, the processor passed to
processDocuments() calls in translators can't access document properties
even when they're on the same domain or even the same document. To get
around that, rewrap them for the sandbox, but there might be a better
fix here.

Addresses https://github.com/zotero/translation-server/issues/36
2016-09-02 02:42:17 -04:00
Dan Stillman
06472a9d3c Add array for debugging specific translators 2016-08-31 02:53:35 -04:00
Dan Stillman
1266c9f1e6 Automatically close rogue dialog boxes
A few sites (e.g., Gallica) were causing alerts to pop up in Standalone during
testing, which breaks testing, so accept them automatically. (Hopefully these
don't happen during manual translation...?)
2016-08-31 02:50:02 -04:00
Dan Stillman
6ad195521b Save test results after every translator
Goes with 0813241150
2016-08-31 02:10:23 -04:00
Dan Stillman
c01fc5d762 Merge branch '4.0' 2016-08-28 03:37:55 -04:00
Dan Stillman
ad45c3e51a Fix document wrapping issues in translation-server
Fixes https://github.com/zotero/translation-server/issues/26
2016-08-28 03:29:46 -04:00
Dan Stillman
b7507b03a8 Generate citation cluster via Create Bibliography dialog
Instead of generating individual citations

This matches Quick Copy behavior and is almost certainly what people
want.
2016-08-26 02:42:56 -04:00
Dan Stillman
bdec4b119f Fix error handling during local file import translation
A failure during detect (which is normal during file import attempts)
would cause later translator detection to fail.
2016-08-22 21:41:10 -04:00
Dan Stillman
8aee80106d Fix errors uploading remotely missing objects with local version numbers
If an object exists locally but not remotely and the local version has a
version number, that's an error. I don't think that should ever happen,
but it can if things somehow get out of sync due to other bugs.

To address, reprocess the API delete log during a full sync and then
reset the version number of all remaining local objects that don't exist
remotely (not just unmodified objects, as was the case previously) to 0
for uploading.

When remote deletions are reprocessed, delete local objects that haven't
been modified and show the conflict resolution window for any local
items that have.

Also:

- Clean up checking of last remote library version during download
  syncs
- Add Zotero.DataObjects.getAllKeys()
2016-08-20 14:56:31 -04:00
Adomas Ven
076bdadb29 Fixes feed sync bugs after conflicts. (#1074)
SyncedSettings.set() caches values. If an object passed to set() is
modified after the call then get() returns that modified object.
2016-08-16 03:03:42 -04:00
Dan Stillman
1b5c7aa6d8 Default to showing synced storage properties in Item::toResponseJSON()
toResponseJSON() is usually used to emulate the API, which shows md5/mtime

Also fix passing of options to toJSON() from toResponseJSON()
2016-08-15 04:47:34 -04:00
Dan Stillman
9ba3745b94 Don't clear md5/mtime in item JSON if skipped in patch mode
The client skips synced storage properties (md5, mtime) when uploading items to
ZFS-enabled libraries, but since the API returns JSON with those values
included after writes, they do get saved to the sync cache. If the local
attachment is then modified and the client generates a diff from the cached
version with those properties skipped, they'll be included in the patch JSON as
empty strings in order to clear them. This changes Zotero.Item::toJSON() to
skip those properties in patch mode as well.

This fixes a sync error ("Cannot change 'md5' directly in group library") when
a group attachment is updated locally.
2016-08-15 04:38:04 -04:00
Dan Stillman
41eb49cf7f Fix handling of object-level 404/412 errors 2016-08-15 02:26:04 -04:00
Dan Stillman
daf0f8e0b0 Merge branch '4.0' 2016-08-14 17:27:36 -04:00
Dan Stillman
03ef4723f8 Fix delay-generator handling during upgrade check and full sync 2016-08-14 17:23:02 -04:00
Dan Stillman
976b5c82c6 Fix error delaying on second library upload conflict 2016-08-14 17:23:02 -04:00
Dan Stillman
b4e6584417 Fix PDF metadata recognition in Firefox 48
Reapplies modifications to SpecialPowers code after a0843f317

This is essentially the changes within the SpecialPowers code block from this
diff, with some modifications for the new code:

git diff 1257b17e..a0571a9a17 chrome/content/zotero/xpcom/translation/translate_firefox.js
2016-08-13 19:36:15 -04:00
Dan Stillman
7ea5bab206 Fix delaying if remote library version changes during downloads 2016-08-13 03:34:29 -04:00
Dan Stillman
a0843f3171 Update to latest Mozilla SpecialPowers code for Proxy.create
This fixes the "Proxy.create is not a function" errors during PDF
metadata retrieval in Firefox 48 after the old Proxy API removal, but it
still throws "doc.location is null".

Addresses #1076
2016-08-13 02:05:50 -04:00
Dan Stillman
2bcd77f870 Temporary fix for 404 uploading missing object with local version
This shouldn't happen, but if it does, the API should return a 412 for
such objects, resulting in a full sync. Until the API fix is rolled out,
do the same on a 404.
2016-08-12 01:51:14 -04:00
Dan Stillman
da9ac72d51 Fix error adding >200 items to sync queue 2016-08-10 01:57:52 -04:00
Adomas Ven
715193639b Fixes a bug when zotero dir exists elsewhere and you want to select a custom one (#1070) 2016-08-09 11:59:10 -04:00
Dan Stillman
0eb6dc9ca5 Merge branch '4.0' 2016-08-09 01:52:21 -04:00
Dan Stillman
19a4c64903 Update citeproc-js to 1.1.113 2016-08-08 02:03:45 -04:00
Dan Stillman
c5dad533a1 Fix translator updates 2016-08-03 01:26:19 -04:00
Dan Stillman
90cc7efef4 Fix #1038 again for separate note windows 2016-08-01 03:36:54 -04:00
Philipp Zumstein
3dfb73faba Allow ZU.doGet to have requestHeaders (#1062)
This is mainly for translators which have to work with content negotiation,
e.g. ORCID API or API calls of ISBN agencies.
2016-07-31 14:46:03 -04:00
Dan Stillman
d5b2f67afa Automatically resolve item deletion/trash conflicts
If the item was deleted on one side and moved to the trash on the other,
just delete the item on the trash side. Since trash emptying happens
automatically, this would otherwise result in a conflict even if the
user carefully avoided making changes before a manual sync.
2016-07-30 23:03:30 -04:00
Dan Stillman
254da12e12 Hide unsigned add-on warning in Standalone
There's no need for Zotero Standalone add-ons to be signed by Mozilla.

Currently only hides when the Extensions pane is first loaded, so if the user
switches to Appearance or Plugins and switches back, the warning reappears
2016-07-23 16:25:25 -04:00
Dan Stillman
9077b2f495 Fix display of some icons in Standalone 2016-07-22 11:59:55 -04:00
Dan Stillman
70a91f9674 Increase max tag colors from 6 to 9 2016-07-22 11:59:55 -04:00
Dan Stillman
3b71ec5410 Throw "Error", not "Exception", in merge.xml 2016-07-21 13:16:08 -04:00
Dan Stillman
01ba8dfc34 Don't show missing-group warning for skipped groups 2016-07-20 15:36:31 -04:00
Dan Stillman
1bd058ed48 Prompt for library data reset on 403 upload error
Addresses #1041 for data -- still needed for files
2016-07-19 22:12:13 -04:00
Dan Stillman
5fee2bf4ca Prompt to reset library data/files on loss of write access
On reset, items are overwritten with pristine versions if available and deleted
otherwise, and then the library is marked for a full sync. Unsynced/changed
files are deleted and marked for download.

Closes #1002

Todo:

- Handle API key access change (#953, in part)
- Handle 403 from data/file upload for existing users (#1041)
2016-07-19 19:05:17 -04:00
Dan Stillman
ee74030d03 Warn if attachmentSyncedModificationTime is set to too-low timestamp 2016-07-19 18:51:15 -04:00
Dan Stillman
3655c09450 Zotero.Item.prototype.deleteAttachmentFile() 2016-07-19 18:51:05 -04:00
Dan Stillman
66ca2cfda2 Fix saving of automatically merged remote changes during sync 2016-07-19 02:27:38 -04:00
Dan Stillman
2857f85656 Alphabetize feed list 2016-07-19 01:50:18 -04:00
Dan Stillman
7b45b920fc Fix clearing of missing fields in Item::fromJSON() 2016-07-18 23:44:36 -04:00
Dan Stillman
2d39614143 Fix subcollections being shown at top level of groups
Fixes #1065
2016-07-18 17:51:59 -04:00
Dan Stillman
ab10d1617e Replace deprecated Zotero.Libraries.isEditable() call on note save 2016-07-17 15:14:06 -04:00
Dan Stillman
381fe38b89 Fix #1038, Notes skip back to beginning if typing during auto-save
Set a unique id on the note editor at initialization and pass it along
to item.saveTx(). When notify() is called, if the save was triggered
from the current note field, don't do a refresh.

This does mean that the note field won't reflect changes (e.g.,
normalizations) made by the save process until the user clicks away and
back, which makes me a little uncomfortable. If we can find specific
cases where that occurs (paste?), we can reevaluate this approach.
2016-07-17 15:14:06 -04:00
Dan Stillman
69dec87aa6 Allow passing arbitrary values to notifier events from DataObject.save()
item.saveTx({
    notifierData: {
        foo: 1
    }
});

foo: 1 will be included in the extraData[id] object in notify().
2016-07-17 15:14:06 -04:00
Dan Stillman
4449da7e91 Tweak note field auto-save triggering
This avoids unnecessary timeout calls and fixes a problem where typing
in a newly initialized note doesn't save it until the first blur().
2016-07-17 15:13:39 -04:00
Dan Stillman
6a7e3d0259 Add "is (less|greater) than" to num pages/volumes search conditions
https://forums.zotero.org/discussion/60897/
2016-07-16 17:15:17 -04:00
Adomas Ven
b0157efd23 Clone feed item if no translators available (#1061) 2016-07-14 14:17:56 -04:00
Adomas Venčkauskas
f7a6464f82 Use feed item links for guid if id unavailable 2016-07-13 13:49:46 +03:00
Dan Stillman
1b6dffb886 Don't refresh collections pane when updating library last-sync times 2016-07-12 03:23:47 -04:00
Dan Stillman
cd3f621a00 Don't auto-sync skipped libraries on change 2016-07-12 00:41:08 -04:00
Dan Stillman
599598566b Use best first creator for OpenURL author, not just first position
This also fixes Google Scholar Search lookup to use an author not in first creator
position [1].

[1] https://forums.zotero.org/discussion/58384/
2016-07-11 06:30:55 -04:00
Dan Stillman
83d11947ff Fix UI breakage that prevents switching collections
I'll add a test later once I figure out how to reproduce this, but I
think this should fix the "id is undefined" errors.
2016-07-11 06:25:19 -04:00
Dan Stillman
c1f7a188e2 Fix error modifying existing saved search with more than 1 condition
Closes #1056, which wasn't actually the problem
2016-07-07 07:55:15 -04:00
Dan Stillman
18cf6088b0 Fix CR window for storage files (follow-up from d44eeb752b) 2016-07-07 05:45:58 -04:00
Dan Stillman
54ba532ebd Fix display of parent item title in popup note window 2016-07-07 05:19:26 -04:00
Dan Stillman
d44eeb752b Fix error on CR of child note, and show parent item title in merge pane 2016-07-07 05:18:02 -04:00
Dan Stillman
72bad4309b Show "Choose Parent" button for deleted items in CR window 2016-07-07 04:08:11 -04:00
Dan Stillman
9f9e95ea96 Show conflicts in debug output when showing CR window 2016-07-06 13:56:27 -04:00
Dan Stillman
bfbac24667 Condense debug output for skipped up-to-date items when syncing 2016-07-06 13:54:25 -04:00
Dan Stillman
7dce069490 Merge English strings to locales 2016-07-06 02:14:55 -04:00
Dan Stillman
c40a5a983c Fix #1057, Item order is lost in saved search after item edit
Broken by 3dc0ad37
2016-07-06 02:09:14 -04:00
Dan Stillman
fc857dc496 Close #1053, Manual sync option in library context menu
This also reworks how the collection context menu is built to do more in
JS instead of XUL, though it can't do it all in JS because some
localized strings are in zotero.dtd and are used in standalone.xul too.
2016-07-02 03:15:37 -04:00
Dan Stillman
893b9ae1fc Show "Duplicate Items" and "Unfiled Items" for all libraries by default
Previously they only showed for My Library by default, which I suspect
meant that most people didn't know you could get them for other
libraries...

This hides "Duplicate Items" and "Unfiled Items" from the context menu
when they're active, which may or may not be desirable (but we don't
show, say, "Trash" in the context menu).

Also tweaks selection behavior after hide to select next appropriate row
instead of the parent library.
2016-07-02 03:15:37 -04:00
Dan Stillman
51b3951fb0 Maintain open state of groups on collectionTreeView refresh() 2016-07-02 03:15:37 -04:00
Dan Stillman
86b5042781 Rename _rememberOpenStates() to _saveOpenStates() in collectionTreeView 2016-07-02 01:27:51 -04:00
Dan Stillman
e787bb1183 Fix save()/saveTx() warning when uploading settings 2016-06-30 07:24:06 -04:00
Dan Stillman
2a55e56f3f Save open field when selecting from an item pane context menu
If a field is open and the user right-clicks on another field (e.g., swap
names, creator type, transform text), any changed value in the open field was
lost.

Also:

- Don't show swap-names menu in single-field mode

I can't quite get programmatic access to context menus to work correctly, so
tests are disabled for now. (They work individually, but not together.)
2016-06-29 05:35:51 -04:00
Adomas Ven
2cce099928 Add custom view groups for different library types (#1042)
I originally attempted this with zotero-persist and column attributes,
but there is no good way to make it succinct paramswise and the code was
painful to look at too. Thus different group settings are stored in
preferences.

Currently there are two view groups: "feed" and "default". Items view
columns have two new attributes:
`default-in` - a space separated list of views in which a column is
visible by default
`disabled-in` - a space separated list of views in which a column is
disabled by default (invisible + not possible to enable)

Fields not parsed for feeds are now disabled.
2016-06-28 20:12:54 -04:00
Dan Stillman
622530e889 Fix #1054, UI breakage after unsubscribing from feed 2016-06-28 14:29:15 -04:00
Dan Stillman
9e6565fe00 Skip skipped groups when syncing
Except if a library list is passed to Zotero.Sync.Data.Runner.sync() (which
isn't done currently but will be in #1053)

Follow-up to #1033
2016-06-27 16:48:32 -04:00
Adomas Ven
b0f3a234d0 Allow choosing of synced libraries in sync preferences (#1033)
Affects Sync button and auto-sync. Manual library sync will be possible later via library context menu.
2016-06-27 12:47:11 -04:00
Adomas Ven
11e7cef057 Show hard warning dialog when unlinking or linking to a different account (#1047)
And give option to delete local data when unlinking

This removes the old behavior of merging accounts when syncing with a different username.
2016-06-27 12:40:38 -04:00
retorquere
bd6dec352c Sort items for translator
In response to https://forums.zotero.org/discussion/60375?page=1#Item_6
2016-06-27 15:54:50 +02:00
retorquere
32c6e1edb3 Sort items for translator
In response to https://forums.zotero.org/discussion/60375?page=1#Item_6
2016-06-27 15:12:02 +02:00
Dan Stillman
caaee87e9e Fix showing of WebDAV settings in sync prefs 2016-06-26 05:29:51 -04:00
Dan Stillman
0ea328dac5 Fix changing of linked attachment base directory 2016-06-26 02:02:22 -04:00
Dan Stillman
2f562a4fdf Fix Travis errors with OS.File.DirectoryIterator for real 2016-06-24 21:12:29 -04:00
Dan Stillman
edc996b1ed Sanity-check OS.File.DirectoryIterator entry.isDir only on Travis
Follow up from 2c2a5a378
2016-06-24 18:32:35 -04:00
Dan Stillman
2d88b07855 Set Zotero.automatedTest flag instead of .noUserInput on Travis
And don't skip alerts in Zotero.alert() during automated tests. (That
was intended to avoid long timeouts after unexpected failures, but,
e.g., PDF metadata lookups (which are currently disabled in automated
tests) should just be mocked so they don't intermittently fail.)
2016-06-24 18:28:32 -04:00
Dan Stillman
2c2a5a3787 Maybe fix zipDirectory() test failures on Travis 2016-06-24 16:50:08 -04:00
Dan Stillman
ec212119cc More zipDirectory debugging 2016-06-24 16:36:20 -04:00
Dan Stillman
62de330bef Make sure sync errors are logged
This might result in some double-logging, but that's better than no
logging.
2016-06-23 14:37:20 -04:00
Dan Stillman
df1c92b9a3 Fix "librariesToSync is undefined" when full-text syncing is disabled 2016-06-23 14:28:13 -04:00
Dan Stillman
6a523347b2 Cancel delayed quickCopy initialization when resetting DB during tests
And improve cancellation of scheduled feed checks
2016-06-23 05:38:15 -04:00
Dan Stillman
511222bcaf Skip child items when generating export format for CSL JSON
itemToCSLJSON() doesn't seem to need child items, so when a Zotero.Item
is passed to it, don't bother loading child items when calling
itemToExportFormat() to convert the item into the necessary format.
2016-06-23 04:26:24 -04:00
Dan Stillman
0238a2c13c Fix errors citing items in unloaded libraries 2016-06-23 04:17:33 -04:00
Dan Stillman
74fe2a2bdc Pass empty array to sync/finish event if no synced libraries 2016-06-23 03:08:16 -04:00
Dan Stillman
3de40256bf Restore drag-and-drop Quick Copy 2016-06-23 03:08:16 -04:00
Dan Stillman
8a0081c84e Sort translators list in Quick Copy drop-down 2016-06-23 03:08:16 -04:00
Dan Stillman
d4532f0cdf Merge pull request #1040 from rmzelle/inherit-class
Correctly inherit "class" from parent style
2016-06-23 03:05:49 -04:00
Philipp Zumstein
f6da7bb8d4 Change const to var in utilities
In order to make these mappings also available when the
script is used with `loadSubScript` from outside we
have to use `var` instead of `const`, `let`.

See https://github.com/aurimasv/z2csl/issues/6
2016-06-23 00:38:48 +02:00
Dan Stillman
4d516c68bf More zipDirectory() test debugging 2016-06-22 06:52:41 -04:00
Dan Stillman
94e0e8b752 Debugging for zipDirectory() test failure on Travis 2016-06-22 06:42:30 -04:00
Dan Stillman
b5344119bb Don't warn if a modified library property is accessed before save
getCellText() can be called between when a property (e.g., .name) is
changed and when ._changed is reset after the save, making this warning
unavoidable
2016-06-22 06:26:02 -04:00
Dan Stillman
48a072d254 Update library version after settings upload 2016-06-22 05:58:12 -04:00
Adomas Venčkauskas
834597c8bb Fix test failures introduced after #1044 2016-06-22 05:47:24 -04:00
Adomas Ven
dd8fd2b1ac Feed syncing (#1044)
Closes #1036

Also:

- Store sync info for feeds more compactly. Address #1037
2016-06-22 03:24:22 -04:00
Dan Stillman
451c12513e Remove unused toResponseJSON() overrides for Collection/Search 2016-06-20 01:21:24 -05:00
Dan Stillman
8e0e69332e Fix syncing of search conditions 2016-06-20 01:08:25 -05:00
rmzelle
e49c09f4a1 Correctly inherit "class" from parent style 2016-06-18 20:28:28 -04:00
Dan Stillman
2225f459b7 Fix breakage after certain Notifier events with My Publications selected 2016-06-14 15:24:47 -04:00
Dan Stillman
87abfdf64d Merge pull request #1032 from adomasven/fix/feed-dates
Changes date parsing and handling for feeds. Closes #1024, #1025
2016-06-14 13:38:38 -04:00
Adomas Venčkauskas
137290b97f Changes date parsing and handling for feeds. Closes #1024, #1025 2016-06-14 13:22:04 +03:00
Dan Stillman
099b45438d Merge branch '4.0' 2016-06-13 23:02:22 -04:00
Dan Stillman
954677636e Fix hang if another key is pressed after Enter in Quick Format dialog 2016-06-13 23:00:08 -04:00
Dan Stillman
c312576d02 Fix indicated return value in comment for itemToExportFormat() 2016-06-13 04:57:26 -04:00
Adomas Ven
f9449b1749 Fixes hidden columns showing on restart. Closes #1030 (#1031) 2016-06-13 04:56:39 -04:00
Philipp Zumstein
a200f6cfc5 Fix more for-each-in (#1029) 2016-06-12 01:23:45 -04:00
Dan Stillman
7dda5a2f69 Fix saving to collection from fallback search translators
Fixes #1028
2016-06-11 14:54:06 -04:00
Dan Stillman
0b75b75b96 When merging items, add master item to all collections
Also changes Zotero.Item.prototype.clone() to take an `options` object for its
second parameter instead of a boolean `skipTags`. The object includes
`skipTags` as well as a new `includeCollections` property to add the new item
to the same collections.
2016-06-10 23:26:32 -04:00
Dan Stillman
e66954a6f7 Correct comment for Zotero.Date.isoToDate()
isoToDate() does handle non-UTC time zones
2016-06-10 20:37:53 -04:00
Dan Stillman
3179a2f0e7 Fix various issues with note pane tags box 2016-06-10 20:35:14 -04:00
Dan Stillman
3de5ed1332 Don't show "false" for empty notes after restart 2016-06-10 19:44:33 -04:00
Dan Stillman
41fe8365a9 Fix #1027, 5.0: Not possible anymore to add tags to notes
Still a little weirdness in the tags popup that I'll clean up, but it should
work now.
2016-06-10 19:21:54 -04:00
Dan Stillman
fdd90b04d3 Save to My Library via connector when read-only library is selected
(Or My Publications, which is editable but shouldn't allow direct saving)

Also switches to My Library
2016-06-09 02:47:29 -04:00
Dan Stillman
de19d2fee5 Update locales from Transifex 2016-06-09 02:43:37 -04:00
Dan Stillman
0cf102b0e6 Fix missing word in string 2016-06-07 12:36:27 -04:00
Dan Stillman
b59edceec2 Fix some title casing of UI labels 2016-06-06 21:30:32 -04:00
Dan Stillman
cf2a673e2b Don't split out "Items First" in feed prefs 2016-06-06 17:58:51 -04:00
Dan Stillman
80f31abc30 Merge new English strings for 5.0 2016-06-06 16:43:02 -04:00
Dan Stillman
a343a7af6e Merge branch '4.0' 2016-06-06 16:42:39 -04:00
Dan Stillman
0a0283483e Update submodules 2016-06-06 16:14:21 -04:00
Dan Stillman
2928e1fda1 Update locales from Transifex 2016-06-06 16:10:30 -04:00
Dan Stillman
8be22b84d1 Merge pull request #1012 from adomasven/fix/hide-list-cols-for-feeds
Closes #1008. Omit certain item list columns in feed views
2016-06-06 15:48:59 -04:00
Dan Stillman
a2fbf04682 Fix handling of unexpected status code for repository update request 2016-06-05 19:08:08 -04:00
Adomas Venčkauskas
60c4262d1e Closes #1008. Omit certain item list columns in feed views 2016-06-03 15:48:46 +01:00
Dan Stillman
19714d5b9b Avoid logged error after server_connector saveSnapshot tests
Indexing currently happens a second after the 201 is returned to the
connector, so we have to wait for that before continuing tests, or else
a DB clear in a later test (e.g., storageLocal) will cause an error to
be logged when the indexing kicks off.
2016-06-02 16:47:27 -04:00
Dan Stillman
7f339af104 Remove debug output during file sync 2016-06-02 16:14:30 -04:00
Dan Stillman
b0b9e84650 Clarify debug output for Zotero.DataObjects.prototype._loadDataTypeInLibrary() 2016-06-02 16:14:30 -04:00
Dan Stillman
3fb2dfe9ac Log error from NetUtil.asyncFetch in Zotero.File.putContentsAsync() 2016-06-02 16:14:30 -04:00
Dan Stillman
0d008b4704 Use OS.File.removeDir() to delete existing attachment files during sync 2016-06-02 16:14:30 -04:00
Dan Stillman
88a43fea31 Handle subdirectories when extracting attachment ZIP files 2016-06-02 16:14:30 -04:00
Dan Stillman
fc4d7fa4bf Fix infinite loop in Zotero.File.zipDirectory() on subdirectory
But subdirectories shouldn't actually be used yet, because they won't
extract properly on 4.0.
2016-06-02 16:14:30 -04:00
Dan Stillman
37063f639f Be sure to clean up temp attachment storage dir in importFromDocument() 2016-06-02 16:14:29 -04:00
Dan Stillman
fcb6e0c068 Save snapshots via nsIWebBrowserPersist instead of WebPageDump
WPD code hasn't been updated in many years, and there was an issue with
document permissions in 5.0. We'll need to replace nsIWBP in Electron,
but this will do for now.

Attachments are opened using file:// URIs instead of
zotero://attachment, which is what Standalone does anyway. Ancient HTML
annotations and highlights won't be displayed anymore, but I'm not sure
they worked anyway, and it hasn't been possible to create them in years.
We might be able to write out existing annotations to notes.

iframes are skipped during saving, in an attempt to reduce the number of
junk ad files. JS can still cause problems with viewing, so we might
still want to either disable scripts or force the viewed page offline
(if such a thing is possible).

There might be issues with auxiliary filename length/characters during
cross-platform file syncing. (We modified the WPD code to shorten/clean
them.)
2016-06-02 16:14:29 -04:00
Joscha Legewie
00497eda3b Allow string path as argument to Zotero.launchFile()
Not sure whether this is desired but it helps to reduce the use of nsIFile to a minimum. `file.launch()` and `file.reveal()` are two of the few things that are not possible with OS.File/OS.Path. When that changes, Zotero.launchFile is the only function that needs to be modified if it works with string paths.
2016-05-30 09:02:40 -04:00
LinuxMercedes
6bff554976 Add a second horizontal layout to Zotero for small screens (#1010) 2016-05-27 20:57:29 -04:00
Dan Stillman
849d206f87 Fix error running tests in translation-server 2016-05-27 04:37:48 -04:00
LinuxMercedes
aeb0d7599a Thread skipNotify through addItem 2016-05-26 23:28:10 -05:00
LinuxMercedes
5c9fce9a9d Add items from RecognizePDF in a DB transaction 2016-05-26 23:28:10 -05:00
Dan Stillman
34208f92f7 Fix startup error in translation-server 2016-05-26 22:44:22 -04:00
Dan Stillman
d7e38d960e Fix error in console on feed update before pane open 2016-05-26 00:35:04 -04:00
Dan Stillman
e4bc4c028d Don't fail if processDocuments() processor returns undefined
Follow up to 157b8deda9
2016-05-26 00:35:04 -04:00
Dan Stillman
2f47eae3ff Allow string path to be passed to Zotero.File.getExtension() 2016-05-26 00:35:04 -04:00
Dan Stillman
47b934f67e Fix direct saving of PDFs via connector 2016-05-25 17:34:26 -04:00
Dan Stillman
3905c98f93 Don't save note if it hasn't been changed by user
After uploading a note to the API, the local version may be overwritten with
the sanitized version in the API write response. This commit prevents the note
from being resaved when the note is clicked, reformatted by TinyMCE, and
clicked away from, which would result in an endless resync cycle. Instead, the
note is only resaved (and marked for syncing) when the user manually makes a
change.

 Please enter the commit message for your changes. Lines starting
2016-05-22 23:09:41 -04:00
Joscha Legewie
0ae070970a Support String for options.file in Zotero.Attachments.linkFromFile (#1005) 2016-05-22 13:42:39 -04:00
Dan Stillman
e21a914a1f Clarify comment for local object version updating behavior 2016-05-21 16:52:27 -04:00
Dan Stillman
4c46ebcf96 loadAllData() no longer necessary before fromJSON()
Post-deasyncification
2016-05-21 16:33:46 -04:00
Dan Stillman
f8716fbe88 Don't change Date Modified when updating local item after upload
If the API returns a modified item after an upload (e.g., to strip invalid
characters), don't update the Date Modified field when saving those changes to
the local version (though it would still be good to avoid API-side changes as
much as possible).
2016-05-21 16:33:46 -04:00
Dan Stillman
8b4a5936a3 Fix checking for file sync downloads at sync time 2016-05-21 16:33:45 -04:00
Dan Stillman
99eb39e288 Always include 'contentType'/'charset'/'filename' in attachment JSON
And omit in ZFS file sync requests

The API previously didn't allow these properties to be set for group items,
because they were set atomically during the file upload process, but 1) that's
not really necessary (makes a little sense for 'filename', but not really a big
deal if an old file is renamed on another computer before the new file is
synced down) and 2) skipping them results in the properties getting erased
after items are uploaded and the empty values returned by the server overwrite
the local values.
2016-05-21 16:33:35 -04:00
Dan Stillman
f5812852cb Default to My Library if pane not yet open saving snapshot from connector 2016-05-20 16:22:28 -04:00
Dan Stillman
0be2796500 Fix webpage/snapshot saving from connector 2016-05-20 15:51:54 -04:00
Dan Stillman
157b8deda9 Allow processor passed to Zotero.HTTP.processDocuments to return a promise
If a promise is returned, it's waited for before continuing with the next
document.
2016-05-20 15:51:01 -04:00
Dan Stillman
d8abfa4f67 Save all item data values as string, and convert old integers to strings
Before 5.0 we performed a regexp on new item data values to determine if
they were integers and saved them natively in SQLite if so. We no longer
do that, but setField() used strict equality when checking for changes,
so an item could be marked as changed when comparing to a new string
value (e.g., from a write response from the API, which always returns
strings). To avoid that, this converts all old values in the DB to
strings and saves all incoming values as strings automatically. (This
should also help with searching and some other things.)
2016-05-18 17:25:50 -04:00
Dan Stillman
b9bbf007f0 Don't bother opening browser window for syncLocal::checkUser() tests
The window is passed to nsIPromptService, which handles finding a parent window
(hidden or otherwise) automatically if necessary.
2016-05-18 02:31:41 -04:00
Dan Stillman
2c18968c3a Fix Quick Format dialog for search results in unloaded libraries
Since the search might return items in libraries that haven't yet been loaded,
we have to get those items asynchronously and load their data explicitly. Need
to test this with a large document to make sure it still properly populates the
list with search results and then adds matching cited items.
2016-05-17 13:43:11 -04:00
Dan Stillman
7192929ac3 Add Zotero.DataObjects.prototype.loadDataTypes(objects, dataTypes)
Bulk-loads data for objects that are potentially in different libraries. This
would generally be used to load necessary data for cross-library search
results, since those results might include objects in libraries that haven't
yet been loaded.
2016-05-17 13:43:11 -04:00
Dan Stillman
dd9cc40c16 Cancel pending feed update check on Zotero shutdown
This avoids errors for a missing 'feeds' table during tests, when the callback
started in Zotero.Feeds.init() runs but the Zotero object has been torn down
and the database hasn't yet been reinitialized.
2016-05-17 13:43:11 -04:00
Dan Stillman
6907af86fd Add XPCOM clearTimeout() and remove Zotero.wait()
Properly emulate setTimeout() with support for cancelling timers.
2016-05-17 13:43:11 -04:00
Dan Stillman
a285e97815 Remove pumpGenerator/promiseGenerator
And update integration code to use ES6 generators and Bluebird's .each()
instead.
2016-05-17 13:43:11 -04:00
Dan Stillman
d8025be676 Ignore sanitization changes when comparing notes in conflict
Until we have a consistent way of sanitizing HTML on client and server, account
for differences manually. More differences between HTMLPurifier and TinyMCE
should be added as necessary.
2016-05-17 02:33:53 -04:00
Dan Stillman
6f04b34d59 Close #945, Optimize bulk reload on multi-item changes 2016-05-16 18:25:35 -04:00
Dan Stillman
56dcd6da26 Add file sync info/link to File Not Found dialog 2016-05-15 04:24:00 -04:00
Dan Stillman
427234917d Properly test whether file syncing is enabled for a library 2016-05-15 04:22:24 -04:00
Dan Stillman
a8ea8656d2 Fix sync error after changing child item to top-level 2016-05-15 03:34:06 -04:00
Dan Stillman
a7ea92fd52 Mark items with missing full-text cache files as unsynced for full text
Fixes #954, Full-text content processor tries to process missing cache
files on every idle
2016-05-15 01:30:35 -04:00
Dan Stillman
82d00a4e7a Change some instances of attachmentMIMEType to attachmentContentType 2016-05-13 15:56:35 -04:00
Dan Stillman
eb400587e8 Fix various bugs saving from connector and add test 2016-05-13 15:00:54 -04:00
Dan Stillman
55c60a69ac Delay feed fetching 5 seconds at startup
Would be better not to start until after the initial library's items had
been loaded, but that's a little awkward to do from non-window code.
Might make more sense when there's only Standalone.
2016-05-13 02:26:46 -04:00
Dan Stillman
ed312b2c89 Tweak text in empty-library sync warning dialog 2016-05-12 17:00:28 -04:00
Dan Stillman
59c0c7fcad Don't include file properties for ZFS-synced libraries
They're disallowed by the API in group libraries and not necessary in personal
libraries, because they're set atomically with the file upload.
2016-05-12 17:00:28 -04:00
Dan Stillman
0f45569ccd Default to NC for My Publications CC license, and reorder SA option 2016-05-12 14:31:57 -04:00
Dan Stillman
62ef910631 Better debug output for full sync 2016-05-12 03:02:50 -04:00
Dan Stillman
92ec1324dc Add a debug flag to prompt or throw on an attempted sync upload
extensions.zotero.sync.debugUploadPolicy = {1, 2}

1 to prompt, 2 to throw

This can be used to test sync functionality without altering the server
state unexpectedly. When prompting, the request body, if any, is logged
to debug output.
2016-05-12 03:02:50 -04:00
Dan Stillman
98cd96eb01 Make DELETE a write method in Zotero.HTTP.isWriteMethod() 2016-05-12 03:02:26 -04:00
Dan Stillman
8bbde63284 Update menu for non-collections when right-clicking on unselected row
Previously, item-dependent menu options in the context menu of
collectionsTreeRow types other than 'collection' weren't updated after
the asynchronous loading of the items. The menu is now updated for all
types, so, e.g., "Empty Trash" is now updated properly after items in
the trash have been loaded.
2016-05-12 02:12:22 -04:00
Dan Stillman
16a58c03be Save scroll position across non-selected changes for collections view 2016-05-09 13:58:33 -04:00
Dan Stillman
9345452601 Don't restore items tree scroll position if selecting new items 2016-05-09 13:58:23 -04:00
Dan Stillman
0bab038925 Fix #984, 5.0: Avoid scrolling items list when adding items via sync 2016-05-09 13:26:33 -04:00
Dan Stillman
53e1e1a9b7 .collectionTreeViewID -> .treeViewID, and add it to Zotero.Item too
Also .collectionTreeViewImage -> .treeViewImage
2016-05-09 12:34:03 -04:00
Dan Stillman
cb8b2bda1b Windows file path fixes
- Fix upgrading of Mozilla-style attachments/storage file paths on upgrade
  (requires re-upgrade)
- Save relative paths using forward slashes for consistency, and convert
  to platform-appropriate slashes on use
2016-05-09 02:30:00 -04:00
Dan Stillman
317b1dfa0f Disable connector switching for 5.0 beta
Don't start the connector pipe (Mac/Linux), don't listen for IPC on the
command-line (Windows), and don't try to release Standalone's lock if DB is
busy when Firefox starts.
2016-05-08 22:38:58 -04:00
Dan Stillman
216900094b Merge branch '4.0' 2016-05-07 13:27:56 -04:00
Dan Stillman
e5edd12371 RTF Scan fixes
- Firefox 46 compatibility
- Stretched progress meters

Partial backport of c5716a395f
2016-05-07 13:18:22 -04:00
Dan Stillman
c7c271f2c4 Fix CSL editor in Firefox 46 2016-05-07 13:17:57 -04:00
Dan Stillman
e1706e15e2 Expand/collapse library fixes
- Fixes #994, 5.0: "+" doesn't expand all collections within a library
- If a container (library, collection) is closed directly, the open state of
  all containers below it are now restored when it's reopened. Previously all
  collections would be closed on a manual reopen (though they might have been
  restored on the next Zotero restart).
- If "-" is pressed, all containers are closed, and reopening the library will
  show only top-level collections.
2016-05-07 04:02:42 -04:00
Dan Stillman
458d110269 Add file for custom sync exceptions 2016-05-06 05:18:09 -04:00
Dan Stillman
950b583e3b Remove obsolete code 2016-05-06 05:00:36 -04:00
Dan Stillman
52ca6d4713 Handle browser-offline error from anywhere in sync code
And don't throw from ConcurrentCaller, because it results in an
unhandled rejection
2016-05-06 05:00:17 -04:00
Dan Stillman
2894e4f462 Fix search by collection 2016-05-06 04:31:49 -04:00
Dan Stillman
8ba9fe7b80 Remove redundant failure delay handling in sync engine
The API client now automatically retries 5xx errors with a backoff schedule, so
the engine doesn't need to do it.
2016-05-06 04:31:49 -04:00
Dan Stillman
a78f923a72 Sync engine cleanup
- Use custom exception for user-initiated sync cancellations, which can bubble
  up to the sync runner -- this should help with a sync stop button (#915)
- Separate out deletions-downloading code
- Refactor delay generator handling on library version mismatch
- Clearer variable names
2016-05-06 04:31:49 -04:00
Dan Stillman
ab4138cf26 Don't throw in Zotero.DataObjects::get() for nonexistent objects
Return false for single ids or skip for multiple ids. This is the original
behavior, but at some point it started throwing an UnloadedDataException. IDs
are always loaded at initialization, though, so we know whether the objects
actually exist.
2016-05-05 06:36:24 -04:00
Dan Stillman
bf3ad6a2a4 Fix test breakage from 3ab335a0 and 09c3a95a 2016-05-05 06:36:24 -04:00
Dan Stillman
b7ad582d99 Merge pull request #991 from adomasven/fix/feed-import-test
Fixes feed-import (and possibly other feed) test unhandled rejections
2016-05-05 06:08:33 -04:00
Adomas Venčkauskas
d4a799b5cb Closes #981. Fixes feed-import (and possibly other feed) test unhandled rejections 2016-05-05 11:07:27 +01:00
Dan Stillman
09c3a95a7e Improve downloaded object processing
- Use an increasing notifier batch size, so objects initially appear one by one
  but then start showing up in batches, up to 50. (UI updates are expensive, so
  for larger syncs we don't want to update after each object.)
- Avoid separate save to update attachment file sync state, which was also
  happening outside of notifier batches (causing individual updates regardless
  of the batch size)
- Add a 10ms delay after processing each object, which keeps the UI responsive
  during downloads. #989 could reduce this to 1 during idle, to save a few
  minutes when downloading very large libraries.
2016-05-05 04:47:01 -04:00
Dan Stillman
4ac2da42d1 Zotero.Items.getAsync() -> get() in itemTreeView::notify() 2016-05-05 02:16:09 -04:00
Dan Stillman
3ab335a078 Don't clear search field when updating items list during sync
Fixes #985
2016-05-05 02:16:08 -04:00
Dan Stillman
8c98abe9dc Fix #988, 5.0: Tab skips Abstract and Extra fields 2016-05-04 21:10:08 -04:00
Dan Stillman
cd5e805b9e Sync logic improvements
- Cancel sync when cancelling conflict resolution window
- Don't try to upload unsynced objects if present in sync queue
2016-05-04 01:39:24 -04:00
Dan Stillman
391f525a75 Close #975, Process conflicts for all batches together 2016-05-03 23:18:42 -04:00
Dan Stillman
f8a0f9ad1d Use synchronous object getters during sync
Since objects should always already be loaded
2016-05-03 18:27:08 -04:00
Dan Stillman
f751495ce8 Remove debug output hover over sync icon 2016-05-03 18:27:08 -04:00
Philipp Zumstein
aef8453924 Fix some for each ... in cases (#978) 2016-05-03 17:51:12 -04:00
Dan Stillman
096ebb188b Try to log a better error for some instances of Zotero.debug(e); 2016-05-03 13:47:37 -04:00
Dan Stillman
72c8711cd3 String::contains() -> indexOf() for Firefox 48 (and 38) compatibility
.contains() was removed in Firefox 48, but .includes() wasn't available until
40, so use indexOf() for now. We can start using .contains() once we no longer
need to support 38 ESR.
2016-05-03 12:08:38 -04:00
Dan Stillman
315100e5ef Remove obsolete style code 2016-05-03 12:06:29 -04:00
Dan Stillman
e8aec31715 Fix various cases of sync errors with read-only libraries
Addresses #983
2016-05-03 02:55:26 -04:00
Dan Stillman
f844d9e46d Skip full-text content download if main library version hasn't changed
Since a data sync always happens first, the main library version will
always be higher if there's any full-text content to download.
2016-05-03 01:17:53 -04:00
Dan Stillman
e0e744f9b1 Use multi-item requests for full-text writes
This is necessary to get a library version after the write instead of an
item version. Otherwise after a full-text write, the main library
version is behind, so the next sync checks all object types for that
library instead of getting a 304.

Full text is batched up to 500K characters or 10 items, whichever is
less.

This also switches to using ?format=versions for /fulltext requests,
which isn't currently necessary but reflects what it's actually doing.
2016-05-03 01:17:52 -04:00
Dan Stillman
a0c7cf9bee Remove redundant error handling in Z.Sync.Data.Engine::_uploadObjects()
makeRequest() now retries 5xx errors automatically, so it's not
necessary higher up.
2016-05-02 05:53:07 -04:00
Dan Stillman
4cc6408105 Use object destructuring in Zotero.Sync.Data.Engine::_uploadObjects() 2016-05-02 05:52:42 -04:00
Dan Stillman
862b371b49 Refactor some API response handling code 2016-05-02 01:28:37 -04:00
Dan Stillman
14ce455483 Fix #982, 5.0: File dots not showing up for child attachments 2016-04-30 19:18:59 -04:00
Dan Stillman
6afce0cf22 Fix "treeRow is undefined" error dragging to bottom of collections list
If you drag past the collections list the row is -1.

Fixes #958
2016-04-30 17:15:13 -04:00
Dan Stillman
10181f7f56 Fix sync error on missing full-text
If a version is returned for an item's full-text content but a 404 is returned
for the content itself (because it's missing in Elasticsearch for some reason),
don't throw an error.

Also remove legacy array comprehensions in fulltext and syncFullTextEngine test
files, which apparently weren't being run.
2016-04-30 01:24:33 -04:00
Dan Stillman
750d691712 Throw errors instead of strings in FeedReader rejections 2016-04-29 23:32:49 -04:00
Dan Stillman
13c4bbebfa Save master item when merging 2016-04-29 20:29:44 -04:00
Dan Stillman
877063e73d Merge branch '4.0' 2016-04-29 20:29:31 -04:00
Dan Stillman
b4ac43fd77 Fix startup error on Firefox 48
Addresses #980. There are a couple other uses of the old API, but I'm not sure
how they're triggered, and we might be gone from Firefox before this is
relevant.
2016-04-29 17:28:24 -04:00