You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+22Lines changed: 22 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,27 @@
1
1
# Changelog
2
2
3
+
## 0.14.0
4
+
5
+
### Added
6
+
-**Comment Replies**: Implemented a comment reply feature. Users can now reply to specific messages, with a link that scrolls to the original message.
7
+
-**Authenticated Media**: Added support for fetching media from private Matrix rooms for authenticated users.
8
+
-**Internationalization (i18n)**: Introduced multilingual support, allowing the UI language to be configured. Shipped with English and Chinese translations.
9
+
-**Read-Only Mode**: Added a `commentEnabled` configuration option to disable commenting, providing a read-only view of the comment section.
10
+
11
+
### Changed
12
+
-**Performance**: Overhauled media caching by replacing the `localStorage` system with a more robust **IndexedDB** implementation, significantly reducing redundant downloads and improving load times.
13
+
-**Performance**: Eliminated comment section flickering during updates (e.g., loading more comments, posting) by using keyed rendering. This preserves the playback state of embedded media.
14
+
-**UI**: Improved the reply functionality with rich-text hover previews, SVG icons, message highlighting on scroll, and better `<blockquote>` styling.
15
+
16
+
### Fixed
17
+
-**"View More" Spam**: Prevented duplicate comments from being loaded by disabling the "View more" button during both initial and subsequent comment fetches.
18
+
-**Reply Tooltips**: Fixed issues where reply tooltips would overlap with the browser's native title attribute and would not disappear correctly on mobile devices.
19
+
-**Layout & Styling**: Resolved various CSS issues, including:
20
+
- Code blocks and audio players overflowing their containers.
21
+
- Incorrect wrapping for inline code.
22
+
- Poorly rendered tooltips in dark mode.
23
+
- Incorrect icon sizes and whitespace in the reply editor.
24
+
3
25
## 0.13.0
4
26
5
27
- Fix for missing `end` tokens, in sync responses from Synapse >= v1.61.0 (Thanks to Tom Price for !20).
An embeddable web client for federated comments using the Matrix network.
7
+
An embeddable web client for federated comments using the Matrix network. This fork revitalizes the original Cactus Comments with new features and bug fixes.
@@ -14,32 +18,110 @@ There are two components to Cactus Comments:
14
18
15
19
This repository is only the web client.
16
20
17
-
18
21
# Demo
19
22
20
-
You can play with a live demo at [cactus.chat/demo](https://cactus.chat/demo/)
23
+
You can play with a live demo at [nigzu.com](https://nigzu.com).
24
+
25
+
## Screenshots
26
+
27
+

28
+

29
+
30
+
# Features
21
31
32
+
-**Modern Architecture**: Refactored to support **Node.js v22+**.
33
+
-**Enhanced Media Support**:
34
+
-**Authenticated Media**: Supports Matrix's authenticated media endpoints (`isAuthenticated: true`) with a three-tier caching system (Memory, IndexedDB, Network) for optimized loading.
35
+
-**Full Reply Functionality**:
36
+
-**Quote Replies**: Clear context for replies.
37
+
-**Hover Preview**: Instantly preview the content of a reply (text, image, video).
38
+
-**Click to Jump**: Navigate to the original message.
39
+
-**Read-Only Mode**: A `commentEnabled: false` option to disable commenting, perfect for archives or announcements.
40
+
-**Internationalization**:
41
+
-**Language Switching**: `language` option to set the display language.
42
+
-**Flexible Translations**: Supports custom translation files (JS or JSON) with smart fallbacks.
43
+
-**UI/UX Fixes**:
44
+
- Fixed layout overflows and text wrapping issues.
45
+
-**Incremental Loading**: "Load More" now appends comments instead of refreshing the entire section, preventing flickers and improving performance.
22
46
23
-
# Example Usage
47
+
# Quick Start
24
48
25
-
Here is a minimal HTML page with the latest Cactus Comments release:
49
+
1. Download the latest release from the [release page](https://github.com/code-gal/cactus-client).
50
+
2. Upload `cactus.js`, `style.css`, and `cactus-lang.js` to your server or CDN.
This is a valid configuration for the client. You also need to use an appservice.
38
-
You can [host your own](https://cactus.chat/docs/server/self-host/), or [use the public one at cactus.chat](https://cactus.chat/docs/getting-started/quick-start/#register-your-site).
59
+
4. Add the comment section container and initialize the client:
39
60
40
-
Check out the [Quick Start guide](https://cactus.chat/docs/getting-started/quick-start/) on our website for a more complete tutorial.
siteName:"your-site-name", // The unique name you registered for your site.
71
+
commentSectionId:"unique-page-id", // A unique ID for each page's comment section.
72
+
73
+
// Optional - New Features!
74
+
isAuthenticated:true, // Set to true if your homeserver uses authenticated media.
75
+
commentEnabled:true, // Set to false for read-only mode.
76
+
language:'en', // e.g., 'en', 'cn', 'fr'.
77
+
translationsData:'cactusTranslations', // Translation file, you can also provide it on your own website.
78
+
79
+
// Other optional parameters...
80
+
pageSize:10,
81
+
loginEnabled:true,
82
+
guestPostingEnabled:true,
83
+
});
84
+
</script>
85
+
```
41
86
87
+
You also need to use an appservice. You can [host your own](https://cactus.chat/docs/server/self-host/), or [use the public one at cactus.chat](https://cactus.chat/docs/getting-started/quick-start/#register-your-site). For self-hosting, see the instructions below.
88
+
89
+
# Configuration
90
+
91
+
The `initComments` function accepts the following parameters:
92
+
93
+
| Name | Type | Required | Default | Description |
94
+
| :--- | :--- | :--- | :--- | :--- |
95
+
|`node`| HTMLElement/String | Yes | - | The HTML element (or a selector string) to be replaced by the comment section. |
96
+
|`defaultHomeserverUrl`| String | Yes | - | The URL of the Matrix homeserver that has the Cactus Comments appservice. |
97
+
|`serverName`| String | Yes | - | The server name of the Matrix homeserver. |
98
+
|`siteName`| String | Yes | - | The unique identifier for your site registered with the Cactusbot. |
99
+
|`commentSectionId`| String | Yes | - | A unique identifier for the comment section, used to create the room alias. |
100
+
|`pageSize`| Integer | No | 10 | Number of comments to load initially and on "load more". |
101
+
|`loginEnabled`| Boolean | No | true | If true, users can log in with their Matrix credentials. |
102
+
|`guestPostingEnabled`| Boolean | No | true | If true, users can post comments as guests without logging in. |
103
+
|`updateInterval`| Float | No | 0 | Interval in seconds to fetch new comments. 0 or negative disables it. |
104
+
|`isAuthenticated`| Boolean | No | false | Enable for homeservers with authenticated media. |
105
+
|`commentEnabled`| Boolean | No | true | Set to `false` to make the comment section read-only. |
106
+
|`translationsData`| String | No |`cactusTranslations`| The variable name for translation data. Defaults to the one in `cactus-lang.js`. |
107
+
|`language`| String | No |`en`| An ISO 639 language code (e.g., `cn`, `fr`, `en`). |
108
+
109
+
# Self-Hosting
110
+
111
+
When self-hosting the Matrix server (e.g., Synapse) and the [Cactus Appservice](https://gitlab.com/cactus-comments/cactus-appservice), make sure to:
112
+
113
+
1.**Enable Guest Access** in your `homeserver.yaml`:
114
+
```yaml
115
+
allow_guest_access: true
116
+
```
117
+
2. **Enable Legacy Appservice Authorization**: The Cactus Appservice requires an older authorization mechanism. Add this to your `homeserver.yaml` to allow the bot to register and manage rooms correctly:
118
+
```yaml
119
+
use_appservice_legacy_authorization: true
120
+
```
121
+
> **Warning**: This is required for the appservice to create its management bot and for you to register sites. Without it, the appservice will fail with a `401 CHAT.CACTUS.APPSERVICE_UNAUTHORIZED` error.
42
122
43
123
# Documentation
44
124
45
-
The complete documentation is available at our website, [cactus.chat](https://cactus.chat).
125
+
The complete documentation for the original project is available at our website, [cactus.chat](https://cactus.chat). Note that it may not cover the new features introduced in this fork.
126
+
127
+
For more instructions and detailed tutorials on this new branch, please refer to the article (in Chinese): [Rejuvenating the Matrix Commenting System: New Features I Developed for Cactus Comments](https://nigzu.com/matrix-cactus-comments-new-features-installation-tutorial/).
0 commit comments