mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-20 22:38:00 +01:00
Remove more unused vars.
This commit is contained in:
@@ -216,7 +216,6 @@ var Bookmarks = Module("bookmarks", {
|
||||
* use in completion functions.
|
||||
*/
|
||||
get searchEngines() {
|
||||
let searchEngines = [];
|
||||
let aliases = {};
|
||||
return iter(services.browserSearch.getVisibleEngines({})).map(function ([, engine]) {
|
||||
let alias = engine.alias;
|
||||
@@ -430,7 +429,7 @@ var Bookmarks = Module("bookmarks", {
|
||||
const tags = {
|
||||
names: ["-tags", "-T"],
|
||||
description: "A comma-separated list of tags",
|
||||
completer: function tags(context, args) {
|
||||
completer: function tags(context) {
|
||||
context.generate = function () Ary(b.tags
|
||||
for (b of bookmarkcache)
|
||||
if (b.tags))
|
||||
|
||||
@@ -1351,7 +1351,6 @@ var CommandLine = Module("commandline", {
|
||||
return;
|
||||
}
|
||||
|
||||
let value = this.editor.selection.focusNode.textContent;
|
||||
this.saveInput();
|
||||
|
||||
if (this.itemList.visible)
|
||||
@@ -1788,8 +1787,6 @@ var CommandLine = Module("commandline", {
|
||||
if (self.completions)
|
||||
self.completions.tabTimer.flush();
|
||||
|
||||
let command = commandline.command;
|
||||
|
||||
self.accepted = true;
|
||||
return function () { modes.pop(); };
|
||||
});
|
||||
|
||||
@@ -846,7 +846,6 @@ var Editor = Module("editor", XPCOM(Ci.nsIEditActionListener, ModuleBase), {
|
||||
count = count || 1;
|
||||
|
||||
let caret = !dactyl.focusedElement;
|
||||
let controller = buffer.selectionController;
|
||||
|
||||
while (count-- && modes.main == modes.VISUAL) {
|
||||
if (caret)
|
||||
|
||||
@@ -374,7 +374,6 @@ var Events = Module("events", {
|
||||
commandline.quiet = quiet;
|
||||
|
||||
for (let evt_obj of DOM.Event.parse(keys)) {
|
||||
let now = Date.now();
|
||||
let key = DOM.Event.stringify(evt_obj);
|
||||
for (let type of values(["keydown", "keypress", "keyup"])) {
|
||||
let evt = update({}, evt_obj, { type: type });
|
||||
@@ -1109,7 +1108,6 @@ var Events = Module("events", {
|
||||
mappings.add([modes.COMMAND],
|
||||
["<A-m>s", "<sleep>"], "Sleep for {count} milliseconds before continuing macro playback",
|
||||
function ({ command, count }) {
|
||||
let now = Date.now();
|
||||
dactyl.assert(count, _("error.countRequired", command));
|
||||
if (events.feedingKeys)
|
||||
util.sleep(count);
|
||||
|
||||
@@ -274,7 +274,7 @@ var History = Module("history", {
|
||||
names: ["-sort", "-s"],
|
||||
type: CommandOption.STRING,
|
||||
description: "The sort order of the results",
|
||||
completer: function (context, args) {
|
||||
completer: function (context) {
|
||||
context.compare = CompletionContext.Sort.unsorted;
|
||||
return Ary.flatten([
|
||||
"annotation",
|
||||
|
||||
@@ -68,7 +68,6 @@ var ProcessorStack = Class("ProcessorStack", {
|
||||
events.dbg("EXECUTE(" + this._result(result) + ", " + force + ") events:" + this.events.length
|
||||
+ " processors:" + this.processors.length + " actions:" + this.actions.length);
|
||||
|
||||
let processors = this.processors;
|
||||
let length = 1;
|
||||
|
||||
if (force)
|
||||
|
||||
@@ -35,7 +35,7 @@ var MOW = Module("mow", {
|
||||
events.listen(window, this, "windowEvents");
|
||||
|
||||
modules.mow = this;
|
||||
let fontSize = DOM(document.documentElement).style.fontSize;
|
||||
//let fontSize = DOM(document.documentElement).style.fontSize;
|
||||
styles.system.add("font-size", "dactyl://content/buffer.xhtml",
|
||||
// "body { font-size: " + fontSize + "; } \
|
||||
"html|html > xul|scrollbar { visibility: collapse !important; }",
|
||||
|
||||
@@ -75,7 +75,6 @@ var StatusLine = Module("statusline", {
|
||||
*/$));
|
||||
}
|
||||
|
||||
let _commandline = "if (window.dactyl) return dactyl.modules.commandline";
|
||||
let prepend = [
|
||||
["button", { id: "appmenu-button", label: "", image: "chrome://branding/content/icon16.png", highlight: "AppmenuButton", xmlns: "xul" }],
|
||||
["toolbarbutton", { id: "appmenu-toolbar-button", label: "", image: "chrome://branding/content/icon16.png" }],
|
||||
|
||||
@@ -666,7 +666,7 @@ var Tabs = Module("tabs", {
|
||||
{
|
||||
argCount: "?",
|
||||
count: true,
|
||||
completer: function (context, args) {
|
||||
completer: function (context) {
|
||||
context.filters.push(({ item }) => item.tab.pinned);
|
||||
completion.buffer(context);
|
||||
}
|
||||
@@ -819,7 +819,7 @@ var Tabs = Module("tabs", {
|
||||
|
||||
commands.add(["quita[ll]", "qa[ll]"],
|
||||
"Quit this " + config.appName + " window",
|
||||
function (args) { window.close(); },
|
||||
function () { window.close(); },
|
||||
{ argCount: "0" });
|
||||
|
||||
commands.add(["reloada[ll]"],
|
||||
@@ -850,7 +850,7 @@ var Tabs = Module("tabs", {
|
||||
}, {
|
||||
argCount: "1",
|
||||
bang: true,
|
||||
completer: function (context, args) completion.buffer(context, true),
|
||||
completer: function (context) completion.buffer(context, true),
|
||||
literal: 0
|
||||
});
|
||||
|
||||
@@ -1008,10 +1008,9 @@ var Tabs = Module("tabs", {
|
||||
|
||||
commands.add(["undoa[ll]"],
|
||||
"Undo closing of all closed tabs",
|
||||
function (args) {
|
||||
function () {
|
||||
for (let i of iter(tabs.closedTabs))
|
||||
window.undoCloseTab(0);
|
||||
|
||||
},
|
||||
{ argCount: "0" });
|
||||
|
||||
|
||||
@@ -371,7 +371,7 @@ var Addons = Module("addons", {
|
||||
names: ["-types", "-type", "-t"],
|
||||
description: "The add-on types to list",
|
||||
default: ["extension"],
|
||||
completer: function (context, args) completion.addonType(context),
|
||||
completer: function (context) completion.addonType(context),
|
||||
type: CommandOption.LIST
|
||||
}
|
||||
]
|
||||
@@ -446,7 +446,7 @@ var Addons = Module("addons", {
|
||||
names: ["-types", "-type", "-t"],
|
||||
description: "The add-on types to operate on",
|
||||
default: ["extension"],
|
||||
completer: function (context, args) completion.addonType(context),
|
||||
completer: function (context) completion.addonType(context),
|
||||
type: CommandOption.LIST
|
||||
}
|
||||
]
|
||||
|
||||
@@ -48,7 +48,7 @@ update(Bookmark.prototype, {
|
||||
let res = [];
|
||||
res.toString = function () this.join("/");
|
||||
|
||||
let id = this.id, parent, title;
|
||||
let id = this.id, title;
|
||||
while ((id = services.bookmarks.getFolderIdForItem(id)) &&
|
||||
(title = services.bookmarks.getItemTitle(id)))
|
||||
res.push(title);
|
||||
|
||||
@@ -772,7 +772,6 @@ var Buffer = Module("Buffer", {
|
||||
let self = this;
|
||||
let doc = elem.ownerDocument;
|
||||
let uri = util.newURI(elem.href || elem.src, null, util.newURI(elem.baseURI));
|
||||
let referrer = util.newURI(doc.documentURI, doc.characterSet);
|
||||
|
||||
try {
|
||||
services.security.checkLoadURIWithPrincipal(doc.nodePrincipal, uri,
|
||||
@@ -1186,7 +1185,7 @@ var Buffer = Module("Buffer", {
|
||||
* @param {boolean} useExternalEditor View the source in the external editor.
|
||||
*/
|
||||
viewSource: function viewSource(loc, useExternalEditor) {
|
||||
let { dactyl, editor, history, options } = this.modules;
|
||||
let { dactyl, history, options } = this.modules;
|
||||
|
||||
let window = this.topWindow;
|
||||
|
||||
@@ -1315,7 +1314,7 @@ var Buffer = Module("Buffer", {
|
||||
* closed range [Buffer.ZOOM_MIN, Buffer.ZOOM_MAX].
|
||||
*/
|
||||
setZoom: function setZoom(value, fullZoom) {
|
||||
let { dactyl, statusline, storage } = this.modules;
|
||||
let { dactyl, statusline } = this.modules;
|
||||
let { ZoomManager } = this;
|
||||
|
||||
if (fullZoom === undefined)
|
||||
@@ -1333,7 +1332,6 @@ var Buffer = Module("Buffer", {
|
||||
}
|
||||
|
||||
if (prefs.get("browser.zoom.siteSpecific")) {
|
||||
var privacy = sanitizer.getContext(this.win);
|
||||
if (value == 1) {
|
||||
this.prefs.clear("browser.content.full-zoom");
|
||||
this.prefs.clear("dactyl.content.full-zoom");
|
||||
@@ -1829,7 +1827,7 @@ var Buffer = Module("Buffer", {
|
||||
|
||||
commands.add(["frameo[nly]"],
|
||||
"Show only the current frame's page",
|
||||
function (args) {
|
||||
function () {
|
||||
dactyl.open(buffer.focusedFrame.location.href);
|
||||
},
|
||||
{ argCount: "0" });
|
||||
@@ -2041,7 +2039,7 @@ var Buffer = Module("Buffer", {
|
||||
});
|
||||
},
|
||||
completion: function initCompletion(dactyl, modules, window) {
|
||||
let { CompletionContext, buffer, completion } = modules;
|
||||
let { buffer, completion } = modules;
|
||||
|
||||
completion.alternateStyleSheet = function alternateStylesheet(context) {
|
||||
context.title = ["Stylesheet", "Location"];
|
||||
@@ -2100,7 +2098,7 @@ var Buffer = Module("Buffer", {
|
||||
mappings.add([modes.NORMAL],
|
||||
["y", "<yank-location>"], "Yank current location to the clipboard",
|
||||
function () {
|
||||
let { doc, uri } = buffer;
|
||||
let { uri } = buffer;
|
||||
if (uri instanceof Ci.nsIURL)
|
||||
uri.query = uri.query.replace(/(?:^|&)utm_[^&]+/g, "")
|
||||
.replace(/^&/, "");
|
||||
@@ -2438,7 +2436,7 @@ var Buffer = Module("Buffer", {
|
||||
function () { buffer.showPageInfo(true); });
|
||||
},
|
||||
options: function initOptions(dactyl, modules, window) {
|
||||
let { Option, buffer, completion, config, options } = modules;
|
||||
let { Option, buffer, completion, options } = modules;
|
||||
|
||||
options.add(["encoding", "enc"],
|
||||
"The current buffer's character encoding",
|
||||
|
||||
@@ -660,7 +660,7 @@ var Commands = Module("commands", {
|
||||
lazyDepends: true,
|
||||
|
||||
Local: function Local(dactyl, modules, window) {
|
||||
let { Group, contexts } = modules;
|
||||
let { contexts } = modules;
|
||||
return {
|
||||
init: function init() {
|
||||
this.Command = Class("Command", Command, { modules: modules });
|
||||
@@ -1550,10 +1550,10 @@ var Commands = Module("commands", {
|
||||
const { commands, contexts } = modules;
|
||||
|
||||
commands.add(["(", "-("], "",
|
||||
function (args) { dactyl.echoerr(_("dactyl.cheerUp")); },
|
||||
function () { dactyl.echoerr(_("dactyl.cheerUp")); },
|
||||
{ hidden: true });
|
||||
commands.add([")", "-)"], "",
|
||||
function (args) { dactyl.echoerr(_("dactyl.somberDown")); },
|
||||
function () { dactyl.echoerr(_("dactyl.somberDown")); },
|
||||
{ hidden: true });
|
||||
|
||||
commands.add(["com[mand]"],
|
||||
@@ -1769,7 +1769,7 @@ var Commands = Module("commands", {
|
||||
});
|
||||
},
|
||||
javascript: function initJavascript(dactyl, modules, window) {
|
||||
const { JavaScript, commands } = modules;
|
||||
const { JavaScript } = modules;
|
||||
|
||||
JavaScript.setCompleter([CommandHive.prototype.get, CommandHive.prototype.remove],
|
||||
[function () [[c.names, c.description] for (c of this)]]);
|
||||
|
||||
@@ -1123,7 +1123,7 @@ var Completion = Module("completion", {
|
||||
const { commands, completion } = modules;
|
||||
commands.add(["contexts"],
|
||||
"List the completion contexts used during completion of an Ex command",
|
||||
function (args) {
|
||||
function () {
|
||||
modules.commandline.commandOutput(
|
||||
["div", { highlight: "Completions" },
|
||||
template.completionRow(["Context", "Title"], "CompTitle"),
|
||||
|
||||
@@ -769,7 +769,7 @@ var Contexts = Module("contexts", {
|
||||
});
|
||||
commands.add(["elsei[f]", "elif"],
|
||||
"Execute commands until the next :elseif, :else, or :endif only if the argument returns true",
|
||||
function (args) {},
|
||||
function () {},
|
||||
{
|
||||
always: function (args) {
|
||||
checkStack("if");
|
||||
@@ -781,7 +781,7 @@ var Contexts = Module("contexts", {
|
||||
});
|
||||
commands.add(["el[se]"],
|
||||
"Execute commands until the next :endif only if the previous conditionals were not executed",
|
||||
function (args) {},
|
||||
function () {},
|
||||
{
|
||||
always: function (args) {
|
||||
checkStack("if");
|
||||
@@ -792,7 +792,7 @@ var Contexts = Module("contexts", {
|
||||
});
|
||||
commands.add(["en[dif]", "fi"],
|
||||
"End a string of :if/:elseif/:else conditionals",
|
||||
function (args) {},
|
||||
function () {},
|
||||
{
|
||||
always: function (args) { args.context.noExecute = pop("if"); },
|
||||
argCount: "0"
|
||||
|
||||
@@ -133,7 +133,7 @@ var Help = Module("Help", {
|
||||
|
||||
function rec(text, level, li) {
|
||||
let res = [];
|
||||
let list, space, i = 0;
|
||||
let list, i = 0;
|
||||
|
||||
for (let match of re.iterate(text)) {
|
||||
if (match.comment)
|
||||
|
||||
@@ -154,8 +154,6 @@ var Highlights = Module("Highlight", {
|
||||
get: function get(k) this.highlight[k],
|
||||
|
||||
set: function set(key, newStyle, force, append, extend) {
|
||||
let [, class_, selectors] = key.match(/^([a-zA-Z_-]+)(.*)/);
|
||||
|
||||
let highlight = this.highlight[key] || this._create(false, [key]);
|
||||
|
||||
let bases = extend || highlight.extends;
|
||||
@@ -316,7 +314,7 @@ var Highlights = Module("Highlight", {
|
||||
if (scheme == "default")
|
||||
highlight.clear();
|
||||
else {
|
||||
lastScheme = modules.io.sourceFromRuntimePath(["colors/" + scheme + "." + config.fileExtension]);
|
||||
lastScheme = io.sourceFromRuntimePath(["colors/" + scheme + "." + config.fileExtension]);
|
||||
dactyl.assert(lastScheme, _("command.colorscheme.notFound", scheme));
|
||||
}
|
||||
autocommands.trigger("ColorScheme", { name: scheme });
|
||||
|
||||
@@ -34,7 +34,7 @@ var IO = Module("io", {
|
||||
},
|
||||
|
||||
Local: function Local(dactyl, modules, window) {
|
||||
let { io, plugins } = modules;
|
||||
let { io } = modules;
|
||||
return {
|
||||
|
||||
init: function init() {
|
||||
|
||||
@@ -4,8 +4,6 @@
|
||||
// given in the LICENSE.txt file included with this file.
|
||||
"use strict";
|
||||
|
||||
let { getOwnPropertyNames } = Object;
|
||||
|
||||
try {
|
||||
|
||||
defineModule("javascript", {
|
||||
@@ -694,7 +692,6 @@ var JavaScript = Module("javascript", {
|
||||
modules.JavaScript = Class("JavaScript", JavaScript, { modules: modules, window: window });
|
||||
},
|
||||
completion: function (dactyl, modules, window) {
|
||||
const { completion } = modules;
|
||||
update(modules.completion, {
|
||||
get javascript() modules.javascript.bound.complete,
|
||||
javascriptCompleter: JavaScript // Backwards compatibility
|
||||
|
||||
@@ -209,7 +209,7 @@ overlay.overlayWindow(Object.keys(config.overlays),
|
||||
load: function onLoad(document) {
|
||||
let self = this;
|
||||
|
||||
var { modules, Module } = this.modules;
|
||||
var { modules } = this.modules;
|
||||
delete window.dactyl;
|
||||
|
||||
this.startTime = Date.now();
|
||||
|
||||
@@ -12,7 +12,6 @@ defineModule("styles", {
|
||||
lazyRequire("contexts", ["Contexts"]);
|
||||
lazyRequire("template", ["template"]);
|
||||
|
||||
function cssUri(css) "chrome-data:text/css," + encodeURI(css);
|
||||
var namespace = "@namespace html " + JSON.stringify(XHTML) + ";\n" +
|
||||
"@namespace xul " + JSON.stringify(XUL) + ";\n" +
|
||||
"@namespace dactyl " + JSON.stringify(NS) + ";\n";
|
||||
@@ -608,7 +607,6 @@ var Styles = Module("Styles", {
|
||||
},
|
||||
{
|
||||
completer: function (context, args) {
|
||||
let compl = [];
|
||||
let sheet = args["-group"].get(args["-name"]);
|
||||
if (args.completeArg == 0) {
|
||||
if (sheet)
|
||||
@@ -685,8 +683,6 @@ var Styles = Module("Styles", {
|
||||
}, {
|
||||
bang: true,
|
||||
completer: function (context, args) {
|
||||
let uris = util.visibleURIs(window.content);
|
||||
|
||||
Styles.completeSite(context, window.content, args["-group"]);
|
||||
if (cmd.filter)
|
||||
context.filters.push(({ sheets }) => sheets.some(cmd.filter));
|
||||
|
||||
@@ -351,7 +351,7 @@ var Template = Module("Template", {
|
||||
|
||||
let s = [""];
|
||||
let start = 0;
|
||||
let n = 0, _i;
|
||||
let _i; // XXX
|
||||
for (let [i, length, args] of iter_) {
|
||||
if (i == _i || i < _i)
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user