|
1 | 1 | // ==UserScript==
|
2 | 2 | // @name UnityForumFixer
|
3 | 3 | // @namespace https://unitycoder.com/
|
4 |
| -// @version 0.8 (21.12.2024) |
| 4 | +// @version 0.81 (21.12.2024) |
5 | 5 | // @description Fixes For Unity Forums - https://github.com/unitycoder/UnityForumFixer
|
6 | 6 | // @author unitycoder.com
|
7 | 7 | // @match https://discussions.unity.com/latest
|
|
24 | 24 | PostViewShowOriginalPosterInfo();
|
25 | 25 | TopicsViewCombineViewAndReplyCounts();
|
26 | 26 | OnMouseOverPostPreview();
|
| 27 | + AddOnHoverOpenNotificationPanel(); |
27 | 28 |
|
28 | 29 | // update notification panel icons
|
29 | 30 | const currentUserButton = document.getElementById('toggle-current-user');
|
30 | 31 | if (currentUserButton) {
|
31 | 32 | currentUserButton.addEventListener('click', () => {
|
32 |
| - console.log(1111); |
33 | 33 | // Add a slight delay to ensure the dropdown content is fully rendered
|
34 | 34 | setTimeout(replaceNotificationIcons, 1000);
|
35 | 35 | });
|
@@ -130,6 +130,7 @@ function AppendCustomCSS()
|
130 | 130 | /*.avatar { margin: 4px; } bug in topic view*/
|
131 | 131 | .topic-body {padding: 0 !important;}
|
132 | 132 | .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 */ |
133 | 134 |
|
134 | 135 | .user-signature {max-height:32px; overflow:hidden;padding: 8px 8px 4px 24px !important;} /* max size for signature */
|
135 | 136 | .avatar-flair {top:55px; right: -2px; bottom:unset !important;}
|
@@ -160,6 +161,9 @@ function AppendCustomCSS()
|
160 | 161 | .custom-user-creation-date {width:45px;margin-top:6px;font: 13px 'Inter', sans-serif !important; color: rgb(150, 150, 150);}
|
161 | 162 | .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; }
|
162 | 163 |
|
| 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 | +
|
163 | 167 |
|
164 | 168 | `;
|
165 | 169 | document.head.appendChild(style);
|
@@ -653,6 +657,23 @@ function replaceNotificationIcons() {
|
653 | 657 | });
|
654 | 658 | }
|
655 | 659 |
|
| 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 | + |
656 | 677 |
|
657 | 678 |
|
658 | 679 |
|
|
0 commit comments