mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2026-02-16 01:55:46 +01:00
Normalise naming of module initializer functions.
This commit is contained in:
@@ -299,7 +299,7 @@ var Abbreviations = Module("abbreviations", {
|
||||
user: contexts.hives.abbrevs.user
|
||||
});
|
||||
},
|
||||
completion: function () {
|
||||
completion: function initCompletion() {
|
||||
completion.abbreviation = function abbreviation(context, modes, group) {
|
||||
group = group || abbreviations.user;
|
||||
let fn = modes ? function (abbr) abbr.inModes(modes) : util.identity;
|
||||
@@ -307,7 +307,7 @@ var Abbreviations = Module("abbreviations", {
|
||||
context.completions = group.merged.filter(fn);
|
||||
};
|
||||
},
|
||||
commands: function () {
|
||||
commands: function initCommands() {
|
||||
function addAbbreviationCommands(modes, ch, modeDescription) {
|
||||
modes.sort();
|
||||
modeDescription = modeDescription ? " in " + modeDescription + " mode" : "";
|
||||
|
||||
@@ -168,7 +168,7 @@ var AutoCommands = Module("autocommands", {
|
||||
}
|
||||
}, {
|
||||
}, {
|
||||
contexts: function () {
|
||||
contexts: function initContexts() {
|
||||
update(AutoCommands.prototype, {
|
||||
hives: contexts.Hives("autocmd", AutoCmdHive),
|
||||
user: contexts.hives.autocmd.user,
|
||||
@@ -176,7 +176,7 @@ var AutoCommands = Module("autocommands", {
|
||||
matchingHives: function matchingHives(uri, doc) contexts.matchingGroups(uri, doc).autocmd
|
||||
});
|
||||
},
|
||||
commands: function () {
|
||||
commands: function initCommands() {
|
||||
commands.add(["au[tocmd]"],
|
||||
"Execute commands automatically on events",
|
||||
function (args) {
|
||||
@@ -280,15 +280,15 @@ var AutoCommands = Module("autocommands", {
|
||||
});
|
||||
});
|
||||
},
|
||||
completion: function () {
|
||||
completion: function initCompletion() {
|
||||
completion.autocmdEvent = function autocmdEvent(context) {
|
||||
context.completions = Iterator(config.autocommands);
|
||||
};
|
||||
},
|
||||
javascript: function () {
|
||||
javascript: function initJavascript() {
|
||||
JavaScript.setCompleter(AutoCmdHive.prototype.get, [function () Iterator(config.autocommands)]);
|
||||
},
|
||||
options: function () {
|
||||
options: function initOptions() {
|
||||
options.add(["eventignore", "ei"],
|
||||
"List of autocommand event names which should be ignored",
|
||||
"stringlist", "",
|
||||
|
||||
@@ -402,7 +402,7 @@ var Bookmarks = Module("bookmarks", {
|
||||
}
|
||||
}, {
|
||||
}, {
|
||||
commands: function () {
|
||||
commands: function initCommands() {
|
||||
// TODO: Clean this up.
|
||||
const tags = {
|
||||
names: ["-tags", "-T"],
|
||||
@@ -565,7 +565,7 @@ var Bookmarks = Module("bookmarks", {
|
||||
privateData: true
|
||||
});
|
||||
},
|
||||
mappings: function () {
|
||||
mappings: function initMappings() {
|
||||
var myModes = config.browserModes;
|
||||
|
||||
mappings.add(myModes, ["a"],
|
||||
@@ -605,7 +605,7 @@ var Bookmarks = Module("bookmarks", {
|
||||
"Toggle bookmarked state of current URL",
|
||||
function () { bookmarks.toggle(buffer.uri.spec); });
|
||||
},
|
||||
options: function () {
|
||||
options: function initOptions() {
|
||||
options.add(["defsearch", "ds"],
|
||||
"The default search engine",
|
||||
"string", "google",
|
||||
@@ -622,7 +622,7 @@ var Bookmarks = Module("bookmarks", {
|
||||
{ completer: function completer(context) completion.searchEngine(context, true), });
|
||||
},
|
||||
|
||||
completion: function () {
|
||||
completion: function initCompletion() {
|
||||
completion.bookmark = function bookmark(context, tags, extra) {
|
||||
context.title = ["Bookmark", "Title"];
|
||||
context.format = bookmarks.format;
|
||||
|
||||
@@ -1593,7 +1593,7 @@ var CommandLine = Module("commandline", {
|
||||
return arg;
|
||||
}
|
||||
}, {
|
||||
commands: function init_commands() {
|
||||
commands: function initCommands() {
|
||||
[
|
||||
{
|
||||
name: "ec[ho]",
|
||||
@@ -1679,7 +1679,7 @@ var CommandLine = Module("commandline", {
|
||||
bases: [modes.INSERT]
|
||||
});
|
||||
},
|
||||
mappings: function init_mappings() {
|
||||
mappings: function initMappings() {
|
||||
|
||||
mappings.add([modes.COMMAND],
|
||||
[":"], "Enter Command Line mode",
|
||||
@@ -1809,7 +1809,7 @@ var CommandLine = Module("commandline", {
|
||||
bind(["<C-]>", "<C-5>"], "Expand command line abbreviation",
|
||||
function () { editor.expandAbbreviation(modes.COMMAND_LINE); });
|
||||
},
|
||||
options: function init_options() {
|
||||
options: function initOptions() {
|
||||
options.add(["history", "hi"],
|
||||
"Number of Ex commands and search patterns to store in the command-line history",
|
||||
"number", 500,
|
||||
@@ -1825,7 +1825,7 @@ var CommandLine = Module("commandline", {
|
||||
"number", 100,
|
||||
{ validator: function (value) value >= 0 });
|
||||
},
|
||||
sanitizer: function init_sanitizer() {
|
||||
sanitizer: function initSanitizer() {
|
||||
sanitizer.addItem("commandline", {
|
||||
description: "Command-line and search history",
|
||||
persistent: true,
|
||||
|
||||
@@ -1234,7 +1234,7 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), {
|
||||
}, {
|
||||
toolbarHidden: function hidden(elem) (elem.getAttribute("autohide") || elem.getAttribute("collapsed")) == "true"
|
||||
}, {
|
||||
cache: function () {
|
||||
cache: function initCache() {
|
||||
cache.register("help/plugins.xml", function () {
|
||||
// Process plugin help entries.
|
||||
XML.ignoreWhiteSpace = XML.prettyPrinting = false;
|
||||
@@ -1315,11 +1315,11 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), {
|
||||
</overlay>;
|
||||
});
|
||||
},
|
||||
events: function () {
|
||||
events: function initEvents() {
|
||||
events.listen(window, dactyl, "events", true);
|
||||
},
|
||||
// Only general options are added here, which are valid for all Dactyl extensions
|
||||
options: function () {
|
||||
options: function initOptions() {
|
||||
options.add(["errorbells", "eb"],
|
||||
"Ring the bell when an error message is displayed",
|
||||
"boolean", false);
|
||||
@@ -1494,7 +1494,7 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), {
|
||||
});
|
||||
},
|
||||
|
||||
mappings: function () {
|
||||
mappings: function initMappings() {
|
||||
if (dactyl.has("session"))
|
||||
mappings.add([modes.NORMAL], ["ZQ"],
|
||||
"Quit and don't save the session",
|
||||
@@ -1505,7 +1505,7 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), {
|
||||
function () { dactyl.quit(true); });
|
||||
},
|
||||
|
||||
commands: function () {
|
||||
commands: function initCommands() {
|
||||
commands.add(["dia[log]"],
|
||||
"Open a " + config.appName + " dialog",
|
||||
function (args) {
|
||||
@@ -1838,7 +1838,7 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), {
|
||||
|
||||
},
|
||||
|
||||
completion: function () {
|
||||
completion: function initCompletion() {
|
||||
completion.dialog = function dialog(context) {
|
||||
context.title = ["Dialog"];
|
||||
context.filters.push(function ({ item }) !item[2] || item[2]());
|
||||
@@ -1869,7 +1869,7 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), {
|
||||
context.completions = dactyl.windows;
|
||||
};
|
||||
},
|
||||
load: function () {
|
||||
load: function initLoad() {
|
||||
dactyl.triggerObserver("load");
|
||||
|
||||
dactyl.log(_("dactyl.modulesLoaded"), 3);
|
||||
|
||||
@@ -688,7 +688,7 @@ var Editor = Module("editor", XPCOM(Ci.nsIEditActionListener, ModuleBase), {
|
||||
return DOM(elem).editor;
|
||||
}
|
||||
}, {
|
||||
modes: function init_modes() {
|
||||
modes: function initModes() {
|
||||
modes.addMode("OPERATOR", {
|
||||
char: "o",
|
||||
description: "Mappings which move the cursor",
|
||||
@@ -745,7 +745,7 @@ var Editor = Module("editor", XPCOM(Ci.nsIEditActionListener, ModuleBase), {
|
||||
bases: [modes.INSERT]
|
||||
});
|
||||
},
|
||||
commands: function init_commands() {
|
||||
commands: function initCommands() {
|
||||
commands.add(["reg[isters]"],
|
||||
"List the contents of known registers",
|
||||
function (args) {
|
||||
@@ -753,7 +753,7 @@ var Editor = Module("editor", XPCOM(Ci.nsIEditActionListener, ModuleBase), {
|
||||
},
|
||||
{ argCount: "*" });
|
||||
},
|
||||
completion: function init_completion() {
|
||||
completion: function initCompletion() {
|
||||
completion.register = function complete_register(context) {
|
||||
context = context.fork("registers");
|
||||
context.keys = { text: util.identity, description: editor.closure.getRegister };
|
||||
@@ -777,7 +777,7 @@ var Editor = Module("editor", XPCOM(Ci.nsIEditActionListener, ModuleBase), {
|
||||
});
|
||||
};
|
||||
},
|
||||
mappings: function init_mappings() {
|
||||
mappings: function initMappings() {
|
||||
|
||||
Map.types["editor"] = {
|
||||
preExecute: function preExecute(args) {
|
||||
@@ -1346,7 +1346,7 @@ var Editor = Module("editor", XPCOM(Ci.nsIEditActionListener, ModuleBase), {
|
||||
bind(["<C-n>"], "Select the next autocomplete result",
|
||||
function () { events.feedkeys("<Down>", { skipmap: true }); });
|
||||
},
|
||||
options: function init_options() {
|
||||
options: function initOptions() {
|
||||
options.add(["editor"],
|
||||
"The external text editor",
|
||||
"string", 'gvim -f +<line> +"sil! call cursor(0, <column>)" <file>', {
|
||||
@@ -1391,7 +1391,7 @@ var Editor = Module("editor", XPCOM(Ci.nsIEditActionListener, ModuleBase), {
|
||||
}
|
||||
});
|
||||
},
|
||||
sanitizer: function () {
|
||||
sanitizer: function initSanitizer() {
|
||||
sanitizer.addItem("registers", {
|
||||
description: "Register values",
|
||||
persistent: true,
|
||||
|
||||
@@ -983,7 +983,7 @@ var Events = Module("events", {
|
||||
});
|
||||
},
|
||||
|
||||
commands: function () {
|
||||
commands: function initCommands() {
|
||||
commands.add(["delmac[ros]"],
|
||||
"Delete macros",
|
||||
function (args) {
|
||||
@@ -1009,13 +1009,13 @@ var Events = Module("events", {
|
||||
completer: function (context) completion.macro(context)
|
||||
});
|
||||
},
|
||||
completion: function () {
|
||||
completion: function initCompletion() {
|
||||
completion.macro = function macro(context) {
|
||||
context.title = ["Macro", "Keys"];
|
||||
context.completions = [item for (item in events.getMacros())];
|
||||
};
|
||||
},
|
||||
mappings: function () {
|
||||
mappings: function initMappings() {
|
||||
|
||||
mappings.add([modes.MAIN],
|
||||
["<A-b>", "<pass-next-key-builtin>"], "Process the next key as a builtin mapping",
|
||||
@@ -1097,7 +1097,7 @@ var Events = Module("events", {
|
||||
},
|
||||
{ count: true });
|
||||
},
|
||||
options: function () {
|
||||
options: function initOptions() {
|
||||
const Hive = Class("Hive", {
|
||||
init: function init(values, map) {
|
||||
this.name = "passkeys:" + map;
|
||||
|
||||
@@ -175,7 +175,7 @@ var History = Module("history", {
|
||||
}
|
||||
}, {
|
||||
}, {
|
||||
commands: function () {
|
||||
commands: function initCommands() {
|
||||
commands.add(["ba[ck]"],
|
||||
"Go back in the browser history",
|
||||
function (args) {
|
||||
@@ -321,7 +321,7 @@ var History = Module("history", {
|
||||
{ argCount: "0" });
|
||||
|
||||
},
|
||||
completion: function () {
|
||||
completion: function initCompletion() {
|
||||
completion.domain = function (context) {
|
||||
context.anchored = false;
|
||||
context.compare = function (a, b) String.localeCompare(a.key, b.key);
|
||||
@@ -351,7 +351,7 @@ var History = Module("history", {
|
||||
|
||||
completion.addUrlCompleter("history", "History", completion.history);
|
||||
},
|
||||
mappings: function () {
|
||||
mappings: function initMappings() {
|
||||
function bind() mappings.add.apply(mappings, [config.browserModes].concat(Array.slice(arguments)));
|
||||
|
||||
bind(["<C-o>"], "Go to an older position in the jump list",
|
||||
|
||||
@@ -332,7 +332,7 @@ var Marks = Module("marks", {
|
||||
{ arg: true });
|
||||
},
|
||||
|
||||
commands: function () {
|
||||
commands: function initCommands() {
|
||||
commands.add(["delm[arks]"],
|
||||
"Delete the specified marks",
|
||||
function (args) {
|
||||
@@ -372,7 +372,7 @@ var Marks = Module("marks", {
|
||||
});
|
||||
},
|
||||
|
||||
completion: function () {
|
||||
completion: function initCompletion() {
|
||||
completion.mark = function mark(context) {
|
||||
function percent(i) Math.round(i * 100);
|
||||
|
||||
@@ -383,7 +383,7 @@ var Marks = Module("marks", {
|
||||
context.completions = marks.all;
|
||||
};
|
||||
},
|
||||
sanitizer: function () {
|
||||
sanitizer: function initSanitizer() {
|
||||
sanitizer.addItem("marks", {
|
||||
description: "Local and URL marks",
|
||||
persistent: true,
|
||||
|
||||
@@ -118,7 +118,7 @@ var QuickMarks = Module("quickmarks", {
|
||||
}
|
||||
}, {
|
||||
}, {
|
||||
commands: function () {
|
||||
commands: function initCommands() {
|
||||
commands.add(["delqm[arks]"],
|
||||
"Delete the specified QuickMarks",
|
||||
function (args) {
|
||||
@@ -175,13 +175,13 @@ var QuickMarks = Module("quickmarks", {
|
||||
completer: function (context) completion.quickmark(context),
|
||||
});
|
||||
},
|
||||
completion: function () {
|
||||
completion: function initCompletion() {
|
||||
completion.quickmark = function (context) {
|
||||
context.title = ["QuickMark", "URL"];
|
||||
context.generate = function () Iterator(quickmarks._qmarks);
|
||||
};
|
||||
},
|
||||
mappings: function () {
|
||||
mappings: function initMappings() {
|
||||
var myModes = config.browserModes;
|
||||
|
||||
mappings.add(myModes,
|
||||
|
||||
@@ -596,10 +596,10 @@ var Tabs = Module("tabs", {
|
||||
services.sessionStore.setTabState(to, tabState);
|
||||
}
|
||||
}, {
|
||||
load: function init_load() {
|
||||
load: function initLoad() {
|
||||
tabs.updateTabCount();
|
||||
},
|
||||
commands: function init_commands() {
|
||||
commands: function initCommands() {
|
||||
[
|
||||
{
|
||||
name: ["bd[elete]"],
|
||||
@@ -1015,7 +1015,7 @@ var Tabs = Module("tabs", {
|
||||
{ argCount: "0" });
|
||||
}
|
||||
},
|
||||
completion: function init_completion() {
|
||||
completion: function initCompletion() {
|
||||
|
||||
completion.buffer = function buffer(context, visible) {
|
||||
let { tabs } = modules;
|
||||
@@ -1096,7 +1096,7 @@ var Tabs = Module("tabs", {
|
||||
};
|
||||
};
|
||||
},
|
||||
events: function init_events() {
|
||||
events: function initEvents() {
|
||||
let tabContainer = config.tabbrowser.mTabContainer;
|
||||
function callback() {
|
||||
tabs.timeout(function () { this.updateTabCount(); });
|
||||
@@ -1105,7 +1105,7 @@ var Tabs = Module("tabs", {
|
||||
events.listen(tabContainer, event, callback, false);
|
||||
events.listen(tabContainer, "TabSelect", tabs.closure._onTabSelect, false);
|
||||
},
|
||||
mappings: function init_mappings() {
|
||||
mappings: function initMappings() {
|
||||
|
||||
mappings.add([modes.COMMAND], ["<C-t>", "<new-tab-next>"],
|
||||
"Execute the next mapping in a new tab",
|
||||
@@ -1199,7 +1199,7 @@ var Tabs = Module("tabs", {
|
||||
{ count: true });
|
||||
}
|
||||
},
|
||||
options: function init_options() {
|
||||
options: function initOptions() {
|
||||
options.add(["showtabline", "stal"],
|
||||
"Define when the tab bar is visible",
|
||||
"string", true,
|
||||
|
||||
Reference in New Issue
Block a user