Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Few ideas for fluentRevealNavbar.uc.js #77

Open
wants to merge 33 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
d7bc621
Fix issue of script non-working for me on Firefox 115
emvaized Jul 22, 2023
0cc13b7
Add option to cache nav bar buttons
emvaized Jul 22, 2023
0f5df53
Add option to filter out mouse events too far from navbar
emvaized Jul 22, 2023
e45dba3
Added variable to store cached buttons
emvaized Jul 22, 2023
130957e
Changed default color to browser navbar button hover
emvaized Jul 22, 2023
293cc72
Add option to apply the effect to url bar as well
emvaized Jul 22, 2023
75f9e8d
Remove unused scroll listener
emvaized Jul 22, 2023
ab69194
Added comment about the change
emvaized Jul 22, 2023
a0dec4f
Don't apply effect to focused url bar
emvaized Jul 22, 2023
aeceba5
Add comment and some padding to make sure effect clears out
emvaized Jul 22, 2023
73c0482
Clear all effects once when cursor leaves the interactive zone
emvaized Jul 22, 2023
77bf366
Changed cacheButtons default value to prevent unexpected behavior for…
emvaized Jul 22, 2023
8126494
Bring back "scroll" event listener (as I figured out why it was there)
emvaized Jul 23, 2023
7af0251
Move cached buttons from static to script scope
emvaized Jul 23, 2023
97905a7
Remove console log and commented lines
emvaized Jul 23, 2023
d1091d5
Added alternative default color
emvaized Jul 23, 2023
94dc10c
Better selector for url background
emvaized Jul 23, 2023
2179e71
Change area selector for url bar
emvaized Jul 23, 2023
4586237
Fixed comment
emvaized Jul 23, 2023
a2cfeb5
Fix for bookmarks
emvaized Jul 23, 2023
0c82178
Changed pointer events check to use getComputedStyle(el)
emvaized Jul 23, 2023
af6d576
Use this._toolbarButtons for storing cached buttons
emvaized Jul 23, 2023
96f3ba2
Change static padding to dynamic + cache browser element
emvaized Jul 23, 2023
4cf3620
Fixed typo
emvaized Jul 23, 2023
aeb10b2
Removed old comment
emvaized Jul 25, 2023
cd09975
Changed default "filterDy" value to false
emvaized Jul 25, 2023
0c96706
Code cleanup
emvaized Jul 25, 2023
819fd64
Removed "!area" check
emvaized Jul 25, 2023
91c0217
Removed "window." part
emvaized Jul 25, 2023
e2aa84f
Removed absolete comment
emvaized Jul 25, 2023
3fafeff
Moved "this_someEffectsApplied" assignments to the bottom
emvaized Jul 25, 2023
36a2814
Removed unused "placesToolbarItems getter"
emvaized Jul 25, 2023
80ac4bb
Removed extra line on bottom
emvaized Jul 25, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions JS/fluentRevealNavbar.uc.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
// ==/UserScript==

(function() {
// store cached navbar buttons
let cachedButtons;
emvaized marked this conversation as resolved.
Show resolved Hide resolved

class FluentRevealEffect {
// user configuration
static options = {
Expand Down Expand Up @@ -39,9 +42,6 @@
cacheButtons: false,
};

// store cached navbar buttons
static buttons;

// instantiate the handler for a given window
constructor() {
this._options = FluentRevealEffect.options;
Expand All @@ -54,20 +54,20 @@

// get all the toolbar buttons in the navbar, in iterable form
get toolbarButtons() {
if (!this.buttons || this._options.cacheButtons == false) {
this.buttons = Array.from(
if (!cachedButtons || this._options.cacheButtons == false) {
cachedButtons = Array.from(
gNavToolbox.querySelectorAll(".toolbarbutton-1")
);
if (this._options.includeUrlBar) {
this.buttons.push(gNavToolbox.querySelector("#urlbar-background"));
cachedButtons.push(gNavToolbox.querySelector("#urlbar-background"));
}
if (this._options.includeBookmarks) {
this.buttons = this.buttons.concat(
cachedButtons = cachedButtons.concat(
Array.from(this.placesToolbarItems.querySelectorAll(".bookmark-item"))
);
}
}
return this.buttons;
return cachedButtons;
}

get placesToolbarItems() {
emvaized marked this conversation as resolved.
Show resolved Hide resolved
emvaized marked this conversation as resolved.
Show resolved Hide resolved
Expand Down