1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-01-07 19:54:11 +01:00

Add the DOMLoad autocommand event to Muttator.

This also fixes the PageLoad* events.
This commit is contained in:
Doug Kearns
2009-07-15 14:10:40 +10:00
parent e5bdef975b
commit 821e48a7e3
4 changed files with 23 additions and 18 deletions

View File

@@ -364,19 +364,20 @@ function Events() //{{{
if (liberator.has("tabs"))
{
let tabcontainer = getBrowser().mTabContainer;
if (tabcontainer) // not every VIM-like extension has a tab container
{
tabcontainer.addEventListener("TabMove", function (event) {
// FIXME: most of this doesn't work for Muttator yet.
liberator.registerObserver("load_tabs", function () {
let tabContainer = tabs.getBrowser().mTabContainer;
tabContainer.addEventListener("TabMove", function (event) {
statusline.updateTabCount();
}, false);
tabcontainer.addEventListener("TabOpen", function (event) {
tabContainer.addEventListener("TabOpen", function (event) {
statusline.updateTabCount();
}, false);
tabcontainer.addEventListener("TabClose", function (event) {
tabContainer.addEventListener("TabClose", function (event) {
statusline.updateTabCount();
}, false);
tabcontainer.addEventListener("TabSelect", function (event) {
tabContainer.addEventListener("TabSelect", function (event) {
// TODO: is all of that necessary?
modes.reset();
// XXX: apparently the tab container hasn't updated mTabs yet
@@ -386,19 +387,19 @@ function Events() //{{{
if (options["focuscontent"])
setTimeout(function () { liberator.focusContent(true); }, 10); // just make sure, that no widget has focus
}, false);
}
getBrowser().addEventListener("DOMContentLoaded", onDOMContentLoaded, true);
tabs.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);
// this adds an event which is is called on each page load, even if the
// page is loaded in a background tab
tabs.getBrowser().addEventListener("load", onPageLoad, true);
// called when the active document is scrolled
getBrowser().addEventListener("scroll", function (event) {
statusline.updateBufferPosition();
modes.show();
}, null);
// called when the active document is scrolled
tabs.getBrowser().addEventListener("scroll", function (event) {
statusline.updateBufferPosition();
modes.show();
}, null);
});
}
// getBrowser().addEventListener("submit", function (event) {

View File

@@ -721,6 +721,8 @@ function Tabs() //{{{
return store.options;
},
getBrowser: getBrowser,
/**
* Returns the local state store for the tab at the specified
* <b>tabIndex</b>. If <b>tabIndex</b> is not specified then the

View File

@@ -1,5 +1,6 @@
2009-XX-XX
* version 0.6a1pre
* add a DOMLoad autocommand event
* add 'online' option
* add 'smtpserver' option

View File

@@ -55,7 +55,8 @@ const config = { //{{{
get visualbellWindow() document.getElementById(this.mainWindowID),
styleableChrome: "chrome://messenger/content/messenger.xul,chrome://messenger/content/messengercompose/messengercompose.xul",
autocommands: [["FolderLoaded", "Triggered after switching folders in Thunderbird"],
autocommands: [["DOMLoad", "Triggered when a page's DOM content has fully loaded"],
["FolderLoaded", "Triggered after switching folders in Thunderbird"],
["PageLoadPre", "Triggered after a page load is initiated"],
["PageLoad", "Triggered when a page gets (re)loaded/opened"],
["MuttatorEnter", "Triggered after Thunderbird starts"],