nodebb-plugin-mentions 3.0.3 → 3.0.4
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/package.json +3 -3
- package/static/admin.js +36 -35
- package/static/autofill.js +4 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nodebb-plugin-mentions",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.4",
|
|
4
4
|
"description": "NodeBB Plugin that allows users to mention other users by prepending an '@' sign to their username",
|
|
5
5
|
"main": "library.js",
|
|
6
6
|
"scripts": {
|
|
@@ -32,8 +32,8 @@
|
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
34
|
"mocha": "9.1.3",
|
|
35
|
-
"eslint": "8.
|
|
36
|
-
"eslint-config-nodebb": "0.
|
|
35
|
+
"eslint": "8.4.0",
|
|
36
|
+
"eslint-config-nodebb": "0.1.1",
|
|
37
37
|
"eslint-plugin-import": "2.25.3"
|
|
38
38
|
}
|
|
39
39
|
}
|
package/static/admin.js
CHANGED
|
@@ -1,36 +1,37 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
$('input#autofillGroups').
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
/* globals $, app, socket, define */
|
|
4
|
+
|
|
5
|
+
define('admin/plugins/mentions', ['settings', 'alerts'], function (Settings, alerts) {
|
|
6
|
+
|
|
7
|
+
var ACP = {};
|
|
8
|
+
|
|
9
|
+
ACP.init = function () {
|
|
10
|
+
Settings.load('mentions', $('.mentions-settings'));
|
|
11
|
+
|
|
12
|
+
$(window).on('action:admin.settingsLoaded', applyDefaults);
|
|
13
|
+
|
|
14
|
+
$('#save').on('click', function () {
|
|
15
|
+
Settings.save('mentions', $('.mentions-settings'), function () {
|
|
16
|
+
alerts.alert({
|
|
17
|
+
type: 'success',
|
|
18
|
+
alert_id: 'mentions-saved',
|
|
19
|
+
title: 'Settings Saved',
|
|
20
|
+
message: 'Please reload your NodeBB to apply these settings',
|
|
21
|
+
clickfn: function () {
|
|
22
|
+
socket.emit('admin.reload');
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
});
|
|
26
|
+
});
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
function applyDefaults() {
|
|
30
|
+
if (!ajaxify.data.settings || !ajaxify.data.settings.hasOwnProperty('autofillGroups')) {
|
|
31
|
+
$('input#autofillGroups').parents('.mdl-switch').toggleClass('is-checked', false);
|
|
32
|
+
$('input#autofillGroups').prop('checked', false);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
return ACP;
|
|
36
37
|
});
|
package/static/autofill.js
CHANGED
|
@@ -118,7 +118,10 @@ $(document).ready(function() {
|
|
|
118
118
|
function loadGroupList() {
|
|
119
119
|
socket.emit('plugins.mentions.listGroups', function(err, groupNames) {
|
|
120
120
|
if (err) {
|
|
121
|
-
|
|
121
|
+
require(['alerts'], function (alerts) {
|
|
122
|
+
alerts.error(err);
|
|
123
|
+
})
|
|
124
|
+
return;
|
|
122
125
|
}
|
|
123
126
|
groupList = groupNames;
|
|
124
127
|
});
|