Skip to content

Commit 8a43836

Browse files
authored
Update unity-forum-fixer.js
- Product areas dropdown, remove row padding - notifications panel: open on avatar hover - code blog, use Fira Code if available (installed on your computer) - post view: remove 38px gap from right
1 parent d5a3218 commit 8a43836

File tree

1 file changed

+23
-2
lines changed

1 file changed

+23
-2
lines changed

‎unity-forum-fixer.js

+23-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// ==UserScript==
22
// @name UnityForumFixer
33
// @namespace https://unitycoder.com/
4-
// @version 0.8 (21.12.2024)
4+
// @version 0.81 (21.12.2024)
55
// @description Fixes For Unity Forums - https://github.com/unitycoder/UnityForumFixer
66
// @author unitycoder.com
77
// @match https://discussions.unity.com/latest
@@ -24,12 +24,12 @@
2424
PostViewShowOriginalPosterInfo();
2525
TopicsViewCombineViewAndReplyCounts();
2626
OnMouseOverPostPreview();
27+
AddOnHoverOpenNotificationPanel();
2728

2829
// update notification panel icons
2930
const currentUserButton = document.getElementById('toggle-current-user');
3031
if (currentUserButton) {
3132
currentUserButton.addEventListener('click', () => {
32-
console.log(1111);
3333
// Add a slight delay to ensure the dropdown content is fully rendered
3434
setTimeout(replaceNotificationIcons, 1000);
3535
});
@@ -130,6 +130,7 @@ function AppendCustomCSS()
130130
/*.avatar { margin: 4px; } bug in topic view*/
131131
.topic-body {padding: 0 !important;}
132132
.topic-map.--op {display: none !important;} /* hide view count under op post, could move it somewhere else later */
133+
.container.posts {gap:unset !important;} /* post view thinner */
133134
134135
.user-signature {max-height:32px; overflow:hidden;padding: 8px 8px 4px 24px !important;} /* max size for signature */
135136
.avatar-flair {top:55px; right: -2px; bottom:unset !important;}
@@ -160,6 +161,9 @@ function AppendCustomCSS()
160161
.custom-user-creation-date {width:45px;margin-top:6px;font: 13px 'Inter', sans-serif !important; color: rgb(150, 150, 150);}
161162
.custom-post-preview { position: absolute; max-width: 450px; max-height: 200px; background-color: var(--primary-low); border: 1px solid black; padding: 5px; border-radius: 5px; box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); z-index: 1000; }
162163
164+
code.lang-auto, code.language-csharp { font-family: 'Fira Code', monospace; }
165+
.select-kit .select-kit-row {padding: 0px 0px 0px 6px !important;} /* project area dropdown */
166+
163167
164168
`;
165169
document.head.appendChild(style);
@@ -653,6 +657,23 @@ function replaceNotificationIcons() {
653657
});
654658
}
655659

660+
function AddOnHoverOpenNotificationPanel() {
661+
const currentUserButton = document.getElementById('toggle-current-user');
662+
663+
if (currentUserButton) {
664+
// Add mouseover event to trigger the button's click
665+
currentUserButton.addEventListener('mouseenter', () => {
666+
// Check if the dropdown is already open
667+
const dropdown = document.querySelector('.user-menu.revamped.menu-panel.drop-down');
668+
if (!dropdown || !dropdown.classList.contains('open')) {
669+
currentUserButton.click(); // Simulate a click to open the dropdown
670+
}
671+
});
672+
} else {
673+
console.warn('Current user button not found.');
674+
}
675+
}
676+
656677

657678

658679

0 commit comments

Comments
 (0)