@okjavis/nodebb-theme-javis 3.0.7 → 4.0.1
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 +1 -1
- package/scss/_composer.scss +37 -1
- package/scss/_feed.scss +2 -2
- package/scss/_forms.scss +6 -0
- package/static/lib/theme.js +50 -14
- package/templates/feed.tpl +3 -4
package/package.json
CHANGED
package/scss/_composer.scss
CHANGED
|
@@ -406,6 +406,7 @@ html.composing .composer .formatting-bar {
|
|
|
406
406
|
margin: 0 !important;
|
|
407
407
|
flex-shrink: 0 !important;
|
|
408
408
|
gap: $jv-space-3 !important;
|
|
409
|
+
overflow: visible !important; // Allow dropdowns to show
|
|
409
410
|
}
|
|
410
411
|
|
|
411
412
|
html.composing .composer .formatting-group {
|
|
@@ -413,11 +414,14 @@ html.composing .composer .formatting-group {
|
|
|
413
414
|
align-items: center !important;
|
|
414
415
|
gap: 2px !important;
|
|
415
416
|
flex-wrap: nowrap !important;
|
|
416
|
-
overflow
|
|
417
|
+
overflow: visible !important; // Allow dropdowns to show
|
|
418
|
+
padding-top: 8px !important; // Space for badges that overflow upward
|
|
417
419
|
|
|
418
420
|
li {
|
|
419
421
|
flex-shrink: 0 !important;
|
|
420
422
|
list-style: none !important;
|
|
423
|
+
position: relative !important; // For badge positioning
|
|
424
|
+
overflow: visible !important; // Allow badges to show
|
|
421
425
|
|
|
422
426
|
.btn {
|
|
423
427
|
color: $jv-text-muted !important;
|
|
@@ -430,11 +434,43 @@ html.composing .composer .formatting-group {
|
|
|
430
434
|
justify-content: center !important;
|
|
431
435
|
background: transparent !important;
|
|
432
436
|
border: none !important;
|
|
437
|
+
position: relative !important; // For badge positioning
|
|
438
|
+
overflow: visible !important; // Allow badges to show
|
|
433
439
|
|
|
434
440
|
&:hover {
|
|
435
441
|
background: $jv-hover-bg !important;
|
|
436
442
|
color: $jv-text-main !important;
|
|
437
443
|
}
|
|
444
|
+
|
|
445
|
+
// Badge on buttons (like thumbnail count)
|
|
446
|
+
.badge {
|
|
447
|
+
position: absolute !important;
|
|
448
|
+
top: -4px !important;
|
|
449
|
+
right: -4px !important;
|
|
450
|
+
transform: none !important;
|
|
451
|
+
left: auto !important;
|
|
452
|
+
font-size: 10px !important;
|
|
453
|
+
min-width: 16px !important;
|
|
454
|
+
height: 16px !important;
|
|
455
|
+
padding: 0 4px !important;
|
|
456
|
+
line-height: 16px !important;
|
|
457
|
+
}
|
|
458
|
+
}
|
|
459
|
+
|
|
460
|
+
// Dropdown containers (like Heading dropdown)
|
|
461
|
+
&.dropdown,
|
|
462
|
+
&.bottom-sheet {
|
|
463
|
+
overflow: visible !important;
|
|
464
|
+
position: relative !important;
|
|
465
|
+
|
|
466
|
+
.dropdown-menu {
|
|
467
|
+
position: absolute !important;
|
|
468
|
+
top: 100% !important;
|
|
469
|
+
left: 0 !important;
|
|
470
|
+
min-width: 150px !important;
|
|
471
|
+
z-index: 9999 !important;
|
|
472
|
+
margin-top: 2px !important;
|
|
473
|
+
}
|
|
438
474
|
}
|
|
439
475
|
}
|
|
440
476
|
|
package/scss/_feed.scss
CHANGED
|
@@ -315,7 +315,7 @@
|
|
|
315
315
|
.feed li[component="post"].posts-list-item {
|
|
316
316
|
background: $jv-surface !important;
|
|
317
317
|
border: 1px solid $jv-border-subtle !important;
|
|
318
|
-
border-radius: $jv-radius-
|
|
318
|
+
border-radius: $jv-radius-lg !important; // Match composer and widgets (16px)
|
|
319
319
|
margin-bottom: $jv-space-2 !important;
|
|
320
320
|
box-shadow: $jv-shadow-sm !important;
|
|
321
321
|
overflow: hidden !important;
|
|
@@ -657,7 +657,7 @@
|
|
|
657
657
|
// Action bar - now a direct child of the post card
|
|
658
658
|
.feed-action-bar {
|
|
659
659
|
background: $jv-surface !important;
|
|
660
|
-
border-radius: 0 0 $jv-radius-
|
|
660
|
+
border-radius: 0 0 $jv-radius-lg $jv-radius-lg; // Match card's bottom corners (16px)
|
|
661
661
|
|
|
662
662
|
.btn-link {
|
|
663
663
|
display: inline-flex;
|
package/scss/_forms.scss
CHANGED
|
@@ -116,9 +116,15 @@ textarea {
|
|
|
116
116
|
|
|
117
117
|
i {
|
|
118
118
|
width: 16px;
|
|
119
|
+
flex-shrink: 0;
|
|
119
120
|
color: $jv-text-muted;
|
|
120
121
|
}
|
|
121
122
|
|
|
123
|
+
// Hide bookmark option from dropdown menu
|
|
124
|
+
&[component="post/bookmark"] {
|
|
125
|
+
display: none !important;
|
|
126
|
+
}
|
|
127
|
+
|
|
122
128
|
&:hover {
|
|
123
129
|
background: rgba(0, 81, 255, 0.06);
|
|
124
130
|
color: $jv-primary;
|
package/static/lib/theme.js
CHANGED
|
@@ -555,15 +555,33 @@
|
|
|
555
555
|
// Remove downvoted if it was set
|
|
556
556
|
$downvoteBtn.removeClass('downvoted');
|
|
557
557
|
|
|
558
|
-
// Update vote count
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
if (
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
558
|
+
// Update vote count - handle various response structures
|
|
559
|
+
var votes = null;
|
|
560
|
+
if (response) {
|
|
561
|
+
if (response.response && response.response.post) {
|
|
562
|
+
votes = response.response.post.votes;
|
|
563
|
+
} else if (response.response && response.response.votes !== undefined) {
|
|
564
|
+
votes = response.response.votes;
|
|
565
|
+
} else if (response.post && response.post.votes !== undefined) {
|
|
566
|
+
votes = response.post.votes;
|
|
567
|
+
} else if (response.votes !== undefined) {
|
|
568
|
+
votes = response.votes;
|
|
565
569
|
}
|
|
566
570
|
}
|
|
571
|
+
|
|
572
|
+
if (votes !== null) {
|
|
573
|
+
$voteCount.text(votes);
|
|
574
|
+
$voteCount.attr('data-votes', votes);
|
|
575
|
+
$voteCount.attr('title', votes);
|
|
576
|
+
} else {
|
|
577
|
+
// Fallback: manually calculate from current state
|
|
578
|
+
var currentVotes = parseInt($voteCount.attr('data-votes') || $voteCount.text()) || 0;
|
|
579
|
+
var wasUpvoted = !$upvoteBtn.hasClass('upvoted'); // toggled already
|
|
580
|
+
votes = wasUpvoted ? currentVotes - 1 : currentVotes + 1;
|
|
581
|
+
$voteCount.text(votes);
|
|
582
|
+
$voteCount.attr('data-votes', votes);
|
|
583
|
+
$voteCount.attr('title', votes);
|
|
584
|
+
}
|
|
567
585
|
},
|
|
568
586
|
error: function(xhr) {
|
|
569
587
|
var msg = xhr.responseJSON && xhr.responseJSON.status && xhr.responseJSON.status.message;
|
|
@@ -601,15 +619,33 @@
|
|
|
601
619
|
// Remove upvoted if it was set
|
|
602
620
|
$upvoteBtn.removeClass('upvoted');
|
|
603
621
|
|
|
604
|
-
// Update vote count
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
if (
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
622
|
+
// Update vote count - handle various response structures
|
|
623
|
+
var votes = null;
|
|
624
|
+
if (response) {
|
|
625
|
+
if (response.response && response.response.post) {
|
|
626
|
+
votes = response.response.post.votes;
|
|
627
|
+
} else if (response.response && response.response.votes !== undefined) {
|
|
628
|
+
votes = response.response.votes;
|
|
629
|
+
} else if (response.post && response.post.votes !== undefined) {
|
|
630
|
+
votes = response.post.votes;
|
|
631
|
+
} else if (response.votes !== undefined) {
|
|
632
|
+
votes = response.votes;
|
|
611
633
|
}
|
|
612
634
|
}
|
|
635
|
+
|
|
636
|
+
if (votes !== null) {
|
|
637
|
+
$voteCount.text(votes);
|
|
638
|
+
$voteCount.attr('data-votes', votes);
|
|
639
|
+
$voteCount.attr('title', votes);
|
|
640
|
+
} else {
|
|
641
|
+
// Fallback: manually calculate from current state
|
|
642
|
+
var currentVotes = parseInt($voteCount.attr('data-votes') || $voteCount.text()) || 0;
|
|
643
|
+
var wasDownvoted = !$downvoteBtn.hasClass('downvoted'); // toggled already
|
|
644
|
+
votes = wasDownvoted ? currentVotes + 1 : currentVotes - 1;
|
|
645
|
+
$voteCount.text(votes);
|
|
646
|
+
$voteCount.attr('data-votes', votes);
|
|
647
|
+
$voteCount.attr('title', votes);
|
|
648
|
+
}
|
|
613
649
|
},
|
|
614
650
|
error: function(xhr) {
|
|
615
651
|
var msg = xhr.responseJSON && xhr.responseJSON.status && xhr.responseJSON.status.message;
|
package/templates/feed.tpl
CHANGED
|
@@ -94,13 +94,12 @@
|
|
|
94
94
|
{{{ end }}}
|
|
95
95
|
|
|
96
96
|
<!-- 3. ACTION BAR (third - separated from content) -->
|
|
97
|
+
<!-- Order: Likes, Comments, Reply -->
|
|
97
98
|
<div class="feed-action-bar d-flex justify-content-between px-3 py-2 border-top">
|
|
98
|
-
<a href="{config.relative_path}/post/{{{ if ./topic.teaserPid }}}{./topic.teaserPid}{{{ else }}}{./pid}{{{ end }}}" class="btn btn-link btn-sm text-body {{{ if !./isMainPost }}}invisible{{{ end }}}"><i class="fa-fw fa-regular fa-message text-muted"></i> {humanReadableNumber(./topic.postcount)}</a>
|
|
99
|
-
|
|
100
|
-
<a href="#" data-pid="{./pid}" data-action="bookmark" data-bookmarked="{./bookmarked}" data-bookmarks="{./bookmarks}" class="btn btn-link btn-sm text-body"><i class="fa-fw fa-bookmark {{{ if ./bookmarked }}}fa text-primary{{{ else }}}fa-regular text-muted{{{ end }}}"></i> <span component="bookmark-count">{humanReadableNumber(./bookmarks)}</span></a>
|
|
101
|
-
|
|
102
99
|
<a href="#" data-pid="{./pid}" data-action="upvote" data-upvoted="{./upvoted}" data-upvotes="{./upvotes}" class="btn btn-link btn-sm text-body"><i class="fa-fw fa-heart {{{ if ./upvoted }}}fa text-danger{{{ else }}}fa-regular text-muted{{{ end }}}"></i> <span component="upvote-count">{humanReadableNumber(./upvotes)}</span></a>
|
|
103
100
|
|
|
101
|
+
<a href="{config.relative_path}/post/{{{ if ./topic.teaserPid }}}{./topic.teaserPid}{{{ else }}}{./pid}{{{ end }}}" class="btn btn-link btn-sm text-body {{{ if !./isMainPost }}}invisible{{{ end }}}"><i class="fa-fw fa-regular fa-message text-muted"></i> {humanReadableNumber(./topic.postcount)}</a>
|
|
102
|
+
|
|
104
103
|
<a href="#" data-pid="{./pid}" data-is-main="{./isMainPost}" data-tid="{./tid}" data-action="reply" class="btn btn-link btn-sm text-body"><i class="fa-fw fa fa-reply text-muted"></i> [[topic:reply]]</a>
|
|
105
104
|
</div>
|
|
106
105
|
</li>
|