mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-24 01:22:27 +01:00
add DOMLoad autocmd event
This commit is contained in:
1
NEWS
1
NEWS
@@ -7,6 +7,7 @@
|
||||
special versions for the old behavior
|
||||
* IMPORTANT: renamed Startup and Quit autocmd events to VimperatorEnter and
|
||||
VimperatorLeave respectively
|
||||
* add DOMLoad autocmd event
|
||||
* add :messages and 'messages'
|
||||
* add :runtime
|
||||
* add 'runtimepath'
|
||||
|
||||
@@ -300,6 +300,8 @@ liberator.Events = function () //{{{
|
||||
}, false);
|
||||
}
|
||||
|
||||
getBrowser().addEventListener("DOMContentLoaded", onDOMContentLoaded, true);
|
||||
|
||||
// this adds an event which is is called on each page load, even if the
|
||||
// page is loaded in a background tab
|
||||
getBrowser().addEventListener("load", onPageLoad, true);
|
||||
@@ -447,6 +449,13 @@ liberator.Events = function () //{{{
|
||||
return false;
|
||||
}
|
||||
|
||||
function onDOMContentLoaded(event)
|
||||
{
|
||||
if (event.originalTarget instanceof HTMLDocument)
|
||||
liberator.autocommands.trigger("DOMLoad", event.originalTarget.location.href);
|
||||
}
|
||||
|
||||
// TODO: see what can be moved to onDOMContentLoaded()
|
||||
function onPageLoad(event)
|
||||
{
|
||||
if (event.originalTarget instanceof HTMLDocument)
|
||||
|
||||
@@ -39,6 +39,7 @@ liberator.config = { //{{{
|
||||
get visualbellWindow() getBrowser().mPanelContainer,
|
||||
|
||||
autocommands: [["BookmarkAdd", "Triggered after a page is bookmarked"],
|
||||
["DOMLoad", "Triggered when a page's DOM content has fully loaded"],
|
||||
["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"],
|
||||
|
||||
@@ -21,6 +21,7 @@ Available {events}:
|
||||
|
||||
`--------------------`----------------------------------------
|
||||
*BookmarkAdd* Triggered after a page is bookmarked
|
||||
*DOMLoad* Triggered when a page's DOM content has fully loaded
|
||||
*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
|
||||
|
||||
@@ -32,8 +32,8 @@ syn match vimperatorCommand "!" contained
|
||||
|
||||
syn keyword vimperatorAutoCmd au[tocmd] contained nextgroup=vimperatorAutoEventList skipwhite
|
||||
|
||||
syn keyword vimperatorAutoEvent BookmarkAdd LocationChange PageLoadPre PageLoad ShellCmdPost VimperatorEnter VimperatorLeavePre
|
||||
\ VimperatorLeave
|
||||
syn keyword vimperatorAutoEvent BookmarkAdd DOMLoad LocationChange PageLoadPre PageLoad ShellCmdPost VimperatorEnter
|
||||
\ VimperatorLeavePre VimperatorLeave
|
||||
\ contained
|
||||
|
||||
syn match vimperatorAutoEventList "\(\a\+,\)*\a\+" contained contains=vimperatorAutoEvent
|
||||
|
||||
Reference in New Issue
Block a user