398 Commits

Author SHA1 Message Date
John McLear
474918a881
feat: make cookie names configurable with prefix setting (#7450)
* feat: make cookie names configurable with prefix setting

Add cookie.prefix setting (default "ep_") that gets prepended to all
cookie names set by Etherpad. This prevents conflicts with other
applications on the same domain that use generic cookie names like
"sessionID" or "token".

Affected cookies: token, sessionID, language, prefs/prefsHttp,
express_sid.

The prefix is passed to the client via clientVars.cookiePrefix in the
bootstrap templates so it's available before the handshake. Server-side
cookie reads fall back to unprefixed names for backward compatibility
during migration.

Fixes #664

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix: default cookie prefix to empty string for backward compatibility

Changing the default to "ep_" would invalidate all existing sessions
on upgrade since express-session only looks for the configured cookie
name. Default to "" (no prefix) so upgrades are non-breaking — users
opt-in to prefixed names by setting cookie.prefix in settings.json.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix: address Qodo review — cookie prefix migration and fallbacks

- l10n.ts: Read prefixed language cookie with fallback to unprefixed
- welcome.ts: Use cookiePrefix for token transfer reads
- timeslider.ts: Use prefix for sessionID in socket messages
- pad_cookie.ts: Fall back to unprefixed prefs cookie for migration
- indexBootstrap.js: Pass cookiePrefix via clientVars to welcome page
- specialpages.ts: Pass settings to indexBootstrap template

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix: escape regex metacharacters in cookie prefix, document Vite hardcode

- l10n.ts: Escape special regex characters in cookiePrefix before using
  it in RegExp constructor to prevent runtime errors
- padViteBootstrap.js: Add comment noting the hardcoded prefix is
  dev-only and must match settings.json

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* security: validate cookie prefix to prevent header injection

Reject cookie.prefix values containing characters outside
[a-zA-Z0-9_-] to prevent HTTP header injection via crafted cookie
names (e.g., \r\n sequences). Falls back to empty prefix with an
error log.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-05 01:58:29 +01:00
John McLear
502a3b93e0
fix: accessibility — keyboard trap, screen reader support, aria-live (#7451)
* fix: accessibility — keyboard trap, screen reader support, aria-live

Three accessibility fixes:

#6581 (WCAG 2.1.2 keyboard trap): Escape key now moves focus from the
editor to the first toolbar button, giving keyboard-only users an
escape route. Added a screen-reader-only hint about Escape and Alt+F9.

#7255 (screen reader access): Added role="textbox", aria-multiline="true",
and aria-label="Pad content" to the contenteditable body so screen
readers can identify and interact with the editor content. Fixed
non-standard aria-role="document" to role="document" in pad.html.

#5695 (aria-live character echo): Removed aria-live="assertive" from
every line div in domline.ts. This was causing screen readers to
announce every character typed, overriding users' keyboard echo
settings. The attribute was added in PR #5149 for JAWS compatibility
but aria-live on individual contenteditable lines is a misuse.

Also added .sr-only CSS utility class for visually hidden content.

Fixes #6581, #7255, #5695

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix: Escape closes gritters first, only exits editor if nothing to dismiss

If gritter popups are visible, Escape closes them and keeps focus in
the editor. Only when there are no popups does Escape move focus to
the toolbar for keyboard trap escape.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix: address Qodo review — keyboard hint in iframe, aria-readonly

- Move keyboard hint (Escape/Alt+F9) inside the inner iframe with
  aria-describedby so screen readers announce it when focusing the
  editor. Previously it was on the outer editorcontainer which is a
  different document context.
- Set aria-readonly on the editor body when in readonly mode so screen
  readers correctly convey editability state.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-05 01:57:59 +01:00
John McLear
09d782f695
Enforce 2-space indentation across codebase (#7426)
* Enforce 2-space indentation across codebase

Convert all 4-space indented source files to 2-space to match
.editorconfig and project contributor guidelines.

74 files converted: admin UI components, type definitions, security
modules, test files, helpers, and utilities.

No functional changes — 2882 insertions, 2882 deletions (pure
whitespace).

Fixes #7353

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* Limit admin tests to chromium and firefox

Webkit is already tested in the dedicated frontend-tests workflow.
Running it again in admin tests causes flaky failures due to slow
socket connections and external API timeouts on webkit CI runners.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 19:48:45 +01:00
SamTV12345
41cb6803d2
7139 let user maintain a single session across multiple browsers (#7228)
* chore: started with implementation

* chore: finished index page

* chore: started with double sided modal

* chore: continue

* chore: completed implementation of transfer token

* chore: fixed typescript checks
2025-11-18 12:23:55 +01:00
SamTV12345
21f0992a17
chore: added settings for darkmode and relaxed width and height of inputs (#7204)
* chore: added settings for darkmode and relaxed width and height of inputs

* chore: add explanation for showRecentPads
2025-10-29 20:29:40 +01:00
SamTV12345
c0396aebf1
chore: add button to settings popup for dark mode (#7136) 2025-09-23 17:41:22 +02:00
SamTV12345
42e6defd37
chore: fixed exposeVersion call (#7135) 2025-09-23 17:32:27 +02:00
SamTV12345
8588d99f12
chore: migrated settings to esm6 (#7062)
* chore: migrated settings to esm6

* chore: fixed frontends

* chore: fixed missing usage of specialpages

* chore: fixed last errors for settings

* chore: fixed favicon test
2025-08-04 22:42:50 +02:00
SamTV12345
4248082c19 feat: updated welcome page 2025-08-01 21:42:05 +02:00
SamTV12345
bdbaa4e67c feat: continued with pad link functionality 2025-08-01 21:42:05 +02:00
SamTV12345
ed4522467a feat: append link programmatically 2025-08-01 21:42:05 +02:00
SamTV12345
4e734eb19e feat: first version 2025-08-01 21:42:05 +02:00
SamTV12345
341691d44a feat: started with recent pads implementation 2025-08-01 21:42:05 +02:00
SamTV12345
1e3a61e5fb
feat(pad-settings): added possibility to delete pad by the creator (#6730) 2024-10-28 21:56:10 +01:00
SamTV12345
3dae23a1e5 Fixed etherpad not being available from subdirectory 2024-08-17 21:13:51 +02:00
SamTV12345
7e3ad03e2f
Moved to ts (#6593)
* Moved to ts

* Fixed type check

* Removed js suffixes

* Migrated to ts

* Fixed ts.

* Fixed type check

* Installed missing d ts
2024-08-17 20:14:36 +02:00
SamTV12345
32a4068468 Fixed index html page 2024-07-23 18:14:49 +02:00
SamTv12345
a2ad4b1975 Fixed path issues in pad bootstrap 2024-07-23 11:47:44 +02:00
SamTV12345
d6d636955c
Feat/bundle js (#6511)
* Added minify

* Added POC for browser

* Moved first js files to ts

* Fixed caret positioning

* Added support for plugins

* Fixed get undefined.

* Removed require of socketio, l10n, html10n and error reporter

* Added minify

* Added POC for browser

* Moved first js files to ts

* Fixed caret positioning

* Added support for plugins

* Fixed get undefined.

* Removed require of socketio, l10n, html10n and error reporter

* Fixed popup not showing

* Fixed timeslider

* Reworked paths

* Fixed loading

* Don't generate sources map in production mode

* Non working hmr

* Added live reloading.

* Fixed timeslider when hot reloading

* Removed eval

* Fixed.

* Fixed env

* Fixed frontend tests.

* Added minifying via lightningcss

* Added minify via esbuild

* Fixed diagnostic url

* Removed lightningcss

* Fixed types

* Fixed alias

* Fixed loadtest

* Fixed

* Fixed loading ep_font_color3

* Restructure windows build

* Fixed windows build

* Fixed pnpm lock

---------

Co-authored-by: SamTv12345 <samtv12345@samtv12345.com>
2024-07-18 08:51:30 +02:00
SamTV12345
ec9e8eda64 Revert "Fix document not scrolling in iOS (all browsers) (#5599)"
This reverts commit 2301fdda8a1a38e0dde31ce2065f8666c9d07dd7.
2024-06-04 08:39:10 +02:00
Ali Sherief
2301fdda8a
Fix document not scrolling in iOS (all browsers) (#5599)
* Fix document not scrolling in iOS (all browsers)

This patches a bug where users cannot scroll a document on iOS,
because iOS does not allow iframes to be scrolled.

See https://davidwalsh.name/scroll-iframes-ios for details.

* trigger GitHub actions

---------

Co-authored-by: John McLear <john@mclear.co.uk>
2024-06-03 22:45:28 +02:00
SamTV12345
f1a1b6bfd7
Added Progressive Web App support for Etherpad (#6411) 2024-06-01 13:14:45 +02:00
SamTV12345
db46ffb63b
Feat/admin react (#6211)
* Added vite react admin ui.

* Added react i18next.

* Added pads manager.

* Fixed docker build.

* Fixed windows build.

* Fixed installOnWindows script.

* Install only if path exists.
2024-03-09 23:07:09 +01:00
Hossein Marzban
b2be2ca714
Migrate Socket.IO from Version 2 to Version 3 🚀 (#6152)
* feat :migrate socket.io 2 -> 3

* fix: backend test

* fix: ts error

* rm

* reset the test timeout

* Updated cli client.

* Updated lock file.

* Use updated load tester.

---------

Co-authored-by: SamTV12345 <40429738+samtv12345@users.noreply.github.com>
2024-02-17 21:36:26 +01:00
SamTV12345
cc22c195d8
Use XHTML syntax for valid Abiword export. (#5986) 2023-10-19 21:34:33 +02:00
SamTV12345
a096f1ae33
Update jQuery to 3.7 and fix admintests (#5868)
* jQuery: Migrate to `.on()`, `.off()`, `.trigger()`

This avoids methods that are deprecated in newer versions of jQuery.

* jQuery: avoid `.removeAttr`, prefer `.prop`

* helper.edit: wait up to 10 seconds for ACCEPT_COMMIT

* Chat: disabled attribute is boolean

* Chat: avoid inline onclick handler to support jQuery 3.4+

* jQuery: update to version 3.6.0

* Update to 3.7

* Removed deprecated event.

* Revert change to focus on padeditor.ace

---------

Co-authored-by: webzwo0i <webzwo0i@c3d2.de>
2023-08-08 18:26:25 +02:00
Chocobozzz
0cc15df9b9 Prevent pad translation and crash
Prevent "TypeError: Cannot read properties of null (reading 'sheet')"
exception because google chrome can translate `<style type="text/css" title="dynamicsyntax"></style>` title attribute
2021-12-22 17:46:32 +01:00
Richard Hansen
e28c9ffc97 tests: Support injecting hook functions during pad load 2021-11-01 01:54:28 -04:00
Richard Hansen
0ca5a3459f Timeslider: Install an error handler 2021-08-14 07:44:05 -04:00
Richard Hansen
1e22e0102d Timeslider: Move <title> and <script> inside <head> 2021-08-14 07:44:05 -04:00
Richard Hansen
b6fba9d66d Pad: Improve page load error handler
* Install the error handler early.
  * Include stack trace.
  * Remove unnecessary escaping.
  * Improve formatting.
  * Move to a separate script file.
2021-08-14 07:44:05 -04:00
Richard Hansen
d4e74fd038 Pad: Add missing <head> and <body> tags
The comment "head and body had been removed intentionally" implies
that the tags were causing some sort of problem, but the commit that
removed them (57075d15453331cd1ff6ad1175cb67bd7852d4d2) didn't provide
any rationale. I'm assuming it was a mistake.
2021-08-14 07:44:05 -04:00
Richard Hansen
834e05fc9c Chat: Use a <textarea> for message input 2021-07-19 23:44:33 +02:00
Richard Hansen
ea8846154f favicon: Redo favicon customization 2021-04-20 13:33:55 -04:00
webzwo0i
6f591b5c77
add class pad to timeslider to fix height issue (#4941) 2021-03-12 21:16:22 -05:00
Richard Hansen
48e1d1c23f CSS: Fix class name for outer iframe <html> tag
* Add the class "pad" to the `<html>` tag in `pad.html` (the outer
    iframe's parent).
  * Change the CSS selector that refers to the `<html>` tag in
    `pad.html` from `html:not(.inner-editor)` to `html.pad`.
  * Change the class name of the outer iframe's `<html>` tag from
    "inner-editor" to "outer-editor".
  * Update CSS rules to use the new class name.
2021-03-05 07:45:48 +00:00
John McLear
237bab7e3e
branding: change etherpad lite to etherpad in Pad settings modal 2021-02-28 15:51:39 +00:00
webzwo0i
a77994ab6e avoid pad_utils in pad.html 2021-02-25 12:46:04 +00:00
John McLear
543e94fd4a
timeslider: slight improvement on code quality (#4836)
This is an interim patch, ultimately the JS needs to be thrown out of the HTML...
2021-02-21 17:59:15 +00:00
John McLear
1b8cd0747d
Move vendor libraries to /vendors folder and exclude from LGTM 2021-02-21 15:07:39 +00:00
webzwo0i
0bb3e65020 fix for caching plugin-definitions 2021-02-21 14:31:15 +00:00
John McLear
086b59b30d
editor: UI polish - Etherpad brand as reconnect & loading animation 2021-02-21 13:24:51 +00:00
Richard Hansen
cd1d322af4 /admin/plugins/info: Move logic to .js file 2021-02-04 08:41:00 +00:00
Richard Hansen
303964c51e socket.io: Factor out client connection logic 2020-12-23 16:18:28 -05:00
webzwo0i
a637920e55
add list-style:none for ul.indents in exported HTML (#4586)
* add list-style:none for ul.indents in exported HTML

* use list-style-type not list-style
2020-12-20 06:00:18 +00:00
Richard Hansen
7e50fc2ab5 Delete dead SERVER_MESSAGE and guest handling code
None of this code seems to be reachable. Hopefully no plugins expect
it to exist.
2020-12-18 09:29:28 +00:00
Richard Hansen
af7cd13787 pad: Add a hook for the permission denied block
This makes it possible for the ep_readonly_guest plugin to add a login
button.
2020-12-16 19:39:52 +00:00
Richard Hansen
92b295193f css: Apply font formatting to the text, not the high-level div
This makes it possible for plugins to add new items without them
rendering centered, at a ridiculous size, or at an awkward location.
2020-12-16 19:39:52 +00:00
Richard Hansen
7f79d201e6 CSP: Move index.html inline code to separate .js file 2020-10-12 20:46:06 +01:00
Richard Hansen
a4927095ae CSP: Disable the indexCustomInlineScripts hook 2020-10-11 20:31:00 +01:00