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