1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-01-06 05:14:11 +01:00

changed vimperator.open() to accept postdata, makes the design a little uncleaner, but supports _all_ firefox search engines now.

This commit is contained in:
Martin Stubenschrott
2007-07-31 23:44:49 +00:00
parent 755dfce0e6
commit f12781220b
3 changed files with 31 additions and 10 deletions

View File

@@ -197,11 +197,13 @@ function Bookmarks() //{{{
return keywords;
}
// if the engine name is null, it uses the default search engine
// if @param engine_name is null, it uses the default search engine
// @returns the url for the search string
// if the search also requires a postdata, [url, postdata] is returned
this.getSearchURL = function(text, engine_name)
{
var url = null;
var postdata = null;
if (!engine_name || engine_name == "")
engine_name = vimperator.options["defsearch"];
@@ -210,7 +212,11 @@ function Bookmarks() //{{{
if (engine)
{
if (text)
url = engine.getSubmission(text, null).uri.spec;
{
var submission = engine.getSubmission(text, null);
url = submission.uri.spec;
postdata = submission.postData;
}
else
url = engine.searchForm;
}
@@ -232,7 +238,10 @@ function Bookmarks() //{{{
}
// if we came here, the engine_name is neither a search engine or URL
return url;
if (postdata)
return [url, postdata];
else
return url; // can be null
}
this.list = function(filter, fullmode)