From 3155e489aa00c63b9b29de6b8d201c9e4be15a7f Mon Sep 17 00:00:00 2001 From: Kris Maglione Date: Fri, 24 Sep 2010 09:23:40 -0400 Subject: [PATCH] Update gP for new activation system. Add comment. --- common/content/buffer.js | 9 +++++---- common/content/commandline.js | 3 +++ 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/common/content/buffer.js b/common/content/buffer.js index 0f8fb74a..5a07eb9e 100644 --- a/common/content/buffer.js +++ b/common/content/buffer.js @@ -1535,15 +1535,16 @@ const Buffer = Module("buffer", { mappings.add(myModes, ["gP"], "Open (put) a URL based on the current clipboard contents in a new buffer", function () { - dactyl.open(dactyl.clipboardRead(), - dactyl[options.get("activate").has("paste") ? "NEW_BACKGROUND_TAB" : "NEW_TAB"]); + let url = dactyl.clipboardRead(); + dactyl.assert(url, "No clipboard data"); + dactyl.open(url, { from: "paste", where: dactyl.NEW_TAB, background: true }); }); mappings.add(myModes, ["p", ""], "Open (put) a URL based on the current clipboard contents in the current buffer", function () { let url = dactyl.clipboardRead(); - dactyl.assert(url); + dactyl.assert(url, "No clipboard data"); dactyl.open(url); }); @@ -1551,7 +1552,7 @@ const Buffer = Module("buffer", { "Open (put) a URL based on the current clipboard contents in a new buffer", function () { let url = dactyl.clipboardRead(); - dactyl.assert(url); + dactyl.assert(url, "No clipboard data"); dactyl.open(url, { from: "paste", where: dactyl.NEW_TAB }); }); diff --git a/common/content/commandline.js b/common/content/commandline.js index 285ce083..b0b42559 100644 --- a/common/content/commandline.js +++ b/common/content/commandline.js @@ -747,6 +747,9 @@ const CommandLine = Module("commandline", { function openLink(where) { event.preventDefault(); // FIXME: Why is this needed? --djk + // : It seems to be a hack so that AnchorElements + // don't need their URLs in their @href and their + // text content. I'd rather be rid of it. --Kris if (event.target.getAttribute("href") == "#") dactyl.open(event.target.textContent, where); else