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

added beep() for p/P when there is no content

This commit is contained in:
Martin Stubenschrott
2008-12-11 23:12:55 +01:00
parent 448b93a9b9
commit 778672f6ae

View File

@@ -372,15 +372,24 @@ function Buffer() //{{{
mappings.add(myModes, ["p", "<MiddleMouse>"],
"Open (put) a URL based on the current clipboard contents in the current buffer",
function () { liberator.open(util.readFromClipboard()); });
function ()
{
let url = util.readFromClipboard();
if (url)
liberator.open(url);
else
liberator.beep();
});
mappings.add(myModes, ["P"],
"Open (put) a URL based on the current clipboard contents in a new buffer",
function ()
{
liberator.open(util.readFromClipboard(),
/\bpaste\b/.test(options["activate"]) ?
liberator.NEW_TAB : liberator.NEW_BACKGROUND_TAB);
let url = util.readFromClipboard();
if (url)
liberator.open(url, options.get("activate").has("paste") ? liberator.NEW_TAB : liberator.NEW_BACKGROUND_TAB);
else
liberator.beep();
});
// reloading