Commit graph

1176 commits

Author SHA1 Message Date
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
Dan Stillman
bc68b6e9fe fx-compat: Start to fix tag color chooser dialog
Among other things, need to recreate XBL <customcolorpicker> as a Custom
Element and need to change `ondialogaccept`/etc. to event listeners:

https://searchfox.org/mozilla-central/rev/b72e9d7d63bf499d1d8168291b93d4ec7fde236e/browser/components/places/content/bookmarkProperties.js#232-237
2022-05-13 04:28:57 -04:00
Dan Stillman
dd2ff63019 fx-compat: Replace nsIDOMParser with new DOMParser() 2022-05-12 02:38:59 -04:00
Dan Stillman
03242e8984 fx-compat: DB.executeTransaction() no longer takes generator functions 2022-05-12 02:38:59 -04:00
Abe Jellinek
9829ea7009
Update utilities, move tests, add to CI (#2584) 2022-04-30 04:55:11 -04:00
Abe Jellinek
3bfc6740c4
Add tests for improved compareCallNumbers (#2579) 2022-04-28 04:43:30 -04:00
Abe Jellinek
89aaa10504
Sort LC call numbers better, sort integers as integers (#2569)
* Update utilities submodule after https://github.com/zotero/utilities/pull/8
* Extract and add tests
2022-04-26 04:11:29 -04:00
Martynas Bagdonas
b8d427790c Fix error when using a note template and checking if array is not empty 2022-04-23 14:52:24 +07:00
Abe Jellinek
f91ca9c18a Don't merge with a deleted master attachment 2022-04-20 11:04:24 -07:00
Abe Jellinek
e8ad2fab95
getSortTitle: Only strip initial punctuation clusters (#2537)
Specifically exclude @, #, and *
2022-04-15 02:08:14 -04:00
Dan Stillman
08d3880d88 Don't remove relations in annotation item JSON
This was causing UUIDs for annotations from Mendeley imports to be
removed after a sync, resulting in annotations being duplicated on a
reimport.
2022-04-14 06:37:30 -04:00