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

Fix something to do with <a>.

This commit is contained in:
Kris Maglione
2009-08-19 14:02:56 -04:00
parent 820b509eb3
commit 9d77c018ca
15 changed files with 12 additions and 13 deletions

18
common/content/bookmarks.js Executable file → Normal file
View File

@@ -276,11 +276,7 @@ function Bookmarks() //{{{
"Open a prompt to bookmark the current URL", "Open a prompt to bookmark the current URL",
function () function ()
{ {
function quote(str) commands.quoteArg['"'](str) let options = {};
let title = "";
let keyword = "";
let tags = "";
let bmarks = bookmarks.get(buffer.URL).filter(function (bmark) bmark.url == buffer.URL); let bmarks = bookmarks.get(buffer.URL).filter(function (bmark) bmark.url == buffer.URL);
@@ -288,19 +284,21 @@ function Bookmarks() //{{{
{ {
let bmark = bmarks[0]; let bmark = bmarks[0];
title = " -title=" + quote(bmark.title); options["-title"] = bmark.title;
if (bmark.keyword) if (bmark.keyword)
keyword = " -keyword=\"" + bmark.keyword + "\""; options["-keyword"] = bmark.keyword;
if (bmark.tags.length > 0) if (bmark.tags.length > 0)
tags = " -tags=\"" + bmark.tags.join(", ") + "\""; options["-tags"] = bmark.tags.join(", ");
} }
else else
{ {
if (buffer.title != buffer.URL) if (buffer.title != buffer.URL)
title = " -title=" + quote(buffer.title); options["-title"] = buffer.title;
} }
commandline.open(":", "bmark " + buffer.URL + title + keyword + tags, modes.EX); commandline.open(":",
commands.commandToString({ command: "bmark", options: options, arguments: [buffer.URL], bang: bmarks.length == 1 }),
modes.EX);
}); });
mappings.add(myModes, ["A"], mappings.add(myModes, ["A"],

0
common/content/browser.js Executable file → Normal file
View File

7
common/content/commands.js Executable file → Normal file
View File

@@ -506,13 +506,14 @@ function Commands() //{{{
commandToString: function (args) commandToString: function (args)
{ {
let res = [args.command + (args.bang ? "!" : "")]; let res = [args.command + (args.bang ? "!" : "")];
function quote(str) quoteArg[/\s/.test(str) ? '"' : ""](str); function quote(str) quoteArg[/[\s"'\\]|^$/.test(str) ? '"' : ""](str);
for (let [opt, val] in Iterator(args.options || {})) for (let [opt, val] in Iterator(args.options || {}))
{ {
res.push(opt); let char = /^-.$/.test(opt) ? " " : "=";
if (val != null) if (val != null)
res.push(quote(val)); opt += char + quote(val)
res.push(opt);
} }
for (let [,arg] in Iterator(args.arguments || [])) for (let [,arg] in Iterator(args.arguments || []))
res.push(quote(arg)); res.push(quote(arg));

0
common/content/completion.js Executable file → Normal file
View File

0
common/content/events.js Executable file → Normal file
View File

0
common/content/hints.js Executable file → Normal file
View File

0
common/content/io.js Executable file → Normal file
View File

0
common/content/liberator.js Executable file → Normal file
View File

0
common/content/mappings.js Executable file → Normal file
View File

0
common/content/modes.js Executable file → Normal file
View File

0
common/content/options.js Executable file → Normal file
View File

0
common/content/style.js Executable file → Normal file
View File

0
common/content/ui.js Executable file → Normal file
View File

0
common/content/util.js Executable file → Normal file
View File

0
xulmus/content/player.js Executable file → Normal file
View File