1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-19 22:57:59 +01:00

Liberate Buffer from the tyrany of the current window. Add DOM#contextmenu event. Provide sensible screenX/screenY for mouse events.

--HG--
rename : common/content/buffer.js => common/modules/buffer.jsm
This commit is contained in:
Kris Maglione
2011-10-01 22:06:15 -04:00
parent 5017217535
commit 36fac82035
11 changed files with 453 additions and 307 deletions

View File

@@ -19,9 +19,8 @@ var HintSession = Class("HintSession", CommandMode, {
this.forceOpen = opts.forceOpen || dactyl.forceOpen;
// Hack.
if (!opts.window && modes.main == modes.OUTPUT_MULTILINE)
opts.window = commandline.widgets.multilineOutput.contentWindow;
if (!opts.window)
opts.window = modes.getStack(0).params.window;
this.hintMode = hints.modes[mode];
dactyl.assert(this.hintMode);
@@ -760,7 +759,7 @@ var Hints = Module("hints", {
this.addMode("V", "View hint source in external editor", function (elem, loc) buffer.viewSource(loc, true));
this.addMode("y", "Yank hint location", function (elem, loc) dactyl.clipboardWrite(loc, true));
this.addMode("Y", "Yank hint description", function (elem) dactyl.clipboardWrite(elem.textContent || "", true));
this.addMode("c", "Open context menu", function (elem) buffer.openContextMenu(elem));
this.addMode("c", "Open context menu", function (elem) DOM(elem).contextmenu());
this.addMode("i", "Show image", function (elem) dactyl.open(elem.src));
this.addMode("I", "Show image in a new tab", function (elem) dactyl.open(elem.src, dactyl.NEW_TAB));