From 8faa8a7113a78ec46de4d251ebb73233a849aca0 Mon Sep 17 00:00:00 2001 From: Kris Maglione Date: Mon, 9 May 2011 20:15:13 -0400 Subject: [PATCH] Add 'pageinfo'=e. --- common/content/buffer.js | 20 +++++++++++++++++++- common/locale/en-US/options.xml | 1 + pentadactyl/NEWS | 4 ++-- 3 files changed, 22 insertions(+), 3 deletions(-) diff --git a/common/content/buffer.js b/common/content/buffer.js index ddd0c206..6096564a 100644 --- a/common/content/buffer.js +++ b/common/content/buffer.js @@ -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++, + {link.href}]; + } + + 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"], diff --git a/common/locale/en-US/options.xml b/common/locale/en-US/options.xml index eac5f444..da128279 100644 --- a/common/locale/en-US/options.xml +++ b/common/locale/en-US/options.xml @@ -1128,6 +1128,7 @@
g
General info
+
e
Search Engines
f
Feeds
m
Meta tags
s
Security information
diff --git a/pentadactyl/NEWS b/pentadactyl/NEWS index f30fe5aa..3a416c36 100644 --- a/pentadactyl/NEWS +++ b/pentadactyl/NEWS @@ -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