mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-23 03:47:57 +01:00
Fix some Firefox version-specific brokenness.
This commit is contained in:
@@ -399,7 +399,6 @@ const Bookmarks = Module("bookmarks", {
|
|||||||
{
|
{
|
||||||
bang: true,
|
bang: true,
|
||||||
completer: function completer(context, args) {
|
completer: function completer(context, args) {
|
||||||
context.quote = null;
|
|
||||||
context.filter = args.join(" ");
|
context.filter = args.join(" ");
|
||||||
completion.bookmark(context, args["-tags"], { keyword: args["-keyword"], title: args["-title"] });
|
completion.bookmark(context, args["-tags"], { keyword: args["-keyword"], title: args["-title"] });
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -408,11 +408,11 @@ const ex = {
|
|||||||
dactyl.assert(cmd, "No such command");
|
dactyl.assert(cmd, "No such command");
|
||||||
|
|
||||||
return update(function exCommand(options) {
|
return update(function exCommand(options) {
|
||||||
let args = this._args(cmd, arguments);
|
let args = ex._args(cmd, arguments);
|
||||||
args.verify();
|
args.verify();
|
||||||
return cmd.execute(args);
|
return cmd.execute(args);
|
||||||
}, {
|
}, {
|
||||||
dactylCompleter: this._complete(cmd)
|
dactylCompleter: ex._complete(cmd)
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
@@ -538,7 +538,7 @@ const CompletionContext = Class("CompletionContext", {
|
|||||||
*/
|
*/
|
||||||
advance: function advance(count) {
|
advance: function advance(count) {
|
||||||
delete this._ignoreCase;
|
delete this._ignoreCase;
|
||||||
if (this.quote) {
|
if (this.quote && count) {
|
||||||
count = this.quote[0].length + this.quote[1](this.filter.substr(0, count)).length;
|
count = this.quote[0].length + this.quote[1](this.filter.substr(0, count)).length;
|
||||||
this.quote[0] = "";
|
this.quote[0] = "";
|
||||||
this.quote[2] = "";
|
this.quote[2] = "";
|
||||||
@@ -608,13 +608,6 @@ const CompletionContext = Class("CompletionContext", {
|
|||||||
return context;
|
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) {
|
highlight: function highlight(start, length, type) {
|
||||||
if (arguments.length == 0) {
|
if (arguments.length == 0) {
|
||||||
for (let type in this.selectionTypes)
|
for (let type in this.selectionTypes)
|
||||||
|
|||||||
@@ -297,7 +297,7 @@ const Dactyl = Module("dactyl", {
|
|||||||
|
|
||||||
if (!context)
|
if (!context)
|
||||||
context = userContext;
|
context = userContext;
|
||||||
if (!window.XPCSafeJSObjectWrapper)
|
if (window.isPrototypeOf(modules))
|
||||||
return Cu.evalInSandbox(str, context, "1.8", fileName, lineNumber);
|
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);
|
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 init = services.get("environment").get(config.idName + "_INIT");
|
||||||
let rcFile = io.getRCFile("~");
|
let rcFile = io.getRCFile("~");
|
||||||
|
|
||||||
if (!window.XPCSafeJSObjectWrapper)
|
if (dactyl.userEval('typeof document') === "undefined")
|
||||||
jsmodules.__proto__ = XPCNativeWrapper(window);
|
jsmodules.__proto__ = (window.XPCSafeJSObjectWrapper || XPCNativeWrapper)(window);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if (dactyl.commandLineOptions.rcFile) {
|
if (dactyl.commandLineOptions.rcFile) {
|
||||||
|
|||||||
@@ -224,7 +224,6 @@ const Option = Class("Option", {
|
|||||||
op: function (operator, values, scope, invert, str) {
|
op: function (operator, values, scope, invert, str) {
|
||||||
|
|
||||||
let newValues = this._op(operator, values, scope, invert);
|
let newValues = this._op(operator, values, scope, invert);
|
||||||
|
|
||||||
if (newValues == null)
|
if (newValues == null)
|
||||||
return "Operator " + operator + " not supported for option type " + this.type;
|
return "Operator " + operator + " not supported for option type " + this.type;
|
||||||
|
|
||||||
@@ -538,6 +537,7 @@ const Option = Class("Option", {
|
|||||||
|
|
||||||
stringlist: function (operator, values, scope, invert) {
|
stringlist: function (operator, values, scope, invert) {
|
||||||
values = Array.concat(values);
|
values = Array.concat(values);
|
||||||
|
|
||||||
switch (operator) {
|
switch (operator) {
|
||||||
case "+":
|
case "+":
|
||||||
return array.uniq(Array.concat(this.value, values), true);
|
return array.uniq(Array.concat(this.value, values), true);
|
||||||
|
|||||||
@@ -1132,7 +1132,7 @@ const array = Class("array", Array, {
|
|||||||
uniq: function uniq(ary, unsorted) {
|
uniq: function uniq(ary, unsorted) {
|
||||||
let ret = [];
|
let ret = [];
|
||||||
if (unsorted) {
|
if (unsorted) {
|
||||||
for (let [, item] in Iterator(ary))
|
for (let item in values(ary))
|
||||||
if (ret.indexOf(item) == -1)
|
if (ret.indexOf(item) == -1)
|
||||||
ret.push(item);
|
ret.push(item);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user