1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-02-12 22:05:54 +01:00

Add :stopall.

This commit is contained in:
Doug Kearns
2009-05-11 01:20:45 +10:00
parent 961c84c33d
commit f73879f43e
7 changed files with 67 additions and 30 deletions

View File

@@ -254,14 +254,8 @@ function Buffer() //{{{
});
mappings.add(myModes, ["<C-c>"],
"Stop loading",
function ()
{
if (config.stop)
config.stop();
else
window.BrowserStop();
});
"Stop loading the current web page",
function () { tabs.stop(getBrowser().mCurrentTab); });
// scrolling
mappings.add(myModes, ["j", "<Down>", "<C-e>"],
@@ -430,7 +424,7 @@ function Buffer() //{{{
// reloading
mappings.add(myModes, ["r"],
"Reload current page",
"Reload the current web page",
function () { tabs.reload(getBrowser().mCurrentTab, false); });
mappings.add(myModes, ["R"],
@@ -592,7 +586,7 @@ function Buffer() //{{{
});
commands.add(["re[load]"],
"Reload current page",
"Reload the current web page",
function (args) { tabs.reload(getBrowser().mCurrentTab, args.bang); },
{
bang: true,
@@ -642,14 +636,8 @@ function Buffer() //{{{
});
commands.add(["st[op]"],
"Stop loading",
function ()
{
if (config.stop)
config.stop();
else
window.BrowserStop();
},
"Stop loading the current web page",
function () { tabs.stop(getBrowser().mCurrentTab); },
{ argCount: "0" });
commands.add(["vie[wsource]"],

View File

@@ -527,6 +527,11 @@ function Tabs() //{{{
bang: true
});
commands.add(["stopa[ll]"],
"Stop loading all tab pages",
function () { tabs.stopAll(); },
{ argCount: "0" });
// TODO: add count support
commands.add(["tabm[ove]"],
"Move the current tab after tab N",
@@ -886,6 +891,13 @@ function Tabs() //{{{
getBrowser().mTabContainer.selectedIndex = index;
},
/**
* Reload the specified tab.
*
* @param {Object} tab The tab to reload.
* @param {boolean} bypassCache Whether to bypass the cache when
* reloading.
*/
reload: function (tab, bypassCache)
{
if (bypassCache)
@@ -899,6 +911,12 @@ function Tabs() //{{{
}
},
/**
* Reload all tabs.
*
* @param {boolean} bypassCache Whether to bypass the cache when
* reloading.
*/
reloadAll: function (bypassCache)
{
if (bypassCache)
@@ -922,6 +940,28 @@ function Tabs() //{{{
}
},
/**
* Stop loading the specified tab.
*
* @param {Object} tab The tab to stop loading.
*/
stop: function (tab)
{
if (config.stop)
config.stop(tab);
else
tab.linkedBrowser.stop();
},
/**
* Stop loading all tabs.
*/
stopAll: function ()
{
for (let [,browser] in this.browsers)
browser.stop();
},
// "buffer" is a string which matches the URL or title of a buffer, if it
// is null, the last used string is used again
switchTo: function (buffer, allowNonUnique, count, reverse)