Commit graph

8026 commits

Author SHA1 Message Date
Tom Najdek
962222a5f5 Mendeley import: Import annotations from matching files in groups
All annotations in all groups are fetched and hashes are compared to
detect annotations created on the same file while it was in a group
library. Annotations created by other users are filtered out.
2021-04-29 00:40:44 -04:00
Tom Najdek
d4d2080a31 Mendeley online importer 2021-04-29 00:40:44 -04:00
Martynas Bagdonas
8799de5284 Display embedded images in item reports
Fixes #2002
2021-04-28 13:05:43 +03:00
Martynas Bagdonas
65329dbf27 Improve popup actions when read-only or multiple annotations selected
Fixes #2046
2021-04-28 12:45:53 +03:00
Martynas Bagdonas
3c3c1ba88a Add "Show in Library" option to PDF reader file menu #2032 2021-04-27 12:50:13 +03:00
Martynas Bagdonas
09125277ac Focus note-editor faster 2021-04-27 11:01:23 +03:00
Martynas Bagdonas
0b219ed8a7 Prevent opening multiple PDFs in windows when shift isn't pressed 2021-04-26 22:49:52 +03:00
Martynas Bagdonas
e7eae06d8d Optimize contextPane notes list rendering 2021-04-26 22:08:11 +03:00
Dan Stillman
76d8818bed Don't count missing annotation values as changed if empty string passed
Similar to 0d377a1c4a, this fixes an unnecessary annotation reload and
loss of unsaved typing on auto-sync immediately after an annotation is
created.
2021-04-26 03:49:59 -04:00
Dan Stillman
0d377a1c4a Clear changed state of annotation after saving color change
This was resulting in an extra 'modify' event after each sync upload.
2021-04-24 19:49:08 -04:00
Dan Stillman
ea42789206 Avoid memory leaks from caching unique DB statements
Many DB statements that were being cached included embedded ids or temp
table names, so they would permanently use memory and never get reused.
During large imports, this could result in hundreds of megabytes of
extra memory usage.

This commit marks many more statements as `noCache`, adds `noCache`
support for column and value queries, adds a log line at DB shutdown in
source builds with the number of cached statements, and adds
Zotero.DB.getCachedStatements() for auditing of cached statements.

Addresses #1531
2021-04-22 02:53:29 -04:00
Dan Stillman
12045a7cf8 Add Zotero.isSourceBuild
This should be used sparingly, since it risks missing problems in
released builds.
2021-04-21 21:37:56 -04:00
Martynas Bagdonas
1eb888d026 Fix missing itemData when creating a note from annotations 2021-04-21 16:55:44 +03:00
Martynas Bagdonas
3de7b6c5ec Trim whitespace from highlights and comments when creating a note 2021-04-21 16:52:19 +03:00
Dan Stillman
7065dacee8 Move About pane strings and URLs to ZOTERO_CONFIG 2021-04-19 18:30:21 -04:00
Dan Stillman
749e28dc1f Fix alphabetical sorting of child attachments in new databases
Broken after global schema introduction
2021-04-18 01:44:39 -04:00
Martynas Bagdonas
633710c90b Improve note-editor:
- Allow to format citations inside note-editor
- Allow quickFormat dialog to display and pick already cited items, even if an item no longer exists
- Watch and automatically update citation itemData in metadata container and re-format citations in body in opened notes
- Reorganize note metadata container handling and improve resistance to accidentally breaking it in further development
- Improve performance when typing in larger notes
- Rewrite note saving mechanism to support automatic note changes and reduce complexity for further development
- Cleanup and comment some core parts or note-editor as the preparation for further development
- Prepopulate quickFormat dialog with the currently opened PDF parent #1984 (doesn't include the currently scrolled page label yet)
2021-04-16 17:55:05 +03:00
HollandeP
4ab6fe8c59 Made About page text visible across default Linux themes 2021-04-13 11:46:56 -04:00
Adomas Venčkauskas
ffab4d5243 Add an optional callback for Integration.initPipe(). Addresses #2031 2021-04-12 12:35:51 +03:00
Dan Stillman
52932b6eb0 Reduce auto-sync timeout to 3 seconds and optimize auto-sync process
Reduce timeout after an object change from 15 seconds to 3 seconds,
ecxept for individual notes. We should probably kick off an auto-sync
3 seconds after a note is blurred, but that's not implemented.

We also now skip file syncing and full-text content syncing altogether
unless an attachment has changed.

Reindexing an item now kicks off auto-sync, whereas before it didn't.
2021-04-06 05:09:42 -04:00
Adomas Venčkauskas
8bff4cff42 Fix the attempt to display the delay citation updates dialog breaking updates
Since 2b3669afd
2021-04-05 16:23:43 +03:00
Adomas Venčkauskas
a6fc2cb206 Fix embedded item citing (since 2e9e6554)
I don't know how this has not been reported yet
2021-04-05 16:23:43 +03:00
Martynas Bagdonas
bbb0f8bca4 Do not strip abstract from citation items data in notes 2021-04-05 09:00:28 +03:00
Martynas Bagdonas
c3a74a22d7 Update signature for _serializeAnnotations and return object instead 2021-04-03 11:08:57 +03:00
Martynas Bagdonas
20022a5d7c Properly check schema version in note editor tests 2021-04-02 21:57:35 +03:00
Martynas Bagdonas
415e644211 Upgrade note schema to v2:
- Automatically upgrade all editable v1 notes when note is being opened
- Pull `itemData` from existing citations and annotations into metadata container attribute `data-citation-items`
- Strip `abstract` from `itemData`
- Fill `citationItem` (in citations and annotations) with `itemData` when passing an HTML fragment for further processing in `note-editor`
- Keep only `uri`, `text`, `color`, `pageLabel`, `position`, `citationItem` annotation properties
2021-04-02 18:35:01 +03:00
Dan Stillman
26bf507fe2 Throw invalid-data error on unknown annotation type 2021-04-01 05:52:14 -04:00
Dan Stillman
6d212b1759 Update About window
- Add Zotero logo
- Move most acknowledgements to the website, where they can be more more
easily updated and more comprehensive
- Increase font size
- Center window on screen
2021-03-29 01:41:37 -04:00
Dan Stillman
5e9636089d Fix primary item types not appearing in More menu when not in MRU list
Regression in 1c366de54
2021-03-29 01:41:37 -04:00
Martynas Bagdonas
5e98b9c533 Select library tab when navigating to item from syncRunner popup 2021-03-25 20:56:02 +02:00
Martynas Bagdonas
f6fa81fdac Strip abstract field to save note space, set new itemData on export 2021-03-25 20:56:01 +02:00
Martynas Bagdonas
3536a384a9 Ensure attachment storage dir exists when saving pdf-reader state 2021-03-24 18:51:27 +02:00
Martynas Bagdonas
ec7251fd98 Fix tab toolbar button icon scaling on HiDPI 2021-03-23 18:04:38 +02:00
Martynas Bagdonas
3d204f75e9 Focus pdf-reader on tab selection if not focused contextPane note editor 2021-03-23 18:00:07 +02:00
Dan Stillman
f690c666d4 Don't make 'engine' required in Sync.Storage.Request
Follow-up to dc12a2c95a
2021-03-23 03:49:05 -04:00
Dan Stillman
f20263a50f Fix disambiguation-related hang in citeproc-js
This reverts the fix for
https://github.com/Juris-M/citeproc-js/issues/171 to fix the hang in
https://github.com/Juris-M/citeproc-js/issues/179
2021-03-23 03:31:22 -04:00
Dan Stillman
45968375d8 Return sooner in _checkForUpdatedFile() on SYNC_STATE_TO_UPLOAD
Before file.stat() instead of after, though it probably doesn't really
matter because the file is already open, which makes the stat call much
faster
2021-03-23 03:20:33 -04:00
Dan Stillman
dc12a2c95a Stop file upload queue after low-quota errors
We weren't making actual upload requests after a quota error if the file
would exceed the quota, but we were still going through all attachments
to upload, which in some cases involves making stat() calls. We now just
stop the queue immediately after a quota error or when starting a new
background sync after a previous quota error.

Closes #1255
2021-03-23 03:20:26 -04:00
Dan Stillman
c0eea4dadd Missed annotation property from 7889cd5d3 2021-03-21 15:53:12 -04:00
Dan Stillman
06b28194da Show annotation widget in conflict resolution window
This adds a very basic reimplementation of the annotation widget for use
in the CR window. It's not pixel-perfect, but it's close enough that
most people probably won't notice. We'll want to replace this with a
real version that's shared between the PDF reader and the rest of the
codebase.

Image annotations currently show an "[image not shown]" placeholder.
Showing images is tricky: we don't have the remote cache image, so if
the remote position has changed, we could only show an image by
rendering it from the file, and only if the file itself hasn't changed.
Just for a better user experience, we could use the local image as long
as the position and file are both the same, but that would take some
rejiggering of the CR window.

Tags aren't shown because they're not shown for CR at all, though that
could be changed in the future.
2021-03-21 14:36:43 -04:00
Dan Stillman
7889cd5d39 Fix item.clone() on annotation items 2021-03-21 14:36:42 -04:00
Martynas Bagdonas
9eb4fdb9cd Return back to notes list when a note is deleted 2021-03-19 12:41:07 +02:00
Martynas Bagdonas
ac750520e7 Use browser element instead of iframe to have access to History API 2021-03-18 18:19:09 +02:00
Martynas Bagdonas
f02b3464b8 Close note editor window when the note item is deleted 2021-03-18 10:05:21 +02:00
Martynas Bagdonas
4f71c2ab09 Improve PDF reader and note editor error handling 2021-03-18 10:03:36 +02:00
Martynas Bagdonas
1ede4240e0 Close all tabs and unregister tabs observer when destroying main window
#2005
2021-03-17 17:59:04 +02:00
Martynas Bagdonas
bf84e16002 Show crash popover on annotation saving failure
#2006
2021-03-17 13:43:48 +02:00
Martynas Bagdonas
1677e957cd Properly ignore deleted PDF attachments and close pdf-reader tabs
#2006
2021-03-17 13:43:48 +02:00
Martynas Bagdonas
8013a6ce97 Do not select the closest tab when closing a tab that is not selected 2021-03-17 13:41:21 +02:00
Dan Stillman
ae98488d2b Fix selectItem() on first items row (regression from d5334dc483) 2021-03-17 00:31:42 -04:00
Dan Stillman
d5334dc483 Fix item tree breakage if annotation is added while search is active 2021-03-17 00:14:43 -04:00
Martynas Bagdonas
bb2f1ced99 Position pdf-reader color popup by element instead of coordinates 2021-03-15 20:27:24 +02:00
Dan Stillman
ed70b404ad Tweak zoom labels in PDF reader context menu
"Automatic" → "Automatically Resize"
"Page Width" → "Zoom to Page Width"
2021-03-12 06:59:53 -05:00
Dan Stillman
76d504c564 Delete child annotations when deleting attachment
And fix a FK definition that could result in orphaned `items` rows
without `itemAnnotations` rows after an attachment was deleted.
2021-03-12 06:35:21 -05:00
Dan Stillman
0bc6b2ccc6 Transfer annotations when converting linked files to stored files
Previously, any annotations on the linked file were partially deleted,
leaving broken `items` rows without `itemAnnotations` rows.
2021-03-12 06:35:21 -05:00
Martynas Bagdonas
7b0bd05865 Add PDF page context menu, update editor & reader
Fixes #1978
2021-03-11 17:24:48 +02:00
Dan Stillman
98c101fd55 Notes pane: Change "Delete" to "Move to Trash" and remove confirm()
And remove unused _removeNote() function

We prompt to delete in the items list to distinguish from collection
removals, but it's arguably not necessary here, since you can always get
the item out of the trash. Undo would be nice, though.
2021-03-10 11:00:48 -05:00
Dan Stillman
24cc59cc7e Compress single-file HTML attachments and other text files
The test for ZIP uploads was having multiple files, but now snapshots
are all single files.
2021-03-10 09:37:52 -05:00
Dan Stillman
249d1aa0da Mendeley import: Add log lines for timing pdf-worker 2021-03-10 09:37:52 -05:00
Martynas Bagdonas
13cafe886e Rework note editor toolbar and related UI 2021-03-09 17:37:44 +02:00
Dan Stillman
824f67cb36 Mendeley import: Ignore empty text highlights 2021-03-08 10:58:15 -05:00
Dan Stillman
e4d7089506 Mendeley import: Fix blank PDF attachment MIME type from previous imports 2021-03-08 09:55:26 -05:00
Dan Stillman
5cdc088c49 Mendeley import: Import highlight and note annotations
Using new PDF worker functionality

If you've previously imported, you should be able to import again to get
annotations in the new PDF reader.

Details:

- Text highlights will be processed to extract text
- Rectangle highlights will turn into image annotations
- Any extracted-annotation notes created by previous improts won't be
  removed, but they're no longer created as long as the file exists.
2021-03-08 09:05:07 -05:00
Dan Stillman
c16432b217 Mendeley import: Set contentType for PDFs 2021-03-08 09:04:40 -05:00
Dan Stillman
3af4793f7f Don't log warning when opening a PDF for the first time
"Setting contains an invalid attachment page index ('null') -- discarding"

Fixes #1973
2021-03-07 02:30:21 -05:00
Martynas Bagdonas
6e49da1452 Add notes list context menu
Fixes #1979
2021-03-06 00:51:00 +02:00
Martynas Bagdonas
a1206e8901 Add Mendeley annotations processor 2021-03-05 21:26:49 +02:00
Martynas Bagdonas
8b1b2ee56a Fix ctrl+something default keyboard shortcuts 2021-03-04 17:02:10 +02:00
Dan Stillman
586a6f1ddf Fix time zone of note modification time in notes pane 2021-03-03 17:06:27 -05:00
Dan Stillman
bda52827da Reset note font size to 14 for new editor 2021-03-03 16:03:31 -05:00
Dan Stillman
49906c3fa0 Add "Export PDF" options to File menu
Quick implementation, but works on parent items or PDF attachments

Currently always includes annotations, but we'll want that to be an
option
2021-03-03 15:31:37 -05:00
Martynas Bagdonas
d893a02092 Properly check note schema version existence 2021-03-03 03:36:13 -05:00
Martynas Bagdonas
8755cf7338 Add missing schema version container 2021-03-03 03:36:13 -05:00
Dan Stillman
d98fabc5ab Add annotation type to schema 2021-03-03 03:33:52 -05:00
Dan Stillman
bffefe6644 Refer to PDF reader preview as a preview in the prefs 2021-03-03 00:59:27 -05:00
Dan Stillman
79e52beb38 Update text of outdated doc template warning 2021-03-02 18:12:25 -05:00
Dan Stillman
2fbb7d404a Fix visual bugs in progress bar and Quick Format dialog on macOS
Fix extra whitespace and misaligned Z icon

Update to e918b430b6 after some recent changes
2021-03-02 18:12:25 -05:00
Dan Stillman
f861249fce Tweak error for Add Note when beta features are disabled
And remove from localized strings
2021-03-02 18:12:25 -05:00
Dan Stillman
03ac62e71e Tweak PDF reader checkbox label 2021-03-02 18:12:25 -05:00
Dan Stillman
5fd7f097f3 Add "Learn more" link below PDF reader checkbox 2021-03-02 18:12:25 -05:00
Dan Stillman
94871dade6 Add Cancel button to prompt for PDF reader checkbox 2021-03-02 18:12:24 -05:00
Adomas Venčkauskas
607cb733da Adds a friendly date and subsequent note line for note insertion
Closes #66
2021-03-02 18:12:24 -05:00
Adomas Venčkauskas
91ac847bab Inform connector about PDF build to enable Add Note button in Google Docs 2021-03-02 18:12:24 -05:00
Adomas Venčkauskas
02fc8bf39f Add an error message when using the Add Note button with beta disabled
Closes #67
2021-03-02 18:12:24 -05:00
Martynas Bagdonas
3aa79f40d7 Populate PDF reader tab title immediately 2021-03-02 18:12:24 -05:00
Martynas Bagdonas
17abf87bcf Improve notes list UI:
- Show both sections even on search
- Add new note creation popups with an option to create from annotations
- Hide child notes section if no parent item
2021-03-02 18:12:24 -05:00
Dan Stillman
ca15e03701 Add commas to "[x] more…" count in notes pane 2021-03-02 18:12:24 -05:00
Dan Stillman
590b6b4a34 Adjust sizing of notes pane search bar and + buttons 2021-03-02 18:12:24 -05:00
Dan Stillman
ebf45a3232 Fix tab bar initialization on macOS after isPDFBuild change 2021-03-02 18:12:24 -05:00
Adomas Venčkauskas
e166a04876 Fix outdated template warning for Mac Word 2021-03-02 18:12:24 -05:00
Dan Stillman
7cd861a9e1 Change PDF reader beta pref to a general beta pref
The PDF reader pref is now "Use Zotero PDF reader and new note editor
(beta, My Library only)". Toggling the pref prompts to restart, and
Zotero.isPDFBuild -- which currently controls the PDF reader, new note
editor, and tabs UI -- is set based on that pref at startup.
2021-03-02 18:12:24 -05:00
Dan Stillman
557a75c90f Fix quotes in invalid-field error messages 2021-03-02 18:12:24 -05:00
Dan Stillman
1e8f2b94d4 Don't show annotation fields in advanced search for now
Since annotations don't show up as items yet
2021-03-02 18:12:24 -05:00
Martynas Bagdonas
7bdd34596d Improve notes list UI:
- Always show both sections
- Do not show empty sections when searching
- Collapse notes list when all tabs are closed
- Work around search input to take full width without breaking its stuff
2021-03-02 18:12:24 -05:00
Martynas Bagdonas
83109fc076 Fix and attach image annotation renderer 2021-03-02 18:12:24 -05:00
Dan Stillman
3e4ad18b2a Show friendlier date in PDF reader notes list
Using new Zotero.Date.toFriendlyDate() function

- Time if today
- Day of week if earlier this week
- Date with two-digit year otherwise

We could consider adding 'Yesterday' as well.
2021-03-02 18:12:24 -05:00
Dan Stillman
0c17829b27 Set isPDFBuild permanently to true
While the code can technically disable various things (e.g., tab bar) to
behave like 5.0, other things (e.g., word processor plugins) would be
tricky to do conditionally.
2021-03-02 18:12:24 -05:00
Dan Stillman
afa989c3a8 Use getExportableNote() for word processor note insertion 2021-03-02 18:12:24 -05:00
Dan Stillman
eb29b69d58 Use typographic quotes around highlights in notes 2021-03-02 18:12:24 -05:00
Dan Stillman
2c66133c7e Add "Add Note from Annotations" menu option on items
Shows as a menu option when there's a single PDF attachment with
annotations and as a submenu containing titles when there are multiple
(even if there's only one attachment that actually has annotations)

Also removes "Create Note from Annotations" on attachment items for now.
(It might make sense to add that back, though "Add" would be a little
weird for creating a sibling note, while using a different label would
be confusing.)
2021-03-02 18:12:24 -05:00
Dan Stillman
3e37d31a49 Sort notes reverse chronologically in note insertion search results 2021-03-02 18:12:24 -05:00
Martynas Bagdonas
5a6424e591 Limit notes count in contextPane notes list 2021-03-02 18:10:44 -05:00
Martynas Bagdonas
e409c8bc27 Improve navigation to specific PDF page 2021-03-02 18:10:44 -05:00
Martynas Bagdonas
4b622f074d Add function to export note with dataURI images 2021-03-02 18:10:44 -05:00
Dan Stillman
79950ecfe5 Exclude annotations from library export
We'll want to support this eventually, but for now they would just break
translation.
2021-03-02 18:10:44 -05:00
Martynas Bagdonas
b00325942a Improve reworked context pane:
- Show child notes at top of notes list, with separate headers for "Item
  Notes" and "All Notes"
- Fix "New Child Note" option
- Add parent item title above note editor when editing child note
- Cleanup

TODO:
- Search on parent item title for child notes
2021-03-02 18:10:44 -05:00
Dan Stillman
db0bd56688 Prevent possible error if schema check occurs before schema update
Not sure if this can happen, but if there's any way for the schema
integrity check to run before the global schema is updated, use -1 for
the annotation itemTypeID.
2021-03-02 18:10:44 -05:00
Dan Stillman
2d2062a63d Block saving of annotations and embedded images in groups
Both should already be disabled via the UI, but just in case there's
some way they sneak through
2021-03-02 18:10:44 -05:00
Adomas Venčkauskas
50dae87b07 Add a warning dialog for an outdated doc template 2021-03-02 18:10:44 -05:00
Adomas Venčkauskas
0fc9037a54 Add a version of citation dialog for citing notes 2021-03-02 18:10:44 -05:00
Dan Stillman
dba841770c Rework context pane in PDF reader
- Remove item pane tabs
- Show all notes in notes pane, showing the parent title where
  appropriate
- Show drop-down menu for "New Note" button in notes pane that allows
  creating standalone or child notes
- Add some temporary styling for notes in the notes pane

TODO:

- Show child notes at top of notes list, with separate headers for "Item
  Notes" and "All Notes"
- Fix "New Child Note" option
- Add parent item title above note editor when editing child note
- Search on parent item title for child notes
2021-03-02 18:10:44 -05:00
Dan Stillman
73ba5f9ffe Auto-sync after setting change 2021-03-02 18:10:44 -05:00
Martynas Bagdonas
f52c50f055 Use synced pageIndex 2021-03-02 18:10:44 -05:00
Dan Stillman
77ea19277d Remove embedded-image attachment under annotation in test 2021-03-02 18:10:44 -05:00
Dan Stillman
651aabc4dc Prevent setting parent item to non-regular item
Except for embedded-image attachments under notes and annotations under
attachments
2021-03-02 18:10:44 -05:00
Dan Stillman
8b57d0000b Don't orphan embedded-image attachments in schema integrity check! 2021-03-02 18:10:44 -05:00
Martynas Bagdonas
d0bdc45b9f Fix "Add to Note" for not yet created note 2021-03-02 18:10:44 -05:00
Martynas Bagdonas
aa836d77af Improve editor ir merge dialog 2021-03-02 18:10:44 -05:00
Martynas Bagdonas
a225c498ec Get rid of image natural dimensions 2021-03-02 18:10:44 -05:00
Dan Stillman
eb865e2625 setAttachmentPageIndex() → setAttachmentLastPageIndex() 2021-03-02 18:10:44 -05:00
Martynas Bagdonas
580d800286 Add support for PDF navigation to pageLabel 2021-03-02 18:10:44 -05:00
Martynas Bagdonas
16650b4ddf Improve note creation from annotations 2021-03-02 18:10:44 -05:00
Martynas Bagdonas
d23e0e30bb Fix annotation insertion 2021-03-02 18:10:44 -05:00
Martynas Bagdonas
7fa68690dd Do not insert citation for parentless PDF 2021-03-02 18:10:44 -05:00
Martynas Bagdonas
8d87eeae35 Capitalize acronyms 2021-03-02 18:10:44 -05:00
Martynas Bagdonas
1a4b2e8c7d Use isPDFBuild for editor switch, fix merge dialog 2021-03-02 18:10:44 -05:00
Dan Stillman
bb9237e82d Better comment for Zotero.Item.prototype._getPageIndexSettingKey() 2021-03-02 18:10:44 -05:00
Dan Stillman
c8ee3196cd Replace attachmentPageIndex with synced-setting-based mechanism
The page index needs to be per-person in group libraries, and it should
still work in read-only libraries, so it doesn't make sense to store it
on the item. This uses a synced setting in the user's library instead.
2021-03-02 18:10:44 -05:00
Dan Stillman
bb79686ce8 Add unused code to switch between the tab bar and the unified toolbar 2021-03-02 18:10:44 -05:00
Dan Stillman
28c1504cdd Use old toolbar if not a PDF build 2021-03-02 18:10:44 -05:00
Dan Stillman
e1c0f6c1a0 Rename zotero-note-editor submodule to note-editor 2021-03-02 18:10:42 -05:00
Dan Stillman
88dc6638fe Add Zotero.isPDFBuild feature flag
Currently limited to PDF opening (which is then dependant on
the beta.useInternalPDFReader pref)
2021-03-02 17:58:29 -05:00
Dan Stillman
10f41547aa Search for words separately in PDF reader notes pane 2021-03-02 17:58:29 -05:00
Dan Stillman
a1655e5643 Remove colon from "[n] notes:" line at top of notes panes 2021-03-02 17:58:29 -05:00
Martynas Bagdonas
224eb6bc84 Fix navigation to specific PDF page 2021-03-02 17:58:28 -05:00
Dan Stillman
f0816cc8fb Add temporary prefs checkbox to use internal PDF reader
And use when opening PDFs in My Library from items list and
zotero://open-pdf

This also adds "Zotero" to the main PDF reader pref, which will be the
real way to set this, but that option is hidden for now so that group
library items will still open with the configured reader.
2021-03-02 17:58:28 -05:00
Martynas Bagdonas
04c64fe9fc Use old editor in group libraries 2021-03-02 17:58:28 -05:00
Martynas Bagdonas
66bed2529c Fix various PDF reader and note editor issues 2021-03-02 17:58:28 -05:00
Dan Stillman
4a4a54da7b Clear annotation change state after save 2021-03-02 17:58:28 -05:00
Dan Stillman
9f954488c6 Delete cache image when image annotation position changes 2021-03-02 17:58:28 -05:00
Martynas Bagdonas
a19693fa7a Improve PDF importing and introduce rendering 2021-03-02 17:58:28 -05:00
Dan Stillman
89d9efdec7 Use seconds instead of ms for attachmentLastProcessedModificationTime 2021-03-02 17:58:28 -05:00
Dan Stillman
88f886cb30 Don't delete all annotations when updating attachment item 2021-03-02 17:58:28 -05:00
Dan Stillman
857b413df1 Don't add non-syncing items to sync delete log
Currently just external annotations
2021-03-02 17:58:28 -05:00
Dan Stillman
226fc90308 Switch to cache files for image annotations
Instead of embedded-image attachments

Create with Zotero.Annotations.saveCacheImage({ libraryID, key }, blob)
2021-03-02 17:58:28 -05:00
Dan Stillman
8c464a7a8b Add options argument for Zotero.File.createDirectoryIfMissingAsync()
To allow passing 'from' argument through to OS.File.makeDir()
2021-03-02 17:58:28 -05:00
Dan Stillman
2a203afb20 Redo Zotero.File.generateDataURI() without XPCOM and type sniffing
Now async and takes a contentType parameter
2021-03-02 17:58:28 -05:00
Martynas Bagdonas
c13ac32ad2 Use new attachment fields for annotations import 2021-03-02 17:58:28 -05:00
Dan Stillman
ebc0ca2462 Add annotationIsExternal property to annotations 2021-03-02 17:58:28 -05:00
Martynas Bagdonas
5266734ac9 Fix note editor tests 2021-03-02 17:58:28 -05:00
Martynas Bagdonas
232ffba2ab Improve note content insertion 2021-03-02 17:58:28 -05:00
Dan Stillman
404eaf13d0 Remove obsolete line from Zotero.Reader.open() 2021-03-02 17:58:28 -05:00
Martynas Bagdonas
a96c16a33d Fix resizing for all vertical panes on macOS 2021-03-02 17:58:28 -05:00
Adomas Venčkauskas
5bc41e250b Fix citing with automatic citation updates disabled 2021-03-02 17:58:28 -05:00
Dan Stillman
c73f51faef Always await callback in ZoteroPane.viewAttachment()
The recent change to sniff for PDFs when an attachment didn't have a
content type resulted in a ZoteroPane test failing, because a stub for
Zotero.launchFile() wouldn't be called by the time the viewAttachment()
promise resolved.
2021-03-02 17:58:28 -05:00
Dan Stillman
55c6de23ba Add "Include Annotations" checkbox to export options dialog
This changes the attachment saveFile() function in translators to be
async. In order for errors to be properly caught, translators will need
to be changed to make doExport() async and await on saveFile() calls.
(The translation architecture theoretically already allows doExport() to
be async.)
2021-03-02 17:58:28 -05:00
Dan Stillman
688298af7f Add Zotero.Item::isPDFAttachment()
Returns true for stored or linked PDFs
2021-03-02 17:58:28 -05:00
Dan Stillman
b1e324ddfb Fix marking of childItems as loaded for non-top-level items
Now that attachments and notes can have child items too
2021-03-02 17:58:28 -05:00
Dan Stillman
ea04c32c9d Fix running of tests after adding tab bar 2021-03-02 17:58:28 -05:00
Dan Stillman
5eeae576b4 Fix item pane tab appearance in PDF tab on Big Sur 2021-03-02 17:58:28 -05:00
Dan Stillman
9254bcbd03 Remove no-op line in ReaderInstance::_getAnnotation()
And clarify variable name for item vs. JSON
2021-03-02 17:58:28 -05:00
Dan Stillman
6ee3863e37 Fix clearing of annotation fields 2021-03-02 17:58:28 -05:00
Dan Stillman
69958d4356 Return Zotero.Item objects from getAnnotations() instead of ids
Returning ids mirrors getAttachments() and getNotes(), but I think we
want to move towards a world where those return actual objects, even if
we need async load calls on the returned objects.
2021-03-02 17:58:28 -05:00
Dan Stillman
60cb299f40 Fix uploading of embedded-image attachments 2021-03-02 17:58:28 -05:00
Martynas Bagdonas
51f760fe1a Improve the new UI:
- Revert `notesList` to standalone notes mode only
- Fix splitter styling on Windows
- Fix `contextPane` performance fixes
- Add a customizable throttle function to `Zotero.Utilities`
- Fix reader tab selection issues
- Improve error handling in the new editor
- Update pdf-reader and zotero-note-editor submodules
- Fix contextPane child notes list
- Properly notify editor about new images
- Fix note title and body snippet extraction
- Persist right-hand pane state when switching tab
- Hopefully fix two panes visible at the same time
2021-03-02 17:58:28 -05:00
Martynas Bagdonas
c6a196b999 Tab bar: Improve tab close button 2021-03-02 17:58:28 -05:00
Dan Stillman
0d4ad01201 Fix attachmentSyncedHash for embedded-image attachments 2021-03-02 17:58:28 -05:00
Dan Stillman
d44ab7efbb Fix attachmentSyncedModificationTime for embedded-image attachments 2021-03-02 17:58:28 -05:00
Martynas Bagdonas
62c6f561a6 Fix missing PDF attachment MIME type on opening 2021-03-02 17:58:27 -05:00
Dan Stillman
9a41dc69fe Add PDF attachment properties to Zotero.Item
- .attachmentLastProcessedModificationTime
- .attachmentPageIndex
2021-03-02 17:58:27 -05:00
Adomas Venčkauskas
901a10f0b6 Fix note citations being inserted in reverse order 2021-03-02 17:58:27 -05:00
Adomas Venčkauskas
50bef8dffe Optimization of note insertion API 2021-03-02 17:58:27 -05:00
Adomas Venčkauskas
06e1c404bd Changes to note insertion for MacWord 2021-03-02 17:58:27 -05:00
Martynas Bagdonas
45a3e96e68 Improve the new UI:
- Rollback all redundant changes made in the last few months
- Introduce `contextPane`
- Show child notes in the notes pane
- Fix splitter styling
- Various bug fixes
- Fix contextPane switching and states persistence
- Persist reader sidebar open/close state
- Fix bottom pane placeholder updating concurrency issues
- Fix toolbar placeholder width updating
- Display titles for split button
- Fix toolbar position when switching tabs
- Add PDF tab loading cover
- Improve notes and citations insertion
- Clean up and refactor code
- Fixes and cleanups to PDF reader
2021-03-02 17:54:48 -05:00
Dan Stillman
ab04468342 Item pane improvements for contextual/pinned modes
- Show item title at top of item pane in contextual mode not in a
  library tab
- Show "All Notes" at top of standalone notes pane
- Add background color when clicking notes in standalone notes list
- Clean up back buttons

Mode button is still a placeholder but uses emoji to show the mode
2021-03-02 17:43:10 -05:00
Martynas Bagdonas
bb5075e8b8 Experiment with the new item pane UI 2021-03-02 17:43:10 -05:00
Adomas Venčkauskas
36cc18e8cf Add root html tags if not present for note insertion 2021-03-02 17:43:10 -05:00
Dan Stillman
b2b9be381e Clean up temporary note slider 2021-03-02 17:43:10 -05:00
Martynas Bagdonas
8e3dc61070 Improve menubar for reader tab and window 2021-03-02 17:43:10 -05:00
Adomas Venčkauskas
51db52a5ea Changes for note insertion in non-GoogleDocs 2021-03-02 17:43:10 -05:00
Martynas Bagdonas
8709ddd657 Experiment with the new UI 2021-03-02 17:43:10 -05:00
Adomas Venčkauskas
52f3945aa4 Disable switching to the classic dialog when inserting a note 2021-03-02 17:43:10 -05:00
Dan Stillman
393807f487 Don't match attachments or annotations for titleCreatorYearNote search 2021-03-02 17:43:10 -05:00
Adomas Venčkauskas
6be2faa9c2 Fix note citation insertion breaking when citing the same item in a note 2021-03-02 17:43:10 -05:00
Adomas Venčkauskas
1401550230 Allow citing items in notes with only property 2021-03-02 17:43:10 -05:00
Dan Stillman
787641dc17 Fix display of item pane after pinned-note changes
Stacked mode is still broken
2021-03-02 17:43:10 -05:00
Adomas Venčkauskas
2e9e655479 Add ability to cite Zotero notes.
<span class=citation data-citation=serialized-citation-data/>
elements will automatically be converted to zotero citations
2021-03-02 17:43:09 -05:00
Adomas Venčkauskas
2b3669afd8 Consolidate Integration.Fields into Integration.Session 2021-03-02 17:43:09 -05:00
Martynas Bagdonas
3701b84116 Proof of concept note view in tab mode 2021-03-02 17:43:08 -05:00
Martynas Bagdonas
783f9c50d5 Tab bar: Fix tabs on Windows & Linux 2021-03-02 17:40:24 -05:00
Martynas Bagdonas
2f505862d7 Tab bar & Reader: Rewrite and connect everything 2021-03-02 17:40:24 -05:00
Martynas Bagdonas
43c55594c1 Store PDF state in .zotero-pdf-state 2021-03-02 17:40:24 -05:00
Martynas Bagdonas
76e77d4422 Improve PDF import/export 2021-03-02 17:40:24 -05:00
Dan Stillman
e99f76b40c Tab bar: Update styling on macOS 2021-03-02 17:40:24 -05:00
Dan Stillman
b5f7255da2 Tab bar: Close current tab with Cmd/Ctrl-w
And use keydown, not keypress, for moving between tabs
2021-03-02 17:40:24 -05:00
Dan Stillman
5b947a3896 Tab bar: Add comment for tab navigation in keypress handler 2021-03-02 17:39:39 -05:00
Dan Stillman
ead8c6bb45 Fix Everything search after annotations
And replace ancient 'annotation' search condition with
'annotationText'/'annotationComment'
2021-03-02 17:39:39 -05:00
Dan Stillman
2ca1618627 Tab bar: Change tab with Ctrl-Page-Up/Page-Down 2021-03-02 17:39:39 -05:00
Dan Stillman
a47d7e4d9c Fix possible selection bug after closing tab 2021-03-02 17:39:39 -05:00
Martynas Bagdonas
a89f7e8ec7 Improve PDF reader 2021-03-02 17:39:39 -05:00
Dan Stillman
875e9f674f Initial tab bar implementation 2021-03-02 17:39:37 -05:00
Dan Stillman
199619f40e Remove .noteSchemaVersion
This leaves item.note in place, rather than reverting all the
`getNote()` → `.note` changes. We can consider which we want to keep.
2021-03-02 17:36:05 -05:00
Dan Stillman
602e4c1e1f More annotation 'position' fixes 2021-03-02 17:36:05 -05:00
Dan Stillman
2536edb6ab Fix annotation 'position' handling and update additional sortIndex tests
Item.position has to be a string. It still gets passed to/from the PDF
reader as an object.
2021-03-02 17:36:05 -05:00
Dan Stillman
a0fb7a8583 Ignore remote noteSchemaVersion: 0 for items with no local note
E.g., embedded attachment notes with no note don't have an itemNotes row
and don't output noteSchemaVersion in their JSON, but they shouldn't
trigger a conflict
2021-03-02 17:36:05 -05:00
Dan Stillman
b2aee30410 Fix fromJSON() not importing parentItem for annotations 2021-03-02 17:36:05 -05:00
Dan Stillman
7ea14aa34e Add Zotero.Item::isStoredFileAttachment()
And replace most uses of isImportedAttachment(), which doesn't include
embedded-image attachments

There might not be much reason to keep isImportedAttachment() around.
2021-03-02 17:36:05 -05:00
Dan Stillman
bdec99f103 Update DB compatibility for annotations and noteSchemaVersion 2021-03-02 17:36:05 -05:00
Dan Stillman
b8eeb3abaa Drop decimal places from annotation sortIndex 2021-03-02 17:36:05 -05:00
Dan Stillman
acc3a70083 Remove SQL sort by parentItemID in Zotero.Sync.Data.Local.getUnsynced()
Now handled by Zotero.DataObjects.sortByParent()
2021-03-02 17:36:05 -05:00
Dan Stillman
8f5662ee6a Better error logging on sync engine upload failure 2021-03-02 17:36:05 -05:00
Dan Stillman
99b959285e Send Zotero-Schema-Version header with API requests
Set to the current global schema version
2021-03-02 17:36:05 -05:00
Dan Stillman
e133aab530 Annotation support in Item::fromJSON()/toJSON()
And clean up embedded-image handling
2021-03-02 17:36:05 -05:00
Dan Stillman
3c6ae0e656 Throw on missing parentItemID in Attachments.importEmbeddedImage() 2021-03-02 17:36:05 -05:00
Dan Stillman
a94323fc15 Sort multiple levels of items when generating API JSON
Added Zotero.DataObjects.sortByParent() to sort child items immediately
after their parent items. Zotero.DataObjects.sortByLevel(), which is
used for collections, sorts each level together, but that's less
appropriate for items where, e.g., an embedded-image attachment should
immediately follow the note that depends on it.
2021-03-02 17:36:05 -05:00
Dan Stillman
427a227370 Rename 'area' annotations to 'image' annotations 2021-03-02 17:36:05 -05:00
Martynas Bagdonas
05318b3021 Improve note editor and backups 2021-03-02 17:36:05 -05:00
Martynas Bagdonas
bce50e8e9c Add old note backup and preview 2021-03-02 17:36:05 -05:00
Martynas Bagdonas
4d8a9ed753 Replace all note local URIs at the first sync time 2021-03-02 17:36:05 -05:00
Martynas Bagdonas
af57565acf Reorganize and improve notes 2021-03-02 17:36:05 -05:00
Dan Stillman
078a18f7c0 Shorten sortIndex to 22 characters 2021-03-02 17:36:05 -05:00
Dan Stillman
63a416db40 Fix display of note titles on startup (regression from noteSchemaVersion) 2021-03-02 17:36:05 -05:00
Dan Stillman
4142f4b316 Replace occurrences of .getNote() with .note 2021-03-02 17:36:05 -05:00
Dan Stillman
ebc53a2bbc Add noteSchemaVersion, and replace item.getNote() with .note
```
var noteContents = item.note; // was item.getNote()
var schemaVersion = item.noteSchemaVersion;

item.setNote(contents) // default to Zotero.Notes.schemaVersion
item.setNote(contents, schemaVersion) - explicit version
```
2021-03-02 17:36:05 -05:00
Martynas Bagdonas
2543a695e8 Introduce PDF reader and note editor 2021-03-02 17:36:05 -05:00
Dan Stillman
cbeb5881e9 Hide annotations from items list 2021-03-02 17:36:05 -05:00
Dan Stillman
1c366de546 Initial annotation support 2021-03-02 17:36:05 -05:00
Dan Stillman
92ba393488 Don't clear item type set in constructor when loading primary data
Generally, don't clear the change state for primaryData when calling
loadPrimaryData() on an item that doesn't exist. Specifically, this
fixes an issue where calling loadPrimaryData() on a nonexistent item
after setting a libraryID and key would also clear any item type set in
the constructor. The same would apply for props set in the
Collection/Search constructors.
2021-03-02 17:36:05 -05:00
Dan Stillman
8026f744c5 Remove old HTML snapshot annotation support
Any data trapped in these tables hasn't been accessible in many years.
2021-03-02 17:36:04 -05:00
Dan Stillman
b54d4e78b7 Save createdByUserID and lastModifiedByUserID for group items 2021-03-02 17:36:04 -05:00
Dan Stillman
bb0a1dab13 Don't normalize primary data values in Item.setField()
Just enforce proper data types
2021-03-02 17:36:04 -05:00
Dan Stillman
cca5dc0314 Don't send unnecessary format=json in sync download requests 2021-03-02 17:36:04 -05:00
Dan Stillman
0941a14a65 Remove 'lastsync' assignment from Zotero.Collection constructor 2021-03-02 17:36:04 -05:00
Dan Stillman
b4522535e8 Add _hasFieldChanged()/_getChangedField/_getLatestField() to DataObject
Make it easier to use the new `_changedData` approach to object
modifications (currently used only for `tags` and `deleted`) where
changed data is stored in a separate object rather than in the primary
variables. _getLatestField() can be used to return either the new
unsaved value or the current saved value.
2021-03-02 17:36:04 -05:00
Dan Stillman
b2b909b42c Update submodules 2021-02-25 18:45:28 -05:00
Dan Stillman
33528d0f36 Fix "New Collection" button when My Publications is selected
Fixes #1955
2021-02-25 18:30:33 -05:00
Dan Stillman
ba7f7e3250
Merge pull request #1962 from fletcherhaz/context-menu
Add context menu for React textboxes to Create Parent Dialog
2021-02-25 17:57:09 -05:00
Dan Stillman
3ff92e2795 Add "More Information" button to invalid-data sync error 2021-02-25 16:08:54 -05:00
Fletcher Hazlehurst
8c00510835 Remove XUL overlay, but keep functionality. 2021-02-24 16:11:19 -07:00
Fletcher Hazlehurst
60d8beece3 Add context menu for React textboxes to Create Parent Dialog 2021-02-22 20:14:07 -07:00
Dan Stillman
31478d1fba Use multi-line editor for all title fields (e.g., Case Name)
https://forums.zotero.org/discussion/87286/suggestion-multi-line-case-name-display-in-info-panel
2021-02-09 17:05:50 -05:00
Dan Stillman
843bcbb68a Show invalid-data warning in sync button tooltip for group libraries
Instead of showing warning button on toolbar

Otherwise if one person in a group upgrades to a beta with new fields,
everyone in the group will get a warning, even if they're already on the
latest release version. In a personal library, the user can upgrade to
the same version.
2021-02-09 16:36:06 -05:00
Dan Stillman
b919143630 Skip conflict resolution for remote objects that can't be saved
E.g., if a local item has been modified in a way that conflicts with a
remote item that also has a new, unknown field, don't show the CR
window -- just add the item to the sync queue and show the
some-data-could-not-be-downloaded error.
2021-02-07 16:49:01 -05:00
Dan Stillman
254695f4b3 Skip extra sync download after some conflicts
If an upload fails with a 412, and then we download, and then we go to
upload but there was nothing to upload (e.g., because the remote version
was chosen or there was an error saving it), there's no reason to do a
download again after that.
2021-02-07 16:38:14 -05:00
Dan Stillman
61e29aa8eb Don't set non-working 'tooltiptext' in React Button
Follow-up to ba9c7ae739
2021-02-06 23:51:28 -05:00
Dan Stillman
e9e434cd2e Fix tooltips for tags box icons
Addresses #1947

If we're going to need this regularly we should just create a React
Image element that does this automatically for 'title'.
2021-02-06 23:51:11 -05:00
Dan Stillman
01819d68d1 Show tag selector Actions menu on mousedown, not click 2021-02-06 23:37:56 -05:00
Dan Stillman
ba9c7ae739 Fix 'title' attribute on React Button component
E.g., Actions menu in tag selector

Neither 'title' (HTML) nor 'tooltiptext' (XUL) works on HTML elements in
XUL documents, so add a mechanism to fake tooltip behavior and use it in
our Button component. This can be triggered by other React components if
necessary.

This is (mostly) mirroring Firefox tooltip behavior, which is a bit less
sophisicated than macOS behavior. If we end up using this for
everything, we can improve the behavior (e.g., start the delay when
entering the element, not when the mouse stops).

Fixes #1947
2021-02-06 23:37:32 -05:00
Dan Stillman
cf132fdd29 Log POST request body for server requests 2021-02-05 17:51:59 -05:00
fletcherhaz
55acf9a0c0
Do not send back saveSingleFile: true if saving a PDF snapshot. (#1950) 2021-02-05 15:31:34 -05:00