nodebb-theme-persona 11.3.22 → 11.3.26

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/less/search.less CHANGED
@@ -78,6 +78,13 @@
78
78
  }
79
79
  }
80
80
 
81
+ @media (max-width: @screen-xs-max) {
82
+ .quick-search-container {
83
+ left: 0px;
84
+ right: 0px;
85
+ }
86
+ }
87
+
81
88
  .quick-search-results, .search-results {
82
89
  .post-info {
83
90
  font-size: 12px;
package/less/topic.less CHANGED
@@ -370,6 +370,7 @@
370
370
  }
371
371
 
372
372
  .quick-reply {
373
+ position: relative;
373
374
  .icon {
374
375
  position: relative;
375
376
  border-radius: 50%;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nodebb-theme-persona",
3
- "version": "11.3.22",
3
+ "version": "11.3.26",
4
4
  "nbbpm": {
5
5
  "compatibility": "^1.18.0"
6
6
  },
@@ -1,8 +1,8 @@
1
1
  'use strict';
2
2
 
3
3
  define('persona/quickreply', [
4
- 'components', 'composer/autocomplete', 'api', 'alerts',
5
- ], function (components, autocomplete, api, alerts) {
4
+ 'components', 'composer/autocomplete', 'api', 'alerts', 'uploadHelpers',
5
+ ], function (components, autocomplete, api, alerts, uploadHelpers) {
6
6
  var QuickReply = {};
7
7
 
8
8
  QuickReply.init = function () {
@@ -27,6 +27,22 @@ define('persona/quickreply', [
27
27
  // data.element.textcomplete(data.strategies, data.options);
28
28
  // $('.textcomplete-wrapper').css('height', '100%').find('textarea').css('height', '100%');
29
29
 
30
+
31
+ uploadHelpers.init({
32
+ dragDropAreaEl: $('[component="topic/quickreply/container"] .quickreply-message'),
33
+ pasteEl: element,
34
+ uploadFormEl: $('[component="topic/quickreply/upload"]'),
35
+ inputEl: element,
36
+ route: '/api/post/upload',
37
+ callback: function (uploads) {
38
+ let text = element.val();
39
+ uploads.forEach((upload) => {
40
+ text = text + (text ? '\n' : '') + (upload.isImage ? '!' : '') + `[${upload.filename}](${upload.url})`;
41
+ });
42
+ element.val(text);
43
+ },
44
+ });
45
+
30
46
  var ready = true;
31
47
  components.get('topic/quickreply/button').on('click', function (e) {
32
48
  e.preventDefault();
package/public/persona.js CHANGED
@@ -192,7 +192,7 @@ $(document).ready(function () {
192
192
  return;
193
193
  }
194
194
 
195
- require(['pulling', 'storage', 'alerts'], function (Pulling, Storage, alerts) {
195
+ require(['pulling', 'storage', 'alerts', 'search'], function (Pulling, Storage, alerts, search) {
196
196
  if (!Pulling) {
197
197
  return;
198
198
  }
@@ -354,12 +354,22 @@ $(document).ready(function () {
354
354
 
355
355
  searchButton.addClass('hidden');
356
356
  searchInputEl.removeClass('hidden').focus();
357
- searchInputEl.off('blur').on('blur', function () {
358
- searchInputEl.addClass('hidden');
359
- searchButton.removeClass('hidden');
360
- });
361
357
  return false;
362
358
  });
359
+ searchInputEl.on('blur', function () {
360
+ searchInputEl.addClass('hidden');
361
+ searchButton.removeClass('hidden');
362
+ });
363
+ search.enableQuickSearch({
364
+ searchElements: {
365
+ inputEl: searchInputEl,
366
+ resultEl: $('.navbar-header .navbar-search .quick-search-container'),
367
+ },
368
+ searchOptions: {
369
+ in: config.searchDefaultInQuick,
370
+ },
371
+ });
372
+
363
373
 
364
374
  // add a checkbox in the user settings page
365
375
  // so users can swap the sides the menus appear on
@@ -21,8 +21,12 @@
21
21
  <textarea component="chat/input" placeholder="[[modules:chat.placeholder]]" class="form-control chat-input mousetrap" rows="1"></textarea>
22
22
  <button class="btn btn-primary" type="button" data-action="send"><i class="fa fa-fw fa-2x fa-paper-plane"></i></button>
23
23
  <span component="chat/message/remaining">{maximumChatMessageLength}</span>
24
+ <form component="chat/upload" method="post" enctype="multipart/form-data">
25
+ <input type="file" name="files[]" multiple class="hidden"/>
26
+ </form>
24
27
  </div>
25
28
  </div>
29
+ <div class="imagedrop"><div>[[topic:composer.drag_and_drop_images]]</div></div>
26
30
  </div>
27
31
  </div>
28
32
  </div>
@@ -13,4 +13,5 @@
13
13
  <div component="chat/main-wrapper">
14
14
  <!-- IMPORT partials/chats/message-window.tpl -->
15
15
  </div>
16
+ <div class="imagedrop"><div>[[topic:composer.drag_and_drop_images]]</div></div>
16
17
  </div>
@@ -20,6 +20,9 @@
20
20
  <textarea component="chat/input" placeholder="[[modules:chat.placeholder]]" class="form-control chat-input mousetrap" rows="2"></textarea>
21
21
  <button class="btn btn-primary" type="button" data-action="send"><i class="fa fa-fw fa-2x fa-paper-plane"></i></button>
22
22
  <span component="chat/message/remaining">{maximumChatMessageLength}</span>
23
+ <form component="chat/upload" method="post" enctype="multipart/form-data">
24
+ <input type="file" name="files[]" multiple class="hidden"/>
25
+ </form>
23
26
  </div>
24
27
  </div>
25
28
  <!-- ELSE -->
@@ -13,11 +13,14 @@
13
13
  {{{ if config.searchEnabled }}}
14
14
  <div class="navbar-search visible-xs pull-right">
15
15
  <form action="{config.relative_path}/search" method="GET">
16
- <button type="button" class="btn btn-link"><i class="fa fa-search fa-fw" title="[[global:header.search]]"></i></button>
16
+ <button type="button" class="btn btn-link"><i class="fa fa-lg fa-fw fa-search" title="[[global:header.search]]"></i></button>
17
17
  <input autocomplete="off" type="text" class="form-control hidden" name="term" placeholder="[[global:search]]"/>
18
18
  <button class="btn btn-primary hidden" type="submit"></button>
19
19
  <input type="text" class="hidden" name="in" value="{config.searchDefaultInQuick}" />
20
20
  </form>
21
+ <div class="quick-search-container hidden">
22
+ <div class="quick-search-results-container"></div>
23
+ </div>
21
24
  </div>
22
25
  {{{ end }}}
23
26
 
@@ -15,8 +15,8 @@
15
15
 
16
16
  {{{ if ./nid }}}<div class="pull-right mark-read" aria-label="Mark Read"></div>{{{ end }}}
17
17
  <a href="{notifications.path}" class="deco-none">
18
- <span class="pull-right relTime">{notifications.timeago}</span>
19
18
  <span class="text">{notifications.bodyShort}</span>
19
+ <span class="pull-right relTime">{notifications.timeago}</span>
20
20
  </a>
21
21
  <div class="clear"></div>
22
22
  </li>
@@ -1,5 +1,4 @@
1
1
  <section class="menu-section" data-section="navigation">
2
- <h3 class="menu-section-title">[[global:header.navigation]]</h3>
3
2
  <ul class="menu-section-list"></ul>
4
3
  </section>
5
4
 
@@ -1,5 +1,5 @@
1
1
  <!-- IF privileges.topics:reply -->
2
- <div class="clearfix quick-reply">
2
+ <div component="topic/quickreply/container" class="clearfix quick-reply">
3
3
  <div class="icon pull-left hidden-xs">
4
4
  <a href="<!-- IF posts.user.userslug -->{config.relative_path}/user/{posts.user.userslug}<!-- ELSE -->#<!-- ENDIF posts.user.userslug -->">
5
5
  {buildAvatar(loggedInUser, "46", true, "", "user/picture")}
@@ -13,8 +13,13 @@
13
13
  <input type="hidden" name="_csrf" value="{config.csrf_token}" />
14
14
  <div class="quickreply-message">
15
15
  <textarea name="content" component="topic/quickreply/text" class="form-control" rows="5"></textarea>
16
+ <div class="imagedrop"><div>[[topic:composer.drag_and_drop_images]]</div></div>
16
17
  </div>
17
18
  <button type="submit" component="topic/quickreply/button" class="btn btn-primary pull-right">[[topic:post-quick-reply]]</button>
18
19
  </form>
20
+ <form component="topic/quickreply/upload" method="post" enctype="multipart/form-data">
21
+ <input type="file" name="files[]" multiple class="hidden"/>
22
+ </form>
23
+
19
24
  </div>
20
25
  <!-- ENDIF privileges.topics:reply -->