Commit graph

8026 commits

Author SHA1 Message Date
Martynas Bagdonas
cf344335ed Use item display title for PDF reader tabs 2021-05-25 19:48:35 +03:00
Martynas Bagdonas
bb40928720 Localize formatted citations in notes
Fixes #2040
2021-05-25 13:07:24 +03:00
Martynas Bagdonas
faec1f1dee Provide filename for recognizer server 2021-05-25 10:30:54 +03:00
Martynas Bagdonas
b2acb5e339 Fix missing title in PDF reader standalone window 2021-05-21 17:20:12 +03:00
Martynas Bagdonas
eb085f2bbe Reorganize View menu, add checkmarks, introduce Go menu
Fixes #2037
Fixes #1997
2021-05-21 17:20:11 +03:00
Martynas Bagdonas
39b56a66dc Fix blank standalone PDF reader window issue 2021-05-21 15:44:38 +03:00
Martynas Bagdonas
a7c6979e75 Add space between items in multi-item citation 2021-05-21 15:24:56 +03:00
Dan Stillman
cdf1f3c856 Mendeley import: Use bytes for path/filename limits on Windows
It's not totally clear how it's calculated, but it doesn't seem to be
just characters.

And make the path limit 255, which is the File Explorer limit, even if
the filesystem can allow up to 260.
2021-05-21 03:02:41 -04:00
Abe Jellinek
06660d04f0
Scaffold: Update year and add spacing in template (#2066) 2021-05-21 00:53:19 -04:00
Dan Stillman
bec42fe2a5 Handle multibyte characters in Zotero.File.truncateFileName()
Filesystems care about byte length, not character length, so treat
maxLength as the byte length limit and truncate accordingly.

This will also now remove entire emoji characters without corrupting
them.
2021-05-20 19:25:57 -04:00
Dan Stillman
b511e452a8 Mendeley import: Only limit paths to 260 characters on Windows 2021-05-20 19:25:15 -04:00
Tom Najdek
7582147dd5
Mendeley Import: Prevent tmp path > 260 chars 2021-05-20 12:53:34 +02:00
Tom Najdek
63205a73e8
Improve truncateFileName logic for edge cases 2021-05-20 12:41:49 +02:00
Tom Najdek
89d81cee41
Mendeley import: Sanitize names of fetched files 2021-05-20 12:41:44 +02:00
Tom Najdek
faf094f0aa
Mendeley import: shorten tmp file path 2021-05-20 11:18:23 +02:00
Martynas Bagdonas
5497598c63 Localize pdf-reader and note-editor 2021-05-20 10:49:03 +03:00
Dan Stillman
861d5787d8 Mendeley online import: Fix error if downloaded file doesn't exist
If a file attached to an item with a URL wasn't found in the temp
directory, it would trigger an error that stopped the sync. (I'm not
sure how a file wouldn't exist.)
2021-05-20 03:15:15 -04:00
J. Ryan Stinnett
d3d2212a0f Start tab title tooltips on mousemove
By changing to `mousemove` to start the tab title tooltip, the behavior matches
applications like Firefox more closely: you can always get the latest tooltip
back after changing state by nudging the mouse (without having to exit and
re-enter anything).
2021-05-18 14:43:09 +01:00
J. Ryan Stinnett
b27ac6649e Hide tab title tooltips whenever the tab bar changes
This hides tooltips (such as the tab title tooltip) whenever the tab bar state
changes, such as when adding or removing a tab, to ensure we don't leave any
tooltips behind that no longer match reality.

Fixes https://github.com/zotero/zotero/issues/2060
2021-05-18 14:42:56 +01:00
J. Ryan Stinnett
5b7e01dff6 Rename tab event handlers to clarify target 2021-05-18 13:31:32 +01:00
Dan Stillman
e7f93cb548 Fix appearance of error report text in dark mode on Linux
Closes #2021
2021-05-16 05:08:44 -04:00
Dan Stillman
3815197b92 Don't allow site-specific Quick Copy setting without domain
And remove existing blank entry in schema update step

Closes #2053
2021-05-16 05:08:44 -04:00
Dan Stillman
3880687d2b
Merge pull request #2039 from HollandeP/master
Made About page text visible across default Linux themes
2021-05-16 04:15:17 -04:00
Dan Stillman
2799dfef5b Clarify sync-to-empty-database warning
Closes #1959
2021-05-15 15:09:33 -04:00
Dan Stillman
3aa355a8b4 Add Zotero.DB.path property 2021-05-15 15:09:33 -04:00
Dan Stillman
146e1af189 Update submodules 2021-05-14 22:44:33 -04:00
Dan Stillman
6834c6062b Fix auto-sync timeout in notes
Regression in 7ace5ea29
2021-05-14 05:13:19 -04:00
Dan Stillman
53f53779a3 Mendeley import: Don't show local import option
It's still possible to trigger a local import from a 1.18 database by
selecting the .sqlite file directly from the file option, but don't
offer it in the dialog.
2021-05-14 04:27:19 -04:00
Dan Stillman
7e23cfef96 Fix invalid imported Mendeley annotation color
After fix in 808b71832e

And require annotation colors to be 6-char hex colors going forward
2021-05-14 04:20:50 -04:00
Dan Stillman
f925f0e402 Don't cache SQL statements during initialization
From executeSQLFile()
2021-05-14 04:20:50 -04:00
Dan Stillman
d2b36c4218 Deduplicate libraryIDs passed to setSyncTimeout() for an auto-sync 2021-05-14 04:20:50 -04:00
Dan Stillman
5eb6935842 Deduplicate queued sync options
E.g., if a sync is ongoing and there are multiple item saves that would
trigger auto-sync with the same options, only queue a single sync.

7ace5ea29e fixed the main cause of this, but in case some other
saves end up happening during a sync, this will prevent them from
triggering multiple sync loops with the same options.
2021-05-14 04:20:36 -04:00
Dan Stillman
7ace5ea29e Fix unnecessary sync looping after downloading items
An extra sync loop would be performed for every object downloaded, so a
download to an empty database could result in a huge number of
unnecessary loops. This was a regression from 52932b6eb, which started
queuing auto-syncs while a sync was in progress. The fix here is to skip
auto-sync for all objects saved from a sync download.

There are two new mechanisms involved:

- Event-level notifier options that get passed to passed to notify() at
  the top level of extraData rather than being included with every
  object (e.g., because `skipAutoSync` should apply to an entire save
  transaction)
- The ability to pass event-level notifier options when initializing
  a Zotero.Notifier.Queue, such as the one used for sync downloads
2021-05-14 03:49:26 -04:00
Dan Stillman
5b0f02a12b Trigger auto-sync after item deletion
It looks like this has been broken for years.
2021-05-14 03:49:26 -04:00
Dan Stillman
9a47f74787 Specify note auto-sync timeout in save call, not in sync event listener
This will allow other operations to specify a longer timeout.
2021-05-14 03:49:26 -04:00
Tom Najdek
808b71832e Fix rgb to hex color conversion 2021-05-13 15:52:54 -04:00
Tom Najdek
833ee10516 Mendeley import: Switch to authorisation code flow via proxy 2021-05-10 14:32:02 -04:00
Dan Stillman
d3a78982f0 Add attr()/text() to search translators 2021-05-07 14:57:55 -04:00
Dan Stillman
d27b622f9f Mendeley import: Fill in Publication field on existing items if empty
It was skipped in online imports before eef0fc6fa8.
2021-05-06 15:59:46 -04:00
Dan Stillman
eef0fc6fa8 Mendeley online import: Fix "Journal" → "Publication" mapping 2021-05-06 15:46:35 -04:00
Dan Stillman
6d5b00e94c Fix descendant collections not skipping delete log
If a collection was deleted with `skipDeleteLog: true`, descendant
collections still ended up in the delete log, which could cause
constant "Reset Group and Sync" prompts.

https://forums.zotero.org/discussion/89485/warning-when-syncing-group-library
2021-05-06 03:34:09 -04:00
J. Ryan Stinnett
74b9604c7b Show full tab title on hover
Fixes https://github.com/zotero/zotero/issues/2033
2021-05-05 01:20:42 -04:00
J. Ryan Stinnett
12b100fd4b Hide tab bar for single tab case on Windows and Linux
This hides the tab bar on Windows and Linux, where it currently takes up a lot
of vertical space below the menu bar. On macOS, the tab bar remains always shown
since we don't have the menu bar and can move tabs in the window there.

Fixes https://github.com/zotero/zotero/issues/2019
2021-05-03 17:24:05 -04:00
Martynas Bagdonas
a74c012b65 Improve contextPane notes list performance 2021-05-03 21:41:41 +03:00
Dan Stillman
48d5ec240e Mendeley import: Tweak intro text 2021-04-30 07:14:19 -04:00
Dan Stillman
3877563abe Mendeley import: Clear cookies when closing OAuth window 2021-04-30 07:10:58 -04:00
Dan Stillman
57fbe61f93 Use notifier queue during Mendeley import
This dramatically speeds up Mendeley imports by avoiding UI updates.
Regular imports in fileInterface have done this for a while, but the
Mendeley importer used a fake translation object that didn't use the
passed queue.

After this change, a 10,000-item import goes from 9m30s to 2m45s, a 71%
decrease.
2021-04-29 00:46:18 -04:00
Dan Stillman
bb75fcd784 Fix support link in encrypted Mendeley database message
It started being flattened at some point.
2021-04-29 00:46:18 -04:00
Dan Stillman
3032cc6a02 Increase default basicViewer height to 700
Though this is currently persisted, so it stops being relevant as soon
as one instance of the basic viewer is resized, which maybe we don't
want.
2021-04-29 00:45:52 -04:00
Dan Stillman
d35719d0e8 Mendeley online import tweaks
- Add "(online import)" and "(local import)" next to "Mendeley Referance
  Manager" and "Mendeley Desktop", respectively
- Adjust size of OAuth window
- Use bound parameter instead of string literal for Fx78 compatibility
2021-04-29 00:45:23 -04:00
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