nodebb-theme-persona 11.3.25 → 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/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.25",
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();
@@ -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 -->
@@ -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 -->