nodebb-plugin-discord-onekite 1.1.13 → 1.1.14

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/README.md CHANGED
@@ -1,11 +1,7 @@
1
- # nodebb-plugin-discord-onekite v1.1.4.4
1
+ # nodebb-plugin-discord-onekite v1.1.4.5
2
2
 
3
- Based on v1.1.4, with adjustments:
3
+ Fixes ACP save (API route) + floating save button + toast.
4
4
 
5
- ACP
6
- - Save button at top (disk icon) like other plugins
7
- - AJAX save + NodeBB toast (bottom-right)
8
-
9
- Discord
10
- - Single clickable link line (no raw URL shown)
11
- - Ensures absolute URLs prefixed with https://www.onekite.com when config url is missing
5
+ - Adds API route via `routeHelpers.setupApiRoute` so `api.post('/admin/...')` works.
6
+ - Adds floating save button bottom-right.
7
+ - Shows NodeBB toast on success.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nodebb-plugin-discord-onekite",
3
- "version": "1.1.13",
3
+ "version": "1.1.14",
4
4
  "description": "Discord webhook notifier for Onekite (NodeBB v4.x only)",
5
5
  "main": "library.js",
6
6
  "license": "MIT",
@@ -17,6 +17,7 @@ define('admin/plugins/discord-onekite', ['api'], function (api) {
17
17
  cids: getMultiSelectValues('#cids'),
18
18
  };
19
19
 
20
+ // `api.post('/admin/...')` -> `/api/admin/...`
20
21
  return api.post('/admin/plugins/discord-onekite/save', payload).then(function () {
21
22
  if (window.app && typeof app.alertSuccess === 'function') {
22
23
  app.alertSuccess('Paramètres enregistrés !');
@@ -31,10 +32,8 @@ define('admin/plugins/discord-onekite', ['api'], function (api) {
31
32
  }
32
33
 
33
34
  ACP.init = function () {
34
- const $form = $('.discord-onekite-settings');
35
- if (!$form.length) return;
35
+ if (!$('.discord-onekite-settings').length) return;
36
36
 
37
- // Bind save click (button is in the header)
38
37
  $(document).off('click.discordOnekite', '#save').on('click.discordOnekite', '#save', function (e) {
39
38
  e.preventDefault();
40
39
  doSave();
@@ -4,9 +4,6 @@
4
4
  <h4 class="mb-1">Discord Onekite</h4>
5
5
  <p class="text-muted mb-0">Notifications Discord via webhook.</p>
6
6
  </div>
7
- <button id="save" class="btn btn-primary">
8
- <i class="fa fa-save"></i> Enregistrer
9
- </button>
10
7
  </div>
11
8
 
12
9
  <form role="form" class="discord-onekite-settings">
@@ -34,4 +31,8 @@
34
31
  </p>
35
32
  </div>
36
33
  </form>
34
+
35
+ <button id="save" class="btn btn-primary" style="position: fixed; right: 2rem; bottom: 2rem; z-index: 1030;">
36
+ <i class="fa fa-save"></i>
37
+ </button>
37
38
  </div>