nodebb-theme-persona 11.2.6 → 11.2.7

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nodebb-theme-persona",
3
- "version": "11.2.6",
3
+ "version": "11.2.7",
4
4
  "nbbpm": {
5
5
  "compatibility": "^1.18.0"
6
6
  },
@@ -1,56 +1,64 @@
1
- "use strict";
2
-
3
- /*globals $, app, ajaxify, socket*/
4
-
5
- define('persona/quickreply', [
6
- 'components', 'composer/autocomplete', 'api'
7
- ], function(components, autocomplete, api) {
8
- var QuickReply = {};
9
-
10
- QuickReply.init = function() {
11
-
12
- var element = components.get('topic/quickreply/text');
13
- var data = {
14
- element: element,
15
- strategies: [],
16
- options: {
17
- style: {
18
- 'z-index': 100,
19
- }
20
- // listPosition: function(position) {
21
- // this.$el.css(this._applyPlacement(position));
22
- // this.$el.css('position', 'absolute');
23
- // return this;
24
- // }
25
- }
26
- };
27
-
28
- $(window).trigger('composer:autocomplete:init', data);
29
- autocomplete._active['persona_qr'] = autocomplete.setup(data);
30
- // data.element.textcomplete(data.strategies, data.options);
31
- // $('.textcomplete-wrapper').css('height', '100%').find('textarea').css('height', '100%');
32
-
33
- components.get('topic/quickreply/button').on('click', function(e) {
34
- e.preventDefault();
35
- var replyMsg = components.get('topic/quickreply/text').val();
36
- var replyData = {
37
- tid: ajaxify.data.tid,
38
- handle: undefined,
39
- content: replyMsg
40
- };
41
- api.post(`/topics/${ajaxify.data.tid}`, replyData, function (err, data) {
42
- if (err) {
43
- return app.alertError(err.message);
44
- }
45
- if (data && data.queued) {
46
- app.alertSuccess(data.message);
47
- }
48
-
49
- components.get('topic/quickreply/text').val('');
50
- autocomplete._active['persona_qr'].hide();
51
- });
52
- });
53
- };
54
-
55
- return QuickReply;
56
- });
1
+ "use strict";
2
+
3
+ /*globals $, app, ajaxify, socket*/
4
+
5
+ define('persona/quickreply', [
6
+ 'components', 'composer/autocomplete', 'api'
7
+ ], function(components, autocomplete, api) {
8
+ var QuickReply = {};
9
+
10
+ QuickReply.init = function() {
11
+
12
+ var element = components.get('topic/quickreply/text');
13
+ var data = {
14
+ element: element,
15
+ strategies: [],
16
+ options: {
17
+ style: {
18
+ 'z-index': 100,
19
+ }
20
+ // listPosition: function(position) {
21
+ // this.$el.css(this._applyPlacement(position));
22
+ // this.$el.css('position', 'absolute');
23
+ // return this;
24
+ // }
25
+ }
26
+ };
27
+
28
+ $(window).trigger('composer:autocomplete:init', data);
29
+ autocomplete._active['persona_qr'] = autocomplete.setup(data);
30
+ // data.element.textcomplete(data.strategies, data.options);
31
+ // $('.textcomplete-wrapper').css('height', '100%').find('textarea').css('height', '100%');
32
+
33
+ var ready = true;
34
+ components.get('topic/quickreply/button').on('click', function(e) {
35
+ e.preventDefault();
36
+ if (!ready) {
37
+ return;
38
+ }
39
+
40
+ var replyMsg = components.get('topic/quickreply/text').val();
41
+ var replyData = {
42
+ tid: ajaxify.data.tid,
43
+ handle: undefined,
44
+ content: replyMsg
45
+ };
46
+
47
+ ready = false;
48
+ api.post(`/topics/${ajaxify.data.tid}`, replyData, function (err, data) {
49
+ ready = true;
50
+ if (err) {
51
+ return app.alertError(err.message);
52
+ }
53
+ if (data && data.queued) {
54
+ app.alertSuccess(data.message);
55
+ }
56
+
57
+ components.get('topic/quickreply/text').val('');
58
+ autocomplete._active['persona_qr'].hide();
59
+ });
60
+ });
61
+ };
62
+
63
+ return QuickReply;
64
+ });