@okjavis/nodebb-theme-javis 5.0.6 → 5.0.8
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/_header.scss +75 -1
- package/static/lib/theme.js +97 -0
package/package.json
CHANGED
package/scss/_header.scss
CHANGED
|
@@ -238,12 +238,46 @@
|
|
|
238
238
|
}
|
|
239
239
|
|
|
240
240
|
// ===========================================================
|
|
241
|
-
// NOTIFICATION DROPDOWN - Reduced width
|
|
241
|
+
// NOTIFICATION DROPDOWN - Reduced width with optimized text
|
|
242
242
|
// ===========================================================
|
|
243
243
|
.notifications-dropdown {
|
|
244
244
|
min-width: 300px !important;
|
|
245
245
|
max-width: 340px !important;
|
|
246
246
|
width: 300px !important;
|
|
247
|
+
padding: $jv-space-2 !important;
|
|
248
|
+
|
|
249
|
+
// Individual notification items (actual class is .unread or .read)
|
|
250
|
+
.unread, .read {
|
|
251
|
+
padding: $jv-space-2 !important;
|
|
252
|
+
|
|
253
|
+
// Make hover effect rectangular instead of pill-shaped
|
|
254
|
+
.btn, .btn-ghost {
|
|
255
|
+
border-radius: $jv-radius-sm !important;
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
// The link containing notification text
|
|
259
|
+
a[component="notifications/item/link"] {
|
|
260
|
+
font-size: 12px !important;
|
|
261
|
+
line-height: 1.5 !important;
|
|
262
|
+
word-wrap: break-word !important;
|
|
263
|
+
overflow-wrap: break-word !important;
|
|
264
|
+
word-break: break-word !important;
|
|
265
|
+
white-space: normal !important;
|
|
266
|
+
text-overflow: clip !important;
|
|
267
|
+
display: block !important;
|
|
268
|
+
|
|
269
|
+
strong {
|
|
270
|
+
font-size: 12px !important;
|
|
271
|
+
font-weight: 600 !important;
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
// Timestamp
|
|
276
|
+
.text-xs.text-muted {
|
|
277
|
+
font-size: 11px !important;
|
|
278
|
+
margin-top: $jv-space-1 !important;
|
|
279
|
+
}
|
|
280
|
+
}
|
|
247
281
|
}
|
|
248
282
|
|
|
249
283
|
// ===========================================================
|
|
@@ -315,6 +349,46 @@
|
|
|
315
349
|
min-width: 280px !important;
|
|
316
350
|
max-width: 90vw !important;
|
|
317
351
|
width: 280px !important;
|
|
352
|
+
padding: $jv-space-2 !important;
|
|
353
|
+
|
|
354
|
+
// Even smaller text on mobile for better fit
|
|
355
|
+
.notification-item,
|
|
356
|
+
[component="notifications/item"],
|
|
357
|
+
.list-group-item {
|
|
358
|
+
padding: $jv-space-2 $jv-space-3 !important;
|
|
359
|
+
font-size: 11px !important;
|
|
360
|
+
line-height: 1.3 !important;
|
|
361
|
+
|
|
362
|
+
p, .notification-text, .text-muted, div {
|
|
363
|
+
font-size: 11px !important;
|
|
364
|
+
line-height: 1.3 !important;
|
|
365
|
+
white-space: normal !important;
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
time, .timeago, small {
|
|
369
|
+
font-size: 10px !important;
|
|
370
|
+
margin-top: 4px !important;
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
strong, .fw-semibold, a {
|
|
374
|
+
font-size: 11px !important;
|
|
375
|
+
white-space: normal !important;
|
|
376
|
+
}
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
.dropdown-header {
|
|
380
|
+
padding: $jv-space-2 !important;
|
|
381
|
+
font-size: 11px !important;
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
.dropdown-footer,
|
|
385
|
+
.list-group-item:last-child {
|
|
386
|
+
padding: $jv-space-2 !important;
|
|
387
|
+
|
|
388
|
+
a, button {
|
|
389
|
+
font-size: 11px !important;
|
|
390
|
+
}
|
|
391
|
+
}
|
|
318
392
|
}
|
|
319
393
|
}
|
|
320
394
|
}
|
package/static/lib/theme.js
CHANGED
|
@@ -57,6 +57,12 @@
|
|
|
57
57
|
// Fix mobile category dropdown positioning in composer
|
|
58
58
|
fixMobileComposerCategoryDropdown();
|
|
59
59
|
|
|
60
|
+
// Fix notification dropdown inline styles
|
|
61
|
+
fixNotificationDropdown();
|
|
62
|
+
|
|
63
|
+
// Initialize share button handlers
|
|
64
|
+
initShareHandlers();
|
|
65
|
+
|
|
60
66
|
// Re-initialize carousels when new posts are loaded (infinite scroll, etc.)
|
|
61
67
|
// Also handle post edits by clearing the processed flag
|
|
62
68
|
$(window).on('action:posts.loaded action:topic.loaded action:ajaxify.end', function() {
|
|
@@ -64,10 +70,12 @@
|
|
|
64
70
|
initParentPostNavigation();
|
|
65
71
|
fixMobileFeedCategoryDropdown();
|
|
66
72
|
fixMobileComposerCategoryDropdown();
|
|
73
|
+
fixNotificationDropdown();
|
|
67
74
|
initPostHoverActions();
|
|
68
75
|
initFeedComposerPromptHandler();
|
|
69
76
|
initTopicListVoting();
|
|
70
77
|
initFeedCategoryFilter();
|
|
78
|
+
initShareHandlers();
|
|
71
79
|
});
|
|
72
80
|
|
|
73
81
|
// Handle post edits - need to re-process the edited post
|
|
@@ -880,6 +888,75 @@
|
|
|
880
888
|
console.log('JAVIS: Composer mobile fix event listener attached');
|
|
881
889
|
}
|
|
882
890
|
|
|
891
|
+
/**
|
|
892
|
+
* Fix notification dropdown width and text styling
|
|
893
|
+
* Removes Popper inline width styles and applies proper text wrapping
|
|
894
|
+
*/
|
|
895
|
+
function fixNotificationDropdown() {
|
|
896
|
+
console.log('JAVIS: fixNotificationDropdown called');
|
|
897
|
+
|
|
898
|
+
// Find the notification component
|
|
899
|
+
var $notificationComponent = $('[component="notifications"]');
|
|
900
|
+
if (!$notificationComponent.length) {
|
|
901
|
+
console.log('JAVIS: Notification component not found');
|
|
902
|
+
return;
|
|
903
|
+
}
|
|
904
|
+
|
|
905
|
+
console.log('JAVIS: Notification component found, setting up fix');
|
|
906
|
+
|
|
907
|
+
// Listen for when dropdown is shown
|
|
908
|
+
$notificationComponent.off('shown.bs.dropdown.javisNotificationFix').on('shown.bs.dropdown.javisNotificationFix', function() {
|
|
909
|
+
console.log('JAVIS: Notification dropdown shown');
|
|
910
|
+
|
|
911
|
+
// Use requestAnimationFrame to ensure we override after Popper runs
|
|
912
|
+
requestAnimationFrame(function() {
|
|
913
|
+
var $dropdownMenu = $notificationComponent.find('.notifications-dropdown');
|
|
914
|
+
|
|
915
|
+
if ($dropdownMenu.length) {
|
|
916
|
+
// Remove width-related inline styles from dropdown
|
|
917
|
+
var currentStyle = $dropdownMenu.attr('style') || '';
|
|
918
|
+
var newStyle = currentStyle
|
|
919
|
+
.replace(/min-width:\s*[^;]+;?/gi, '')
|
|
920
|
+
.replace(/max-width:\s*[^;]+;?/gi, '')
|
|
921
|
+
.replace(/width:\s*[^;]+;?/gi, '');
|
|
922
|
+
$dropdownMenu.attr('style', newStyle);
|
|
923
|
+
|
|
924
|
+
// Apply styling to notification items (.unread and .read are the actual classes)
|
|
925
|
+
$dropdownMenu.find('.unread, .read').css({
|
|
926
|
+
'padding': '8px'
|
|
927
|
+
});
|
|
928
|
+
|
|
929
|
+
// Style the notification link text
|
|
930
|
+
$dropdownMenu.find('a[component="notifications/item/link"]').css({
|
|
931
|
+
'font-size': '12px',
|
|
932
|
+
'line-height': '1.5',
|
|
933
|
+
'word-wrap': 'break-word',
|
|
934
|
+
'overflow-wrap': 'break-word',
|
|
935
|
+
'word-break': 'break-word',
|
|
936
|
+
'white-space': 'normal',
|
|
937
|
+
'text-overflow': 'clip',
|
|
938
|
+
'display': 'block'
|
|
939
|
+
});
|
|
940
|
+
|
|
941
|
+
// Style strong tags within notifications
|
|
942
|
+
$dropdownMenu.find('a[component="notifications/item/link"] strong').css({
|
|
943
|
+
'font-size': '12px',
|
|
944
|
+
'font-weight': '600'
|
|
945
|
+
});
|
|
946
|
+
|
|
947
|
+
// Style timestamps
|
|
948
|
+
$dropdownMenu.find('.text-xs.text-muted').css({
|
|
949
|
+
'font-size': '11px'
|
|
950
|
+
});
|
|
951
|
+
|
|
952
|
+
console.log('JAVIS: Notification dropdown styling applied');
|
|
953
|
+
}
|
|
954
|
+
});
|
|
955
|
+
});
|
|
956
|
+
|
|
957
|
+
console.log('JAVIS: Notification dropdown fix event listener attached');
|
|
958
|
+
}
|
|
959
|
+
|
|
883
960
|
/**
|
|
884
961
|
* Initialize immediate category filter navigation on feed page
|
|
885
962
|
* When a category is selected, navigate immediately instead of waiting for dropdown close
|
|
@@ -928,4 +1005,24 @@
|
|
|
928
1005
|
});
|
|
929
1006
|
}
|
|
930
1007
|
|
|
1008
|
+
/**
|
|
1009
|
+
* Initialize share button handlers on feed page
|
|
1010
|
+
* Ensures share buttons work on initial load and after ajaxify navigation
|
|
1011
|
+
*/
|
|
1012
|
+
function initShareHandlers() {
|
|
1013
|
+
// Only run on feed page
|
|
1014
|
+
if (!$('.feed').length) {
|
|
1015
|
+
return;
|
|
1016
|
+
}
|
|
1017
|
+
|
|
1018
|
+
// Check if share module is available
|
|
1019
|
+
require(['share'], function(share) {
|
|
1020
|
+
// Get page title from meta tag or default
|
|
1021
|
+
var pageTitle = $('meta[property="og:title"]').attr('content') || document.title || 'JAVIS Community';
|
|
1022
|
+
|
|
1023
|
+
// Initialize share handlers for all share buttons on the page
|
|
1024
|
+
share.addShareHandlers(pageTitle);
|
|
1025
|
+
});
|
|
1026
|
+
}
|
|
1027
|
+
|
|
931
1028
|
})();
|