1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-21 22:17:59 +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>"], mappings.add(myModes, ["<C-c>"],
"Stop loading", "Stop loading the current web page",
function () function () { tabs.stop(getBrowser().mCurrentTab); });
{
if (config.stop)
config.stop();
else
window.BrowserStop();
});
// scrolling // scrolling
mappings.add(myModes, ["j", "<Down>", "<C-e>"], mappings.add(myModes, ["j", "<Down>", "<C-e>"],
@@ -430,7 +424,7 @@ function Buffer() //{{{
// reloading // reloading
mappings.add(myModes, ["r"], mappings.add(myModes, ["r"],
"Reload current page", "Reload the current web page",
function () { tabs.reload(getBrowser().mCurrentTab, false); }); function () { tabs.reload(getBrowser().mCurrentTab, false); });
mappings.add(myModes, ["R"], mappings.add(myModes, ["R"],
@@ -592,7 +586,7 @@ function Buffer() //{{{
}); });
commands.add(["re[load]"], commands.add(["re[load]"],
"Reload current page", "Reload the current web page",
function (args) { tabs.reload(getBrowser().mCurrentTab, args.bang); }, function (args) { tabs.reload(getBrowser().mCurrentTab, args.bang); },
{ {
bang: true, bang: true,
@@ -642,14 +636,8 @@ function Buffer() //{{{
}); });
commands.add(["st[op]"], commands.add(["st[op]"],
"Stop loading", "Stop loading the current web page",
function () function () { tabs.stop(getBrowser().mCurrentTab); },
{
if (config.stop)
config.stop();
else
window.BrowserStop();
},
{ argCount: "0" }); { argCount: "0" });
commands.add(["vie[wsource]"], commands.add(["vie[wsource]"],

View File

@@ -527,6 +527,11 @@ function Tabs() //{{{
bang: true bang: true
}); });
commands.add(["stopa[ll]"],
"Stop loading all tab pages",
function () { tabs.stopAll(); },
{ argCount: "0" });
// TODO: add count support // TODO: add count support
commands.add(["tabm[ove]"], commands.add(["tabm[ove]"],
"Move the current tab after tab N", "Move the current tab after tab N",
@@ -886,6 +891,13 @@ function Tabs() //{{{
getBrowser().mTabContainer.selectedIndex = index; 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) reload: function (tab, bypassCache)
{ {
if (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) reloadAll: function (bypassCache)
{ {
if (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 // "buffer" is a string which matches the URL or title of a buffer, if it
// is null, the last used string is used again // is null, the last used string is used again
switchTo: function (buffer, allowNonUnique, count, reverse) switchTo: function (buffer, allowNonUnique, count, reverse)

View File

@@ -4,6 +4,7 @@
* TabMixPlus (and other tab extensions) should work much better now * TabMixPlus (and other tab extensions) should work much better now
together with Vimperator unless you :set guioptions+=[nN] together with Vimperator unless you :set guioptions+=[nN]
* remove 'preload' option. You can fake it by some custom javascript in your init file * remove 'preload' option. You can fake it by some custom javascript in your init file
* add :stopall
* add :tabdo * add :tabdo
* add 'encoding' * add 'encoding'
* add 'hintinputs' * add 'hintinputs'

View File

@@ -1,7 +1,7 @@
" Vim syntax file " Vim syntax file
" Language: VIMperator configuration file " Language: VIMperator configuration file
" Maintainer: Doug Kearns <dougkearns@gmail.com> " Maintainer: Doug Kearns <dougkearns@gmail.com>
" Last Change: 2009 Apr 30 " Last Change: 2009 May 11
if exists("b:current_syntax") if exists("b:current_syntax")
finish finish
@@ -26,7 +26,7 @@ syn keyword vimperatorCommand ab[breviate] ab[clear] addo[ns] bN[ext] b[uffer] b
\ ino[remap] iu[nmap] iuna[bbrev] javas[cript] js ju[mps] let loadplugins lpl ls ma[rk] macros map mapc[lear] marks mes[sages] \ ino[remap] iu[nmap] iuna[bbrev] javas[cript] js ju[mps] let loadplugins lpl ls ma[rk] macros map mapc[lear] marks mes[sages]
\ mkv[imperatorrc] no[remap] noh[lsearch] norm[al] o[pen] optionu[sage] pa[geinfo] pagest[yle] pc[lose] pl[ay] pref[erences] \ mkv[imperatorrc] no[remap] noh[lsearch] norm[al] o[pen] optionu[sage] pa[geinfo] pagest[yle] pc[lose] pl[ay] pref[erences]
\ prefs pw[d] q[uit] qa[ll] qma[rk] qmarks quita[ll] re[draw] re[load] reloada[ll] res[tart] run runt[ime] sav[eas] sb[ar] \ prefs pw[d] q[uit] qa[ll] qma[rk] qmarks quita[ll] re[draw] re[load] reloada[ll] res[tart] run runt[ime] sav[eas] sb[ar]
\ sb[open] sbcl[ose] scrip[tnames] se[t] setg[lobal] setl[ocal] sideb[ar] so[urce] st[op] sty[le] tN[ext] t[open] tab \ sb[open] sbcl[ose] scrip[tnames] se[t] setg[lobal] setl[ocal] sideb[ar] so[urce] st[op] stopall sty[le] tN[ext] t[open] tab
\ tabN[ext] tabc[lose] tabd[uplicate] tabde[tach] tabd[o] tabe[dit] tabfir[st] tabl[ast] tabm[ove] tabn[ext] tabnew tabo[nly] \ tabN[ext] tabc[lose] tabd[uplicate] tabde[tach] tabd[o] tabe[dit] tabfir[st] tabl[ast] tabm[ove] tabn[ext] tabnew tabo[nly]
\ tabopen tabp[revious] tabr[ewind] tabs time tn[ext] tp[revious] u[ndo] una[bbreviate] undoa[ll] unl[et] unm[ap] ve[rsion] \ tabopen tabp[revious] tabr[ewind] tabs time tn[ext] tp[revious] u[ndo] una[bbreviate] undoa[ll] unl[et] unm[ap] ve[rsion]
\ vie[wsource] viu[sage] w[rite] wc[lose] win[open] winc[lose] wine[dit] wo[pen] wq wqa[ll] xa[ll] zo[om] \ vie[wsource] viu[sage] w[rite] wc[lose] win[open] winc[lose] wine[dit] wo[pen] wq wqa[ll] xa[ll] zo[om]

View File

@@ -240,22 +240,22 @@ section:Reloading[reloading]
|r| |r|
||r|| ||r||
________________________________________________________________________________ ________________________________________________________________________________
Force reloading of the current page. Force reloading of the current web page.
________________________________________________________________________________ ________________________________________________________________________________
|R| |R|
||R|| ||R||
________________________________________________________________________________ ________________________________________________________________________________
Force reloading of the current page skipping the cache. Force reloading of the current web page skipping the cache.
________________________________________________________________________________ ________________________________________________________________________________
|:re| |:reload| + |:re| |:reload| +
||:re[load][!]|| ||:re[load][!]||
________________________________________________________________________________ ________________________________________________________________________________
Reload current page. Forces reloading of the current page. If [!] is Reload current web page. Forces reloading of the current page. If [!] is given,
given, skip the cache. skip the cache.
________________________________________________________________________________ ________________________________________________________________________________
@@ -277,7 +277,13 @@ ________________________________________________________________________________
|:st| |:stop| |:st| |:stop|
||:st[op]|| ||:st[op]||
________________________________________________________________________________ ________________________________________________________________________________
Stop loading. Stop loading current web page. Stop loading the current web page.
________________________________________________________________________________
|:stopa| |:stopall| +
||:stopa[ll]||
________________________________________________________________________________
Stop loading all web pages.
________________________________________________________________________________ ________________________________________________________________________________
section:Writing[writing,save-file] section:Writing[writing,save-file]

View File

@@ -14,7 +14,7 @@ section:Normal{nbsp}mode[normal-index]
||[m]<C-^>[m]|| Select the alternate tab or the [count]th tab + ||[m]<C-^>[m]|| Select the alternate tab or the [count]th tab +
||[m]<C-a>[m]|| Increment last number in URL + ||[m]<C-a>[m]|| Increment last number in URL +
||[m]<C-b>[m]|| Scroll up a full page + ||[m]<C-b>[m]|| Scroll up a full page +
||[m]<C-c>[m]|| Stop loading + ||[m]<C-c>[m]|| Stop loading the current web page +
||[m]<C-d>[m]|| Scroll window downwards in the buffer + ||[m]<C-d>[m]|| Scroll window downwards in the buffer +
||[m]<C-f>[m]|| Scroll down a full page + ||[m]<C-f>[m]|| Scroll down a full page +
||[m]<C-g>[m]|| Print the current file name + ||[m]<C-g>[m]|| Print the current file name +
@@ -66,7 +66,7 @@ section:Normal{nbsp}mode[normal-index]
||[m]o[m]|| Open one or more URLs + ||[m]o[m]|| Open one or more URLs +
||[m]p[m]|| Open (put) a URL based on the current clipboard contents in the current buffer + ||[m]p[m]|| Open (put) a URL based on the current clipboard contents in the current buffer +
||[m]q[m]|| Record a key sequence into a macro + ||[m]q[m]|| Record a key sequence into a macro +
||[m]r[m]|| Reload current page + ||[m]r[m]|| Reload the current web page +
||[m]t[m]|| Open one or more URLs in a new tab + ||[m]t[m]|| Open one or more URLs in a new tab +
||[m]u[m]|| Undo closing of a tab + ||[m]u[m]|| Undo closing of a tab +
||[m]y[m]|| Yank current location to the clipboard + ||[m]y[m]|| Yank current location to the clipboard +
@@ -222,7 +222,7 @@ section:Ex{nbsp}commands[ex-cmd-index,:index]
||[c]:quit[c]|| Quit current tab + ||[c]:quit[c]|| Quit current tab +
||[c]:quitall[c]|| Quit Vimperator + ||[c]:quitall[c]|| Quit Vimperator +
||[c]:redraw[c]|| Redraw the screen + ||[c]:redraw[c]|| Redraw the screen +
||[c]:reload[c]|| Reload current page + ||[c]:reload[c]|| Reload the current web page +
||[c]:reloadall[c]|| Reload all tab pages + ||[c]:reloadall[c]|| Reload all tab pages +
||[c]:restart[c]|| Force the browser to restart + ||[c]:restart[c]|| Force the browser to restart +
||[c]:runtime[c]|| Source the specified file from each directory in 'runtimepath' + ||[c]:runtime[c]|| Source the specified file from each directory in 'runtimepath' +
@@ -236,7 +236,8 @@ section:Ex{nbsp}commands[ex-cmd-index,:index]
||[c]:silent[c]|| Execute a command silently + ||[c]:silent[c]|| Execute a command silently +
||[c]:style[c]|| Style Vimperator and web sites + ||[c]:style[c]|| Style Vimperator and web sites +
||[c]:source[c]|| Read Ex commands from a file + ||[c]:source[c]|| Read Ex commands from a file +
||[c]:stop[c]|| Stop loading + ||[c]:stop[c]|| Stop loading the current web page +
||[c]:stopall[c]|| Stop loading all tab pages +
||[c]:tab[c]|| Execute a command and tell it to output in a new tab + ||[c]:tab[c]|| Execute a command and tell it to output in a new tab +
||[c]:tabdo[c]|| Execute a command in each tab + ||[c]:tabdo[c]|| Execute a command in each tab +
||[c]:tabdetach[c]|| Detach current tab to its own window + ||[c]:tabdetach[c]|| Detach current tab to its own window +

View File

@@ -174,7 +174,8 @@ const config = { //{{{
"library.js" "library.js"
], ],
stop: function () // FIXME: tab arg and media tab exception?
stop: function (tab)
{ {
SBGetBrowser().mCurrentBrowser.stop(); SBGetBrowser().mCurrentBrowser.stop();
}, },