nodebb-theme-persona 12.1.8 → 12.1.9

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": "12.1.8",
3
+ "version": "12.1.9",
4
4
  "nbbpm": {
5
5
  "compatibility": "^2.0.0"
6
6
  },
@@ -1,8 +1,12 @@
1
1
  'use strict';
2
2
 
3
3
  define('persona/quickreply', [
4
- 'components', 'composer/autocomplete', 'api', 'alerts', 'uploadHelpers',
5
- ], function (components, autocomplete, api, alerts, uploadHelpers) {
4
+ 'components', 'composer', 'composer/autocomplete', 'api',
5
+ 'alerts', 'uploadHelpers', 'mousetrap',
6
+ ], function (
7
+ components, composer, autocomplete, api,
8
+ alerts, uploadHelpers, mousetrap
9
+ ) {
6
10
  var QuickReply = {};
7
11
 
8
12
  QuickReply.init = function () {
@@ -27,6 +31,11 @@ define('persona/quickreply', [
27
31
  // data.element.textcomplete(data.strategies, data.options);
28
32
  // $('.textcomplete-wrapper').css('height', '100%').find('textarea').css('height', '100%');
29
33
 
34
+ mousetrap.bind('ctrl+return', (e) => {
35
+ if (e.target === element.get(0)) {
36
+ components.get('topic/quickreply/button').get(0).click();
37
+ }
38
+ });
30
39
 
31
40
  uploadHelpers.init({
32
41
  dragDropAreaEl: $('[component="topic/quickreply/container"] .quickreply-message'),
@@ -79,6 +88,14 @@ define('persona/quickreply', [
79
88
  autocomplete._active.persona_qr.hide();
80
89
  });
81
90
  });
91
+
92
+ components.get('topic/quickreply/expand').on('click', (e) => {
93
+ e.preventDefault();
94
+
95
+ const textEl = components.get('topic/quickreply/text');
96
+ composer.newReply(ajaxify.data.tid, undefined, ajaxify.data.title, utils.escapeHTML(textEl.val()));
97
+ textEl.val('');
98
+ });
82
99
  };
83
100
 
84
101
  return QuickReply;
@@ -12,10 +12,13 @@
12
12
  <input type="hidden" name="tid" value="{tid}" />
13
13
  <input type="hidden" name="_csrf" value="{config.csrf_token}" />
14
14
  <div class="quickreply-message">
15
- <textarea name="content" component="topic/quickreply/text" class="form-control" rows="5" placeholder="[[modules:composer.textarea.placeholder]]"></textarea>
15
+ <textarea name="content" component="topic/quickreply/text" class="form-control mousetrap" rows="5" placeholder="[[modules:composer.textarea.placeholder]]"></textarea>
16
16
  <div class="imagedrop"><div>[[topic:composer.drag_and_drop_images]]</div></div>
17
17
  </div>
18
- <button type="submit" component="topic/quickreply/button" class="btn btn-primary pull-right">[[topic:post-quick-reply]]</button>
18
+ <div class="btn-group pull-right">
19
+ <button type="submit" component="topic/quickreply/button" class="btn btn-primary">[[topic:post-quick-reply]]</button>
20
+ <button type="submit" component="topic/quickreply/expand" class="btn btn-default" formmethod="get"><i class="fa fa-expand"></i></button>
21
+ </div>
19
22
  </form>
20
23
  <form component="topic/quickreply/upload" method="post" enctype="multipart/form-data">
21
24
  <input type="file" name="files[]" multiple class="hidden"/>