nodebb-plugin-facebook-post 1.0.17 → 1.0.19

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/CLAUDE.md CHANGED
@@ -22,7 +22,6 @@ There is no build step for this plugin. NodeBB handles asset bundling.
22
22
  - `NODEBB_FB_PAGE_ID` – Facebook Page ID
23
23
  - `NODEBB_FB_PAGE_ACCESS_TOKEN` – Page access token
24
24
  - `NODEBB_FB_GRAPH_VERSION` – optional, defaults to `v25.0`
25
- - `NODEBB_FB_ALLOWED_GROUPS` – comma-separated NodeBB group names allowed to use the feature (e.g. `Staff,Communication`); empty = nobody
26
25
 
27
26
  ## Architecture
28
27
 
@@ -52,8 +51,8 @@ There is no build step for this plugin. NodeBB handles asset bundling.
52
51
 
53
52
  ### Settings Split
54
53
 
55
- - **Sensitive** (env vars, never stored in DB): `fbPageId`, `fbPageAccessToken`, `fbGraphVersion`, `allowedGroups`
56
- - **Non-sensitive** (stored in NodeBB DB via `meta.settings` with key `facebook-post`): `enabled`, `includeExcerpt`, `excerptMaxLen`, `categoriesWhitelist`, `minimumReputation`, `maxImages`, `enablePlaceTagging`
54
+ - **Sensitive** (env vars, never stored in DB): `fbPageId`, `fbPageAccessToken`, `fbGraphVersion`
55
+ - **Non-sensitive** (stored in NodeBB DB via `meta.settings` with key `facebook-post`): `enabled`, `includeExcerpt`, `excerptMaxLen`, `categoriesWhitelist`, `minimumReputation`, `maxImages`, `enablePlaceTagging`, `allowedGroups`
57
56
 
58
57
  Both are merged in `loadSettings()`, which is called on each relevant request to pick up live DB changes without restart.
59
58
 
package/library.js CHANGED
@@ -39,7 +39,6 @@ function readEnv() {
39
39
  fbGraphVersion: trimStr(env.NODEBB_FB_GRAPH_VERSION) || 'v25.0',
40
40
  fbPageId: trimStr(env.NODEBB_FB_PAGE_ID),
41
41
  fbPageAccessToken: trimStr(env.NODEBB_FB_PAGE_ACCESS_TOKEN),
42
- allowedGroups: trimStr(env.NODEBB_FB_ALLOWED_GROUPS || ''),
43
42
  };
44
43
  }
45
44
 
@@ -59,7 +58,6 @@ async function loadSettings() {
59
58
  settings.fbGraphVersion = env.fbGraphVersion;
60
59
  settings.fbPageId = env.fbPageId;
61
60
  settings.fbPageAccessToken = env.fbPageAccessToken;
62
- settings.allowedGroups = env.allowedGroups;
63
61
  }
64
62
 
65
63
  function getForumBaseUrl() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nodebb-plugin-facebook-post",
3
- "version": "1.0.17",
3
+ "version": "1.0.19",
4
4
  "description": "Auto-post new NodeBB topics to a fixed Facebook Page (text + NodeBB uploads + place id).",
5
5
  "main": "library.js",
6
6
  "dependencies": {
@@ -37,9 +37,17 @@
37
37
  </div>
38
38
  `;
39
39
 
40
- const $target = $composer.find('.write, .composer-body, .composer-content').first();
41
- if ($target.length) $target.prepend(html);
42
- else $composer.prepend(html);
40
+ const $write = $composer.find('.write').first();
41
+ if ($write.is('textarea')) {
42
+ // .write est la textarea elle-même — injecter après son conteneur parent
43
+ $write.parent().after(html);
44
+ } else if ($write.length) {
45
+ $write.prepend(html);
46
+ } else {
47
+ const $target = $composer.find('.composer-body, .composer-content').first();
48
+ if ($target.length) $target.prepend(html);
49
+ else $composer.prepend(html);
50
+ }
43
51
 
44
52
  const $enabled = $composer.find('[data-fbpost-enabled]');
45
53
  const $placeWrap = $composer.find('[data-fbpost-place-wrap]');