1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-01-07 23:14:12 +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

@@ -6,8 +6,6 @@
// given in the LICENSE.txt file included with this file.
"use strict";
var DEFAULT_FAVICON = "chrome://mozapps/skin/places/defaultFavicon.png";
// also includes methods for dealing with keywords and search engines
var Bookmarks = Module("bookmarks", {
init: function () {

File diff suppressed because it is too large Load Diff

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));

View File

@@ -36,12 +36,12 @@ var History = Module("history", {
let root = services.history.executeQuery(query, options).root;
root.containerOpen = true;
try {
let items = iter(util.range(0, root.childCount)).map(function (i) {
var items = iter(util.range(0, root.childCount)).map(function (i) {
let node = root.getChild(i);
return {
url: node.uri,
title: node.title,
icon: node.icon ? node.icon : DEFAULT_FAVICON
icon: node.icon ? node.icon : BookmarkCache.DEFAULT_FAVICON
};
}).toArray();
}