@okjavis/nodebb-theme-javis 5.0.4 → 5.0.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/package.json +1 -1
- package/scss/_base.scss +91 -0
- package/scss/_composer.scss +28 -0
- package/scss/_header.scss +16 -0
- package/static/lib/theme.js +99 -0
package/package.json
CHANGED
package/scss/_base.scss
CHANGED
|
@@ -340,3 +340,94 @@ a {
|
|
|
340
340
|
visibility: hidden !important;
|
|
341
341
|
}
|
|
342
342
|
}
|
|
343
|
+
|
|
344
|
+
// ===========================================================
|
|
345
|
+
// ACCOUNT/PROFILE SIDEBAR - Structured layout for mobile
|
|
346
|
+
// ===========================================================
|
|
347
|
+
@media (max-width: 767px) {
|
|
348
|
+
// Account sidebar container - force column layout
|
|
349
|
+
.account [component="sidebar/left"] .flex-shrink-0,
|
|
350
|
+
.account .flex-shrink-0.pe-2.border-end-md {
|
|
351
|
+
width: 100% !important;
|
|
352
|
+
padding: 0 !important;
|
|
353
|
+
border: none !important;
|
|
354
|
+
margin-bottom: $jv-space-4 !important;
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
// Inner container - structured grid layout
|
|
358
|
+
.account [component="sidebar/left"] .sticky-md-top,
|
|
359
|
+
.account .sticky-md-top.d-flex {
|
|
360
|
+
display: grid !important;
|
|
361
|
+
grid-template-columns: 1fr 1fr !important;
|
|
362
|
+
gap: $jv-space-2 !important;
|
|
363
|
+
padding: $jv-space-3 !important;
|
|
364
|
+
background: $jv-surface !important;
|
|
365
|
+
border-radius: $jv-radius-md !important;
|
|
366
|
+
border: 1px solid $jv-border-subtle !important;
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
// Menu items - consistent sizing
|
|
370
|
+
.account [component="sidebar/left"] a.btn {
|
|
371
|
+
margin: 0 !important;
|
|
372
|
+
padding: $jv-space-3 !important;
|
|
373
|
+
border-radius: $jv-radius-sm !important;
|
|
374
|
+
background: $jv-bg !important;
|
|
375
|
+
border: 1px solid $jv-border-subtle !important;
|
|
376
|
+
transition: all $jv-transition-fast !important;
|
|
377
|
+
min-height: 56px !important;
|
|
378
|
+
display: flex !important;
|
|
379
|
+
flex-direction: column !important;
|
|
380
|
+
align-items: flex-start !important;
|
|
381
|
+
justify-content: center !important;
|
|
382
|
+
|
|
383
|
+
&:hover {
|
|
384
|
+
background: $jv-hover-bg !important;
|
|
385
|
+
border-color: $jv-border-strong !important;
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
&.active {
|
|
389
|
+
background: $jv-primary !important;
|
|
390
|
+
color: white !important;
|
|
391
|
+
border-color: $jv-primary !important;
|
|
392
|
+
|
|
393
|
+
.text-xs {
|
|
394
|
+
color: rgba(255, 255, 255, 0.9) !important;
|
|
395
|
+
}
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
// Text content
|
|
399
|
+
.flex-grow-1 {
|
|
400
|
+
font-size: $jv-font-size-sm !important;
|
|
401
|
+
font-weight: 600 !important;
|
|
402
|
+
margin-bottom: 2px !important;
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
// Count badges
|
|
406
|
+
.text-xs {
|
|
407
|
+
font-size: $jv-font-size-xs !important;
|
|
408
|
+
color: $jv-text-soft !important;
|
|
409
|
+
font-weight: 500 !important;
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
// Horizontal rules - full width dividers
|
|
414
|
+
.account [component="sidebar/left"] hr {
|
|
415
|
+
grid-column: 1 / -1 !important;
|
|
416
|
+
margin: $jv-space-2 0 !important;
|
|
417
|
+
border-color: $jv-border-subtle !important;
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
// Settings and action links - full width buttons
|
|
421
|
+
.account [component="sidebar/left"] a.btn.ff-secondary.text-xs,
|
|
422
|
+
.account [component="sidebar/left"] a[href*="/edit"],
|
|
423
|
+
.account [component="sidebar/left"] a[component*="account/"] {
|
|
424
|
+
grid-column: 1 / -1 !important;
|
|
425
|
+
flex-direction: row !important;
|
|
426
|
+
gap: $jv-space-2 !important;
|
|
427
|
+
align-items: center !important;
|
|
428
|
+
|
|
429
|
+
i {
|
|
430
|
+
flex-shrink: 0 !important;
|
|
431
|
+
}
|
|
432
|
+
}
|
|
433
|
+
}
|
package/scss/_composer.scss
CHANGED
|
@@ -856,4 +856,32 @@ html.composing .composer.reply {
|
|
|
856
856
|
padding-bottom: max($jv-space-3, env(safe-area-inset-bottom)) !important;
|
|
857
857
|
border-radius: 0 !important;
|
|
858
858
|
}
|
|
859
|
+
|
|
860
|
+
// Fix composer category dropdown positioning on mobile
|
|
861
|
+
html.composing .composer .category-list-container {
|
|
862
|
+
[component="category-selector"],
|
|
863
|
+
.btn-group {
|
|
864
|
+
position: relative !important;
|
|
865
|
+
}
|
|
866
|
+
|
|
867
|
+
.dropdown-menu {
|
|
868
|
+
transition: none !important;
|
|
869
|
+
animation: none !important;
|
|
870
|
+
|
|
871
|
+
&.show {
|
|
872
|
+
position: absolute !important;
|
|
873
|
+
top: 100% !important;
|
|
874
|
+
left: 0 !important;
|
|
875
|
+
right: auto !important;
|
|
876
|
+
bottom: auto !important;
|
|
877
|
+
transform: none !important;
|
|
878
|
+
margin: 4px 0 0 0 !important;
|
|
879
|
+
width: auto !important;
|
|
880
|
+
min-width: 280px !important;
|
|
881
|
+
max-width: 320px !important;
|
|
882
|
+
max-height: none !important;
|
|
883
|
+
height: auto !important;
|
|
884
|
+
}
|
|
885
|
+
}
|
|
886
|
+
}
|
|
859
887
|
}
|
package/scss/_header.scss
CHANGED
|
@@ -237,6 +237,15 @@
|
|
|
237
237
|
}
|
|
238
238
|
}
|
|
239
239
|
|
|
240
|
+
// ===========================================================
|
|
241
|
+
// NOTIFICATION DROPDOWN - Reduced width for better fit
|
|
242
|
+
// ===========================================================
|
|
243
|
+
.notifications-dropdown {
|
|
244
|
+
min-width: 300px !important;
|
|
245
|
+
max-width: 340px !important;
|
|
246
|
+
width: 300px !important;
|
|
247
|
+
}
|
|
248
|
+
|
|
240
249
|
// ===========================================================
|
|
241
250
|
// RESPONSIVE ADJUSTMENTS
|
|
242
251
|
// ===========================================================
|
|
@@ -300,6 +309,13 @@
|
|
|
300
309
|
justify-content: center;
|
|
301
310
|
flex-shrink: 0;
|
|
302
311
|
}
|
|
312
|
+
|
|
313
|
+
// Reduce notification dropdown width on mobile to prevent cutoff
|
|
314
|
+
.notifications-dropdown {
|
|
315
|
+
min-width: 280px !important;
|
|
316
|
+
max-width: 90vw !important;
|
|
317
|
+
width: 280px !important;
|
|
318
|
+
}
|
|
303
319
|
}
|
|
304
320
|
}
|
|
305
321
|
|
package/static/lib/theme.js
CHANGED
|
@@ -54,16 +54,24 @@
|
|
|
54
54
|
// Fix mobile category dropdown positioning on feed page
|
|
55
55
|
fixMobileFeedCategoryDropdown();
|
|
56
56
|
|
|
57
|
+
// Fix mobile category dropdown positioning in composer
|
|
58
|
+
fixMobileComposerCategoryDropdown();
|
|
59
|
+
|
|
60
|
+
// Initialize share button handlers
|
|
61
|
+
initShareHandlers();
|
|
62
|
+
|
|
57
63
|
// Re-initialize carousels when new posts are loaded (infinite scroll, etc.)
|
|
58
64
|
// Also handle post edits by clearing the processed flag
|
|
59
65
|
$(window).on('action:posts.loaded action:topic.loaded action:ajaxify.end', function() {
|
|
60
66
|
initPostImageCarousels();
|
|
61
67
|
initParentPostNavigation();
|
|
62
68
|
fixMobileFeedCategoryDropdown();
|
|
69
|
+
fixMobileComposerCategoryDropdown();
|
|
63
70
|
initPostHoverActions();
|
|
64
71
|
initFeedComposerPromptHandler();
|
|
65
72
|
initTopicListVoting();
|
|
66
73
|
initFeedCategoryFilter();
|
|
74
|
+
initShareHandlers();
|
|
67
75
|
});
|
|
68
76
|
|
|
69
77
|
// Handle post edits - need to re-process the edited post
|
|
@@ -79,6 +87,11 @@
|
|
|
79
87
|
initPostImageCarousels();
|
|
80
88
|
}
|
|
81
89
|
});
|
|
90
|
+
|
|
91
|
+
// Handle composer events - fix category dropdown on mobile when composer is shown
|
|
92
|
+
$(window).on('action:composer.loaded action:composer.enhanced', function() {
|
|
93
|
+
fixMobileComposerCategoryDropdown();
|
|
94
|
+
});
|
|
82
95
|
});
|
|
83
96
|
|
|
84
97
|
/**
|
|
@@ -805,6 +818,72 @@
|
|
|
805
818
|
console.log('JAVIS: Mobile fix event listener attached');
|
|
806
819
|
}
|
|
807
820
|
|
|
821
|
+
/**
|
|
822
|
+
* Fix mobile category dropdown positioning in composer
|
|
823
|
+
* Aggressively overrides Popper.js positioning on mobile to prevent bottom-left corner issue
|
|
824
|
+
*/
|
|
825
|
+
function fixMobileComposerCategoryDropdown() {
|
|
826
|
+
console.log('JAVIS: fixMobileComposerCategoryDropdown called, window width:', window.innerWidth);
|
|
827
|
+
|
|
828
|
+
// Find the composer category selector
|
|
829
|
+
var $categorySelector = $('.composer [component="category-selector"]');
|
|
830
|
+
if (!$categorySelector.length) {
|
|
831
|
+
console.log('JAVIS: Composer category selector not found');
|
|
832
|
+
return;
|
|
833
|
+
}
|
|
834
|
+
|
|
835
|
+
console.log('JAVIS: Composer category selector found, setting up mobile fix');
|
|
836
|
+
|
|
837
|
+
// Find the dropdown button and menu
|
|
838
|
+
var $dropdownButton = $categorySelector.find('.dropdown-toggle');
|
|
839
|
+
var $dropdownMenu = $categorySelector.find('.dropdown-menu');
|
|
840
|
+
|
|
841
|
+
if (!$dropdownButton.length || !$dropdownMenu.length) {
|
|
842
|
+
console.log('JAVIS: Composer dropdown button or menu not found');
|
|
843
|
+
return;
|
|
844
|
+
}
|
|
845
|
+
|
|
846
|
+
// Disable Popper immediately on mobile to prevent animation from bottom-left
|
|
847
|
+
if (window.innerWidth <= 767) {
|
|
848
|
+
$dropdownButton.attr('data-bs-display', 'static');
|
|
849
|
+
console.log('JAVIS: Disabled Popper positioning on mobile for composer');
|
|
850
|
+
}
|
|
851
|
+
|
|
852
|
+
// Always bind the event, but check window width when it fires
|
|
853
|
+
$categorySelector.off('shown.bs.dropdown.javisComposerMobileFix').on('shown.bs.dropdown.javisComposerMobileFix', function() {
|
|
854
|
+
console.log('JAVIS: Composer dropdown shown event fired, window width:', window.innerWidth);
|
|
855
|
+
|
|
856
|
+
// Only apply fix on mobile
|
|
857
|
+
if (window.innerWidth > 767) {
|
|
858
|
+
console.log('JAVIS: Not mobile, skipping composer positioning fix');
|
|
859
|
+
return;
|
|
860
|
+
}
|
|
861
|
+
|
|
862
|
+
console.log('JAVIS: Applying mobile positioning fix for composer');
|
|
863
|
+
|
|
864
|
+
// Use requestAnimationFrame to ensure we override after Popper runs
|
|
865
|
+
requestAnimationFrame(function() {
|
|
866
|
+
$dropdownMenu.css({
|
|
867
|
+
'position': 'absolute',
|
|
868
|
+
'top': '100%',
|
|
869
|
+
'left': '0',
|
|
870
|
+
'right': 'auto',
|
|
871
|
+
'bottom': 'auto',
|
|
872
|
+
'transform': 'none',
|
|
873
|
+
'margin': '4px 0 0 0',
|
|
874
|
+
'inset': 'auto'
|
|
875
|
+
});
|
|
876
|
+
|
|
877
|
+
// Also remove Popper attributes
|
|
878
|
+
$dropdownMenu.removeAttr('data-popper-placement');
|
|
879
|
+
|
|
880
|
+
console.log('JAVIS: Composer mobile positioning applied successfully');
|
|
881
|
+
});
|
|
882
|
+
});
|
|
883
|
+
|
|
884
|
+
console.log('JAVIS: Composer mobile fix event listener attached');
|
|
885
|
+
}
|
|
886
|
+
|
|
808
887
|
/**
|
|
809
888
|
* Initialize immediate category filter navigation on feed page
|
|
810
889
|
* When a category is selected, navigate immediately instead of waiting for dropdown close
|
|
@@ -853,4 +932,24 @@
|
|
|
853
932
|
});
|
|
854
933
|
}
|
|
855
934
|
|
|
935
|
+
/**
|
|
936
|
+
* Initialize share button handlers on feed page
|
|
937
|
+
* Ensures share buttons work on initial load and after ajaxify navigation
|
|
938
|
+
*/
|
|
939
|
+
function initShareHandlers() {
|
|
940
|
+
// Only run on feed page
|
|
941
|
+
if (!$('.feed').length) {
|
|
942
|
+
return;
|
|
943
|
+
}
|
|
944
|
+
|
|
945
|
+
// Check if share module is available
|
|
946
|
+
require(['share'], function(share) {
|
|
947
|
+
// Get page title from meta tag or default
|
|
948
|
+
var pageTitle = $('meta[property="og:title"]').attr('content') || document.title || 'JAVIS Community';
|
|
949
|
+
|
|
950
|
+
// Initialize share handlers for all share buttons on the page
|
|
951
|
+
share.addShareHandlers(pageTitle);
|
|
952
|
+
});
|
|
953
|
+
}
|
|
954
|
+
|
|
856
955
|
})();
|