Commit graph

8840 commits

Author SHA1 Message Date
Martynas Bagdonas
a78860f092 Add Filename option for PDF tab title pref 2023-02-09 17:21:21 +00:00
Dan Stillman
382bde0fc2 Rename PDF tab title pref to include reader
In case we have a separate pref for notes or something else

(cherry picked from commit 6d0e5959e6)
2023-02-09 17:21:21 +00:00
Martynas Bagdonas
c0c1d011fa Add a hidden pref for tab title with support for Creator-Year-Title option (#2985)
(cherry picked from commit a5fb64f295)
2023-02-09 17:21:21 +00:00
Dan Stillman
8272989171 Add DOMParser to plugin scope 2023-02-09 05:36:03 -05:00
Abe Jellinek
4865f8afca Scaffold: Await more async functions
Might help prevent a deadlock I experienced when switching back to Zotero after
changing a translator file externally (although I can't reproduce it).
2023-01-23 12:32:30 -05:00
Dan Stillman
786d3db880 Revert "Limit Windows version to 2 PDF tabs in memory"
This reverts commit ffc8088ccd.

I cherry-picked this, but it's not necessary in Zotero 7, which has a
Win64 build.
2023-01-17 23:09:05 -05:00
Dan Stillman
3d4b93c86a Fix DOI field context menu not appearing after field edit
Context menu wouldn't appear again until the item box was refreshed
2023-01-17 23:05:48 -05:00
YFdyh000
bb5fe45f31 Show fieldLocalizedName in Scaffold - List All Fields (#2965) 2023-01-17 10:39:02 -05:00
Abe Jellinek
7e0b898765 fx-compat: Preferences: Fix pane script global object
Panes were being loaded with Zotero_Preferences as their global scope, so global
variables they defined would be set on that object instead of the window.
2023-01-17 10:28:57 -05:00
Adomas Venčkauskas
b6edaea54c fx102: Fix Word for Windows initialization and prefs 2023-01-13 09:56:59 +02:00
Dan Stillman
c7da16f07d Add protection against immediate retries in delayGenerator 2023-01-11 02:31:08 -05:00
Dan Stillman
6a1f0251cd Fix incorrect retries if multiple HTTP.request() calls get 500s
https://forums.zotero.org/discussion/comment/425814/#Comment_425814

The passed intervals array was modified, so after a request() got a 500,
subsequent calls would start with longer delays and eventually start
retrying immediately.
2023-01-11 02:20:07 -05:00
Dan Stillman
437b457134 Additional logging for "Invalid sync state undefined"
https://forums.zotero.org/discussion/102186/invalid-sync-state-undefined
2023-01-08 02:02:28 -05:00
Martynas Bagdonas
ffc8088ccd Limit Windows version to 2 PDF tabs in memory
Fixes zotero/zotero#2955
2023-01-08 02:02:28 -05:00
Abe Jellinek
7e7e8b88a2 LABD file relinking: Process using Unix paths (#2961) 2023-01-05 15:40:28 -05:00
Dan Stillman
959e868126 Read default prefs from prefs.js in a plugin's root directory
The file should follow the same `pref("extensions.foo.bar", "value");`
syntax as files previously in defaults/preferences/, which should no
longer be used in Zotero 7. (For an extension that works in both Zotero
6 and 7, it's OK to have a file in defaults/preferences for Zotero 6 and
an identical prefs.js for Zotero 7.)

Files in defaults/preferences/ aren't automatically loaded when a plugin
is installed/enabled but are still loaded at app startup by Mozilla code
for now. Plugins shouldn't count on that continuing to be the case in
Zotero 7 and should switch to prefs.js.

We'll add a way for bootstrapped plugins to manually trigger reading of
a prefs.js file in Zotero 6.
2023-01-05 01:53:03 -05:00
Dan Stillman
83792757de Remove pref code for <Fx59 2023-01-05 01:09:28 -05:00
Abe Jellinek
fc8a037d12 Zotero.HTTP.request(): Process headers case insensitively
Using the Headers class from the Fetch API.

Before, the added test would fail: `_requestInternal()`, not finding a header
named `Content-Type` (case sensitive), would set it to
`application/x-www-form-urlencoded`. XMLHttpRequest, upon being given both
`content-type`: `application/json`) and `Content-Type`:
`application/x-www-form-urlencoded`, would helpfully merge the two, producing
`content-type`: `application/json, application/x-www-form-urlencoded`. That's
obviously not the correct behavior.
2022-12-23 21:37:15 -05:00
Abe Jellinek
e46ffaf84b Add /connector/request endpoint 2022-12-23 21:37:15 -05:00
Dan Stillman
bad4597a86 Add mechanism for setting preferences remotely
Limited to a hard-coded list

Initially limited to `extensions.zotero.import.mendeleyUseOAuth`,
to switch the Mendeley importer from direct login to OAuth
2022-12-23 17:26:20 -05:00
Dan Stillman
32b6e0a485 Allow 204 response to OPTIONS request from WebDAV server
https://forums.zotero.org/discussion/101824/possible-to-allow-http-204-response-for-options-request-in-webdav-server-check

The specs used to (seemingly inadvertently) disallow 204 for OPTIONS,
but they've been clarified to make it clear that it's allowed [1], and MDN
now even shows it as an example [2].

[1] https://stackoverflow.com/a/57455110
[2] https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/OPTIONS
2022-12-23 17:26:04 -05:00
Abe Jellinek
da075fb215 fx-compat: Scaffold: Fix Tests richlistbox growing when tests are added 2022-12-20 13:19:22 -05:00
Adomas Venčkauskas
c12e5659ab Fix a potential bug in integration plugin when field codes are corrupt 2022-12-14 16:26:33 +02:00
Dan Stillman
75aa17f169 Fix running function passed to Zotero.openInViewer()
This fixes plugin removal in the Add-ons window.

Broken by b8966f7878
2022-12-11 18:39:27 -07:00
Dan Stillman
e7fa5d7f9d Add setTimeout and clearTimeout to plugin scope 2022-12-10 02:11:30 -07:00
Abe Jellinek
45e0340787 v-t: Fix freeze when type-to-find wraps and first row is selected 2022-12-06 14:58:58 +02:00
Adomas Venčkauskas
e59bcd2b64 Link Mendeley citations in documents to imported items. Closes #2622 2022-11-29 16:27:19 +02:00
Dan Stillman
76f2f0c783 Don't show items with annotated attachments after moving to trash
https://forums.zotero.org/discussion/100775/deleted-items-keep-reappearing-in-my-library

Regression from c3ee588bf
2022-11-28 04:34:49 -05:00
Abe Jellinek
ca1f83e9c9 fx-compat: Tag Color Chooser: Don't disable label
The default styles make it a strange-looking gray color, and there's no reason
to disable it separately if the element it's connected to is disabled.
2022-11-22 21:00:35 -05:00
Abe Jellinek
16eac5040b fx-compat: Fix error when switching language to Automatic
Services.locale always wants an array now, but it can be empty.

We still get "Uncaught (in promise) undefined" printed to the console, no stack,
not caught by "Pause on exceptions" in the debugger... but it's not clear that
that's actually coming from this code, and it doesn't seem to prevent anything
from working.
2022-11-22 20:53:29 -05:00
Adomas Venčkauskas
f98ab3b0a6 Import URL from XPCOM code instead of relying on window for Proxy code
Also fix other failing proxy tests. Closes #2928
2022-11-22 15:58:49 +02:00
Adomas Venčkauskas
b561aff94f Avoid locator detection on paste in citation dialog. Closes #2856
Locators will get detected if there is additional typing or editing
after the paste
2022-11-22 15:54:30 +02:00
Adomas Venčkauskas
4fa208d4d7 fx-compat: Fix pasting in quick format dialog 2022-11-22 15:52:57 +02:00
Adomas Venčkauskas
350a5d2cbb Fix quick format locator regexp to not match numbers without space.
Closes #2915
2022-11-22 15:51:54 +02:00
Adomas Venčkauskas
e8356de3c1 Proxy code: ensure URL constructor in non-window JS scope
Closes #2924
2022-11-22 15:51:54 +02:00
Abe Jellinek
4b09edfa42
fx-compat: Add color picker CE (#2682) 2022-11-21 02:48:16 -05:00
Dan Stillman
4dbb2d88b9 Update styles, translators, and CSL locales 2022-11-21 01:14:07 -05:00
Dan Stillman
5a82aa952d Don't allow note on embedded-image attachments
https://github.com/windingwind/zotero-better-notes/issues/212
2022-11-21 01:14:07 -05:00
Dan Stillman
b5862ba780 Handle relative PDF links when using custom PDF resolver 2022-11-21 01:14:07 -05:00
Dan Stillman
1f0a721101 Fix focus stealing in item box (#2885)
Port of #2895
2022-11-21 01:14:07 -05:00
Adomas Venčkauskas
0e4cdda8c7 Prevent citation merging from being always enabled after refreshing the doc 2022-11-21 01:14:07 -05:00
Abe Jellinek
00b387afc2
fx-compat: Toolbar fixes (#2922)
- Don't rely on Zotero.hiDPISuffix being initialized in menuToolbarbutton.js --
  it probably hasn't been at the time that the code that creates the dropmarker
  is running
- Fix merge mistake that created a duplicate block of CSS
2022-11-21 00:07:59 -05:00
Abe Jellinek
74492e40c4
Improve bidi & RTL support (#2415)
- Render cell text in its native direction
- Fix context menu positioning
- Fix item box (localizations needed)
- Fix column resizing
- Fix bidi text in collection tree
- Always right-align in RTL, always left-align in LTR.
  I'm going off advice from this excellent guide for RTL website design
  by Ahmad Shadeed: https://rtlstyling.com/posts/rtl-styling#tables
- Join creators in the tree ("Smith and Jones") using a format string to
  support languages like Arabic and Hebrew where there shouldn't be a
  space after the "and".
- Fix tabs
- Fix toolbar on Mac, flip icons on other platforms
2022-11-20 18:23:17 -05:00
Adomas Venčkauskas
93bba41dd5 Don't throw when getting potential proxies with invalid URL 2022-11-15 13:54:33 +02:00
Adomas Venčkauskas
ed46d8c53c Deproxify homepage URLs without trailing slash. Closes #2884 2022-11-15 13:22:52 +02:00
Dan Stillman
039142e50d Fix clearing of active quick search after annotation change
https://forums.zotero.org/discussion/90727/search-results-disappear
2022-11-14 22:55:17 -05:00
Abe Jellinek
a7b605f0cc
Add "Open PDF reader in new window" preference (#2868)
When enabled:
- Double-clicking a PDF or choosing "Open PDF" opens a new window
- Shift-double-clicking opens a new tab
- "Open in New Window" locate option becomes "Open in New Tab" and has the
  reverse behavior
2022-11-14 17:12:48 -05:00
Abe Jellinek
b6591dba5a
Make Feeds row into a selectable global view of feed items (#2800) 2022-11-14 16:55:28 -05:00
Abe Jellinek
318ec4074e
fx-compat: Style Editor: Validate inline (#2745) 2022-11-12 05:31:29 -05:00
Adomas Venčkauskas
e789872efe Improve cookie-sandbox behavior when getting attachments via WBP
Previously cookies only got attached on the initial request but not on
any redirect and subsequent request. This may have been the cause for
many reports of import failures behind proxies in the past.
2022-11-11 12:56:12 +02:00