summaryrefslogtreecommitdiff
path: root/common/content
diff options
context:
space:
mode:
authorKris Maglione <maglione.k@gmail.com>2011-02-05 16:22:25 -0500
committerKris Maglione <maglione.k@gmail.com>2011-02-05 16:22:25 -0500
commit4d47bfe0028c69778db80a1e63eac6f4124ce380 (patch)
tree1594a07189183988570022a23d3bfa5bfb5f9ac9 /common/content
parent96bce6efdf9c61b3a17a11d3fc82a8d3ffda6f87 (diff)
downloadpentadactyl-4d47bfe0028c69778db80a1e63eac6f4124ce380.tar.gz
Cache bookmarkcache.keywords.
Diffstat (limited to 'common/content')
-rw-r--r--common/content/bookmarks.js12
-rw-r--r--common/content/buffer.js8
2 files changed, 7 insertions, 13 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"];
diff --git a/common/content/buffer.js b/common/content/buffer.js
index 146daf9b..3c5f9cb8 100644
--- a/common/content/buffer.js
+++ b/common/content/buffer.js
@@ -324,13 +324,13 @@ var Buffer = Module("buffer", {
if (win && uri) {
statusline.progress = win.dactylProgress;
- let oldURI = webProgress.document.dactylURI;
- if (webProgress.document.dactylLoadIdx === webProgress.loadedTransIndex
+ let oldURI = win.document.dactylURI;
+ if (win.document.dactylLoadIdx === webProgress.loadedTransIndex
|| !oldURI || uri.spec.replace(/#.*/, "") !== oldURI.replace(/#.*/, ""))
for (let frame in values(buffer.allFrames(win)))
frame.document.dactylFocusAllowed = false;
- webProgress.document.dactylURI = uri.spec;
- webProgress.document.dactylLoadIdx = webProgress.loadedTransIndex;
+ win.document.dactylURI = uri.spec;
+ win.document.dactylLoadIdx = webProgress.loadedTransIndex;
}
// Workaround for bugs 591425 and 606877, dactyl bug #81