- | Totals: |
+ Totals: |
|
- Clear
+ Clear
|
", "Filename"], ["text-align: right; padding-right: 1em;"],
- ([i + 1, file] for ([i, file] in Iterator(io._scriptNames))))); // TODO: add colon and remove column titles for pedantic Vim compatibility?
+ if (!io._scriptNames.length)
+ dactyl.echomsg(_("command.scriptnames.none"));
+ else
+ modules.commandline.commandOutput(
+ template.tabular(["", "Filename"], ["text-align: right; padding-right: 1em;"],
+ ([i + 1, file] for ([i, file] in Iterator(io._scriptNames))))); // TODO: add colon and remove column titles for pedantic Vim compatibility?
+
},
{ argCount: "0" });
@@ -831,7 +835,7 @@ unlet s:cpo_save
let result = io.system(arg);
if (result.returnValue != 0)
- result.output += "\nshell returned " + result.returnValue;
+ result.output += "\n" + _("io.shellReturn", result.returnValue);
modules.commandline.command = "!" + arg;
modules.commandline.commandOutput({result.output});
@@ -981,9 +985,9 @@ unlet s:cpo_save
context.key = match.prefix;
context.advance(match.prefix.length + 1);
context.generate = function () iter({
- content: "Chrome content",
- locale: "Locale-specific content",
- skin: "Theme-specific content"
+ content: /*L*/"Chrome content",
+ locale: /*L*/"Locale-specific content",
+ skin: /*L*/"Theme-specific content"
});
}
}
diff --git a/common/modules/javascript.jsm b/common/modules/javascript.jsm
index 49feed58..7d8de811 100644
--- a/common/modules/javascript.jsm
+++ b/common/modules/javascript.jsm
@@ -45,7 +45,7 @@ var JavaScript = Module("javascript", {
}),
globals: Class.memoize(function () [
- [this.modules.userContext, "Global Variables"],
+ [this.modules.userContext, /*L*/"Global Variables"],
[this.modules, "modules"],
[this.window, "window"]
]),
@@ -117,12 +117,8 @@ var JavaScript = Module("javascript", {
return cache[key];
context[JavaScript.EVAL_TMP] = tmp;
- context[JavaScript.EVAL_EXPORT] = function export_(obj) cache[key] = obj;
try {
- if (tmp != null) // Temporary hack until bug 609949 is fixed.
- this.modules.dactyl.userEval(JavaScript.EVAL_EXPORT + "(" + arg + ")", context, "[Command Line Completion]", 1);
- else
- cache[key] = this.modules.dactyl.userEval(arg, context, "[Command Line Completion]", 1);
+ cache[key] = this.modules.dactyl.userEval(arg, context, /*L*/"[Command Line Completion]", 1);
return cache[key];
}
@@ -170,7 +166,7 @@ var JavaScript = Module("javascript", {
if (this._top.char != arg) {
this.context.highlight(this._top.offset, this._i - this._top.offset, "SPELLCHECK");
- throw Error("Invalid JS");
+ throw Error(/*L*/"Invalid JS");
}
// The closing character of this stack frame will have pushed a new
@@ -308,7 +304,7 @@ var JavaScript = Module("javascript", {
if (this._checkFunction(prev, dot, cacheKey))
return [];
if (prev != statement && obj == null) {
- this.context.message = "Error: " + cacheKey.quote() + " is " + String(obj);
+ this.context.message = /*L*/"Error: " + cacheKey.quote() + " is " + String(obj);
return [];
}
@@ -324,7 +320,7 @@ var JavaScript = Module("javascript", {
let end = (frame == -1 ? this._lastIdx : this._get(frame + 1).offset);
this._cacheKey = null;
- let obj = [[this.cache.evalContext, "Local Variables"]].concat(this.globals);
+ let obj = [[this.cache.evalContext, /*L*/"Local Variables"]].concat(this.globals);
// Is this an object dereference?
if (dot < statement) // No.
dot = statement - 1;
@@ -339,7 +335,7 @@ var JavaScript = Module("javascript", {
const self = this;
if (!getOwnPropertyNames && !services.debugger.isOn && !this.context.message)
- this.context.message = "For better completion data, please enable the JavaScript debugger (:set jsdebugger)";
+ this.context.message = /*L*/"For better completion data, please enable the JavaScript debugger (:set jsdebugger)";
let base = this.context.fork("js", this._top.offset);
base.forceAnchored = true;
@@ -419,14 +415,14 @@ var JavaScript = Module("javascript", {
objects.forEach(function (obj) {
obj.ctxt_p.split(obj[1] + "/anchored", this, function (context) {
context.anchored = true;
- context.title[0] += " (prototypes)";
+ context.title[0] += /*L*/" (prototypes)";
});
});
objects.forEach(function (obj) {
obj.ctxt_t.split(obj[1] + "/unanchored", this, function (context) {
context.anchored = false;
- context.title[0] += " (substrings)";
+ context.title[0] += /*L*/" (substrings)";
context.filters.push(unanchored);
});
});
@@ -434,7 +430,7 @@ var JavaScript = Module("javascript", {
objects.forEach(function (obj) {
obj.ctxt_p.split(obj[1] + "/unanchored", this, function (context) {
context.anchored = false;
- context.title[0] += " (prototype substrings)";
+ context.title[0] += /*L*/" (prototype substrings)";
context.filters.push(unanchored);
});
});
@@ -646,7 +642,6 @@ var JavaScript = Module("javascript", {
}, {
EVAL_TMP: "__dactyl_eval_tmp",
- EVAL_EXPORT: "__dactyl_eval_export",
/**
* A map of argument completion functions for named methods. The
@@ -775,8 +770,8 @@ var JavaScript = Module("javascript", {
this.js.newContext = function newContext() modules.newContext(self.context, !sandbox);
this.js.globals = [
- [this.context, "REPL Variables"],
- [context, "REPL Global"]
+ [this.context, /*L*/"REPL Variables"],
+ [context, /*L*/"REPL Global"]
].concat(this.js.globals.filter(function ([global]) isPrototypeOf.call(global, context)));
if (!isPrototypeOf.call(modules.jsmodules, context))
@@ -790,13 +785,14 @@ var JavaScript = Module("javascript", {
this.repl = REPL(this.context);
},
+
open: function open(context) {
- this.updatePrompt();
modules.mow.echo(this.repl);
this.widgets.message = null;
open.superapply(this, arguments);
+ this.updatePrompt();
},
complete: function complete(context) {
@@ -807,6 +803,8 @@ var JavaScript = Module("javascript", {
mode: modes.REPL,
+ get completionList() this.widgets.statusbar.commandline.id,
+
accept: function accept() {
dactyl.trapErrors(function () { this.repl.addOutput(this.command) }, this);
diff --git a/common/modules/options.jsm b/common/modules/options.jsm
index de033724..dc73558a 100644
--- a/common/modules/options.jsm
+++ b/common/modules/options.jsm
@@ -448,7 +448,7 @@ var Option = Class("Option", {
regexplist: function regexplist(k, default_) {
for (let re in values(this.value))
- if (re(k))
+ if ((re.test || re).call(re, k))
return re.result;
return arguments.length > 1 ? default_ : null;
},
@@ -619,18 +619,23 @@ var Option = Class("Option", {
stringlist: function stringlist(operator, values, scope, invert) {
values = Array.concat(values);
+ function uniq(ary) {
+ let seen = {};
+ return ary.filter(function (elem) !set.add(seen, elem));
+ }
+
switch (operator) {
case "+":
- return array.uniq(Array.concat(this.value, values), true);
+ return uniq(Array.concat(this.value, values), true);
case "^":
// NOTE: Vim doesn't prepend if there's a match in the current value
- return array.uniq(Array.concat(values, this.value), true);
+ return uniq(Array.concat(values, this.value), true);
case "-":
- return this.value.filter(function (item) values.indexOf(item) == -1);
+ return this.value.filter(function (item) !set.has(this, item), set(values));
case "=":
if (invert) {
- let keepValues = this.value.filter(function (item) values.indexOf(item) == -1);
- let addValues = values.filter(function (item) this.value.indexOf(item) == -1, this);
+ let keepValues = this.value.filter(function (item) !set.has(this, item), set(values));
+ let addValues = values.filter(function (item) !set.has(this, item), set(this.value));
return addValues.concat(keepValues);
}
return values;
@@ -870,7 +875,7 @@ var Options = Module("options", {
allPrefs: deprecated("prefs.getNames", function allPrefs() prefs.getNames.apply(prefs, arguments)),
getPref: deprecated("prefs.get", function getPref() prefs.get.apply(prefs, arguments)),
invertPref: deprecated("prefs.invert", function invertPref() prefs.invert.apply(prefs, arguments)),
- listPrefs: deprecated("prefs.list", function listPrefs() { commandline.commandOutput(prefs.list.apply(prefs, arguments)); }),
+ listPrefs: deprecated("prefs.list", function listPrefs() { this.modules.commandline.commandOutput(prefs.list.apply(prefs, arguments)); }),
observePref: deprecated("prefs.observe", function observePref() prefs.observe.apply(prefs, arguments)),
popContext: deprecated("prefs.popContext", function popContext() prefs.popContext.apply(prefs, arguments)),
pushContext: deprecated("prefs.pushContext", function pushContext() prefs.pushContext.apply(prefs, arguments)),
@@ -1056,7 +1061,7 @@ var Options = Module("options", {
},
{ promptHighlight: "WarningMsg" });
else if (name == "all")
- commandline.commandOutput(prefs.list(onlyNonDefault, ""));
+ modules.commandline.commandOutput(prefs.list(onlyNonDefault, ""));
else if (reset)
prefs.reset(name);
else if (invertBoolean)
@@ -1169,7 +1174,7 @@ var Options = Module("options", {
context.advance(context.filter.indexOf("="));
if (option.type == "boolean")
- return error(context.filter.length, _("error.trailing"));
+ return error(context.filter.length, _("error.trailingCharacters"));
context.advance(1);
if (opt.error)
@@ -1235,7 +1240,7 @@ var Options = Module("options", {
if (str.text().length() == str.*.length())
dactyl.echomsg(_("variable.none"));
else
- dactyl.echo(str, commandline.FORCE_MULTILINE);
+ dactyl.echo(str, modules.commandline.FORCE_MULTILINE);
return;
}
diff --git a/common/modules/prefs.jsm b/common/modules/prefs.jsm
index e9b85bbb..1fa898b2 100644
--- a/common/modules/prefs.jsm
+++ b/common/modules/prefs.jsm
@@ -115,7 +115,7 @@ var Prefs = Module("prefs", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakReference])
}
};
- return template.options(config.host + " Preferences", prefs.call(this));
+ return template.options(/*L*/config.host + " Preferences", prefs.call(this));
},
/**
@@ -219,8 +219,8 @@ var Prefs = Module("prefs", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakReference])
function assertType(needType)
util.assert(type === Ci.nsIPrefBranch.PREF_INVALID || type === needType,
type === Ci.nsIPrefBranch.PREF_INT
- ? "E521: Number required after =: " + name + "=" + value
- : "E474: Invalid argument: " + name + "=" + value);
+ ? /*L*/"E521: Number required after =: " + name + "=" + value
+ : /*L*/"E474: Invalid argument: " + name + "=" + value);
let type = this.branch.getPrefType(name);
switch (typeof value) {
@@ -288,7 +288,7 @@ var Prefs = Module("prefs", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakReference])
*/
toggle: function (name) {
util.assert(this.branch.getPrefType(name) === Ci.nsIPrefBranch.PREF_BOOL,
- _("error.trailing", name + "!"));
+ _("error.trailingCharacters", name + "!"));
this.set(name, !this.get(name));
},
diff --git a/common/modules/sanitizer.jsm b/common/modules/sanitizer.jsm
index f6b79a27..924aa4db 100644
--- a/common/modules/sanitizer.jsm
+++ b/common/modules/sanitizer.jsm
@@ -183,7 +183,7 @@ var Sanitizer = Module("sanitizer", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakRef
append: {
SanitizeDialogPane:
-
+
{
@@ -204,7 +204,7 @@ var Sanitizer = Module("sanitizer", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakRef
function (win) prefOverlay(branch, false, {
append: {
itemList: <>
-
+
{
template.map(ourItems(), function ([item, desc])
|
|
- Name |
- Filter |
- CSS |
+ Name |
+ Filter |
+ CSS |
|