Commit graph

8824 commits

Author SHA1 Message Date
Abe Jellinek
22b00c33de Empty Trash: Visually remove deleted items, refresh icon (#2606)
There were a few problems causing the incorrect behavior:
1. Rows were being removed only if they had no non-deleted children, which
   wasn't the right check. We want to remove all rows with no *deleted*
   children.
2. Children of the removed rows weren't being removed with them.
3. We weren't invalidating the tree (which _removeRows() doesn't do).

Also:

* Erase trashed annotation after getAnnotations() test

Because ItemTree#notify() doesn't yet correctly handle refresh events on
parent items that are themselves children (three-level nesting: item ->
attachment -> annotation), this test was causing a failure in
itemTreeTest.js.
2022-08-19 09:14:24 -04:00
Martynas Bagdonas
40ae2e3246 Fix navigation to annotation when opening an unloaded PDF reader tab
Regression from 142e3b09
2022-08-18 04:12:44 -04:00
Martynas Bagdonas
8ca7356489 Fix regression for broken "Snow in Page"
Fixes #2764
Regression from 7ec54fd
2022-08-18 04:12:44 -04:00
Abe Jellinek
0eaf5887ea fx-compat: Scaffold: Use platform keys like zoteroPane 2022-08-17 16:47:39 -04:00
Abe Jellinek
f5f49c7b1d fx-compat: Scaffold: Non-async detectWeb and async scrape by default
We don't usually want an async detectWeb, since HTTP requests should only be
used there in very exceptional cases. We do usually want an async scrape (and we
were already - mistakenly - awaiting it).
2022-08-17 16:31:30 -04:00
Dan Stillman
c3ee588bfe Match parent attachments for annotation tags
Expose annotation tags in tag selector and match parent attachments when
filtering/searching

This also fixes searching for annotation text or comments when using
Everything quick search.

This is temporary until we display annotations in the items list
directly.
2022-08-17 03:35:28 -04:00
Dan Stillman
6cd1a41a32 Fix importing of standalone attachments without URLs
And allow `importSnapshotFromFile()` without `parentItemID` or
`libraryID`, which is more consistent with other attachment functions

Follow-up to 318e4852e9

https://forums.zotero.org/discussion/comment/414802/#Comment_414802
2022-08-16 06:09:00 -04:00
Abe Jellinek
b03657add3 fx-compat: Use DOMParser constructor in _eventToEventTitle 2022-08-15 10:38:11 -04:00
Dan Stillman
676abca671 Fix importing of standalone attachments
Maybe has been broken for years?

https://forums.zotero.org/discussion/99020/warning-data-loss-when-exporting-collections
2022-08-13 16:24:14 -04:00
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
Abe Jellinek
30197a09d2 Revert mistaken change from 26069a580a
Shouldn't have made it into that commit.
2022-08-12 15:36:54 -04:00
Abe Jellinek
fc86bdb55c fx-compat: Fix error when Edit menu is shown 2022-08-12 15:34:27 -04:00
Abe Jellinek
26069a580a fx-compat: Fix Quit when main window is closed
Application menu items, contrary to the comment I added in a654ad291f,
actually *do* belong in hiddenWindow.xhtml so that they still work when
zoteroPane.xhtml is closed. They just can't be split between there and
zoteroPane.xhtml. This commit moves all of them to hiddenWindow.xhtml and
reimplements openPreferences() in a non-Zotero-object-dependent way.

Fixes #2738
2022-08-12 15:34:26 -04:00
Abe Jellinek
333cf8cc2a
Add Book -> Book Section and Book Section -> Book to context menu (#2754) 2022-08-11 16:28:32 -04:00
Martynas Bagdonas
4f52eb9be3 Fix PDF reader selector popup that was never opening
(cherry picked from commit e4e3c72036)
2022-08-11 14:22:52 +03:00
Martynas Bagdonas
d1550a3fd5 Fix regression preventing opening PDF reader window when the tab is open
(cherry picked from commit 0857cefb0c)
2022-08-11 14:22:52 +03:00
Adomas Venčkauskas
d6909ec8e5 Update SingleFile config for current version
They got updated upstream and the backwards-compat code
does not run for the way we execute singlefile

See https://github.com/gildas-lormeau/SingleFile/issues/1021
Addresses https://github.com/zotero/zotero-connectors/issues/398
2022-08-11 14:00:40 +03:00
Adomas Venčkauskas
2dd54fddf4 Prevent singlefile config from overwriting the Zotero.SingleFile namespace 2022-08-11 13:51:57 +03: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
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
Dan Stillman
57b91a0add Move item box comment from 87455d28c3
The code seems to have already been applied on the fx102 branch
2022-08-11 03:56:46 -04:00
Abe Jellinek
678a6101b3 Advanced Search: Make sure items are loaded (#2743) 2022-08-11 03:53:39 -04:00
Dan Stillman
72d4cdd3a3 Don't preselect Act for multiple sources in classic citation dialog
"Multiple Sources…" wasn't properly handled by 629892b0b8

https://forums.zotero.org/discussion/98877/act-instead-of-page
https://twitter.com/drezvera99/status/1554521940684984320
2022-08-11 03:53:34 -04:00
Martynas Bagdonas
098886bcb6 Select existing unloaded tab instead of opening a new one
Fixes #2740
2022-08-11 03:52:53 -04:00
Martynas Bagdonas
9190eb8f34 Allow to scroll tabs with mouse wheel
Fixes #2724
2022-08-11 03:52:45 -04:00
Abe Jellinek
1f9e518581 Duplicates Merge: Preserve embedded annotations (#2728) 2022-08-11 03:52:40 -04:00
Adomas Venčkauskas
63148dff3b Do not load-timeout on browser PDF download during content load
Closes #2726
2022-08-11 03:52:31 -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
Martynas Bagdonas
44ef4cd35a Fix regression that prevents showing the last selected tab on startup
Fixes #2723
2022-08-11 03:50:01 -04:00
Martynas Bagdonas
b02ad0dc83 Fix regression that prevents showing new notes in contextPane notes list 2022-08-11 03:49:52 -04:00
Adomas Venčkauskas
1955427d62 Fixes some assets not being saved with SingleFile snapshots
Part of zotero/zotero-connectors#394

When saving an item (e.g. on arxiv) with a site translator, the
translator may add a custom snapshot attachment URL which does not match
the translation URL (the URL in the browser where translation was
initiated) in which case Zotero handles snapshot saving. Zotero loads
the page in a background browser. By default images are not loaded in
this browser. SingleFile due to CORS restrictions has to refetch all
resources that are not from the same domain or subdomain, but uses
pre-loaded resources (images) from the same domain. Before this change
any images that were from the same domain as the saved website were not
saved in the snapshot. This commit fixes that.
2022-08-11 03:49:52 -04:00
Adomas Venčkauskas
3ba78dec78 Changes for updated SingleFile submodule 2022-08-11 03:49:52 -04:00
Dan Stillman
f46c0986d3 Localize "Export PDF…" menu option
Fixes #2710
2022-08-11 03:49:52 -04:00
Dan Stillman
a33775d2a1 Update translate submodule 2022-08-11 03:49:52 -04:00
Dan Stillman
8bce2b1fdd Increase Mendeley API timeout to 60 seconds
To see if we can fix the 30-second timeout here:

https://forums.zotero.org/discussion/comment/412750/#Comment_412750
2022-08-11 03:46:51 -04:00
Dan Stillman
393b1f8369 Add warning in toolbar for 'dev' channel builds 2022-08-11 03:43:03 -04:00
Martynas Bagdonas
7089ce8fc7 Use Quick Copy (Markdown) for direct plain-text copying from note-editor
Fixes #2505
2022-08-11 02:49:07 -04:00
Abe Jellinek
bd18339797 Prevent deleting My Publications
Previously showed a blank confirmation dialog and logged an error.
2022-08-11 02:48:59 -04:00
Martynas Bagdonas
221aa25e00 Prevent delayed context pane expansion and pdf-reader rerender/resize when switching from library tab 2022-08-11 02:48:54 -04:00
Martynas Bagdonas
4ab154c4bf Don't include quotes when {{highlight}} is placed in a blockquote
Fixes #2697
2022-08-11 02:48:49 -04:00
Martynas Bagdonas
fcb63465ac Include quotation marks for highlights by default, but allow to disable
Fixes #2697
2022-08-11 02:48:44 -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
9dc8995ba8 Sort empty rows last for Date/Year columns when descending
Date columns start in descending order, so put empty rows at end

Also remove a seemingly unnecessary exception for Title when not the
primary sort and just always sort it with empty rows first
2022-08-11 02:48:26 -04:00
Dan Stillman
e25ec0d981 Fix sorting of attachments and notes columns
Regression from a8ed30ce80
2022-08-11 02:48:22 -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
5620dc96bd CookieSandbox: Fix error setting request cookies
Regression from 6af3b0276a, showing up as "trackedBy is undefined" error

https://forums.zotero.org/discussion/98322/no-snapshot-or-pdf-autosaved-using-zotero-connector-on-safari
2022-08-11 02:48:06 -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
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
a7c5f78107 Improve log output for multiple Mendeley imports
Helps with debugging cases where new import is started while previous
one is still being cancelled
2022-08-11 02:46:47 -04:00
Tom Najdek
9acf1ac42e Lint code related to Mendeley importer 2022-08-11 02:46:42 -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
Tom Najdek
c9400c565c Mendeley import: detect win close, better feedback
* Detect wizard cancel/close and interrupt import. This will still
  have to wait for current fetch (file or metadata) to complete but will
  then advance to the cleanup stage
* Advance progress bar during metadata fetch
* Add some extra logging
2022-08-11 02:46:31 -04:00
Tom Najdek
4b86c2a3fd Don't try to remove temporary dir after import
Previously we had a structure that also created folders in temp dir,
that has since changed but code in cleanup phase to remove containing
dir has been accidentally left unremoved.
2022-08-11 02:46:26 -04:00
Martynas Bagdonas
5f6d6da154 Fix disabled "Add to Note" when a child note is open
Fixes #2687
2022-08-11 02:46:17 -04:00
Dan Stillman
01dc397afd Update global schema and utilities for CSL 1.0.2 2022-08-11 02:43:53 -04:00
Martynas Bagdonas
ca3e048b78 Adjust page rotation labels in PDF reader
Fixes #2669
2022-08-11 02:43:47 -04:00
Martynas Bagdonas
b9f4a7835a Show parent item title for child notes in context pane
Fixes #2681
2022-08-11 02:43:32 -04:00
Martynas Bagdonas
b5bdae3d6d Implement smart notes switching in contextPane (#2671)
Fixes #2650
2022-08-11 02:38:55 -04:00
Dan Stillman
5920c5d3e5 Update utilities submodule and date-parsing tests
Includes strToDate() fixes
2022-08-11 02:36:04 -04:00
Adomas Venčkauskas
3ff650f046 Limit the force-click during drag fix to macOS (4fb0661b) 2022-08-11 02:34:29 -04:00
Adomas Venčkauskas
9feb2fc6cf Fix alt-arrow not working on macOS when editing collection names.
Fixes #2651
2022-08-11 02:34:24 -04:00
Adomas Venčkauskas
1937220099 Fix force-click during drag sometimes causing collections to switch
Closes #2652
2022-08-11 02:34:17 -04:00
Abe Jellinek
48ad6dcb99 Fix error if New Collection prompt is canceled 2022-08-11 02:34:12 -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
c8cc97dd97 Properly strip ZWJ in isOnlyEmoji() 2022-08-11 02:33:54 -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
6828e24481 citeproc-js: Add space after left margin in plain-text mode
This adds a space after the the number in some numeric styles ("[1]" in
IEEE style, "1." in Nature) when pasting bibliography entries into a
plain-text editor.

Some styles (ACS, AMA, Vancouver) will need to be updated to remove
their hard-coded spaces to avoid double spaces after this change.

Patch from @zepinglee

Fixes #2633
2022-08-11 02:32:39 -04:00
Martynas Bagdonas
bfc61a69ba Add support for PDF page deletion and rotation (#2595)
* Add support for PDF page deletion and rotation
Fixes #2561
2022-08-11 02:32:30 -04:00
Adomas Venčkauskas
44e8a372e5 Fix a MIMETypeHandler.removeHandler() bug 2022-08-11 02:31:33 -04:00
Adomas Venčkauskas
1687d4caad Improve downloadPDFViaBrowser handlers and logging 2022-08-11 02:31:28 -04:00
Adomas Venčkauskas
f88cc8b988 Fix cookieSandbox not overriding user agent if no cookies for domain.
Potential fix for #2635
2022-08-11 02:31:23 -04:00
Martynas Bagdonas
266ea99a77 Fix library tab tooltip always staying on top 2022-08-11 02:31:15 -04:00
Dan Stillman
b1c2b9e005 Fix detection of some emoji set as colored tags
Emoji such as ️ that began as text-based Unicode characters and depend
on Variation Selector-16 to display the emoji presentation weren't being
properly detected.
2022-08-11 02:31:01 -04:00
Dan Stillman
5eecc3fc54 Add prefs for timeouts for downloading PDF via browser
1 second isn't enough for some users, so try 1.5, and allow for easier
debugging via a pref.

https://forums.zotero.org/discussion/96431/i-have-access-to-pdf-but-zotero-cannot-automatically-add-it
https://forums.zotero.org/discussion/97277/unable-to-download-papers-using-zotero-chrome-extension
2022-08-11 02:28:16 -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
Martynas Bagdonas
b98a5e0545 Avoid error interrupting annotation extraction from multiple items 2022-08-11 02:25:43 -04:00
Dan Stillman
82eb701ea7 Try to open external PDF reader to page number for "Show on Page"
PDF-handling code from `ZoteroPane.viewAttachment()` predates
`Zotero.OpenPDF` and didn't handle page numbers for external PDF
readers, so when called from "Show on Page" in a note (via
`ZoteroPane.viewPDF()`) it just launched the file itself in the
specified handler or via the OS.

For now, change to use `Zotero.OpenPDF.openToPage()` when there's a page
number. Later we should use `Zotero.OpenPDF` for everything, but that
code is more complicated than just using `launchFile()`, so we'll need
to do some testing (particularly on Linux) to see what's best.

(Note that "Show on Page" with an external reader doesn't make a ton of
sense, since you can't actually see the annotation, but opening the
right page is better than nothing.)

Fixes #2612
2022-08-11 02:25:43 -04:00
Abe Jellinek
139d92054f Scaffold templates: Pull URL from doc
Link URLs could lead to redirects.
2022-08-11 02:25:43 -04:00
Abe Jellinek
7d3e95e050 Fix Scaffold load error when fontSize pref is set 2022-08-11 02:25:43 -04:00
Abe Jellinek
8d75f37548
fx-compat: Add preferences with full-text/keyword search (#2659) 2022-08-10 18:26:23 -04:00
Abe Jellinek
db600cb5b9 fx-compat: Item box: Don't set flex attribute on HTML elements 2022-08-08 14:52:17 -04:00
Dan Stillman
78b0055206 Change app id to zotero@zotero.org
And remove all references to old id

We can do this because plugins will use new mechanisms for install and
update manifests that don't use the id (which also means it's now only
used internally).
2022-08-08 05:11:21 -04:00
Dan Stillman
ef33731490 fx-compat: Add message to Add-ons pane when no plugins installed
We'll want to update the rest of the instances of "extensions" or
"add-ons" to say "plugins" (unless we think we might support themes, in
which case we can keep "add-ons").
2022-08-06 03:49:40 -04:00
Abe Jellinek
cd296b1f37 fx-compat: Item box: Fix _*FieldValue(), more focus issues
_getFieldValue() and _setFieldValue() were using `.value` instead of
`.textContent`, so the few places that use it were getting/setting ignored
fields on divs.

fbc25834 messed up the tab index logic, shifting the responsibility for
preserving _lastTabIndex across refreshes: originally, the default was to throw
it away, and the caller was responsible for saving and restoring it if the
refresh was caused by tabbing between fields. The bad commit reversed the
situation and made the item box *remember* the _lastTabIndex by default,
meaning that a refresh caused by the notifier, for example, would focus the
last focused field even if it had been closed by the user in the meantime.

That bad change was a misguided attempt to fix the Tab key cycling infinitely
between Item Type, Title, and creators and never reaching further fields. The
actual fix was just to add `, textarea` to the query on line 1459.
2022-08-05 16:12:28 -04:00
Abe Jellinek
1ecc0b113b fx-compat: Item box: Fix auto-scroll functions 2022-08-05 12:32:03 -04:00
Abe Jellinek
cb14564174 fx-compat: Item box: Prevent editor from reopening after close
We did need to reset _lastTabIndex as the line removed in fbc25834 did, but
only immediately surrounding the saveTx() call.
2022-08-05 12:10:16 -04:00
Abe Jellinek
57abea5416 fx-compat: Item box: Remove some dead code
All already being handled by CSS (besides the exact character length limits, but
it's not clear that we really need those - we just ellipsize if it visually
overflows now, which seems fine).
2022-08-05 11:57:54 -04:00
Abe Jellinek
4e6fe4d119 fx-compat: Remove temp item type menulist logging 2022-08-05 11:49:14 -04:00
Abe Jellinek
1c36406b1e fx-compat: Item box: Fix removing creator while editing it 2022-08-05 11:45:58 -04:00
Abe Jellinek
361a83c378 fx-compat: Item box: Restore batch paste behavior
Since <input>s are single-line, we do the split operation on paste instead of on
blur.
2022-08-05 11:45:58 -04:00
Dan Stillman
53a09bb912 Add reason parameter for plugin bootstrap methods
As documented on https://wiki.mozilla.org/Extension_Manager:Bootstrapped_Extensions

And fix method names for `install()` and `uninstall()`
2022-08-05 04:51:07 -04:00
Dan Stillman
51f9150410 fx-compat: Initial plugin support
Plugins are ZIPs containing at least these two files:

- manifest.json: A WebExtension MV2 manifest with basic metadata
  properties and `applications.gecko` with `id` and `update_url`
- bootstrap.js: A bootstrap file, similar to old bootstrapped extensions,
  with `installed()`, `startup()`, `shutdown()`, and `uninstalled()`
2022-08-05 01:08:51 -04:00
Dan Stillman
e82e808f2b Update definition style of Zotero.log() and Zotero.logError() 2022-08-05 01:08:51 -04:00
Dan Stillman
e6256d60ec fx-compat: Fix logging to the browser console 2022-08-05 01:08:51 -04:00
Abe Jellinek
080ada78ee fx-compat: Item box: Prevent tabbing to hidden firstName 2022-08-04 17:20:01 -04:00
Abe Jellinek
fbc2583433 fx-compat: Item box: Fix tabbing 2022-08-04 17:02:41 -04:00
Abe Jellinek
7a22458ed4 fx-compat: Item box: Fix fieldMode resetting on blur
The fieldMode attribute of the input was being set by the call to
switchCreatorMode(), but it didn't carry over to the label that replaces it on
line 1997.

Also removed a debug line and cleaned up a bit.
2022-08-04 16:50:48 -04:00
Abe Jellinek
581f4bdf7b fx-compat: Fix parameter name typo 2022-08-04 15:10:32 -04:00
Abe Jellinek
617ede481a fx-compat: Add roles to banners
Fixes #2655 (with 0983ff)
2022-08-04 14:52:16 -04:00
Abe Jellinek
c7fc98dff6 fx-compat: editContextMenu -> editMenuOverlay
To reflect that it now handles the menu bar Edit menu as well.
2022-08-02 15:50:44 -04:00
Abe Jellinek
64155bf58f fx-compat: Fix edit context menu
The menupopup needs to be in a popupset to show correctly.
2022-08-02 15:49:06 -04:00
Abe Jellinek
27841acb83 fx-compat: Select items dialog: Fix search and make functional 2022-08-01 15:39:57 -04:00
Abe Jellinek
f8ac57bdb1 fx-compat: Don't focus dropdown in quick search textbox
To match old behavior and fix autofocus.
2022-08-01 15:22:25 -04:00
Abe Jellinek
d018133e9b fx-compat: Use html-tooltip everywhere
And convert tooltiptext attributes on item box HTML elements to titles.
2022-08-01 15:02:42 -04:00
Abe Jellinek
812511e31b fx-compat: Open DOI popup as native menu, too 2022-08-01 14:29:35 -04:00
Abe Jellinek
bcf62e688f fx-compat: Item box: Use addEventListener() 2022-08-01 14:27:46 -04:00
Adomas Venčkauskas
41907975b0 Adjust integration function comments and test dummy signature 2022-07-26 10:53:05 +03:00
Abe Jellinek
808375d5e3 fx-compat: Item box: Fix creator name field sizing
Not the exact same sizing as Fx60, because that relied on some quirks
of the Mozilla box model that I can't reproduce with flexbox, but still
works about as well.
2022-07-21 16:12:28 -04:00
Abe Jellinek
26a2398399 fx-compat: Restore guidance panels as CE
Fixes #2711.
2022-07-20 11:12:52 -04:00
Dan Stillman
7b10182e4a Disable obsolete "Open in External Viewer" menu option
Hasn't done anything since in-browser viewing of certain file types in
Zotero 4 for Firefox. Perhaps we'd bring it back at some point, but
disable for now.
2022-07-19 22:38:01 -04:00
Dan Stillman
744837cce7 fx-compat: Remove Zotero.MIME.hasInternalHandler()
Hasn't been relevant since the Firefox NPAPI days, but was returning
true for `application/pdf` (possibly due to the bundled pdf.js in
Firefox still being included in our builds, which we should remove if
so), which was causing "Open in External Viewer" to appear, even though
it just opened the internal reader.
2022-07-19 22:38:01 -04:00
Abe Jellinek
5e6dc290b6 fx-compat: Scaffold: Read ESLint output from stdin
Need to update your zotero/translators clone to get linting working again.
2022-07-19 16:26:17 -04:00
Abe Jellinek
14f79018ad fx-compat: Scaffold: Fix "undefined" attributes 2022-07-19 14:44:28 -04:00
Abe Jellinek
8ff75607a5 fx-compat: Item box: Disable guidancepanel trigger + cleanup 2022-07-19 14:44:28 -04:00
Abe Jellinek
083e3c7a36 fx-compat: Search: Clear join mode condition
Fixes an error that prevents changing the join mode from having an effect
after clearing the search when a join mode was already set. Bug also
present on master, not introduced with fx102.
2022-07-12 22:01:20 -04:00
Abe Jellinek
5f8a5056f1 fx-compat: Remove unused progress display 2022-07-12 14:50:53 -04:00
Abe Jellinek
5c6837c1fc fx-compat: Add copyright to CE base 2022-07-12 14:47:24 -04:00
Abe Jellinek
916627b590 fx-compat: Scaffold: Fix indentation using spaces 2022-07-11 13:03:48 -04:00
Abe Jellinek
dc96c1a175 fx-compat: Fix ZP progress queue button creation 2022-07-11 13:02:51 -04:00
Abe Jellinek
ab6b683d90
fx-compat: More progress on platform menus (#2675)
Not able to test on non-Mac yet, but this behavior should be right.
Removes all the #ifdefs and moves the behavior into platformKeys.js.
2022-07-07 00:04:13 -04:00
Abe Jellinek
9a8e78aaf4
fx-compat: Restore quick search menu and update styles (#2684) 2022-07-06 23:42:23 -04:00
Abe Jellinek
bc41c3b7b0 fx-compat: Make changelog link in About work 2022-07-06 15:24:31 -04:00
Abe Jellinek
abe19b9435 fx-compat: Fix error when v-t tooltip shows 2022-07-06 11:12:44 -04:00
Abe Jellinek
0983ffbef2 fx-compat: Make sync / retraction links tabbable
Addresses #2655. Still need to add roles.
2022-07-06 10:53:08 -04:00
Abe Jellinek
8face792c0
fx-compat: Fix search dialogs (#2631) 2022-07-04 01:48:52 -04:00
Abe Jellinek
b78b9cad1f fx-compat: Duplicates: UI fixes
- Scroll vertically
- Restore margins between groupboxes
- Restore field version dropmarker
2022-06-30 12:32:11 -04:00
Abe Jellinek
97786bfa77 fx-compat: Fix multiline Add Item by Identifier
Now just one textarea instead of an input and a textarea.

Fixes #2677
2022-06-30 11:48:15 -04:00
Abe Jellinek
f81b4b071f fx-compat: Correct create[XUL]Element[NS]() calls
This fixes the dictionary manager and various other places where a XUL
element was being created with createElement(), and also simplifies a lot
of createElementNS(HTML_NS, ...) calls.

This might cause some minor regressions but everything tested has
worked. Not touching preferences (#2659) or bindings.
2022-06-29 11:14:40 -04:00
Abe Jellinek
8b7d959781 fx-compat: Fix column picker context menu 2022-06-29 09:27:11 -04:00
Dan Stillman
4fcde6c8c5 fx-compat: hiddenWindow.xul → hiddenWindow.xhtml 2022-06-29 06:17:21 -04:00
Dan Stillman
41f54624b1 fx-compat: Fix "Hide {-brand-shorter-name}" in Mac application menu 2022-06-29 03:38:16 -04:00
Abe Jellinek
1eb9718b6b Style editor: Light theme, leave selection if unchanged
Since onStyleModified() is called when a style is loaded.
2022-06-28 15:12:57 -04:00
Abe Jellinek
9c837b3361 Improve Monaco integration and use in csledit
And remove timedtextarea.xml. Fixes #2665.
2022-06-28 15:05:16 -04:00
Abe Jellinek
8681e8ffe9 fx-compat: Make macOS application menu shortcuts work
e.g. Cmd-H flashed the menu but didn't actually hide.
2022-06-28 12:15:11 -04:00
Abe Jellinek
00e46443a6 Add XULElementBase class for custom elements
https://github.com/zotero/zotero/pull/2631#discussion_r906723540
2022-06-28 11:52:11 -04:00
Abe Jellinek
6295050fa6
Restore platform edit menu behavior without #ifdef (#2674) 2022-06-27 23:06:01 -04:00
Abe Jellinek
f0aef79c7a fx-compat: Use permalink in comment 2022-06-27 14:26:00 -04:00
Abe Jellinek
a654ad291f fx-compat: Add comment explaining menubar change 2022-06-27 14:22:02 -04:00
Abe Jellinek
a8c4e0637b fx-compat: Restore Mac application menu
The stuff in hiddenWindow.xul doesn't seem to have been doing anything
in Fx102 anyway.
2022-06-27 14:15:11 -04:00
Abe Jellinek
89587e6b76 fx-compat: native="true" on more checkboxes/menulists 2022-06-24 09:11:38 -04:00
Dan Stillman
3805f901cf fx-compat: Fix centering of library pane progress bar 2022-06-23 04:17:08 -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
3743c179e1 Add missing commonDialog.js from dictionary manager
Currently provides close-on-Esc functionality
2022-06-21 01:39:07 -04:00
Dan Stillman
20945f60c9 fx-compat: Remove nsIURI.clone() usage 2022-06-21 01:39:07 -04:00
Dan Stillman
6297d0862f fx-compat: Replace last use of getURLSpecFromFile()
Follow-up to 8f7a160ba1

Untested, since it's in the prefs -- we'll have to see if this works
after #2659
2022-06-21 01:39:00 -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
96f6b871ce fx-compat: Fix sync error panel 2022-06-20 18:43:09 -04:00
Martynas Bagdonas
5b879f75c5 fx-compat: Avoid dead object errors in note-editor
Fixes #2663
2022-06-20 11:33:10 +03:00
Dan Stillman
b3077182d2 fx-compat: Fix Zotero.MIME.getMIMETypeFromURL()
Replace

```
Components.classes["@mozilla.org/network/standard-url;1"]
	.createInstance(Components.interfaces.nsIURL)
```

with

```
Services.io.newURI(url).QueryInterface(Ci.nsIURL);
```
2022-06-20 01:12:57 -04:00
Dan Stillman
30f636274b Update Notifier ids for itemBox/notesEditor custom elements 2022-06-20 00:47:50 -04:00
Dan Stillman
be3b245dbe Don't index PDF if fulltext.textMaxLength is 0
Follow-up to 13adfd131c
2022-06-19 19:03:41 -04:00
Dan Stillman
dfff86df72 fx-compat: Fix Zotero.File.download() 2022-06-19 18:58:25 -04:00
Dan Stillman
8f7a160ba1 fx-compat: getURLSpecFromFile()Zotero.File.pathToFileURI()
One remaining instance in the prefs that will need to be fixed
2022-06-19 15:20:54 -04:00
Abe Jellinek
9c69f73de5 Manually remove handler instead of using once
Since we only want to remove if the target matches.
2022-06-18 03:45:32 -04:00
Abe Jellinek
a48ebe2dd7 Show native menus from toolbar 2022-06-18 03:45:32 -04:00
Abe Jellinek
a60e46dd5c fx-compat: Fix toolbar 2022-06-18 03:45:32 -04:00
Abe Jellinek
dd3385ec67 Revert "fx-compat: Remove Mac toolbarbutton images"
This reverts commit 280a1265c8.
2022-06-18 03:45:32 -04:00
Dan Stillman
d90334e883 fx-compat: Initial nsIWebBrowserPersist.saveURI() fixes
Will need additional fixes for cookie handling, etc., but this at least
fixes the signature
2022-06-17 20:29:01 -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
1dd24f7082 Remove Zotero.File.getCharsetFromFile()/addCharsetListener()
Unused in over a decade, and now replaced by the PageData actor
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
Dan Stillman
7f748b2620 Take path or nsIFile in Zotero.File.pathToFileURI() 2022-06-17 20:24:43 -04:00
Dan Stillman
730e86d661 fx-compat: Restore tests and test using actual Zotero executable
The test runner now uses the Zotero executable from
`zotero-standalone-build/staging` rather than the Firefox from
`zotero-standalone-build/xulrunner`. Along with testing the actual
program, this restores visible UI updates during tests, which should
make debugging various things easier. We can also now remove anything
related to Zotero being an extension.

Many tests are still broken, but this at least lets us start running
them.
2022-06-17 20:24:43 -04:00
Dan Stillman
3c9dcea46b Add comment explaining CSS rule to hide menuitem icons on macOS 2022-06-17 20:24:43 -04:00
Abe Jellinek
0e1a16b96b fx-compat: Show native field/creator transform popups
No longer anchored to the element, but instead to the cursor.
2022-06-17 18:49:07 -05:00
Abe Jellinek
c31df4ae6b fx-compat: Display item box using CSS grid
- Widths are now correct
- Rows are a little too tall
- Field value vertical alignment is off
- Platform styling isn't done and some styles might be redundant
- Still can't scroll vertically
- Creator name inputs still displayed wrong
2022-06-16 16:27:16 -05:00
Tom Najdek
cb3d4b1800
Fix tag selector menus not appearing on fx102 (#2654)
Also tweaked offset where a context menu appears to 1px from cursor
(was 2px) to match other context menus.
2022-06-14 18:28:02 -04:00
Abe Jellinek
cd17c90f2e fx-compat: Don't show hidden types in Item Type menu 2022-06-10 14:03:53 -05:00
Abe Jellinek
ac9e882bda fx-compat: Item box: Fix URL opening and field blurring 2022-06-10 13:59:01 -05:00
Martynas Bagdonas
097d423275 fx-compat: Fix spellchecker and dictionary manager 2022-06-10 12:57:27 +03:00
Martynas Bagdonas
5924753fd1 fx-compat: Fix unloaded tab loading 2022-06-09 16:30:34 +03:00
Martynas Bagdonas
64c652ea06 fx-compat: Replace eval with wrappedJSObject in PDF reader 2022-06-09 13:13:08 +03:00
Abe Jellinek
9a2e98360a fx-compat: Scaffold: Update Monaco
Now that we can. Quite a bit faster and more customizable.
2022-06-08 17:38:59 -05:00
Abe Jellinek
e537018e71 fx-compat: Initial fix for Scaffold
Not working:
- Web tests (hidden browser is broken)
- Test Updated status text
- Various platform menu things (code copied from ZP and will use whichever
  approach we settle on there)
2022-06-08 17:16:50 -05:00
Martynas Bagdonas
1b324f9bd1 fx-compat: Fix color rendering in annotation popup, use checkbox 2022-06-08 21:22:37 +03:00
Martynas Bagdonas
1e25e2ac4c fx-compat: Fix invisible caret issue in linksBox tags popup 2022-06-08 21:22:37 +03:00
Martynas Bagdonas
a7bc25b553 fx-compat: Fix PDF reader window 2022-06-08 18:57:26 +03:00
Martynas Bagdonas
08089d6120 fx-compat: Fix tooltip node to work in PDF reader tab 2022-06-08 18:57:26 +03:00
Martynas Bagdonas
2e5388af5b fx-compat: Implement tagsBox element 2022-06-07 17:13:48 +03:00
Abe Jellinek
7e55ea59bb fx-compat: Item box: Change creator type label correctly 2022-05-31 16:31:20 -07:00
Abe Jellinek
b9f3bea8c3 fx-compat: Attachment box: Only add listener once 2022-05-31 16:30:55 -07:00
Abe Jellinek
1b74befd64 fx-compat: Fix Item Type menu regression 2022-05-31 15:04:14 -07:00
Abe Jellinek
d3555228b2 fx-compat: Fix Duplicate Items merge view 2022-05-31 14:57:47 -07:00
Abe Jellinek
59d5013952 fx-compat: Item box: Fix menu actions, plus/minus buttons 2022-05-31 11:23:19 -07:00
Abe Jellinek
496f34117c fx-compat: Fix attachment rename, remove <links-box> observer
<links-box> doesn't actually have a notify() method, so an error was
being thrown on each notification.
2022-05-27 13:28:07 -06:00
Abe Jellinek
1ef40d9423 fx-compat: Fix attachment box 2022-05-27 12:56:13 -06:00
Martynas Bagdonas
307701788f fx-compat: Fix and extract notesBox into a separate element 2022-05-27 13:21:18 +03:00
Abe Jellinek
f05d6fe0e0 fx-compat: Fix basicViewer for http(s):// URLs
maychangeremoteness="true" is required to successfully load pages from
the web even though we never actually change remoteness.

https://searchfox.org/comm-central/rev/2cf3a09a0127fe73e932c5ee793986f3bed2ccd2/mail/base/content/aboutMessage.xhtml#118
2022-05-26 10:45:57 -06:00
Abe Jellinek
e26fd18450 fx-compat: Change autocomplete-input load method 2022-05-26 09:39:30 -06:00
Martynas Bagdonas
0079fbdb08 fx-compat: Fix relatedBox 'Add' button visibility 2022-05-26 18:31:07 +03:00
Martynas Bagdonas
db0ac723fa fx-compat: Note editor and links box fixes:
- Add links-box component (inside noteEditor.js).
- Add related-box component and fix related pane.
- Use tagsBox.jsx instead of tagsbox.xml in note editor links box popup.
- Remove CSS styles and bindings for noteeditor, relatedbox and tagsbox.
2022-05-26 18:23:31 +03:00
Martynas Bagdonas
4a1812e5ba fx-compat: Fix selectItemsDialog 2022-05-26 18:23:31 +03:00