mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-23 13:52:26 +01:00
Add Fullscreen autocommand
This commit is contained in:
1
NEWS
1
NEWS
@@ -12,6 +12,7 @@
|
||||
special versions for the old behavior
|
||||
* IMPORTANT: renamed Startup and Quit autocmd events to VimperatorEnter and
|
||||
VimperatorLeave respectively
|
||||
* add 'Fullscreen' autocommmand
|
||||
* add :colorscheme
|
||||
* multibyte support for hints (thanks Xie&Tian)
|
||||
* add 'exrc'
|
||||
|
||||
@@ -133,11 +133,7 @@ function Buffer() //{{{
|
||||
"Show the current window fullscreen",
|
||||
"boolean", false,
|
||||
{
|
||||
setter: function (value)
|
||||
{
|
||||
window.fullScreen = value;
|
||||
return value;
|
||||
},
|
||||
setter: function (value) window.fullScreen = value,
|
||||
getter: function () window.fullScreen
|
||||
});
|
||||
|
||||
|
||||
@@ -269,6 +269,8 @@ function Events() //{{{
|
||||
|
||||
const input = liberator.input;
|
||||
|
||||
var fullscreen = window.fullScreen;
|
||||
|
||||
var inputBufferLength = 0; // count the number of keys in v.input.buffer (can be different from v.input.buffer.length)
|
||||
var skipMap = false; // while feeding the keys (stored in v.input.buffer | no map found) - ignore mappings
|
||||
|
||||
@@ -360,6 +362,7 @@ function Events() //{{{
|
||||
window.addEventListener("popuphidden", exitPopupMode, true);
|
||||
window.addEventListener("DOMMenuBarActive", enterMenuMode, true);
|
||||
window.addEventListener("DOMMenuBarInactive", exitMenuMode, true);
|
||||
window.addEventListener("resize", onResize, true);
|
||||
|
||||
// window.document.addEventListener("DOMTitleChanged", function (event)
|
||||
// {
|
||||
@@ -469,6 +472,16 @@ function Events() //{{{
|
||||
autocommands.trigger(name, args);
|
||||
}
|
||||
|
||||
function onResize(event)
|
||||
{
|
||||
if (window.fullScreen != fullscreen)
|
||||
{
|
||||
fullscreen = window.fullScreen;
|
||||
liberator.triggerObserver("fullscreen", fullscreen);
|
||||
autocommands.trigger("Fullscreen", {url: "", fullscreen: fullscreen});
|
||||
}
|
||||
}
|
||||
|
||||
function onDOMContentLoaded(event)
|
||||
{
|
||||
if (event.originalTarget instanceof HTMLDocument)
|
||||
|
||||
@@ -43,6 +43,7 @@ const config = { //{{{
|
||||
["ColorScheme", "Triggered after a color scheme has been loaded"],
|
||||
["DOMLoad", "Triggered when a page's DOM content has fully loaded"],
|
||||
["DownloadPost", "Triggered when a download has completed"],
|
||||
["Fullscreen", "Triggered when the browser's fullscreen state changes"],
|
||||
["LocationChange", "Triggered when changing tabs or when naviagtion to a new location"],
|
||||
["PageLoadPre", "Triggered after a page load is initiated"],
|
||||
["PageLoad", "Triggered when a page gets (re)loaded/opened"],
|
||||
|
||||
@@ -24,6 +24,7 @@ Available {events}:
|
||||
*ColorScheme* Triggered after a color scheme has been loaded
|
||||
*DOMLoad* Triggered when a page's DOM content has fully loaded
|
||||
*DownloadPost* Triggered when a download has completed
|
||||
*Fullscreen* Triggered when the browser's fullscreen state changes
|
||||
*LocationChange* Triggered when changing tabs or when navigating to a new location
|
||||
*PageLoadPre* Triggered after a page load is initiated.
|
||||
*PageLoad* Triggered when a page gets (re)loaded/opened
|
||||
|
||||
Reference in New Issue
Block a user