nodebb-theme-persona 12.1.8 → 12.1.10

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.10",
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;
@@ -0,0 +1,50 @@
1
+ <div id="results" class="search-results col-md-12" data-search-query="{search_query}">
2
+ <!-- IF matchCount -->
3
+ <div class="alert alert-info">[[search:results_matching, {matchCount}, {search_query}, {time}]] </div>
4
+ <!-- ELSE -->
5
+ <!-- IF search_query -->
6
+ <div class="alert alert-warning">[[search:no-matches]]</div>
7
+ <!-- ENDIF search_query -->
8
+ <!-- ENDIF matchCount -->
9
+
10
+ {{{each posts}}}
11
+ <div class="topic-row panel panel-default clearfix">
12
+ <div class="panel-body">
13
+ <a href="{config.relative_path}/user/{posts.user.userslug}">{buildAvatar(posts.user, "sm", true)}</a>
14
+ <span class="search-result-text search-result-title"><a href="{config.relative_path}/post/{posts.pid}">{posts.topic.title}</a></span>
15
+ <br/>
16
+ <!-- IF showAsPosts -->
17
+ <div class="search-result-text">
18
+ {posts.content}
19
+ <p class="fade-out"></p>
20
+ </div>
21
+ <!-- ENDIF showAsPosts -->
22
+
23
+ <small class="post-info pull-right">
24
+ <a href="{config.relative_path}/category/{posts.category.slug}"><span class="fa-stack" style="{function.generateCategoryBackground, posts.category}"><i style="color:{posts.category.color};" class="fa {posts.category.icon} fa-stack-1x"></i></span> {posts.category.name}</a> &bull;
25
+ <span class="timeago" title="{posts.timestampISO}"></span>
26
+ </small>
27
+ </div>
28
+ </div>
29
+ {{{end}}}
30
+
31
+ <!-- IF users.length -->
32
+ <ul id="users-container" class="users-container">
33
+ <!-- IMPORT partials/users_list.tpl -->
34
+ </ul>
35
+ <!-- ENDIF users.length -->
36
+
37
+ <!-- IF tags.length -->
38
+ <!-- IMPORT partials/tags_list.tpl -->
39
+ <!-- ENDIF tags.length -->
40
+
41
+ {{{ if categories.length }}}
42
+ <ul class="categories">
43
+ {{{each categories}}}
44
+ <!-- IMPORT partials/categories/item.tpl -->
45
+ {{{end}}}
46
+ </ul>
47
+ {{{ end }}}
48
+
49
+ <!-- IMPORT partials/paginator.tpl -->
50
+ </div>
@@ -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"/>
@@ -36,12 +36,10 @@
36
36
 
37
37
  <div class="row">
38
38
  <div class="col-xs-12 col-sm-8 col-sm-offset-2">
39
- <button class="btn btn-primary btn-block">[[topic:composer.submit]]</button>
39
+ <div class="btn-group btn-block">
40
+ <button class="btn btn-block btn-primary">[[topic:composer.submit]]</button>
41
+ <button class="btn btn-block btn-link" formaction="{config.relative_path}/register/abort?_csrf={config.csrf_token}">{{{ if register }}}[[register:cancel_registration]]{{{ else }}}[[modules:bootbox.cancel]]{{{ end }}}</button>
42
+ </div>
40
43
  </div>
41
44
  </div>
42
- </form>
43
- <form role="form" method="post" action="{config.relative_path}/register/abort">
44
- <p class="text-center">
45
- <button class="btn btn-link">{{{ if register }}}[[register:cancel_registration]]{{{ else }}}[[modules:bootbox.cancel]]{{{ end }}}</button>
46
- </p>
47
45
  </form>
@@ -168,55 +168,6 @@
168
168
  </div>
169
169
 
170
170
  <div class="row">
171
- <div id="results" class="search-results col-md-12" data-search-query="{search_query}">
172
- <!-- IF matchCount -->
173
- <div class="alert alert-info">[[search:results_matching, {matchCount}, {search_query}, {time}]] </div>
174
- <!-- ELSE -->
175
- <!-- IF search_query -->
176
- <div class="alert alert-warning">[[search:no-matches]]</div>
177
- <!-- ENDIF search_query -->
178
- <!-- ENDIF matchCount -->
179
-
180
- {{{each posts}}}
181
- <div class="topic-row panel panel-default clearfix">
182
- <div class="panel-body">
183
- <a href="{config.relative_path}/user/{posts.user.userslug}">{buildAvatar(posts.user, "sm", true)}</a>
184
- <span class="search-result-text search-result-title"><a href="{config.relative_path}/post/{posts.pid}">{posts.topic.title}</a></span>
185
- <br/>
186
- <!-- IF showAsPosts -->
187
- <div class="search-result-text">
188
- {posts.content}
189
- <p class="fade-out"></p>
190
- </div>
191
- <!-- ENDIF showAsPosts -->
192
-
193
- <small class="post-info pull-right">
194
- <a href="{config.relative_path}/category/{posts.category.slug}"><span class="fa-stack" style="{function.generateCategoryBackground, posts.category}"><i style="color:{posts.category.color};" class="fa {posts.category.icon} fa-stack-1x"></i></span> {posts.category.name}</a> &bull;
195
- <span class="timeago" title="{posts.timestampISO}"></span>
196
- </small>
197
- </div>
198
- </div>
199
- {{{end}}}
200
-
201
- <!-- IF users.length -->
202
- <ul id="users-container" class="users-container">
203
- <!-- IMPORT partials/users_list.tpl -->
204
- </ul>
205
- <!-- ENDIF users.length -->
206
-
207
- <!-- IF tags.length -->
208
- <!-- IMPORT partials/tags_list.tpl -->
209
- <!-- ENDIF tags.length -->
210
-
211
- {{{ if categories.length }}}
212
- <ul class="categories">
213
- {{{each categories}}}
214
- <!-- IMPORT partials/categories/item.tpl -->
215
- {{{end}}}
216
- </ul>
217
- {{{ end }}}
218
-
219
- <!-- IMPORT partials/paginator.tpl -->
220
- </div>
171
+ <!-- IMPORT partials/search-results.tpl -->
221
172
  </div>
222
173
  </div>