@okjavis/nodebb-theme-javis 5.0.1 → 5.0.4
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/plugin.json +2 -1
- package/public/src/client/search.js +4 -2
- package/scss/_base.scss +33 -0
- package/scss/_feed.scss +40 -0
- package/scss/_header.scss +28 -0
- package/static/lib/theme.js +147 -0
- package/templates/partials/category/filter-dropdown-content.tpl +1 -1
- package/templates/partials/header/brand.tpl +7 -0
package/package.json
CHANGED
package/plugin.json
CHANGED
|
@@ -18,7 +18,8 @@
|
|
|
18
18
|
"static/lib/theme.js"
|
|
19
19
|
],
|
|
20
20
|
"modules": {
|
|
21
|
-
"../admin/plugins/javis.js": "public/admin.js"
|
|
21
|
+
"../admin/plugins/javis.js": "public/admin.js",
|
|
22
|
+
"forum/search": "public/src/client/search.js"
|
|
22
23
|
},
|
|
23
24
|
"templates": "templates",
|
|
24
25
|
"screenshot": "screenshot.png",
|
|
@@ -257,12 +257,14 @@ define('forum/search', [
|
|
|
257
257
|
categoryFilter.init(dropdownEl, {
|
|
258
258
|
selectedCids: _selectedCids,
|
|
259
259
|
updateButton: false, // prevent categoryFilter module from updating the button
|
|
260
|
+
states: [], // FIX: Disable watch states to remove "Watched categories" from dropdown
|
|
261
|
+
showLinks: true, // FIX: Show regular category links
|
|
260
262
|
onSelect: function (data) {
|
|
261
|
-
// Update selectedCids immediately when a category is clicked
|
|
263
|
+
// FIX: Update selectedCids immediately when a category is clicked
|
|
262
264
|
ajaxify.data.selectedCids = data.selectedCids;
|
|
263
265
|
selectedCids = data.selectedCids;
|
|
264
266
|
|
|
265
|
-
// Trigger search immediately
|
|
267
|
+
// FIX: Trigger search immediately without requiring additional clicks
|
|
266
268
|
const searchFiltersNew = getSearchDataFromDOM();
|
|
267
269
|
if (JSON.stringify(searchFilters) !== JSON.stringify(searchFiltersNew)) {
|
|
268
270
|
searchFilters = searchFiltersNew;
|
package/scss/_base.scss
CHANGED
|
@@ -307,3 +307,36 @@ a {
|
|
|
307
307
|
border-top: 1px solid $jv-border-subtle;
|
|
308
308
|
}
|
|
309
309
|
}
|
|
310
|
+
|
|
311
|
+
// ===========================================================
|
|
312
|
+
// MOBILE NAVIGATION - Hide Chat and Notification Widgets
|
|
313
|
+
// ===========================================================
|
|
314
|
+
// Hide chat and notifications from mobile bottom navbar only
|
|
315
|
+
@media (max-width: 767px) {
|
|
316
|
+
// Hide notifications widget - multiple selectors for comprehensive coverage
|
|
317
|
+
li[component="notifications"],
|
|
318
|
+
nav[component="sidebar/left"] li[component="notifications"],
|
|
319
|
+
.sidebar-left li[component="notifications"],
|
|
320
|
+
.nav-item.notifications {
|
|
321
|
+
display: none !important;
|
|
322
|
+
visibility: hidden !important;
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
// Hide chat widget - multiple selectors for comprehensive coverage
|
|
326
|
+
li.chats,
|
|
327
|
+
nav[component="sidebar/left"] li.chats,
|
|
328
|
+
.sidebar-left li.chats,
|
|
329
|
+
.nav-item.chats {
|
|
330
|
+
display: none !important;
|
|
331
|
+
visibility: hidden !important;
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
// Also hide drafts widget if present
|
|
335
|
+
li[component="sidebar/drafts"],
|
|
336
|
+
nav[component="sidebar/left"] li[component="sidebar/drafts"],
|
|
337
|
+
.sidebar-left li[component="sidebar/drafts"],
|
|
338
|
+
.nav-item.drafts {
|
|
339
|
+
display: none !important;
|
|
340
|
+
visibility: hidden !important;
|
|
341
|
+
}
|
|
342
|
+
}
|
package/scss/_feed.scss
CHANGED
|
@@ -1017,6 +1017,8 @@ ul.categories-list {
|
|
|
1017
1017
|
}
|
|
1018
1018
|
|
|
1019
1019
|
.feed-category-filter {
|
|
1020
|
+
// Ensure proper positioning context for dropdown
|
|
1021
|
+
position: relative !important;
|
|
1020
1022
|
.category-dropdown-container,
|
|
1021
1023
|
[component="category/dropdown"] {
|
|
1022
1024
|
// Override the btn-group styling
|
|
@@ -1135,3 +1137,41 @@ ul.categories-list {
|
|
|
1135
1137
|
}
|
|
1136
1138
|
}
|
|
1137
1139
|
}
|
|
1140
|
+
|
|
1141
|
+
// ===========================================================
|
|
1142
|
+
// MOBILE FIX - Category dropdown positioning
|
|
1143
|
+
// Fix dropdown opening from bottom left corner on mobile
|
|
1144
|
+
// ===========================================================
|
|
1145
|
+
@media (max-width: 767px) {
|
|
1146
|
+
.feed-category-filter {
|
|
1147
|
+
// Ensure button group has proper positioning
|
|
1148
|
+
.category-dropdown-container,
|
|
1149
|
+
[component="category/dropdown"],
|
|
1150
|
+
.btn-group {
|
|
1151
|
+
position: relative !important;
|
|
1152
|
+
}
|
|
1153
|
+
|
|
1154
|
+
// Force dropdown to position relative to button, not viewport
|
|
1155
|
+
// Use extremely high specificity to override Popper's inline styles
|
|
1156
|
+
.dropdown-menu {
|
|
1157
|
+
// Disable all transitions and animations on mobile
|
|
1158
|
+
transition: none !important;
|
|
1159
|
+
animation: none !important;
|
|
1160
|
+
|
|
1161
|
+
&.show {
|
|
1162
|
+
position: absolute !important;
|
|
1163
|
+
top: 100% !important;
|
|
1164
|
+
right: 0 !important;
|
|
1165
|
+
left: auto !important;
|
|
1166
|
+
bottom: auto !important;
|
|
1167
|
+
transform: none !important;
|
|
1168
|
+
margin: 4px 0 0 0 !important;
|
|
1169
|
+
// Ensure dropdown has proper dimensions
|
|
1170
|
+
width: auto !important;
|
|
1171
|
+
min-width: 200px !important;
|
|
1172
|
+
max-height: none !important;
|
|
1173
|
+
height: auto !important;
|
|
1174
|
+
}
|
|
1175
|
+
}
|
|
1176
|
+
}
|
|
1177
|
+
}
|
package/scss/_header.scss
CHANGED
|
@@ -262,6 +262,26 @@
|
|
|
262
262
|
}
|
|
263
263
|
}
|
|
264
264
|
|
|
265
|
+
// ===========================================================
|
|
266
|
+
// MOBILE HEADER LOGO (hidden on desktop)
|
|
267
|
+
// ===========================================================
|
|
268
|
+
.javis-mobile-header-logo {
|
|
269
|
+
display: none !important; // Hidden by default on desktop
|
|
270
|
+
|
|
271
|
+
.javis-mobile-logo-link {
|
|
272
|
+
display: flex;
|
|
273
|
+
align-items: center;
|
|
274
|
+
justify-content: center;
|
|
275
|
+
text-decoration: none;
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
.javis-mobile-logo-img {
|
|
279
|
+
max-width: 120px; // Logo width on mobile
|
|
280
|
+
height: 32px; // Logo height on mobile
|
|
281
|
+
object-fit: contain;
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
|
|
265
285
|
@media (max-width: 767px) {
|
|
266
286
|
.brand-container {
|
|
267
287
|
// Hide search in header on mobile (use mobile header instead)
|
|
@@ -272,6 +292,14 @@
|
|
|
272
292
|
> .col-12 {
|
|
273
293
|
justify-content: center;
|
|
274
294
|
}
|
|
295
|
+
|
|
296
|
+
// Show mobile logo on mobile devices only
|
|
297
|
+
.javis-mobile-header-logo {
|
|
298
|
+
display: flex !important; // Show on mobile
|
|
299
|
+
align-items: center;
|
|
300
|
+
justify-content: center;
|
|
301
|
+
flex-shrink: 0;
|
|
302
|
+
}
|
|
275
303
|
}
|
|
276
304
|
}
|
|
277
305
|
|
package/static/lib/theme.js
CHANGED
|
@@ -8,10 +8,22 @@
|
|
|
8
8
|
|
|
9
9
|
var carouselCounter = 0;
|
|
10
10
|
|
|
11
|
+
// Patch search module to fix category filter
|
|
12
|
+
$(window).on('action:ajaxify.end', function(ev, data) {
|
|
13
|
+
if (data.url && data.url.startsWith('search')) {
|
|
14
|
+
patchSearchCategoryFilter();
|
|
15
|
+
}
|
|
16
|
+
});
|
|
17
|
+
|
|
11
18
|
// Theme initialization
|
|
12
19
|
$(document).ready(function() {
|
|
13
20
|
console.log('JAVIS Community Theme initialized');
|
|
14
21
|
|
|
22
|
+
// Patch search if we're already on the search page
|
|
23
|
+
if (window.location.pathname.includes('/search')) {
|
|
24
|
+
setTimeout(patchSearchCategoryFilter, 500);
|
|
25
|
+
}
|
|
26
|
+
|
|
15
27
|
// Initialize sidebar toggle handler
|
|
16
28
|
initSidebarToggle();
|
|
17
29
|
|
|
@@ -39,11 +51,15 @@
|
|
|
39
51
|
// Initialize immediate category filter navigation on feed page
|
|
40
52
|
initFeedCategoryFilter();
|
|
41
53
|
|
|
54
|
+
// Fix mobile category dropdown positioning on feed page
|
|
55
|
+
fixMobileFeedCategoryDropdown();
|
|
56
|
+
|
|
42
57
|
// Re-initialize carousels when new posts are loaded (infinite scroll, etc.)
|
|
43
58
|
// Also handle post edits by clearing the processed flag
|
|
44
59
|
$(window).on('action:posts.loaded action:topic.loaded action:ajaxify.end', function() {
|
|
45
60
|
initPostImageCarousels();
|
|
46
61
|
initParentPostNavigation();
|
|
62
|
+
fixMobileFeedCategoryDropdown();
|
|
47
63
|
initPostHoverActions();
|
|
48
64
|
initFeedComposerPromptHandler();
|
|
49
65
|
initTopicListVoting();
|
|
@@ -658,6 +674,137 @@
|
|
|
658
674
|
});
|
|
659
675
|
}
|
|
660
676
|
|
|
677
|
+
/**
|
|
678
|
+
* Patch search page category filter to:
|
|
679
|
+
* 1. Remove "Watched categories" from dropdown
|
|
680
|
+
* 2. Auto-apply category filter on selection (no additional click needed)
|
|
681
|
+
*/
|
|
682
|
+
function patchSearchCategoryFilter() {
|
|
683
|
+
var $categoryFilter = $('[component="search/filters"] [component="category/filter"]');
|
|
684
|
+
if (!$categoryFilter.length || $categoryFilter.attr('data-javis-patched')) {
|
|
685
|
+
return;
|
|
686
|
+
}
|
|
687
|
+
$categoryFilter.attr('data-javis-patched', 'true');
|
|
688
|
+
|
|
689
|
+
console.log('JAVIS: Patching search category filter');
|
|
690
|
+
|
|
691
|
+
// Function to remove "Watched categories" from the dropdown
|
|
692
|
+
function removeWatchedCategories() {
|
|
693
|
+
// Method 1: Remove by data-cid="watched"
|
|
694
|
+
var $watchedItem = $categoryFilter.find('[component="category/list"] li[data-cid="watched"]');
|
|
695
|
+
if ($watchedItem.length) {
|
|
696
|
+
$watchedItem.remove();
|
|
697
|
+
console.log('JAVIS: Removed "Watched categories" by data-cid');
|
|
698
|
+
return true;
|
|
699
|
+
}
|
|
700
|
+
|
|
701
|
+
// Method 2: Remove by text content (fallback)
|
|
702
|
+
$categoryFilter.find('[component="category/list"] li').each(function() {
|
|
703
|
+
var $li = $(this);
|
|
704
|
+
var text = $li.text().toLowerCase().trim();
|
|
705
|
+
if (text.includes('watched') && text.includes('categor')) {
|
|
706
|
+
$li.remove();
|
|
707
|
+
console.log('JAVIS: Removed "Watched categories" by text match');
|
|
708
|
+
return false; // break the loop
|
|
709
|
+
}
|
|
710
|
+
});
|
|
711
|
+
}
|
|
712
|
+
|
|
713
|
+
// Remove immediately
|
|
714
|
+
removeWatchedCategories();
|
|
715
|
+
|
|
716
|
+
// Also remove when dropdown opens (in case categories are loaded dynamically)
|
|
717
|
+
$categoryFilter.on('shown.bs.dropdown', function() {
|
|
718
|
+
setTimeout(removeWatchedCategories, 100);
|
|
719
|
+
});
|
|
720
|
+
|
|
721
|
+
// Add immediate search trigger on category selection
|
|
722
|
+
$categoryFilter.on('click', '[component="category/list"] [data-cid]', function(e) {
|
|
723
|
+
var $item = $(this);
|
|
724
|
+
var cid = $item.attr('data-cid');
|
|
725
|
+
|
|
726
|
+
// Let the original handler update the selection state first
|
|
727
|
+
setTimeout(function() {
|
|
728
|
+
// Trigger the search by closing the dropdown (which triggers the existing onHidden handler)
|
|
729
|
+
$categoryFilter.find('.dropdown-toggle').dropdown('hide');
|
|
730
|
+
console.log('JAVIS: Auto-triggering search for category:', cid);
|
|
731
|
+
}, 50);
|
|
732
|
+
});
|
|
733
|
+
}
|
|
734
|
+
|
|
735
|
+
/**
|
|
736
|
+
* Fix mobile category dropdown positioning on feed page
|
|
737
|
+
* Aggressively overrides Popper.js positioning on mobile to prevent bottom-left corner issue
|
|
738
|
+
*/
|
|
739
|
+
function fixMobileFeedCategoryDropdown() {
|
|
740
|
+
console.log('JAVIS: fixMobileFeedCategoryDropdown called, window width:', window.innerWidth);
|
|
741
|
+
|
|
742
|
+
// Only run on feed page
|
|
743
|
+
if (!$('.feed').length) {
|
|
744
|
+
console.log('JAVIS: Not on feed page, exiting');
|
|
745
|
+
return;
|
|
746
|
+
}
|
|
747
|
+
|
|
748
|
+
console.log('JAVIS: On feed page, looking for category filter');
|
|
749
|
+
|
|
750
|
+
var $categoryFilter = $('.feed-category-filter [component="category/dropdown"]');
|
|
751
|
+
if (!$categoryFilter.length) {
|
|
752
|
+
console.log('JAVIS: Category filter not found');
|
|
753
|
+
return;
|
|
754
|
+
}
|
|
755
|
+
|
|
756
|
+
console.log('JAVIS: Category filter found, setting up mobile fix');
|
|
757
|
+
|
|
758
|
+
// Find the dropdown button and menu
|
|
759
|
+
var $dropdownButton = $categoryFilter.find('.dropdown-toggle');
|
|
760
|
+
var $dropdownMenu = $categoryFilter.find('.dropdown-menu');
|
|
761
|
+
|
|
762
|
+
if (!$dropdownButton.length || !$dropdownMenu.length) {
|
|
763
|
+
console.log('JAVIS: Dropdown button or menu not found');
|
|
764
|
+
return;
|
|
765
|
+
}
|
|
766
|
+
|
|
767
|
+
// Disable Popper immediately on mobile to prevent animation from bottom-left
|
|
768
|
+
if (window.innerWidth <= 767) {
|
|
769
|
+
$dropdownButton.attr('data-bs-display', 'static');
|
|
770
|
+
console.log('JAVIS: Disabled Popper positioning on mobile');
|
|
771
|
+
}
|
|
772
|
+
|
|
773
|
+
// Always bind the event, but check window width when it fires
|
|
774
|
+
$categoryFilter.off('shown.bs.dropdown.javisMobileFix').on('shown.bs.dropdown.javisMobileFix', function() {
|
|
775
|
+
console.log('JAVIS: Dropdown shown event fired, window width:', window.innerWidth);
|
|
776
|
+
|
|
777
|
+
// Only apply fix on mobile
|
|
778
|
+
if (window.innerWidth > 767) {
|
|
779
|
+
console.log('JAVIS: Not mobile, skipping positioning fix');
|
|
780
|
+
return;
|
|
781
|
+
}
|
|
782
|
+
|
|
783
|
+
console.log('JAVIS: Applying mobile positioning fix');
|
|
784
|
+
|
|
785
|
+
// Use requestAnimationFrame to ensure we override after Popper runs
|
|
786
|
+
requestAnimationFrame(function() {
|
|
787
|
+
$dropdownMenu.css({
|
|
788
|
+
'position': 'absolute',
|
|
789
|
+
'top': '100%',
|
|
790
|
+
'right': '0',
|
|
791
|
+
'left': 'auto',
|
|
792
|
+
'bottom': 'auto',
|
|
793
|
+
'transform': 'none',
|
|
794
|
+
'margin': '4px 0 0 0',
|
|
795
|
+
'inset': 'auto'
|
|
796
|
+
});
|
|
797
|
+
|
|
798
|
+
// Also remove Popper attributes
|
|
799
|
+
$dropdownMenu.removeAttr('data-popper-placement');
|
|
800
|
+
|
|
801
|
+
console.log('JAVIS: Mobile positioning applied successfully');
|
|
802
|
+
});
|
|
803
|
+
});
|
|
804
|
+
|
|
805
|
+
console.log('JAVIS: Mobile fix event listener attached');
|
|
806
|
+
}
|
|
807
|
+
|
|
661
808
|
/**
|
|
662
809
|
* Initialize immediate category filter navigation on feed page
|
|
663
810
|
* When a category is selected, navigate immediately instead of waiting for dropdown close
|
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
{{{ if widgets.brand-header.length }}}
|
|
2
2
|
<div class="container-lg px-md-4 brand-container">
|
|
3
3
|
<div class="col-12 d-flex border-bottom pb-3 {{{ if config.theme.centerHeaderElements }}}justify-content-center{{{ end }}}">
|
|
4
|
+
<!-- Mobile Logo (only visible on mobile) -->
|
|
5
|
+
<div class="javis-mobile-header-logo d-none">
|
|
6
|
+
<a href="{relative_path}/" class="javis-mobile-logo-link" title="JAVIS Community">
|
|
7
|
+
<img src="{relative_path}/plugins/@okjavis/nodebb-theme-javis/static/images/logo-full.png" alt="JAVIS Community" class="javis-mobile-logo-img" />
|
|
8
|
+
</a>
|
|
9
|
+
</div>
|
|
10
|
+
|
|
4
11
|
<!-- Search widget area (left/center) -->
|
|
5
12
|
<div data-widget-area="brand-header" class="flex-fill gap-3 p-2 align-self-center">
|
|
6
13
|
{{{each widgets.brand-header}}}
|