Commit graph

7577 commits

Author SHA1 Message Date
Martynas Bagdonas
5815088586 Fix PDF tools usage in tests 2018-01-18 12:23:27 +02:00
Martynas Bagdonas
77ffc6ad5d Deleted strings that are no longer in use 2018-01-17 13:33:18 +02:00
Martynas Bagdonas
0d5ea8520a Use the bundled PDF tools 2018-01-17 13:33:18 +02:00
Dan Stillman
d662a828d1 Update locales from Transifex and merge new English strings 2018-01-16 13:25:23 -05:00
Dan Stillman
48757f08ff Add missing spinners from 87cf336e2 2018-01-16 12:53:31 -05:00
Dan Stillman
17d4515002 Tweak padding in doc prefs 2018-01-16 12:53:31 -05:00
Dan Stillman
e4cc28ac60 Tweak wording of delayed-citations mode
"Delay citation updates until manual refresh" would be fine in the doc
prefs, but "until manual refresh" is a bit too awkward for the prompt.
Instead, go with @rmzelle's suggestion from #1242 of referring to
"automatic citation updates", and invert the checkbox.
2018-01-16 12:53:12 -05:00
Dan Stillman
cc9efde843 Fix translator architecture hangs on bad JSON in translatorCache 2018-01-16 11:31:34 -05:00
Dan Stillman
2b8311d3d7 Start sync icon spinning before purging data 2018-01-16 09:12:14 -05:00
Dan Stillman
0cd50b5560
Merge pull request #1242 from adomasven/feature/delay-updating-citatations
Refactor integration and delay citation updates
2018-01-16 09:11:21 -05:00
Adomas Venčkauskas
2b27e40308 Refresh citation text upon citation insertion 2018-01-16 14:04:13 +02:00
Adomas Venčkauskas
b985ef8a53 Ensure delayed citation styling is removed upon proper update
Ensure delayed citation styling is removed upon proper update
2018-01-16 14:04:10 +02:00
Dan Stillman
fec3fa2a72 Update locales from Transifex 2018-01-11 20:23:13 -05:00
Dan Stillman
09fc3c2b1c Update submodules 2018-01-11 20:20:32 -05:00
Dan Stillman
7cb95f4129 Automatically rename dragged file attachments from parent metadata
Rename happens if only one file is dragged and the parent item has no
existing file attachments.

Closes #1405
2018-01-10 00:39:47 -05:00
Dan Stillman
ea2feadbff Add spacing between icon and search field in Quick Format window 2018-01-08 01:08:44 -05:00
Dan Stillman
87cf336e22 Cancel active Quick Format search if another one starts
This fixes inconsistent results (#1349) from async searches finishing
out of order.

Also adds spinner when search is active
2018-01-08 01:08:28 -05:00
Dan Stillman
7d41047a9d Blacklist spurious warnings about word processor plugin update manifests 2018-01-08 00:02:47 -05:00
Dan Stillman
3f6ef7fb01 Allow "now" in Accessed field to use current time
Closes #1340
2018-01-05 03:41:08 -05:00
Dan Stillman
5847388862 Add schema update step to remove dc:isReplacedBy relations
These should've all been replaced with dc:replaces relations in a schema
update step, so any that exist were likely synced down from the API
(since fixed) and should be obsolete/redundant.
2018-01-05 02:53:27 -05:00
Dan Stillman
4ac368e052 Add "Publication" to top level of search condition drop-down 2018-01-04 22:59:23 -05:00
Dan Stillman
fdb9e20076 Clear parentKey change marker after save
Fixes #1325, Field editor closes during auto-sync of newly created
parent item
2018-01-04 19:10:41 -05:00
Adomas Venčkauskas
4b78ebcd72 Pause the document update timer during warning dialogs 2018-01-03 14:27:16 +02:00
Adomas Venčkauskas
47744e4ccd Simplify field handling
Don't use field.writeToDoc(), because it prevents from optimizing
libreoffice text writes
2018-01-03 14:27:16 +02:00
Adomas Venčkauskas
2ad0dc00da Add session.getItems in preparation for document collections 2018-01-03 14:27:16 +02:00
Adomas Venčkauskas
f8f403eca4 Display a refresh notice instead of bibliography when citing delayed 2018-01-03 14:27:16 +02:00
Adomas Venčkauskas
2827f70daa Option to delay updating citation in document.
The checkbox in doc prefs is hidden until an update takes 5s or longer
after which the user is prompted to enable delaying.
2018-01-03 14:27:16 +02:00
Adomas Venčkauskas
6d05c3472b Add more integration tests 2018-01-03 14:27:16 +02:00
Adomas Venčkauskas
5805c7e562 Integration refactor megacommit
- Removed obsolete logic for citation.properties.deleted, which is no
  longer set anywhere
- Introduced a bibliography class
- BibliographyEditInterface no longer edits state
- Fields._processFields() now has linear flow because:
- Exception handling for missing items and corrupt fields reworked to be
  handled in relevant Field classes, so that the flow remains linear
- Document modifying functions (i.e. Fields.updateDocument()) now only
  called in Zotero.Integration.Interface functions instead of all over
  the place
- document.setDocPrefs() now called after every execCommand() since
  the cost is trivial, but that simplifies a bunch of logic
- Misc code cleanup

TODO at some point in the future:
- Move Integration.(init/delete)Pipe out
- Decouple references and clarify functions in Integration.Fields and
  Integration.Session
2018-01-03 14:27:16 +02:00
Adomas Venčkauskas
f44d563a15 Add Zotero.Integration.Citation
- Moves a bunch of citation related processing from Integration.Session
- Replaces missing item handling with a function instead of exception
- Solves some really confusing flow issues in _processFields
2018-01-03 14:27:16 +02:00
Adomas Venčkauskas
a1acbd4038 Make current session globally available
Decoupling! Sessions can be instantiated without
Zotero.Integration.Interface
2018-01-03 14:27:16 +02:00
Adomas Venčkauskas
54b4ec6f5c Fix bugs for style-switching and footnote citations 2018-01-03 14:27:16 +02:00
Adomas Venčkauskas
4159c63a3b Refactor CitationEditInterface
This is the first really big change that detangles UI stuff from
directly changing state. io.citation is no longer tied to the citation
loaded in the session in any way and CitationEditInterface does not
write anything to session or document. All writes are handled in
Fields.addEditCitation()
2018-01-03 14:27:16 +02:00
Adomas Venčkauskas
41db61ecb9 Move citation unserialization
Using new es6 class syntax because getters/setters don't
retain `this` context with Zotero.extendClass and we're building
with at least FX45 on every platform now where the syntax is supported
2018-01-03 14:27:16 +02:00
Adomas Venčkauskas
52fd0d992d Add a wrapper class for citation and bibliography fields 2018-01-03 14:27:16 +02:00
Adomas Venčkauskas
41c93ab034 Rename Integration.Document to Integration.Interface 2018-01-03 14:27:16 +02:00
Adomas Venčkauskas
18e4e37b32 Remove integration plugin version checks 2018-01-03 14:27:16 +02:00
Adomas Venčkauskas
430f58d3c4 Moves utilities code away from Zotero.Integration 2018-01-03 14:27:16 +02:00
Dan Stillman
2baa537542 Don't close clicked field when clicking away from changed field
Fixes #1401

The item box badly wants to be redone in React.
2018-01-03 02:33:36 -05:00
Dan Stillman
374eefada1 Additional try/catch to fix NS_ERROR_UNEXPECTED from tree select
Follow-up to 7cd1439928
2018-01-02 20:20:01 -05:00
Dan Stillman
2bc44dddd1 Add attr()/text() to translator sandbox
The current document is automatically used (but can still be provided as
the first argument to avoid accidental bugs during the transition).

Closes #1323
Addresses zotero/translators#1277
2017-12-27 18:26:51 -05:00
Dan Stillman
5350931617 Update locales from Transifex 2017-12-27 17:13:51 -05:00
Dan Stillman
c4fde7ebbf Fix undo in notes to not restore changes from another note
Fixes #1398
2017-12-27 17:13:39 -05:00
Dan Stillman
5fcac10db9 Update locales from Transifex 2017-12-20 21:48:36 -05:00
Dan Stillman
a1c96f1db1 Fix deletion of tags across libraries
https://forums.zotero.org/discussion/comment/296384/#Comment_296384
2017-12-20 21:48:36 -05:00
Dan Stillman
7cd1439928 Hopefully fix intermittently broken items pane
https://forums.zotero.org/discussion/69226/papers-become-invisible-in-the-middle-pane

I can't reproduce this, but it seems like if the tree disappears (due to
a collection change?) while the tree is refreshing, the toggleSelect()
in the rememberSelection() call can fail and break the tree.
2017-12-18 02:55:24 -05:00
Dan Stillman
fa33eb72b2 Fix some UI issues with storage settings
- Enable/disable download mode drop-down for groups separately from user
  library
- Fixing hiding of terms of service message when Zotero storage isn't
  selected
2017-12-18 00:34:55 -05:00
Dan Stillman
6acf208a36 Disable "Check Database Integrity" button while running 2017-12-14 23:49:08 -05:00
Dan Stillman
a85ea18fd9 Update locales from Transifex 2017-12-14 23:31:50 -05:00
Dan Stillman
0ad439395e Log skipped libraries 2017-12-14 23:20:57 -05:00
Dan Stillman
1a46196080 Use numbered placeholders for new localized strings 2017-12-14 02:18:32 -05:00
Dan Stillman
aefeb1f613 Update locales from Transifex 2017-12-13 21:05:01 -05:00
Dan Stillman
05eb3a340c Fix cursor reset while typing in attachment notes
If you started typing just as auto-save was kicking in (i.e., 1 second
after stopping typing), any additional characters could be removed and
the cursor could jump back to the beginning of the note.

Fixes #1336, probably
2017-12-12 03:33:37 -05:00
Dan Stillman
8f5903f5eb Wrap URLs and DOIs in HTML output
Closes #1387
2017-12-11 23:24:43 -05:00
Dan Stillman
9ca40890a9 Update citeproc-js to 1.1.182 2017-12-11 17:34:17 -05:00
Dan Stillman
392687f9ee Tweak a couple font sizes in Sync -> Reset pane 2017-12-11 17:34:01 -05:00
Dan Stillman
341d4f169f Updates locales from Transifex and merge new English strings 2017-12-11 03:58:07 -05:00
Dan Stillman
6051c245b4 Fix auto-focusing of notes in external window 2017-12-11 02:39:22 -05:00
Dan Stillman
dcfaa5521e Don't show note in right-hand pane when editing in separate window
- When a child note is opened in a separate window, the parent window is
  selected. (This used to work but was broken in 5.0.)
- When a top-level note is opened (via double-click), the right-hand pane
  changes to show "Editing in separate window".
- If a note that's currently open in a separate window is clicked on,
  the right-hand pane shows "Editing in a separate window".
- If a note window is closed and the item is selected, the note editor
  reappears in the right-hand pane after the note is saved.

This will avoid unnecessary UI updates and data loss bugs from the two
notes getting out of sync (and is just generally cleaner).

Also:

- General cleanup of note display code
2017-12-11 02:25:05 -05:00
Dan Stillman
b2c9a42103 Prevent Add Item by Identifier button from flashing on textbox click
Nesting the panel in the toolbarbutton seems to cause the button to
appear as if it were clicked on any click/right-click in the textbox,
and I couldn't find a way to prevent that with event.stopPropagation().

Also cleans up this code in general
2017-12-10 23:16:01 -05:00
Dan Stillman
383f8d2219 Fix context-menu paste into Add Item by Identifier
The context menu was triggering onpopuphidden, which was clearing the
textbox.
2017-12-10 17:20:13 -05:00
Dan Stillman
df38f4ded7 Avoid upload retry loops
- Don't try uploading an object more than 5 times
- Don't retry a child item if the parent item failed too
2017-12-10 03:45:08 -05:00
Dan Stillman
c723e1ebe4 Select text in search bar when using Find menu option (or shortcut)
https://forums.zotero.org/discussion/69305
2017-12-10 02:23:39 -05:00
Dan Stillman
f353b7ca61 API-based "Restore to Online Library"
Restores the "Restore to Zotero Server" functionality, now using the
API:

1. Get all remote keys and send `DELETE` for any that don't exist
   locally.
2. Upload all local objects in full (non-patch) mode using only library
   version so that the remotes are overwritten.
3. Reset file sync history, causing all files to be uploaded (or, more
   likely, reassociated with existing remote files).

Since these are treated as regular updates on the server, they'll sync
down to other clients normally. Unsynced changes by other clients might
still trigger conflicts.

This and Reset File Sync History can also now be run on group libraries,
with a library selector in the Reset pane (which I forgot to do with
React).

The full sync option is now removed from the Reset pane, since there
wasn't ever really a reason to run it manually.

We should be able to reimplement Restore from Online Library (#1386)
using the inverse of this approach.

Closes #914
2017-12-08 00:42:03 -05:00
Dan Stillman
885ed6039f Add comment regarding strToDate()'s month handling in retrieveItem() 2017-12-08 00:42:03 -05:00
Dan Stillman
e01cb38c5d Avoid deprecation warning in recognizePDF 2017-12-08 00:42:03 -05:00
Dan Stillman
9a43b53ebe Show file path instead of "(null)" when installing style via file open
And fix deprecation warning from passing an nsIFile

(Also updates the Zotero.Styles.install() documentation to note that the
first parameter's `file` property can be a string path.)
2017-12-08 00:42:03 -05:00
Dan Stillman
045f1fbb7e Add utility functions for building drop-down library lists
A XUL one for the current use in Advanced Search and an HTML one for
future uses. Sets the value to libraryID and adds data attributes for
editable/filesEditable on the HTML one.
2017-12-08 00:42:03 -05:00
Dan Stillman
816fb52b76 Update locales from Transifex 2017-12-03 15:24:42 -05:00
Dan Stillman
4c337e5294 Show friendlier error on setDates() failure during file sync download 2017-12-02 04:14:47 -05:00
Dan Stillman
6941f96a5a Clear Windows read-only attribute when storing file 2017-12-02 04:11:35 -05:00
Dan Stillman
c3df3fcebf Fix "Access is denied" file sync error with read-only files
If the read-only file is set on a file in the 'storage' directory, it's
added to the ZIP for snapshot/WebDAV syncing, and when extracted the
setDates() call was failing. This clears the read-only attribute (and
system and hidden) when extracting all files.
2017-12-02 04:09:52 -05:00
Dan Stillman
2c47b6403d Missed image files for 2x grippy dimples from 640846961a 2017-12-02 01:51:35 -05:00
Dan Stillman
cdaf73b3d0 Fix sync error after resetting read-only group
If an item needed to be erased, it would fail with "Cannot edit item in
read-only library", because the deletion didn't skip the edit check.
2017-12-02 01:35:23 -05:00
Dan Stillman
640846961a 2x grippy dimple 2017-12-01 13:09:06 -05:00
Dan Stillman
fb74fe76b7 Update citeproc-js to 1.1.181 2017-12-01 02:10:05 -05:00
Dan Stillman
b397ee2281 Show sync error about embedded images in notes for attachment notes too 2017-11-30 23:51:36 -05:00
Adomas Venčkauskas
6970556dbd Clone feed items if translation returns no items. Closes #1377 2017-11-30 11:39:34 +02:00
Dan Stillman
9b9af65f8a Don't show Firefox profile access message on empty 'zotero' dir
But maybe do show in cases where it didn't show before, since we were
using exists(), which can return false for inaccessible directories.
2017-11-29 03:57:09 -05:00
Dan Stillman
e2eef779c5 Fix localized sorting of creator types
Don't just rely on "Author" being first
2017-11-29 00:28:05 -05:00
Dan Stillman
76b96a8b07 Fix error selecting item with item type without creator types
https://forums.zotero.org/discussion/69118/
2017-11-29 00:27:27 -05:00
Dan Stillman
45b0c3ab19 Update locales from Transifex 2017-11-27 20:48:24 -05:00
Dan Stillman
575968929c Skip auto-sync on stream notification if library version is up to date
This avoids an extra no-op sync after an upload when the notification
for the change comes back down from the streaming server.
2017-11-27 20:48:24 -05:00
Dan Stillman
baeb846b5c Simplify quick search handling in itemTreeView notify() 2017-11-27 20:48:24 -05:00
Dan Stillman
7bbb4a8e2d Avoid logged deprecation warning in external note editor 2017-11-27 19:56:14 -05:00
Dan Stillman
202192bc72 Restore use of beginUpdateBatch/endUpdateBatch in itemTreeView notify()
Not sure why this was disabled, but it prevents flashing of child items
when a child item is modified.
2017-11-27 19:56:14 -05:00
Dan Stillman
ae21b3113e Avoid unnecessary item map refreshes during sorting 2017-11-27 19:56:14 -05:00
Dan Stillman
a854ce9dce Filter stack in debug output when using debug.stackTrace pref 2017-11-27 19:56:14 -05:00
Dan Stillman
a70a517f7e Don't start transaction to clear search temp table
This might fix loss of item focus when editing a note in a search,
possibly starting with fbf2fbe0c6.
2017-11-27 19:56:14 -05:00
Adomas Venčkauskas
da387874a2 Temporarily restore double text setting in LibreOffice for footnotes
Regressions from 921b21c3. Footnotes in LibreOffice lose styling
2017-11-27 17:24:42 +02:00
Dan Stillman
8241149079 Fix sync error if item with no content type somehow was indexed
https://forums.zotero.org/discussion/68954/mimetype-is-undefined-error

Not sure how this could happen.
2017-11-22 04:22:08 -05:00
Dan Stillman
d45a9c22c5 Merge locales from Transifex 2017-11-22 03:18:32 -05:00
Dan Stillman
dfea8b5a6a Localize "Verify Server" 2017-11-22 03:15:37 -05:00
Dan Stillman
4a6922ba48 Check for lost legacy data directory after migration
The check only does anything if we're using the default location, and
otherwise if we migrate the wrong directory (say, because somebody
opened Standalone 4.0 before upgrading to 5.0) we won't prompt until the
next restart.
2017-11-22 03:15:37 -05:00
Adomas Venčkauskas
921b21c3e1 Remove the additional setText() call for libreoffice plugin
Possible since zotero/zotero-libreoffice-integration@2deea6bd46
2017-11-21 11:36:56 +02:00
Dan Stillman
88a6e4f79f Don't send inPublications=false in 'full' mode for group items 2017-11-20 16:27:45 -05:00
Dan Stillman
f0b7a212e5 Skip migration on error checking whether dataDir is on different drive 2017-11-20 11:38:15 -05:00
Dan Stillman
f546fbda99 Remove ellipses from toolbar button labels 2017-11-19 22:27:46 -05:00
Dan Stillman
d072c6233e Update locales from Transifex 2017-11-19 21:33:18 -05:00
Dan Stillman
10a5d8d02e Check for Firefox profile access at startup and show warning
f40b7ae6ac didn't help with people who've already upgraded, so check at
startup and show a warning if the profile is inaccessible until 1) the
profile has been accessed once or 2) the user checks "Don't show again"
in the warning dialog.

Also fix Zotero.Profile.getDefaultInProfilesDir() to properly throw an
error if it can't access the default directory.
2017-11-17 22:49:57 -05:00