diff options
author | Kris Maglione <maglione.k@gmail.com> | 2011-02-05 16:22:25 -0500 |
---|---|---|
committer | Kris Maglione <maglione.k@gmail.com> | 2011-02-05 16:22:25 -0500 |
commit | 4d47bfe0028c69778db80a1e63eac6f4124ce380 (patch) | |
tree | 1594a07189183988570022a23d3bfa5bfb5f9ac9 /common/content/bookmarks.js | |
parent | 96bce6efdf9c61b3a17a11d3fc82a8d3ffda6f87 (diff) | |
download | pentadactyl-4d47bfe0028c69778db80a1e63eac6f4124ce380.tar.gz |
Cache bookmarkcache.keywords.
Diffstat (limited to 'common/content/bookmarks.js')
-rw-r--r-- | common/content/bookmarks.js | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/common/content/bookmarks.js b/common/content/bookmarks.js index 89ee37cc..52c1ecee 100644 --- a/common/content/bookmarks.js +++ b/common/content/bookmarks.js @@ -192,8 +192,8 @@ var Bookmarks = Module("bookmarks", { let aliases = {}; return iter(services.browserSearch.getVisibleEngines({})).map(function ([, engine]) { let alias = engine.alias; - if (!alias || !/^[a-z-]+$/.test(alias)) - alias = engine.name.replace(/[^a-z_-]+/gi, "-").replace(/^-|-$/, "").toLowerCase(); + if (!alias || !/^[a-z0-9-]+$/.test(alias)) + alias = engine.name.replace(/[^a-z0-9]+/gi, "-").replace(/^-|-$/, "").toLowerCase(); if (!alias) alias = "search"; // for search engines which we can't find a suitable alias @@ -249,12 +249,6 @@ var Bookmarks = Module("bookmarks", { }, /** - * Returns an array of bookmark keyword objects. - * @deprecated - */ - getKeywords: function getKeywords() bookmarkcache.keywords, - - /** * Returns an array containing a search URL and POST data for the * given search string. If *useDefsearch* is true, the string is * always passed to the default search engine. If it is not, the @@ -600,7 +594,7 @@ var Bookmarks = Module("bookmarks", { completion.search = function search(context, noSuggest) { let [, keyword, space, args] = context.filter.match(/^\s*(\S*)(\s*)(.*)$/); - let keywords = bookmarks.getKeywords(); + let keywords = bookmarkcache.keywords; let engines = bookmarks.searchEngines; context.title = ["Search Keywords"]; |