Commit graph

1186 commits

Author SHA1 Message Date
Dan Stillman
d546caca4c Don't relate book sections to each other when creating from book
Fixes #2757
2022-08-13 05:46:04 -04:00
Dan Stillman
344a10421a Fix copying of standalone attachments between libraries
Regression in f684984b07 (maybe a race condition)
2022-08-13 02:04:07 -04:00
Dan Stillman
c90f8415b3 Improve test for event-title substitution
And add comments

Follow-up to 20d0f103f
2022-08-11 03:57:25 -04:00
Dan Stillman
ebacb83563 Reset Zotero.locale to 'en-US' after cite test 2022-08-11 03:57:20 -04:00
Dan Stillman
7eab91a160 Automatically substitute event-title for event in styles
Stopgap until styles are updated in citation-style-language/styles#6151
2022-08-11 03:57:15 -04:00
Abe Jellinek
df5bde79e5 Add test for 87455d 2022-08-11 03:57:09 -04:00
Abe Jellinek
1f9e518581 Duplicates Merge: Preserve embedded annotations (#2728) 2022-08-11 03:52:40 -04:00
Martynas Bagdonas
d595b3f195 Freeze note schema version to 8
We can do it because it was only used to create a note from annotations.

No need to update schema version in Zotero client, unless using new
features when creating a note from annotations.
2022-08-11 03:50:06 -04:00
Dan Stillman
1e5fd2d551 Disable sort tests from 26a5e2900a for now
Until I can figure out the race-condition breakage they trigger later in
the file
2022-08-11 03:46:56 -04:00
Dan Stillman
612fec8961 Fix test failure after 26a5e2900a 2022-08-11 02:48:39 -04:00
Dan Stillman
d3942ad1f0 Better fix for errors from invalid sort fields
Just catch the error from `ItemTree::sort()` and clear the
secondary-sort and fallback-sort prefs so that sorting works on the next
attempt.

Replacement for a8ed30ce80

https://groups.google.com/g/zotero-dev/c/kc0-C6-SA74/m/bhHniGceAQAJ
2022-08-11 02:48:35 -04:00
Dan Stillman
d747da7c65 Revert "Validate fields in ItemTree::getSortFields()"
This reverts commit a8ed30ce80 and related
commits.

We'll address breakage from invalid sort fields another way, without
inconveniencing plugin authors.

https://groups.google.com/g/zotero-dev/c/kc0-C6-SA74/m/bhHniGceAQAJ
2022-08-11 02:48:31 -04:00
Dan Stillman
3ab661b628 Fix sorting by Item Type and feed item itemID
Regression from a8ed30ce80
2022-08-11 02:48:16 -04:00
Dan Stillman
2c11aadc57 Add localized string for timestamp CSL locator
Not included in the CSL locales:

https://forums.zotero.org/discussion/comment/412060/#Comment_412060
2022-08-11 02:47:46 -04:00
Abe Jellinek
b18967fba4 recursiveCollections: Remove from all subcollections on delete (#2689) 2022-08-11 02:47:28 -04:00
Dan Stillman
387e4dd958 Add CSL 1.0.2 locators and switch to CSL locales for localization
And move Page to middle of list, while still selecting by default

https://forums.zotero.org/discussion/comment/396602/#Comment_396602
2022-08-11 02:47:15 -04:00
Dan Stillman
fea99bf8f8 Fix test failure after a8ed30ce8
We added a `toggleSort()` call on the title, so then when called again
it reverses the direction. To avoid, sort by creator and then title in
the second test.
2022-08-11 02:47:09 -04:00
Dan Stillman
92a1a43cbb Validate fields in ItemTree::getSortFields()
To avoid startup hang if a plugin does something bad:

https://forums.zotero.org/discussion/comment/411843/#Comment_411843

Fixes #2692
2022-08-11 02:47:04 -04:00
Tom Najdek
141258d564 Fix a bug in regex extracting fields to "extra"
Because regex is built using a template string, \s* is actually escaped
into s*, i.e. literal "s" appearing 0 or more times. In most cases this
would mean that output can have spacing slightly off. In extreme case,
when identifier starts with letter "s", this could this could lead to
identifier being stored incorrectly.

Also adjusted tests to be more strict and mock data to cover this case.
2022-08-11 02:46:37 -04:00
Dan Stillman
5920c5d3e5 Update utilities submodule and date-parsing tests
Includes strToDate() fixes
2022-08-11 02:36:04 -04:00
Dan Stillman
3fb9e2162e Use String.fromCharCode() to load Chinese characters in strToDate() test
Follow-up to dc045250a6
2022-08-11 02:34:06 -04:00
Dan Stillman
56151a4198 Fix parsing of Chinese and other non-ASCII month names
https://forums.zotero.org/discussion/97683/bug-locale-issues-concerning-zotero-and-zotero-connector
2022-08-11 02:33:58 -04:00
Dan Stillman
011b60af61 Fix Emoji detection
And move to Zotero.Utilities.Internal.isOnlyEmoji()

Fixes #2643
2022-08-11 02:33:41 -04:00
Abe Jellinek
3481def4f6 Fix sorting by attachment (#2586) 2022-08-11 02:33:03 -04:00
Dan Stillman
65318a442e Fix support tests after 28ed3e34b 2022-08-11 02:29:44 -04:00
Dan Stillman
cb2594f53f Feed import: Don't fail on OPML entry with no title or text
https://forums.zotero.org/discussion/96841/impossible-dimporter-ompl-rss
2022-08-11 02:28:03 -04:00
Abe Jellinek
8d75f37548
fx-compat: Add preferences with full-text/keyword search (#2659) 2022-08-10 18:26:23 -04:00
Adomas Venčkauskas
41907975b0 Adjust integration function comments and test dummy signature 2022-07-26 10:53:05 +03:00
Abe Jellinek
8face792c0
fx-compat: Fix search dialogs (#2631) 2022-07-04 01:48:52 -04:00
Dan Stillman
f827b9ef50 fx-compat: initKeyEvent()new KeyboardEvent()
Quick Format change is untested
2022-06-21 03:31:58 -04:00
Dan Stillman
587ae6ba7e fx-compat: Fix blurring of textarea fields in item box
And fix tests
2022-06-21 03:03:37 -04:00
Dan Stillman
563f91bf18 Rename zoteroIntlTest.js to intlTest.js 2022-06-21 01:39:31 -04:00
Dan Stillman
bbdcb92042 Add missing test data files 2022-06-21 01:39:07 -04:00
Dan Stillman
789a8a5fe9 fx-compat: Use new mozILocaleService API
Replace functions with arrays, as in https://phabricator.services.mozilla.com/D6339
2022-06-20 23:09:46 -04:00
Dan Stillman
6e43d2cd4e fx-compat: Fix tags-box tests 2022-06-20 23:02:09 -04:00
Dan Stillman
3a5c24b6f1 fx-compat: Fix some tag selector tests 2022-06-20 19:32:03 -04:00
Dan Stillman
842e100b73 Additional assertion for sync test from d0c1a1f600 2022-06-20 18:43:02 -04:00
Dan Stillman
d0c1a1f600 fx-compat: Fix sync test involving waitForDialog()
`waitForDialog()` now returns a regular window, and
`window.document.documentElement.textContent` includes all form
elements, so this updates a test to include the checkbox label.
2022-06-20 17:47:15 -04:00
Dan Stillman
5bc1b6ad81 Update tests for itemBox/noteEditor custom elements 2022-06-20 00:47:50 -04:00
Dan Stillman
df3e7a600e Update Zotero.File.getContentsAsync() tests 2022-06-19 18:59:01 -04:00
Dan Stillman
dfff86df72 fx-compat: Fix Zotero.File.download() 2022-06-19 18:58:25 -04:00
Dan Stillman
f8aa14d431 fx-compat: Fix feed test using Array.map() 2022-06-19 15:09:23 -04:00
Dan Stillman
fa2ad2f234 loadBrowserWindow() → loadZoteroWindow() in feed test 2022-06-19 15:07:41 -04:00
Dan Stillman
408453c9e9 fx-compat: Fix dictionaries tests 2022-06-19 04:16:53 -04:00
Dan Stillman
2b41b0127c Get binary contents in Zotero.File.getSample()
And fix magic numbers for content-type sniffing, which wrongly used the
Unicode replacement character (which likely just meant we were falling
back to file-extension-based detection)
2022-06-17 20:29:01 -04:00
Dan Stillman
13adfd131c fx-compat: Update full-text indexing
Use the new PageData mechanism for character set detection, don't try to
index HTML files directly without properly detecting the charset, and
generally simplify the indexing code.

HTML files are now considered cached files that require indexing and
won't be indexed automatically in Zotero.FullText.findTextInItems(),
which breaks certain expectations, including in some tests. This will
need to be addressed.
2022-06-17 20:29:01 -04:00
Dan Stillman
6a2949be8a fx-compat: Add HiddenBrowser.jsm
Remove Zotero.Browser and add HiddenBrowser.jsm. Post-Fission, web/file
content loads in a separate process, so it's not possible (as best as I
can tell) to directly access the contents of a hidden browser -- it just
appears as about:blank in the parent process. We now use Mozilla's
JSWindowActor mechanism [1] to get page data, including character set
and body text for full-text indexing. We'll have to evaluate other uses
of hidden browsers to see how to handle them.

This also adds include.jsm for loading the Zotero object into a JSM.

[1] https://firefox-source-docs.mozilla.org/dom/ipc/jsactors.html
2022-06-17 20:28:58 -04:00
Abe Jellinek
29b270e761 fx-compat: Fix progress queue / Find Available PDFs 2022-05-24 13:52:52 -06:00
Abe Jellinek
a2215cb8f6 fx-compat: Fix hard confirmation dialog
ID changed to commonDialog so we get commonDialog.css styling for free.
2022-05-24 11:43:45 -06:00
Abe Jellinek
547311ff26 Fix Create Bibliography
listbox is gone, but richlistbox is still here as a custom element and
works fine for cases where we don't need virtualization.

groupbox label and richlistitem styles should probably be copied to
somewhere global once tuned a bit.
2022-05-18 19:32:39 -07:00