1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-02-14 23:35:44 +01:00

added search suggestions (thanks to M.Terada)

This commit is contained in:
Martin Stubenschrott
2008-04-23 18:00:52 +00:00
parent 545a0ffb25
commit b9327b6bf2
7 changed files with 89 additions and 20 deletions

View File

@@ -286,9 +286,25 @@ liberator.CommandLine = function () //{{{
"Items which are completed at the :[tab]open prompt",
"charlist", "sfbh",
{
validator: function (value) { return !/[^sfbhg]/.test(value); }
validator: function (value) { return !/[^sfbhS]/.test(value); }
});
liberator.options.add(["suggestengines"],
"Engine Alias which has a feature of suggest",
"stringlist", "google",
{
validator: function (value)
{
var ss = Components.classes["@mozilla.org/browser/search-service;1"]
.getService(Components.interfaces.nsIBrowserSearchService);
return value.split(",").every(function (item)
{
var e = ss.getEngineByAlias(item);
return (e && e.supportsResponseType("application/x-suggestions+json")) ? true : false;
});
}
});
liberator.options.add(["showmode", "smd"],
"Show the current mode in the command line",
"boolean", true);