nodebb-theme-persona 13.0.30 → 13.0.31

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": "13.0.30",
3
+ "version": "13.0.31",
4
4
  "nbbpm": {
5
5
  "compatibility": "^3.0.0"
6
6
  },
package/plugin.json CHANGED
@@ -14,7 +14,6 @@
14
14
  ],
15
15
  "modules": {
16
16
  "../admin/plugins/persona.js": "public/admin.js",
17
- "persona/quickreply.js": "public/modules/quickreply.js",
18
17
  "persona/taskbar.js": "public/modules/taskbar.js",
19
18
  "persona/mobile-menu.js": "public/modules/mobile-menu.js",
20
19
  "../client/account/theme.js": "public/settings.js"
package/public/persona.js CHANGED
@@ -5,7 +5,6 @@ $(document).ready(function () {
5
5
  setupTaskbar();
6
6
  setupEditedByIcon();
7
7
  setupMobileMenu();
8
- setupQuickReply();
9
8
  configureNavbarHiding();
10
9
 
11
10
  $(window).on('resize', utils.debounce(configureNavbarHiding, 200));
@@ -256,18 +255,4 @@ $(document).ready(function () {
256
255
  });
257
256
  });
258
257
  }
259
-
260
- function setupQuickReply() {
261
- $(window).on('action:ajaxify.end', function (ev, data) {
262
- if (data.url && data.url.match('^topic/')) {
263
- if (config.enableQuickReply) {
264
- require(['persona/quickreply'], function (quickreply) {
265
- if (quickreply) {
266
- quickreply.init();
267
- }
268
- });
269
- }
270
- }
271
- });
272
- }
273
258
  });
@@ -1,102 +0,0 @@
1
- 'use strict';
2
-
3
- define('persona/quickreply', [
4
- 'components', 'composer', 'composer/autocomplete', 'api',
5
- 'alerts', 'uploadHelpers', 'mousetrap',
6
- ], function (
7
- components, composer, autocomplete, api,
8
- alerts, uploadHelpers, mousetrap
9
- ) {
10
- var QuickReply = {};
11
-
12
- QuickReply.init = function () {
13
- var element = components.get('topic/quickreply/text');
14
- var data = {
15
- element: element,
16
- strategies: [],
17
- options: {
18
- style: {
19
- 'z-index': 100,
20
- },
21
- // listPosition: function(position) {
22
- // this.$el.css(this._applyPlacement(position));
23
- // this.$el.css('position', 'absolute');
24
- // return this;
25
- // }
26
- },
27
- };
28
-
29
- $(window).trigger('composer:autocomplete:init', data);
30
- autocomplete._active.persona_qr = autocomplete.setup(data);
31
- // data.element.textcomplete(data.strategies, data.options);
32
- // $('.textcomplete-wrapper').css('height', '100%').find('textarea').css('height', '100%');
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
- });
39
-
40
- uploadHelpers.init({
41
- dragDropAreaEl: $('[component="topic/quickreply/container"] .quickreply-message'),
42
- pasteEl: element,
43
- uploadFormEl: $('[component="topic/quickreply/upload"]'),
44
- inputEl: element,
45
- route: '/api/post/upload',
46
- callback: function (uploads) {
47
- let text = element.val();
48
- uploads.forEach((upload) => {
49
- text = text + (text ? '\n' : '') + (upload.isImage ? '!' : '') + `[${upload.filename}](${upload.url})`;
50
- });
51
- element.val(text);
52
- },
53
- });
54
-
55
- var ready = true;
56
- components.get('topic/quickreply/button').on('click', function (e) {
57
- e.preventDefault();
58
- if (!ready) {
59
- return;
60
- }
61
-
62
- var replyMsg = components.get('topic/quickreply/text').val();
63
- var replyData = {
64
- tid: ajaxify.data.tid,
65
- handle: undefined,
66
- content: replyMsg,
67
- };
68
-
69
- ready = false;
70
- api.post(`/topics/${ajaxify.data.tid}`, replyData, function (err, data) {
71
- ready = true;
72
- if (err) {
73
- return alerts.error(err);
74
- }
75
- if (data && data.queued) {
76
- alerts.alert({
77
- type: 'success',
78
- title: '[[global:alert.success]]',
79
- message: data.message,
80
- timeout: 10000,
81
- clickfn: function () {
82
- ajaxify.go(`/post-queue/${data.id}`);
83
- },
84
- });
85
- }
86
-
87
- components.get('topic/quickreply/text').val('');
88
- autocomplete._active.persona_qr.hide();
89
- });
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
- });
99
- };
100
-
101
- return QuickReply;
102
- });