1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-02-16 13:25:46 +01:00

Revert last revision.

This commit is contained in:
Kris Maglione
2011-02-03 09:06:52 -05:00
parent 4a09c97eb1
commit e470de350c
10 changed files with 39 additions and 66 deletions

View File

@@ -1640,9 +1640,9 @@ var Buffer = Module("buffer", {
};
},
events: function () {
events.addSessionListener(config.browser, "DOMContentLoaded", buffer.closure.onDOMContentLoaded, true);
events.addSessionListener(config.browser, "load", buffer.closure.onPageLoad, true);
events.addSessionListener(config.browser, "scroll", buffer.closure._updateBufferPosition, false);
events.addSessionListener(config.browser, "DOMContentLoaded", this.closure.onDOMContentLoaded, true);
events.addSessionListener(config.browser, "load", this.closure.onPageLoad, true);
events.addSessionListener(config.browser, "scroll", this.closure._updateBufferPosition, false);
},
mappings: function () {
var myModes = config.browserModes;

View File

@@ -468,7 +468,7 @@ var Commands = Module("commands", {
_addCommand: function (args, replace) {
if (!args[3])
args[3] = {};
args[3].definedAt = Commands.getCaller(Components.stack.caller.caller);
args[3].definedAt = commands.getCaller(Components.stack.caller.caller);
let names = array.flatten(Command.parseSpecs(args[0]));
args.parsedSpecs = names;
@@ -659,6 +659,23 @@ var Commands = Module("commands", {
return this._exCommands.filter(function (cmd) cmd.user);
},
/**
* Returns a frame object describing the currently executing
* command, if applicable, otherwise returns the passed frame.
*
* @param {nsIStackFrame} frame
*/
getCaller: function (frame) {
if (io.sourcing)
return {
__proto__: frame,
filename: io.sourcing.file[0] == "[" ? io.sourcing.file :
services.io.newFileURI(File(io.sourcing.file)).spec,
lineNumber: io.sourcing.line
};
return frame;
},
/**
* Returns true if a command invocation contains a URL referring to the
* domain *host*.
@@ -1162,23 +1179,6 @@ var Commands = Module("commands", {
delete this._exMap[name];
}
}, {
/**
* Returns a frame object describing the currently executing
* command, if applicable, otherwise returns the passed frame.
*
* @param {nsIStackFrame} frame
*/
getCaller: function (frame) {
if (io.sourcing)
return {
__proto__: frame,
filename: io.sourcing.file[0] == "[" ? io.sourcing.file :
services.io.newFileURI(File(io.sourcing.file)).spec,
lineNumber: io.sourcing.line
};
return frame;
},
// returns [count, parsed_argument]
parseArg: function parseArg(str, sep, keepQuotes) {
let arg = "";

View File

@@ -172,7 +172,7 @@ var MapHive = Class("MapHive", {
extra = extra || {};
let map = Map(modes, keys, description, action, extra);
map.definedAt = Commands.getCaller(Components.stack.caller);
map.definedAt = commands.getCaller(Components.stack.caller);
map.hive = this;
if (this.name !== "builtin")
@@ -344,7 +344,7 @@ var Mappings = Module("mappings", {
*/
add: function () {
let map = this.builtin.add.apply(this.builtin, arguments);
map.definedAt = Commands.getCaller(Components.stack.caller);
map.definedAt = commands.getCaller(Components.stack.caller);
return map;
},
@@ -361,7 +361,7 @@ var Mappings = Module("mappings", {
*/
addUserMap: function () {
let map = this.user.add.apply(this.user, arguments);
map.definedAt = Commands.getCaller(Components.stack.caller);
map.definedAt = commands.getCaller(Components.stack.caller);
return map;
},

View File

@@ -208,7 +208,7 @@ var Marks = Module("marks", {
events: function () {
let appContent = document.getElementById("appcontent");
if (appContent)
events.addSessionListener(appContent, "load", marks.closure._onPageLoad, true);
events.addSessionListener(appContent, "load", this.closure._onPageLoad, true);
},
mappings: function () {
var myModes = config.browserModes;

View File

@@ -660,7 +660,7 @@ var Options = Module("options", {
if (!extraInfo)
extraInfo = {};
extraInfo.definedAt = Commands.getCaller(Components.stack.caller);
extraInfo.definedAt = commands.getCaller(Components.stack.caller);
let name = names[0];
if (name in this._optionMap) {
@@ -973,7 +973,7 @@ var Options = Module("options", {
}
if (res)
dactyl.echoerr(res);
option.setFrom = Commands.getCaller(null);
option.setFrom = commands.getCaller(null);
}
}
flushList();

View File

@@ -875,7 +875,7 @@ var Tabs = Module("tabs", {
}
for (let event in values(["TabMove", "TabOpen", "TabClose"]))
events.addSessionListener(tabContainer, event, callback, false);
events.addSessionListener(tabContainer, "TabSelect", tabs.closure._onTabSelect, false);
events.addSessionListener(tabContainer, "TabSelect", this.closure._onTabSelect, false);
},
mappings: function () {
mappings.add([modes.NORMAL], ["g0", "g^"],