mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-20 23:07:59 +01:00
added beep() for p/P when there is no content
This commit is contained in:
@@ -372,15 +372,24 @@ function Buffer() //{{{
|
|||||||
|
|
||||||
mappings.add(myModes, ["p", "<MiddleMouse>"],
|
mappings.add(myModes, ["p", "<MiddleMouse>"],
|
||||||
"Open (put) a URL based on the current clipboard contents in the current buffer",
|
"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"],
|
mappings.add(myModes, ["P"],
|
||||||
"Open (put) a URL based on the current clipboard contents in a new buffer",
|
"Open (put) a URL based on the current clipboard contents in a new buffer",
|
||||||
function ()
|
function ()
|
||||||
{
|
{
|
||||||
liberator.open(util.readFromClipboard(),
|
let url = util.readFromClipboard();
|
||||||
/\bpaste\b/.test(options["activate"]) ?
|
if (url)
|
||||||
liberator.NEW_TAB : liberator.NEW_BACKGROUND_TAB);
|
liberator.open(url, options.get("activate").has("paste") ? liberator.NEW_TAB : liberator.NEW_BACKGROUND_TAB);
|
||||||
|
else
|
||||||
|
liberator.beep();
|
||||||
});
|
});
|
||||||
|
|
||||||
// reloading
|
// reloading
|
||||||
|
|||||||
Reference in New Issue
Block a user