mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2026-03-29 13:33:31 +02:00
Add the DOMLoad autocommand event to Muttator.
This also fixes the PageLoad* events.
This commit is contained in:
@@ -364,19 +364,20 @@ function Events() //{{{
|
|||||||
|
|
||||||
if (liberator.has("tabs"))
|
if (liberator.has("tabs"))
|
||||||
{
|
{
|
||||||
let tabcontainer = getBrowser().mTabContainer;
|
// FIXME: most of this doesn't work for Muttator yet.
|
||||||
if (tabcontainer) // not every VIM-like extension has a tab container
|
liberator.registerObserver("load_tabs", function () {
|
||||||
{
|
let tabContainer = tabs.getBrowser().mTabContainer;
|
||||||
tabcontainer.addEventListener("TabMove", function (event) {
|
|
||||||
|
tabContainer.addEventListener("TabMove", function (event) {
|
||||||
statusline.updateTabCount();
|
statusline.updateTabCount();
|
||||||
}, false);
|
}, false);
|
||||||
tabcontainer.addEventListener("TabOpen", function (event) {
|
tabContainer.addEventListener("TabOpen", function (event) {
|
||||||
statusline.updateTabCount();
|
statusline.updateTabCount();
|
||||||
}, false);
|
}, false);
|
||||||
tabcontainer.addEventListener("TabClose", function (event) {
|
tabContainer.addEventListener("TabClose", function (event) {
|
||||||
statusline.updateTabCount();
|
statusline.updateTabCount();
|
||||||
}, false);
|
}, false);
|
||||||
tabcontainer.addEventListener("TabSelect", function (event) {
|
tabContainer.addEventListener("TabSelect", function (event) {
|
||||||
// TODO: is all of that necessary?
|
// TODO: is all of that necessary?
|
||||||
modes.reset();
|
modes.reset();
|
||||||
// XXX: apparently the tab container hasn't updated mTabs yet
|
// XXX: apparently the tab container hasn't updated mTabs yet
|
||||||
@@ -386,19 +387,19 @@ function Events() //{{{
|
|||||||
if (options["focuscontent"])
|
if (options["focuscontent"])
|
||||||
setTimeout(function () { liberator.focusContent(true); }, 10); // just make sure, that no widget has focus
|
setTimeout(function () { liberator.focusContent(true); }, 10); // just make sure, that no widget has focus
|
||||||
}, false);
|
}, 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
|
// this adds an event which is is called on each page load, even if the
|
||||||
// page is loaded in a background tab
|
// page is loaded in a background tab
|
||||||
getBrowser().addEventListener("load", onPageLoad, true);
|
tabs.getBrowser().addEventListener("load", onPageLoad, true);
|
||||||
|
|
||||||
// called when the active document is scrolled
|
// called when the active document is scrolled
|
||||||
getBrowser().addEventListener("scroll", function (event) {
|
tabs.getBrowser().addEventListener("scroll", function (event) {
|
||||||
statusline.updateBufferPosition();
|
statusline.updateBufferPosition();
|
||||||
modes.show();
|
modes.show();
|
||||||
}, null);
|
}, null);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// getBrowser().addEventListener("submit", function (event) {
|
// getBrowser().addEventListener("submit", function (event) {
|
||||||
|
|||||||
@@ -721,6 +721,8 @@ function Tabs() //{{{
|
|||||||
return store.options;
|
return store.options;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
getBrowser: getBrowser,
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the local state store for the tab at the specified
|
* Returns the local state store for the tab at the specified
|
||||||
* <b>tabIndex</b>. If <b>tabIndex</b> is not specified then the
|
* <b>tabIndex</b>. If <b>tabIndex</b> is not specified then the
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
2009-XX-XX
|
2009-XX-XX
|
||||||
* version 0.6a1pre
|
* version 0.6a1pre
|
||||||
|
* add a DOMLoad autocommand event
|
||||||
* add 'online' option
|
* add 'online' option
|
||||||
* add 'smtpserver' option
|
* add 'smtpserver' option
|
||||||
|
|
||||||
|
|||||||
@@ -55,7 +55,8 @@ const config = { //{{{
|
|||||||
get visualbellWindow() document.getElementById(this.mainWindowID),
|
get visualbellWindow() document.getElementById(this.mainWindowID),
|
||||||
styleableChrome: "chrome://messenger/content/messenger.xul,chrome://messenger/content/messengercompose/messengercompose.xul",
|
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"],
|
["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"],
|
||||||
["MuttatorEnter", "Triggered after Thunderbird starts"],
|
["MuttatorEnter", "Triggered after Thunderbird starts"],
|
||||||
|
|||||||
Reference in New Issue
Block a user