Open panels on mouse-over.
-
@oudstand Hi, i don't encounter any problems if you enter it with the "Code" function.
function panelMouseOver(autoHide, delay_show, delay_change, delay_hide) { var buttons = document.getElementById('switch').getElementsByTagName('button'); var show_token = null; var activeButton = null; /* Stop timer if mouse exits screen */ document.addEventListener("mouseout", function(e) { clearTimeout(show_token); }); /* Do auto-hide if applicable */ if (autoHide) { var content = document.getElementById("webview-container").onmouseover = function() { if (!document.getElementById("panels-container").getAttribute('class').includes("icons")) { clearTimeout(show_token); setTimeout(function() { if (activeButton && (activeButton.getAttribute('class').includes("active"))) { activeButton.click(); activeButton = null; } }, delay_hide); } }; } function activeButtonIndex() { for (let i = 0; i < buttons.length - 2; i++) { if (buttons[i].getAttribute('class').includes('active')) { return i; } } return -1; } function setActive(index, doDelay) { clearTimeout(show_token); var delay = 0; if (doDelay) { delay = (activeButtonIndex() < 0) ? delay_show : delay_change; } show_token = setTimeout(function() { var newButton = buttons[index]; if (!newButton.getAttribute('class').includes('active')) { activeButton = newButton; activeButton.click(); panel = index; } }, delay); } function setListeners() { for (let index = 0; index < buttons.length - 2; index++) { buttons[index].onmouseover = function() {setActive(index, true);}; buttons[index].onmouseout = function() {clearTimeout(show_token);}; buttons[index].ondragover = function() {setActive(index, false);}; } } setListeners(); } setTimeout(function wait() { var adr = document.querySelector("#browser"); if (adr != null) { panelMouseOver(true, 1400, 1500, 800); } else { setTimeout(wait, 300); } }, 300);
-
Now it is working again
This is my code I use:
// https://forum.vivaldi.net/topic/28413/open-panels-on-mouse-over/22?_=1593504963587 function panelMouseOver(autoHide, delay_show, delay_change, delay_hide) { var buttons = document.getElementById('switch').getElementsByTagName('button'); buttons = [...buttons].filter(button => button.title !== 'http://empty/'); var show_token = null; var activeButton = null; /* Stop timer if mouse exits screen */ document.addEventListener("mouseout", function(e) { clearTimeout(show_token); }); /* Do auto-hide if applicable */ if (autoHide) { var content = document.getElementById("webview-container").onmouseover = function() { if (!document.getElementById("panels-container").getAttribute('class').includes("icons")) { clearTimeout(show_token); setTimeout(function() { vivaldi.prefs.get('vivaldi.panels.as_overlay.enabled', function(isEnabled) { hidePanel(isEnabled); }); }, delay_hide); } }; } function activeButtonIndex() { for (let i = 0; i < buttons.length - 2; i++) { if (buttons[i].getAttribute('class').includes('active')) { return i; } } return -1; } function getActiveButton() { if (buttons[activeButtonIndex()]) { return buttons[activeButtonIndex()]; } return null; } function setActive(index, doDelay) { clearTimeout(show_token); var delay = 0; if (doDelay) { delay = (activeButtonIndex() < 0) ? delay_show : delay_change; } show_token = setTimeout(function() { var newButton = buttons[index]; if (!newButton.getAttribute('class').includes('active')) { activeButton = newButton; activeButton.click(); panel = index; } }, delay); } function setListeners() { for (let index = 0; index < buttons.length - 2; index++) { buttons[index].onmouseover = function() { setActive(index, true); }; buttons[index].onmouseout = function() { clearTimeout(show_token); }; buttons[index].ondragover = function() { setActive(index, false); }; } } setListeners(); function hidePanel(isFloating) { if (isFloating) { activeButton = activeButton ? activeButton : getActiveButton(); if (activeButton && (activeButton.getAttribute('class').includes("active"))) { activeButton.click(); activeButton = null; } } } } function addObserver() { const switchPanel = document.getElementById('switch'); const config = { childList: true, subtree: true }; const callback = function(mutationList, observer) { for (let mutation of mutationList) { if (mutation.type === 'childList') { panelMouseOver(true, 100, 50, 250); } } }; const observer = new MutationObserver(callback); observer.observe(switchPanel, config); }; setTimeout(function wait() { const browser = document.getElementById('browser'); if (browser) { panelMouseOver(true, 100, 50, 250); addObserver(); } else { setTimeout(wait, 300); } }, 300);
-
@folgore101 Recently the side panel has changed its transparency such that the web page shows through. Any ideas how to stop this?
regards -
@brianhuahin
Settings | Themes | Colour | Opacity
& move the slider to 100%. -
hlehyaric
Thanks but still the same. -
@oudstand Hi, thanks for the awesome additional features!
Can you please also excluded these buttons from auto click on mouseover? Their classname is
.addwebpanel
,.add
, and.webpanel-suggestion
Many thanks in advanced.
-
@dude99 with this code it should be working
And thanks for providing the classes!// https://forum.vivaldi.net/topic/28413/open-panels-on-mouse-over/22?_=1593504963587 function panelMouseOver(autoHide, delay_show, delay_change, delay_hide) { var buttons = document.getElementById('switch').getElementsByTagName('button'); buttons = [...buttons].filter(button => button.title !== 'http://empty/'); var show_token = null; var activeButton = null; /* Stop timer if mouse exits screen */ document.addEventListener("mouseout", function(e) { clearTimeout(show_token); }); /* Do auto-hide if applicable */ if (autoHide) { var content = document.getElementById("webview-container").onmouseover = function() { if (!document.getElementById("panels-container").getAttribute('class').includes("icons")) { clearTimeout(show_token); setTimeout(function() { vivaldi.prefs.get('vivaldi.panels.as_overlay.enabled', function(isEnabled) { hidePanel(isEnabled); }); }, delay_hide); } }; } function activeButtonIndex() { for (let i = 0; i < buttons.length - 2; i++) { if (buttons[i].getAttribute('class').includes('active')) { return i; } } return -1; } function getActiveButton() { if (buttons[activeButtonIndex()]) { return buttons[activeButtonIndex()]; } return null; } function setActive(index, doDelay) { clearTimeout(show_token); var delay = 0; if (doDelay) { delay = (activeButtonIndex() < 0) ? delay_show : delay_change; } show_token = setTimeout(function() { var newButton = buttons[index]; if (!['active', 'add', 'webpanel-suggestion'].some(cls => newButton.classList.contains(cls))) { activeButton = newButton; activeButton.click(); panel = index; } }, delay); } function setListeners() { for (let index = 0; index < buttons.length - 2; index++) { buttons[index].onmouseover = function() { setActive(index, true); }; buttons[index].onmouseout = function() { clearTimeout(show_token); }; buttons[index].ondragover = function() { setActive(index, false); }; } } setListeners(); function hidePanel(isFloating) { if (isFloating) { activeButton = activeButton ? activeButton : getActiveButton(); if (activeButton && (activeButton.getAttribute('class').includes("active"))) { activeButton.click(); activeButton = null; } } } } function addObserver() { const switchPanel = document.getElementById('switch'); const config = { childList: true, subtree: true }; const callback = function(mutationList, observer) { for (let mutation of mutationList) { if (mutation.type === 'childList') { panelMouseOver(true, 100, 50, 250); } } }; const observer = new MutationObserver(callback); observer.observe(switchPanel, config); }; setTimeout(function waitMouseOver() { const browser = document.getElementById('browser'); if (browser) { panelMouseOver(true, 100, 50, 250); addObserver(); } else { setTimeout(waitMouseOver, 300); } }, 300);
You can skip this line if you want:
buttons = [...buttons].filter(button => button.title !== 'http://empty/');
I use it for another mod from me: Seperator for web panels
-
@oudstand Thanks again, after 1 day of testing I think it works perfectly!
-
@dude99 Your're welcome, that's nice to hear
-
@dude99 said in Open panels on mouse-over.:
@oudstand Hi, thanks for the awesome additional features!
Can you please also excluded these buttons from auto click on mouseover? Their classname is
.addwebpanel
,.add
, and.webpanel-suggestion
Many thanks in advanced.
The problem showed up again with the latest Snapshot version. Here is the fixed code:
// https://forum.vivaldi.net/topic/28413/open-panels-on-mouse-over/22?_=1593504963587 function panelMouseOver(autoHide, delay_show, delay_change, delay_hide) { var buttons = document.getElementById('switch').getElementsByTagName('button'); buttons = [...buttons].filter(button => button.title !== 'http://empty/'); var show_token = null; var activeButton = null; /* Stop timer if mouse exits screen */ document.addEventListener("mouseout", function(e) { clearTimeout(show_token); }); /* Do auto-hide if applicable */ if (autoHide) { var content = document.getElementById("webview-container").onmouseover = function() { if (!document.getElementById("panels-container").getAttribute('class').includes("icons")) { clearTimeout(show_token); setTimeout(function() { vivaldi.prefs.get('vivaldi.panels.as_overlay.enabled', function(isEnabled) { hidePanel(isEnabled); }); }, delay_hide); } }; } function activeButtonIndex() { for (let i = 0; i < buttons.length - 2; i++) { if (buttons[i].getAttribute('class').includes('active')) { return i; } } return -1; } function getActiveButton() { if (buttons[activeButtonIndex()]) { return buttons[activeButtonIndex()]; } return null; } function setActive(index, doDelay) { clearTimeout(show_token); var delay = 0; if (doDelay) { delay = (activeButtonIndex() < 0) ? delay_show : delay_change; } show_token = setTimeout(function() { var newButton = buttons[index]; if (!['active', 'add', 'webpanel-suggestion', 'addwebpanel'].some(cls => newButton.classList.contains(cls))) { activeButton = newButton; activeButton.click(); panel = index; } }, delay); } function setListeners() { for (let index = 0; index < buttons.length - 2; index++) { buttons[index].onmouseover = function() { setActive(index, true); }; buttons[index].onmouseout = function() { clearTimeout(show_token); }; buttons[index].ondragover = function() { setActive(index, false); }; } } setListeners(); function hidePanel(isFloating) { if (isFloating) { activeButton = activeButton ? activeButton : getActiveButton(); if (activeButton && (activeButton.getAttribute('class').includes("active"))) { activeButton.click(); activeButton = null; } } } } function addObserver() { const switchPanel = document.getElementById('switch'); const config = { childList: true, subtree: true }; const callback = function(mutationList, observer) { for (let mutation of mutationList) { if (mutation.type === 'childList') { panelMouseOver(true, 100, 50, 250); } } }; const observer = new MutationObserver(callback); observer.observe(switchPanel, config); }; setTimeout(function waitMouseOver() { const browser = document.getElementById('browser'); if (browser) { panelMouseOver(true, 100, 50, 250); addObserver(); } else { setTimeout(waitMouseOver, 300); } }, 300);
As before you can skip this line if you want:
buttons = [...buttons].filter(button => button.title !== 'http://empty/');
I use it for another mod from me: Seperator for web panels
-
Currently the
activeButton.click();
doesn't seem to work anymore. TheactiveButton
is the but theclick()
method doesn't do anything. I've tried it with some versions ofdispatchEvent
but I couldn't make it open the panel. Maybe someone of you has an idea?But I already improved getting web panel buttons without the new separators etc.
var buttons = document.getElementById('switch').getElementsByTagName('button'); buttons = [...buttons].filter(button => !['Divider', 'Spacer', 'FlexibleSpacer', 'Settings', 'PanelWeb'].some(name => button.name === name));
-
This post is deleted! -
Hi
Using 5.6.2867.36 (Stable channel) (64-bit) "open panel on mouse over" not working. Any software gurus got a fix. Panel is selected but does not switch. -
So... that's it? Another awesome mod bite the dust?
-
@dude99 There isnβt much to be done. In one of my own mods, which switches tabs on mouseover, I had a version which could switch tabs in stacks. This broke at some point for the same reason, simulating the click wasnβt possible anymore. Read into the subject online, maybe youβll find a solution.
-
@luetage Is this another unnecessary safety feature to prevent exploites, or it's a bug?
OK, how about double-click? Can we cheat by transform hover > double-click, then double-click > single-click? LOL
or mousedown mouseup?
-
@dude99 Try it out.
-
Open panels on mouse over don't work with 5.7.2921.53 (Stable channel) (64-bit) :
This is the CSS code I have:
/*PANELS OVERLAY ON MOUSE OVER*/ #panels {overflow:visible;} :not(.resizing)#panels-container.overlay .panel-group {transition: width .1s linear !important;} #panels-container.overlay {width:0 !important;} #panels-container.right.overlay > .SlideBar--FullHeight.alternate, #panels-container.right.icons:not(.overlay) {margin-left:-35p;} #panels-container.left.overlay > .SlideBar--FullHeight.alternate, #panels-container.left.icons:not(.overlay) {margin-right: -35px;} #panels-container.overlay #switch, #panels-container:not(.overlay).icons #switch {background-color: var(--colorBgAlphaBlur);} #panels-container #switch {height: 100%; flex-basis:35px; visibility:visible !important; z-index:3;} #panels-container.icons:not(:hover) #switch, #panels-container.switcher:not(:hover) #switch {height:50px; flex-basis: 4px; opacity:0; margin: 0 2.5px; transition: .1s .9s, background-color 0s 0s, opacity 0s 1s !important;}
Please help.
-
@barbudo2005 that CSS mod is for hiding the switch section (panel buttons bar) when the floating panel is inactive. You need the JS mod in this topic to auto show/hide the panel.
Also, I probably won't be able to fix it if it broke in 5.7, because I didn't update beyond window 8.1 yet... LOL
-
Said:
that CSS mod is for hiding the switch section.
Sorry, It is this f***ing browser which allows to have as many CSS and JS Mods that sometimes I get dizzy.
The JS Mod is this:
/*AUTOHIDE PANELS OVERLAY ON MOUSE OVER*/ function panelMouseOver(autoHide, delay_show, delay_change, delay_hide) { var buttons = document.getElementById('switch').getElementsByTagName('button'); var show_token = null; var activeButton = null; /* Stop timer if mouse exits screen */ document.addEventListener("mouseout", function(e) { clearTimeout(show_token); }); /* Do auto-hide if applicable */ if (autoHide) { var content = document.getElementById("webview-container").onmouseover = function() { if (!document.getElementById("panels-container").getAttribute('class').includes("icons")) { clearTimeout(show_token); setTimeout(function() { if (activeButton && (activeButton.getAttribute('class').includes("active"))) { activeButton.click(); activeButton = null; } }, delay_hide); } }; } function activeButtonIndex() { for (let i = 0; i < buttons.length - 2; i++) { if (buttons[i].getAttribute('class').includes('active')) { return i; } } return -1; } function setActive(index, doDelay) { clearTimeout(show_token); var delay = 0; if (doDelay) { delay = (activeButtonIndex() < 0) ? delay_show : delay_change; } show_token = setTimeout(function() { var newButton = buttons[index]; if (!newButton.getAttribute('class').includes('active')) { activeButton = newButton; activeButton.click(); panel = index; } }, delay); } function setListeners() { for (let index = 0; index < buttons.length - 2; index++) { buttons[index].onmouseover = function() {setActive(index, true);}; buttons[index].onmouseout = function() {clearTimeout(show_token);}; buttons[index].ondragover = function() {setActive(index, false);}; } } setListeners(); } function addObserver() { const switchPanel = document.getElementById('switch'); const config = { childList: true, subtree: true }; const callback = function (mutationList, observer) { for (let mutation of mutationList) { if (mutation.type === 'childList') { panelMouseOver(true, 140, 150, 300); } } }; const observer = new MutationObserver(callback); observer.observe(switchPanel, config); }; setTimeout(function pwait() { var adr = document.querySelector("#browser"); if (adr != null) { panelMouseOver(true, 140, 150, 300); addObserver(); } else { setTimeout(pwait, 300); } }, 300);