mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2026-03-13 05:05:45 +01:00
Fill the :bmark command line generated by <a> with any existing data.
Fixes #237 (The "a" key should fill command line with existing data on bookmarked).
This commit is contained in:
@@ -277,9 +277,26 @@ function Bookmarks() //{{{
|
|||||||
function ()
|
function ()
|
||||||
{
|
{
|
||||||
let title = "";
|
let title = "";
|
||||||
if (buffer.title != buffer.URL)
|
let keyword = "";
|
||||||
title = " -title=\"" + buffer.title + "\"";
|
let tags = "";
|
||||||
commandline.open(":", "bmark " + buffer.URL + title, modes.EX);
|
|
||||||
|
let bmark = bookmarks.get(buffer.URL)[0];
|
||||||
|
if (bmark)
|
||||||
|
{
|
||||||
|
title = " -title=\"" + bmark.title + "\"";
|
||||||
|
if (bmark.keyword)
|
||||||
|
keyword = " -keyword=\"" + bmark.keyword + "\"";
|
||||||
|
if (bmark.tags.length > 0)
|
||||||
|
tags = " -tags=\"" + bmark.tags.join(", ") + "\"";
|
||||||
|
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (buffer.title != buffer.URL)
|
||||||
|
title = " -title=\"" + buffer.title + "\"";
|
||||||
|
}
|
||||||
|
|
||||||
|
commandline.open(":", "bmark " + buffer.URL + title + keyword + tags, modes.EX);
|
||||||
});
|
});
|
||||||
|
|
||||||
mappings.add(myModes, ["A"],
|
mappings.add(myModes, ["A"],
|
||||||
@@ -524,6 +541,7 @@ function Bookmarks() //{{{
|
|||||||
},
|
},
|
||||||
|
|
||||||
// if starOnly = true it is saved in the unfiledBookmarksFolder, otherwise in the bookmarksMenuFolder
|
// if starOnly = true it is saved in the unfiledBookmarksFolder, otherwise in the bookmarksMenuFolder
|
||||||
|
// FIXME: tags are not updated differentially
|
||||||
add: function add(starOnly, title, url, keyword, tags, force)
|
add: function add(starOnly, title, url, keyword, tags, force)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
@@ -552,7 +570,11 @@ function Bookmarks() //{{{
|
|||||||
if (keyword)
|
if (keyword)
|
||||||
bookmarksService.setKeywordForBookmark(id, keyword);
|
bookmarksService.setKeywordForBookmark(id, keyword);
|
||||||
if (tags)
|
if (tags)
|
||||||
|
{
|
||||||
|
// TODO: presumably this needs to be done in two Places transactions *double yawn* --djk
|
||||||
|
//taggingService.untagURI(uri, null);
|
||||||
taggingService.tagURI(uri, tags);
|
taggingService.tagURI(uri, tags);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
catch (e)
|
catch (e)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user