1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-20 18:37:58 +01:00

Fix :bmark!.

--HG--
extra : rebase_source : 0a2fca19627555ada35aa580e58bc5e0e608a756
This commit is contained in:
Kris Maglione
2010-09-20 11:36:56 -04:00
parent a460446f00
commit 29eef10f03
4 changed files with 6 additions and 5 deletions

View File

@@ -34,17 +34,16 @@ const Bookmarks = Module("bookmarks", {
add: function add(starOnly, title, url, keyword, tags, force) { add: function add(starOnly, title, url, keyword, tags, force) {
try { try {
let uri = util.createURI(url); let uri = util.createURI(url);
if (!force && bookmarks.isBookmarked(uri.spec)) { if (force && bookmarks.isBookmarked(uri.spec))
// WTF? This seems wrong... --Kris // WTF? This seems wrong... --Kris
for (let bmark in bookmarkcache) { for (let bmark in bookmarkcache)
if (bmark[0] == uri.spec) { if (bmark[0] == uri.spec) {
var id = bmark[5]; var id = bmark[5];
if (title) if (title)
services.get("bookmarks").setItemTitle(id, title); services.get("bookmarks").setItemTitle(id, title);
break; break;
} }
}
}
if (id == undefined) if (id == undefined)
id = services.get("bookmarks").insertBookmark( id = services.get("bookmarks").insertBookmark(
services.get("bookmarks")[starOnly ? "unfiledBookmarksFolder" : "bookmarksMenuFolder"], services.get("bookmarks")[starOnly ? "unfiledBookmarksFolder" : "bookmarksMenuFolder"],

View File

@@ -914,6 +914,7 @@ const Commands = Module("commands", {
// dynamically get completions as specified with the command's completer function // dynamically get completions as specified with the command's completer function
let command = cmd && commands.get(cmd); let command = cmd && commands.get(cmd);
if (!command) { if (!command) {
context.highlight();
context.highlight(0, cmd && cmd.length, "SPELLCHECK"); context.highlight(0, cmd && cmd.length, "SPELLCHECK");
return; return;
} }

View File

@@ -266,6 +266,7 @@ const Hints = Module("hints", {
hint.span = baseNodeAbsolute.cloneNode(true); hint.span = baseNodeAbsolute.cloneNode(true);
rect = elem.getClientRects()[0] || rect;
let leftPos = Math.max((rect.left + offsetX), offsetX); let leftPos = Math.max((rect.left + offsetX), offsetX);
let topPos = Math.max((rect.top + offsetY), offsetY); let topPos = Math.max((rect.top + offsetY), offsetY);

View File

@@ -29,7 +29,7 @@ const BookmarkCache = Module("BookmarkCache", {
bookmarks.addObserver(this, false); bookmarks.addObserver(this, false);
}, },
__iterator__: function () (val for ([, val] in Iterator(this.bookmarks))), __iterator__: function () (val for ([, val] in Iterator(bookmarkcache.bookmarks))),
get bookmarks() Class.replaceProperty(this, "bookmarks", this.load()), get bookmarks() Class.replaceProperty(this, "bookmarks", this.load()),