1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-23 01:47:58 +01:00

Fix some Firefox version-specific brokenness.

This commit is contained in:
Kris Maglione
2010-11-07 07:33:25 -05:00
parent 21fe6d9fff
commit 506c684073
6 changed files with 8 additions and 16 deletions

View File

@@ -399,7 +399,6 @@ const Bookmarks = Module("bookmarks", {
{
bang: true,
completer: function completer(context, args) {
context.quote = null;
context.filter = args.join(" ");
completion.bookmark(context, args["-tags"], { keyword: args["-keyword"], title: args["-title"] });
},

View File

@@ -408,11 +408,11 @@ const ex = {
dactyl.assert(cmd, "No such command");
return update(function exCommand(options) {
let args = this._args(cmd, arguments);
let args = ex._args(cmd, arguments);
args.verify();
return cmd.execute(args);
}, {
dactylCompleter: this._complete(cmd)
dactylCompleter: ex._complete(cmd)
});
},

View File

@@ -538,7 +538,7 @@ const CompletionContext = Class("CompletionContext", {
*/
advance: function advance(count) {
delete this._ignoreCase;
if (this.quote) {
if (this.quote && count) {
count = this.quote[0].length + this.quote[1](this.filter.substr(0, count)).length;
this.quote[0] = "";
this.quote[2] = "";
@@ -608,13 +608,6 @@ const CompletionContext = Class("CompletionContext", {
return context;
},
getText: function getText(item) {
let text = item[self.keys["text"]];
if (self.quote)
return self.quote(text);
return text;
},
highlight: function highlight(start, length, type) {
if (arguments.length == 0) {
for (let type in this.selectionTypes)

View File

@@ -297,7 +297,7 @@ const Dactyl = Module("dactyl", {
if (!context)
context = userContext;
if (!window.XPCSafeJSObjectWrapper)
if (window.isPrototypeOf(modules))
return Cu.evalInSandbox(str, context, "1.8", fileName, lineNumber);
return Cu.evalInSandbox("with (window) { with (modules) { this.eval(" + str.quote() + ") } }", context, "1.8", fileName, lineNumber);
},
@@ -2016,8 +2016,8 @@ const Dactyl = Module("dactyl", {
let init = services.get("environment").get(config.idName + "_INIT");
let rcFile = io.getRCFile("~");
if (!window.XPCSafeJSObjectWrapper)
jsmodules.__proto__ = XPCNativeWrapper(window);
if (dactyl.userEval('typeof document') === "undefined")
jsmodules.__proto__ = (window.XPCSafeJSObjectWrapper || XPCNativeWrapper)(window);
try {
if (dactyl.commandLineOptions.rcFile) {

View File

@@ -224,7 +224,6 @@ const Option = Class("Option", {
op: function (operator, values, scope, invert, str) {
let newValues = this._op(operator, values, scope, invert);
if (newValues == null)
return "Operator " + operator + " not supported for option type " + this.type;
@@ -538,6 +537,7 @@ const Option = Class("Option", {
stringlist: function (operator, values, scope, invert) {
values = Array.concat(values);
switch (operator) {
case "+":
return array.uniq(Array.concat(this.value, values), true);

View File

@@ -1132,7 +1132,7 @@ const array = Class("array", Array, {
uniq: function uniq(ary, unsorted) {
let ret = [];
if (unsorted) {
for (let [, item] in Iterator(ary))
for (let item in values(ary))
if (ret.indexOf(item) == -1)
ret.push(item);
}