1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-01-10 08:24:16 +01:00

Add 'pageinfo'=e.

This commit is contained in:
Kris Maglione
2011-05-09 20:15:13 -04:00
parent a4aa3b5bc4
commit 8faa8a7113
3 changed files with 22 additions and 3 deletions

View File

@@ -19,6 +19,24 @@ var Buffer = Module("buffer", {
this.evaluateXPath = util.evaluateXPath;
this.pageInfo = {};
this.addPageInfoSection("e", "Search Engines", function (verbose) {
let n = 1;
let nEngines = 0;
for (let { document: doc } in values(buffer.allFrames())) {
let engines = util.evaluateXPath(["link[@href and @rel='search' and @type='application/opensearchdescription+xml']"], doc);
nEngines += engines.snapshotLength;
if (verbose)
for (let link in engines)
yield [link.title || /*L*/ "Engine " + n++,
<a xmlns={XHTML} href={link.href} onclick="window.external.AddSearchProvider(this.href); return false;">{link.href}</a>];
}
if (!verbose && nEngines)
yield nEngines + /*L*/" engine" + (nEngines > 1 ? "s" : "");
});
this.addPageInfoSection("f", "Feeds", function (verbose) {
const feedTypes = {
"application/rss+xml": "RSS",
@@ -1887,7 +1905,7 @@ var Buffer = Module("buffer", {
options.add(["pageinfo", "pa"],
"Define which sections are shown by the :pageinfo command",
"charlist", "gsfm",
"charlist", "gesfm",
{ get values() values(buffer.pageInfo).toObject() });
options.add(["scroll", "scr"],

View File

@@ -1128,6 +1128,7 @@
<dl dt="width: 6em;">
<dt>g</dt> <dd>General info</dd>
<dt>e</dt> <dd>Search Engines</dd>
<dt>f</dt> <dd>Feeds</dd>
<dt>m</dt> <dd>Meta tags</dd>
<dt>s</dt> <dd>Security information</dd>

View File

@@ -109,7 +109,7 @@
- Added several new options, including -javascript, to :abbreviate and
:map. [b2]
- Added :mksyntax command to auto-generate Vim syntax files. [b4]
- Added 's' flag to :pageinfo command. [b7]
- Added 's' and 'e' flags to :pageinfo command. [b7]
- Added :pintab and :unpintab commands. [b7]
- :open now only opens files beginning with /, ./, ../, or ~/ [b1]
- :saveas now provides completions for default file names, and
@@ -148,7 +148,7 @@
specially. Use "." instead. [b2]
- 'extendedhinttags' is now a [regexpmap] rather than a
string. [b2]
- 'guioptions' default value has changed. [b4]
- 'guioptions' default value has changed. [b4][b7]
- 'hinttags' and 'extendedhinttags' now treat their values as
CSS selectors by default. [b6]
- 'incsearch', 'hlsearch', 'ignorecase', and 'smartcase' have