Commit graph

9497 commits

Author SHA1 Message Date
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
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
b1b9dcf233 Update version 2017-12-20 21:48:36 -05:00
Dan Stillman
22d3fbbc9b Update version 2017-12-19 15:59:45 -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
7d98f04bd8 Update version 2017-12-15 02:29:32 -05:00
Dan Stillman
545c800459 Open /start on first-run instead of /start_standalone
Closes #1389
2017-12-15 00:14:52 -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
90d948a6bc Update submodules 2017-12-13 21:33:00 -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
c17695939c Update Node packages 2017-12-10 03:45:07 -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
da1dd75265 Don't compress uploaded data in tests
It would be better to handle this automatically in Sinon, but as it is
uploads are compressed if they're bigger than an arbitrary limit, which
can break tests unexpectedly if they check req.requestBody.
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
36436d0b43 Update version 2017-12-03 18:05:31 -05:00