ep_rss 11.0.26 → 11.0.27

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/AGENTS.md CHANGED
@@ -17,13 +17,14 @@ ep_rss/
17
17
  ├── client.js
18
18
  ├── ep.json
19
19
  ├── index.js
20
+ ├── locales/
21
+ │ └── en.json
20
22
  ├── package.json
21
23
  ├── static/
22
- │ ├── img/
23
- ├── tests/
24
+ │ ├── css/exportColumn.css
25
+ └── tests/
24
26
  ├── templates/
25
- ├── embedFrame.ejs
26
- │ ├── embedFrame.html
27
+ └── exportColumn.ejs
27
28
  ```
28
29
 
29
30
  ## Helpers used
@@ -59,6 +60,6 @@ pnpm --filter ep_etherpad-lite run test-ui
59
60
 
60
61
  ## Quick reference: hooks declared in `ep.json`
61
62
 
62
- * Server: `eejsBlock_htmlHead`, `expressCreateServer`, `eejsBlock_embedPopup`
63
+ * Server: `eejsBlock_htmlHead`, `expressCreateServer`, `eejsBlock_exportColumn`, `eejsBlock_styles`
63
64
 
64
65
  When adding a hook, register it in both `ep.json` *and* the matching `exports.<hook> = ...` in the JS file.
package/client.js CHANGED
@@ -2,8 +2,14 @@
2
2
 
3
3
  const eejs = require('ep_etherpad-lite/node/eejs');
4
4
 
5
- exports.eejsBlock_embedPopup = (hookName, args, cb) => {
5
+ exports.eejsBlock_exportColumn = (hookName, args, cb) => {
6
6
  const feedURL = `..${args.renderContext.req.url}/feed`;
7
- args.content += eejs.require('ep_rss/templates/embedFrame.ejs', {feed: feedURL});
7
+ args.content += eejs.require('ep_rss/templates/exportColumn.ejs', {feed: feedURL});
8
+ return cb();
9
+ };
10
+
11
+ exports.eejsBlock_styles = (hookName, args, cb) => {
12
+ args.content +=
13
+ '<link rel="stylesheet" href="/static/plugins/ep_rss/static/css/exportColumn.css">';
8
14
  return cb();
9
15
  };
package/ep.json CHANGED
@@ -5,7 +5,8 @@
5
5
  "hooks": {
6
6
  "eejsBlock_htmlHead": "ep_rss/index",
7
7
  "expressCreateServer" : "ep_rss/index:registerRoute",
8
- "eejsBlock_embedPopup": "ep_rss/client:eejsBlock_embedPopup"
8
+ "eejsBlock_exportColumn": "ep_rss/client:eejsBlock_exportColumn",
9
+ "eejsBlock_styles": "ep_rss/client:eejsBlock_styles"
9
10
  }
10
11
  }
11
12
  ]
@@ -0,0 +1,4 @@
1
+ {
2
+ "ep_rss.exportrssa.title": "RSS feed of this pad",
3
+ "ep_rss.exportrss": "RSS"
4
+ }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "ep_rss",
3
3
  "description": "Get an RSS feed of pad updates",
4
- "version": "11.0.26",
4
+ "version": "11.0.27",
5
5
  "author": {
6
6
  "name": "John McLear",
7
7
  "email": "john@mclear.co.uk",
@@ -0,0 +1,24 @@
1
+ /*
2
+ * SVG export-icon styling. The other export buttons render a Fontello
3
+ * glyph via the .exporttype:before / .buttonicon-* pseudo-element; we
4
+ * use an inline SVG instead so the icon survives without registering
5
+ * an extra font character. Sized at 22px to match the heuristic
6
+ * height of the buttonicon font row, kept orange so RSS readers still
7
+ * recognise it at a glance.
8
+ */
9
+ #exportrssa .ep_rss_export_icon {
10
+ display: inline-flex;
11
+ align-items: center;
12
+ justify-content: center;
13
+ width: 22px;
14
+ height: 22px;
15
+ margin-right: 10px;
16
+ color: #f26522;
17
+ vertical-align: middle;
18
+ }
19
+
20
+ #exportrssa .ep_rss_export_icon svg {
21
+ width: 100%;
22
+ height: 100%;
23
+ fill: currentColor;
24
+ }
@@ -0,0 +1,43 @@
1
+ import {expect, test} from '@playwright/test';
2
+ import {goToNewPad} from 'ep_etherpad-lite/tests/frontend-new/helper/padHelper';
3
+
4
+ test.describe('ep_rss export-column link', () => {
5
+ test('renders the RSS link inside the Import/Export column', async ({page}) => {
6
+ await goToNewPad(page);
7
+ const link = page.locator('#exportColumn a#exportrssa');
8
+ await expect(link).toHaveCount(1);
9
+ await expect(link).toHaveAttribute('data-l10n-id', 'ep_rss.exportrssa.title');
10
+ await expect(link).toHaveAttribute('target', '_blank');
11
+ await expect(link).toHaveAttribute('rel', 'noopener');
12
+ const href = await link.getAttribute('href');
13
+ expect(href).toMatch(/\/feed$/);
14
+ await expect(link.locator('span#exportrss svg')).toHaveCount(1);
15
+ });
16
+
17
+ test('localized title attribute resolves via html10n', async ({page}) => {
18
+ await goToNewPad(page);
19
+ const link = page.locator('#exportrssa');
20
+ await expect.poll(
21
+ async () => link.getAttribute('title'),
22
+ {timeout: 5000},
23
+ ).toBe('RSS feed of this pad');
24
+ });
25
+
26
+ test('clicking the link reaches /p/<pad>/feed', async ({page, request}) => {
27
+ await goToNewPad(page);
28
+ const href = await page.locator('#exportrssa').getAttribute('href');
29
+ expect(href).toBeTruthy();
30
+ const resolved = new URL(href!, page.url()).toString();
31
+ const res = await request.get(resolved);
32
+ expect(res.status()).toBe(200);
33
+ expect(res.headers()['content-type']).toContain('application/rss+xml');
34
+ });
35
+
36
+ test('share/embed popup no longer carries an RSS block', async ({page}) => {
37
+ await goToNewPad(page);
38
+ // The legacy embedFrame.ejs put `<a class="rssfeed">` inside #embed.
39
+ // Verify nothing in #embed references the feed any more.
40
+ const stale = page.locator('#embed a.rssfeed, #embed a[href*="feed"]');
41
+ await expect(stale).toHaveCount(0);
42
+ });
43
+ });
@@ -0,0 +1,7 @@
1
+ <a id="exportrssa" data-l10n-id="ep_rss.exportrssa.title" target="_blank" rel="noopener" class="exportlink" href="<%= feed %>">
2
+ <span class="exporttype ep_rss_export_icon" id="exportrss" data-l10n-id="ep_rss.exportrss" aria-hidden="true">
3
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" focusable="false" aria-hidden="true">
4
+ <path d="M5 4.5a1.5 1.5 0 0 1 1.5-1.5C14.4 3 21 9.6 21 17.5a1.5 1.5 0 0 1-3 0C18 11.3 12.7 6 6.5 6A1.5 1.5 0 0 1 5 4.5Zm0 6a1.5 1.5 0 0 1 1.5-1.5C11.7 9 16 13.3 16 18.5a1.5 1.5 0 0 1-3 0C13 14.9 10.1 12 6.5 12A1.5 1.5 0 0 1 5 10.5ZM6.5 16a2 2 0 1 1 0 4 2 2 0 0 1 0-4Z"/>
5
+ </svg>
6
+ </span>
7
+ </a>
Binary file
@@ -1,8 +0,0 @@
1
- <br>
2
- <h2>Rss Feeds</h2>
3
- <p>
4
- <a class="rssfeed" href="<%= feed%>" title="Pad Feed">
5
- <img src="../static/plugins/ep_rss/static/img/rss.gif">
6
- </a>
7
-
8
- </p>
@@ -1 +0,0 @@
1
- <a class="rssfeed" href="feed">RSS Feed</a>