mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-22 23:18:01 +01:00
"A" adds the bookmark in the unfiled bookmarks folder now
This commit is contained in:
@@ -110,7 +110,8 @@ vimperator.Bookmarks = function () //{{{
|
||||
return vimperator.completion.filterURLArray(bookmarks, filter, tags);
|
||||
},
|
||||
|
||||
add: function (title, url, keyword, tags)
|
||||
// if starOnly = true it is saved in the unfiledBookmarksFolder, otherwise in the bookmarksMenuFolder
|
||||
add: function (starOnly, title, url, keyword, tags)
|
||||
{
|
||||
if (!bookmarks)
|
||||
load();
|
||||
@@ -122,7 +123,10 @@ vimperator.Bookmarks = function () //{{{
|
||||
try
|
||||
{
|
||||
var uri = ioService.newURI(url, null, null);
|
||||
var id = bookmarksService.insertBookmark(bookmarksService.placesRoot, uri, -1, title);
|
||||
var id = bookmarksService.insertBookmark(
|
||||
starOnly ? bookmarksService.unfiledBookmarksFolder : bookmarksService.bookmarksMenuFolder,
|
||||
uri, -1, title);
|
||||
|
||||
if (!id)
|
||||
return false;
|
||||
|
||||
@@ -165,7 +169,7 @@ vimperator.Bookmarks = function () //{{{
|
||||
var extra = "";
|
||||
if (title != url)
|
||||
extra = " (" + title + ")";
|
||||
this.add(title, url);
|
||||
this.add(true, title, url);
|
||||
vimperator.commandline.echo("Added bookmark: " + url + extra, vimperator.commandline.HL_NORMAL, vimperator.commandline.FORCE_SINGLELINE);
|
||||
}
|
||||
},
|
||||
|
||||
@@ -602,7 +602,7 @@ vimperator.Commands = function () //{{{
|
||||
var keyword = getOption(res.opts, "-keyword", null);
|
||||
var tags = getOption(res.opts, "-tags", []);
|
||||
|
||||
if (vimperator.bookmarks.add(title, url, keyword, tags))
|
||||
if (vimperator.bookmarks.add(false, title, url, keyword, tags))
|
||||
{
|
||||
var extra = "";
|
||||
if (title != url)
|
||||
|
||||
@@ -425,7 +425,9 @@ vimperator.Mappings = function () //{{{
|
||||
function () { vimperator.bookmarks.toggle(vimperator.buffer.URL); },
|
||||
{
|
||||
shortHelp: "Toggle bookmarked state of current URL",
|
||||
help: "Add/remove a bookmark for the current location, depending if it already is bookmarked or not."
|
||||
help: "Add/remove a bookmark for the current location, depending if it already is bookmarked or not. " +
|
||||
"In contrast to the <code class='command'>:bmark</code> command, the bookmark is just 'starred' " +
|
||||
"which means it is placed in the 'Unfiled Bookmarks Folder' instead of the bookmarks menu."
|
||||
}
|
||||
));
|
||||
addDefaultMap(new vimperator.Map([vimperator.modes.NORMAL], ["b"],
|
||||
|
||||
Reference in New Issue
Block a user