nodebb-theme-persona 11.3.3 → 11.3.7
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/account.less +1 -1
- package/less/mixins.less +6 -0
- package/less/mobile.less +0 -1
- package/package.json +1 -1
- package/public/admin.js +5 -14
- package/public/modules/quickreply.js +11 -14
- package/public/persona.js +21 -17
package/less/account.less
CHANGED
package/less/mixins.less
CHANGED
|
@@ -100,6 +100,10 @@
|
|
|
100
100
|
&+.timeline-event:before {
|
|
101
101
|
display: none;
|
|
102
102
|
}
|
|
103
|
+
|
|
104
|
+
.timeline-text.timeago {
|
|
105
|
+
display: none;
|
|
106
|
+
}
|
|
103
107
|
}
|
|
104
108
|
}
|
|
105
109
|
|
|
@@ -145,6 +149,8 @@
|
|
|
145
149
|
display: flex;
|
|
146
150
|
align-items: center;
|
|
147
151
|
justify-content: center;
|
|
152
|
+
flex-shrink: 0;
|
|
153
|
+
|
|
148
154
|
width: 32px;
|
|
149
155
|
height: 32px;
|
|
150
156
|
padding: 0;
|
package/less/mobile.less
CHANGED
package/package.json
CHANGED
package/public/admin.js
CHANGED
|
@@ -1,24 +1,15 @@
|
|
|
1
1
|
'use strict';
|
|
2
|
-
/* globals $, app */
|
|
3
|
-
|
|
4
|
-
define('admin/plugins/persona', ['settings'], function(Settings) {
|
|
5
2
|
|
|
3
|
+
define('admin/plugins/persona', ['settings'], function (Settings) {
|
|
6
4
|
var ACP = {};
|
|
7
5
|
|
|
8
|
-
ACP.init = function() {
|
|
6
|
+
ACP.init = function () {
|
|
9
7
|
Settings.load('persona', $('.persona-settings'));
|
|
10
8
|
|
|
11
|
-
$('#save').on('click', function() {
|
|
12
|
-
Settings.save('persona', $('.persona-settings')
|
|
13
|
-
app.alert({
|
|
14
|
-
type: 'success',
|
|
15
|
-
alert_id: 'persona-saved',
|
|
16
|
-
title: 'Settings Saved',
|
|
17
|
-
message: 'Persona settings saved'
|
|
18
|
-
});
|
|
19
|
-
});
|
|
9
|
+
$('#save').on('click', function () {
|
|
10
|
+
Settings.save('persona', $('.persona-settings'));
|
|
20
11
|
});
|
|
21
12
|
};
|
|
22
13
|
|
|
23
14
|
return ACP;
|
|
24
|
-
});
|
|
15
|
+
});
|
|
@@ -1,14 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
/*globals $, app, ajaxify, socket*/
|
|
1
|
+
'use strict';
|
|
4
2
|
|
|
5
3
|
define('persona/quickreply', [
|
|
6
|
-
'components', 'composer/autocomplete', 'api'
|
|
7
|
-
], function(components, autocomplete, api) {
|
|
4
|
+
'components', 'composer/autocomplete', 'api', 'alerts',
|
|
5
|
+
], function (components, autocomplete, api, alerts) {
|
|
8
6
|
var QuickReply = {};
|
|
9
7
|
|
|
10
|
-
QuickReply.init = function() {
|
|
11
|
-
|
|
8
|
+
QuickReply.init = function () {
|
|
12
9
|
var element = components.get('topic/quickreply/text');
|
|
13
10
|
var data = {
|
|
14
11
|
element: element,
|
|
@@ -16,17 +13,17 @@ define('persona/quickreply', [
|
|
|
16
13
|
options: {
|
|
17
14
|
style: {
|
|
18
15
|
'z-index': 100,
|
|
19
|
-
}
|
|
16
|
+
},
|
|
20
17
|
// listPosition: function(position) {
|
|
21
18
|
// this.$el.css(this._applyPlacement(position));
|
|
22
19
|
// this.$el.css('position', 'absolute');
|
|
23
20
|
// return this;
|
|
24
21
|
// }
|
|
25
|
-
}
|
|
22
|
+
},
|
|
26
23
|
};
|
|
27
24
|
|
|
28
25
|
$(window).trigger('composer:autocomplete:init', data);
|
|
29
|
-
autocomplete._active
|
|
26
|
+
autocomplete._active.persona_qr = autocomplete.setup(data);
|
|
30
27
|
// data.element.textcomplete(data.strategies, data.options);
|
|
31
28
|
// $('.textcomplete-wrapper').css('height', '100%').find('textarea').css('height', '100%');
|
|
32
29
|
|
|
@@ -41,21 +38,21 @@ define('persona/quickreply', [
|
|
|
41
38
|
var replyData = {
|
|
42
39
|
tid: ajaxify.data.tid,
|
|
43
40
|
handle: undefined,
|
|
44
|
-
content: replyMsg
|
|
41
|
+
content: replyMsg,
|
|
45
42
|
};
|
|
46
43
|
|
|
47
44
|
ready = false;
|
|
48
45
|
api.post(`/topics/${ajaxify.data.tid}`, replyData, function (err, data) {
|
|
49
46
|
ready = true;
|
|
50
47
|
if (err) {
|
|
51
|
-
return
|
|
48
|
+
return alerts.error(err);
|
|
52
49
|
}
|
|
53
50
|
if (data && data.queued) {
|
|
54
|
-
|
|
51
|
+
alerts.success(data.message);
|
|
55
52
|
}
|
|
56
53
|
|
|
57
54
|
components.get('topic/quickreply/text').val('');
|
|
58
|
-
autocomplete._active
|
|
55
|
+
autocomplete._active.persona_qr.hide();
|
|
59
56
|
});
|
|
60
57
|
});
|
|
61
58
|
};
|
package/public/persona.js
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
/*globals ajaxify, config, utils, app, socket, window, document, $*/
|
|
1
|
+
'use strict';
|
|
4
2
|
|
|
5
3
|
$(document).ready(function () {
|
|
6
4
|
setupNProgress();
|
|
@@ -32,7 +30,11 @@ $(document).ready(function () {
|
|
|
32
30
|
const headerRect = headerEl.getBoundingClientRect();
|
|
33
31
|
const headerStyle = window.getComputedStyle(headerEl);
|
|
34
32
|
|
|
35
|
-
let offset =
|
|
33
|
+
let offset =
|
|
34
|
+
headerRect.y + headerRect.height +
|
|
35
|
+
(parseInt(headerStyle.marginTop, 10) || 0) +
|
|
36
|
+
(parseInt(headerStyle.marginBottom, 10) || 0);
|
|
37
|
+
|
|
36
38
|
// body element itself introduces a hardcoded 70px padding on desktop resolution
|
|
37
39
|
if (env === 'lg') {
|
|
38
40
|
offset -= 70;
|
|
@@ -52,7 +54,7 @@ $(document).ready(function () {
|
|
|
52
54
|
return;
|
|
53
55
|
}
|
|
54
56
|
lastBSEnv = env;
|
|
55
|
-
var navbarEl = $(
|
|
57
|
+
var navbarEl = $('.navbar-fixed-top');
|
|
56
58
|
navbarEl.autoHidingNavbar('destroy').removeData('plugin_autoHidingNavbar');
|
|
57
59
|
navbarEl.css('top', '');
|
|
58
60
|
|
|
@@ -64,7 +66,7 @@ $(document).ready(function () {
|
|
|
64
66
|
|
|
65
67
|
function fixTopCss(topValue) {
|
|
66
68
|
if (ajaxify.data.template.topic) {
|
|
67
|
-
$('.topic .topic-header').css({top: topValue });
|
|
69
|
+
$('.topic .topic-header').css({ top: topValue });
|
|
68
70
|
} else {
|
|
69
71
|
var topicListHeader = $('.topic-list-header');
|
|
70
72
|
if (topicListHeader.length) {
|
|
@@ -74,12 +76,12 @@ $(document).ready(function () {
|
|
|
74
76
|
}
|
|
75
77
|
|
|
76
78
|
navbarEl.off('show.autoHidingNavbar')
|
|
77
|
-
.on('show.autoHidingNavbar', function() {
|
|
79
|
+
.on('show.autoHidingNavbar', function () {
|
|
78
80
|
fixTopCss('');
|
|
79
81
|
});
|
|
80
82
|
|
|
81
83
|
navbarEl.off('hide.autoHidingNavbar')
|
|
82
|
-
.on('hide.autoHidingNavbar', function() {
|
|
84
|
+
.on('hide.autoHidingNavbar', function () {
|
|
83
85
|
fixTopCss('0px');
|
|
84
86
|
});
|
|
85
87
|
}
|
|
@@ -164,7 +166,8 @@ $(document).ready(function () {
|
|
|
164
166
|
function setupEditedByIcon() {
|
|
165
167
|
function activateEditedTooltips() {
|
|
166
168
|
$('[data-pid] [component="post/editor"]').each(function () {
|
|
167
|
-
var el = $(this)
|
|
169
|
+
var el = $(this);
|
|
170
|
+
var icon;
|
|
168
171
|
|
|
169
172
|
if (!el.attr('data-editor')) {
|
|
170
173
|
return;
|
|
@@ -253,8 +256,9 @@ $(document).ready(function () {
|
|
|
253
256
|
|
|
254
257
|
$(window).on('resize action:ajaxify.start', function () {
|
|
255
258
|
navSlideout.close();
|
|
256
|
-
if (chatsSlideout) {
|
|
257
|
-
|
|
259
|
+
if (chatsSlideout) {
|
|
260
|
+
chatsSlideout.close();
|
|
261
|
+
}
|
|
258
262
|
});
|
|
259
263
|
|
|
260
264
|
navSlideout
|
|
@@ -359,7 +363,7 @@ $(document).ready(function () {
|
|
|
359
363
|
}
|
|
360
364
|
});
|
|
361
365
|
});
|
|
362
|
-
})
|
|
366
|
+
});
|
|
363
367
|
}
|
|
364
368
|
}
|
|
365
369
|
|
|
@@ -449,13 +453,13 @@ $(document).ready(function () {
|
|
|
449
453
|
}
|
|
450
454
|
|
|
451
455
|
function setupFavouriteMorph(parent, uid, username) {
|
|
452
|
-
require(['api'], function (api) {
|
|
456
|
+
require(['api', 'alerts'], function (api, alerts) {
|
|
453
457
|
parent.find('.btn-morph').click(function (ev) {
|
|
454
458
|
var type = $(this).hasClass('plus') ? 'follow' : 'unfollow';
|
|
455
459
|
var method = $(this).hasClass('plus') ? 'put' : 'del';
|
|
456
460
|
|
|
457
461
|
api[method]('/users/' + uid + '/follow').then(() => {
|
|
458
|
-
|
|
462
|
+
alerts.success('[[global:alert.' + type + ', ' + username + ']]');
|
|
459
463
|
});
|
|
460
464
|
|
|
461
465
|
$(this).toggleClass('plus').toggleClass('heart');
|
|
@@ -465,9 +469,9 @@ $(document).ready(function () {
|
|
|
465
469
|
$(this).prepend('<b class="drop"></b>');
|
|
466
470
|
}
|
|
467
471
|
|
|
468
|
-
var drop = $(this).find('b.drop').removeClass('animate')
|
|
469
|
-
|
|
470
|
-
|
|
472
|
+
var drop = $(this).find('b.drop').removeClass('animate');
|
|
473
|
+
var x = ev.pageX - (drop.width() / 2) - $(this).offset().left;
|
|
474
|
+
var y = ev.pageY - (drop.height() / 2) - $(this).offset().top;
|
|
471
475
|
|
|
472
476
|
drop.css({ top: y + 'px', left: x + 'px' }).addClass('animate');
|
|
473
477
|
});
|