Commit graph

11767 commits

Author SHA1 Message Date
Abe Jellinek
95550403a7 Register CookieSandbox observer at startup (#5358) 2025-06-25 23:58:30 -04:00
Abe Jellinek
12f344e03d Fix all cookies being lost during remote translation (#5358) 2025-06-25 23:58:15 -04:00
Abe Jellinek
556b571da2 RemoteTranslate: Fix request methods not sending cookies 2025-06-25 23:57:33 -04:00
Abe Jellinek
6a611179d1 Undo Scholaread changes to user.js (#5313)
And any other fileHandler changes
2025-06-21 12:13:26 -04:00
Dan Stillman
7dc8d13543 Merge new English strings 2025-06-21 00:31:25 -04:00
abaevbog
3aef6cddcb
qf: fix breakage with unloaded tab (#5347)
Properly load all item data for items opened in tabs
to account for the fact that they can belong to
libraries that are not yet loaded.

Similar fix as in 4421de63de
2025-06-20 00:19:17 -04:00
Tom Najdek
4cc52ec928 File renaming: Add pascal case. Fix unicode handling. (#4876) 2025-06-19 02:19:59 -04:00
Dan Stillman
0d5d43f930 Don't use Firefox user agent for files.zotero.net requests 2025-06-19 02:19:53 -04:00
Tom Najdek
7ffd1d4504 Unhide "title" column on "Restore Column Order" (#5299)
This actually checks for a "primary" column, so if an extension hides the "title" column but provides its own "primary" column, the "title" column remains hidden.
2025-06-19 02:18:24 -04:00
Adomas Venčkauskas
1c2ec3fd75 Fix Google Docs allowing to select note style (endnotes)
Report: https://forums.zotero.org/discussion/123928/zotero-citations-not-appearing-as-endnotes-despite-selected-setting
2025-06-19 02:16:53 -04:00
Abe Jellinek
7eeb666894 Skip invalid relative path when changing LABD (#5239) 2025-06-19 02:16:36 -04:00
Abe Jellinek
bd451196b0 Tags box: Disable Remove All Tags when not editable 2025-06-19 02:14:32 -04:00
abaevbog
427e8daaf9 add string for note-editor a11y link popup message (#5205)
String read out by screen readers when the link popup
appears instructing users to navigate it.

Addresses: #5199
2025-06-19 02:14:21 -04:00
abaevbog
a7e1035b77 a11y: clear aria-expanded on empty itemTree rows (#5201)
Per https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Reference/Attributes/aria-expanded#treeitems
only treeitems that contain children should have
the aria-expanded attribute. This is instead of having
aria-expanded="false" on empty regular items or standalone
attachments, which erroneously indicates to screen readers
that the row has children but is collapsed.

Fixes: #5200
2025-06-19 02:13:58 -04:00
Dan Stillman
ec59f43a68 Mark locally missing files marked for upload for download instead
Z7 removed an `OS.File.open()` in `_checkForUpdatedFiles()` that would
throw on missing files and cause them to be marked for download in a
`catch`.

This likely caused the fix for #1753 not to work in Z7.
2025-06-19 02:13:02 -04:00
abaevbog
76b8556c16 runJS: better message if nothing is returned (#5181)
Display "===>undefined<=== (completed successfully)" instead
of current "===>undefined<=== (undefined)", which is a bit misleading.

Fixes: #5180
2025-06-19 02:05:23 -04:00
abaevbog
79feeaecb1 load all tabs items' data when restoring tab state (#5193)
This fixes the breakage in tabs menu on initial load
if one of the tab is for an item from not-loaded group.
Now, every component relying on tab items (e.g. tabs menu)
can just assume that items are all loaded.

Fixes: #5192
2025-06-19 02:05:05 -04:00
abaevbog
bfe28b5918 include mru types in main list of "New Item" menu (#5195)
Per https://forums.zotero.org/discussion/123269/bad-practice-in-new-item-drop-down-menu
2025-06-19 01:57:01 -04:00
Tom Najdek
730d3b1f34 File renaming: add support for counting creators (#5175)
Also extends the templating engine to support inequality comparisons.
2025-06-19 01:34:55 -04:00
abaevbog
9fb961fd63 transform menu: preserve cases in capitalize title (#5174)
Do not lowercase the entire title before capitalizing
the first letter of each word to preserve abbreviations
or spelling of unusual words (e.g. 3D or iPhone).

Fixes: #5165
2025-06-19 01:33:56 -04:00
Abe Jellinek
ea4f5fee60 FileHandlers: Fix unintended fallthrough in switch
May have been responsible for this:
https://forums.zotero.org/discussion/comment/483004#Comment_483004
2025-06-19 01:19:19 -04:00
Tom Najdek
e700f5ca98 Improve layout of the buttons in the locate manager (#5139) 2025-06-19 01:18:42 -04:00
Dan Stillman
ebecf0f4cc Indicate Troubleshooting Mode in error reports
And show plugins as disabled

Closes #4345
2025-06-19 01:06:47 -04:00
windingwind
9129625dd0 Fix plugin scope not loaded if plugin is disabled when starting Zotero (#5129) 2025-06-19 01:06:09 -04:00
Dan Stillman
a2b7d0674e Fix WebDAV progress updates for Zotero.HTTP.download() 2025-06-19 01:05:58 -04:00
Dan Stillman
e6f15d006f Remove hack for Issue search condition in French locale
https://forums.zotero.org/discussion/comment/473643/#Comment_473643
2025-06-19 01:02:19 -04:00
abaevbog
bb79e10851 Fix unintentional title transfer between attachments on item switch (#5245)
Also added similar test for item details table

Fixes #5244
2025-06-19 01:02:19 -04:00
Adomas Ven
cd856efef8
Connector attachment saving server changes for 7.0 (#5345) 2025-06-19 01:01:52 -04:00
Abe Jellinek
1dad1ae0f8 Accept length-7 sortIndexes for snapshots (#5209) 2025-06-11 09:58:55 -04:00
Dan Stillman
bbf4692b99 Don't log entire byte array when downloading files 2025-03-15 23:07:17 -04:00
Dan Stillman
56f182f816 Fix file downloads timing out after 30 seconds
We switched file downloads to use XHR to fix downloads failing via
authenticated proxies in fx115+, but that made them subject to our
default 30-second timeout in `Zotero.HTTP.request()`. That timeout uses
the XHR `timeout` property, which applies to the whole request, even if
data is actively being downloaded. As a result, file downloads would
fail for people downloading large files or on very slow connections.

This implements manual connect and inactivity timeouts when using
`Zotero.HTTP.download()`. Currently, these both use `options.timeout`,
or the default 30 seconds, but we could probably take separate options
and have lower defaults now that they no longer apply to the whole
request.
2025-03-15 22:54:35 -04:00
Dan Stillman
601358f24b Fix very slow purging of itemDataValues at startup in large databases
When an item is erased (removed from the trash or cleaned up from a
feed), we set a flag to purge values in `itemDataValues` on the next
startup, with this query:

DELETE FROM itemDataValues WHERE valueID NOT IN (SELECT valueID FROM itemData);

For some people, that query was incredibly slow and would result in
Zotero intermittently hanging on "Loading items…" for a long time at
startup. It's possible this is mostly limited to people who subscribe to
high-volume feeds and have a lot of item churn. One affected person had
>900K values in `itemDataValues` despite having only 20K items.

It turns out the slow query is due to the foreign-key constraint on
`itemData(valueID)` that references`itemDataValues(valueID)`. SQLite is
checking every row being deleted from `itemDataValues` against
`itemData`, even though the query is specifically removing rows that
don't exist in `itemData`! For the 900K-value DB, disabling foreign-key
checks causes the `DELETE` query to take 25 seconds instead of...some
much longer time that I didn't wait for.

We already had an `executeTransaction()` flag, `disableForeignKeys`, to
temporarily disable foreign-key checks, but it didn't do so in a way
that was safe for post-initialization usage -- a write query outside of
a transaction could've run between the transaction commit and
foreign-key checks being re-enabled. This commit changes it to properly
block all other queries unless they include an `ignoreDBLock` option,
meaning that queries within the function passed to the transaction need
to include that option. (And since that's not realistic for the couple
other uses of `disableForeignKeys` -- one for a test and one in code
that almost certainly hasn't been run by anyone in 15 years -- those now
just run `PRAGMA foreign_keys=OFF|ON` explicitly, leaving this as the
only current use.)
2025-03-12 23:25:32 -04:00
PChemGuy
f4b531e657 Sort strings naturally or alphabetically (#5075)
Hidden setting. If true, use natural collection sorting matching the current behavior. If false, use conventional alphabetic sorting.
2025-03-12 23:25:32 -04:00
Abe Jellinek
096cc2e27b renderItemTitle(): Create <span> when inverting style
Creating an <i> with a style attribute that *removes* italics is just
too confusing.
2025-03-12 23:25:32 -04:00
Abe Jellinek
5ae1986f79 renderItemTitle(): Fix nested tag handling when rendering to string
Need to exit the loop regardless of whether we're rendering actual
nodes.

Fixes #5082
2025-03-12 23:25:32 -04:00
abaevbog
b250aed79d always trim editableText from itemBox on blur (#5081)
So that whitespaces are removed even if the itemBox
does not refresh.

Fixes: #5080
2025-03-12 23:25:32 -04:00
Dan Stillman
0542010659 Fix Zotero.HTTP.download() for fx115
Blob#bytes() was introduced in fx128.
2025-03-12 23:25:31 -04:00
Dan Stillman
4b78b2c130 Replace Zotero.Utilities.Internal.saveURI() with Zotero.HTTP.download()
Adds a new function, Zotero.HTTP.download(), that uses
Zotero.HTTP.request(). This fixes downloads via authenticated proxies in
Zotero 7 and gives us other request() functionality (e.g., 5xx retrying)
for free.

The downside is that this is probably less efficient, potentially
loading large downloads in memory. We should create a replacement for
request() based on fetch() that supports getting the body as a
ReadableStream.

Fixes #5062
2025-03-12 23:09:47 -04:00
Adomas Venčkauskas
051280fc43 Update ScienceDirect cf captcha selector 2025-02-19 02:03:27 -05:00
Abe Jellinek
264f55545a Fix faulty siblings-of-type check in setAutoAttachmentTitle() (#5045) 2025-02-19 02:03:26 -05:00
Dan Stillman
184671f919 Fix sync not downloading queued objects on first sync of session
`firstInSession` wasn't being properly set, so previously failed data
objects weren't being retried until a manual sync. Local files also
weren't being scanned for changes for three hours, but that's probably
better in the age of DB-stored annotations, so leave that off for now
and address properly in #5025.
2025-02-19 02:03:26 -05:00
Dan Stillman
24c7f146b3 Don't open new copies of runJS/scaffold/csledit
Possible we'll get complaints about no longer being able to open
multiple copies of at least runJS and csledit, and we can reconsider if
so, but reopening the existing window is certainly the intended
behavior.
2025-02-19 02:03:26 -05:00
Abe Jellinek
707c71506f Check editability based on tab when adding attachments (#4936)
And make `get[Selected/Sorted]Items()` and `canEdit[Library/Files]()` tab-aware
2025-02-19 02:03:26 -05:00
Abe Jellinek
569bd1ffae Item box: Fix missing Copy/Paste menuitems on URL fields (#5001) 2025-02-19 02:03:26 -05:00
Dan Stillman
62d46d337a Fix selectItems() not selecting non-top-level item in trash
https://forums.zotero.org/discussion/comment/484380/#Comment_484380

Adds `Zotero.Item#isInTrash()` that returns true if the item or any of
its ancestors is in the trash (i.e., `.deleted == true`)
2025-02-19 02:03:26 -05:00
Dan Stillman
ce0f7c0378 Use commas in file size in over-quota error 2025-02-19 02:03:25 -05:00
Dan Stillman
b4bf86915b Item#fromJSON(): Don't process any Extra rows in strict mode
And enable migration of Extra rows to valid fields in non-strict mode,
but since that's only used by translators now, that probably won't do
anything

Fixes #3422
2025-02-19 02:03:25 -05:00
Dan Stillman
8804effba4 Don't auto-select item after sync on upload error
Bug from 2017
2025-02-19 02:03:25 -05:00
Abe Jellinek
006a787272 Add key to Advanced Search menuitem
Fixes #4978
2025-02-19 02:03:25 -05:00
Dan Stillman
0424faee42 Unset Mozilla environment variables when launching files and URLs (#4983)
Fixes #4981
2025-02-19 02:03:25 -05:00