1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-02-13 02:55:47 +01:00

Normalise naming of module initializer functions.

This commit is contained in:
Doug Kearns
2012-10-11 01:08:36 +11:00
parent 50597cc80a
commit 53f3ea342c
22 changed files with 84 additions and 84 deletions

View File

@@ -357,7 +357,7 @@ var Addons = Module("addons", {
.toObject())
}, {
}, {
commands: function (dactyl, modules, window) {
commands: function initCommands(dactyl, modules, window) {
const { CommandOption, commands, completion, io } = modules;
commands.add(["addo[ns]", "ao"],
@@ -458,7 +458,7 @@ var Addons = Module("addons", {
});
});
},
completion: function (dactyl, modules, window) {
completion: function initCompletion(dactyl, modules, window) {
completion.addonType = function addonType(context) {
let base = ["extension", "theme"];
function update(types) {

View File

@@ -1114,7 +1114,7 @@ var Completion = Module("completion", {
get options() this.modules.options
});
},
commands: function (dactyl, modules, window) {
commands: function initCommands(dactyl, modules, window) {
const { commands, completion } = modules;
commands.add(["contexts"],
"List the completion contexts used during completion of an Ex command",
@@ -1135,7 +1135,7 @@ var Completion = Module("completion", {
literal: 0
});
},
options: function (dactyl, modules, window) {
options: function initOptions(dactyl, modules, window) {
const { completion, options } = modules;
let wildmode = {
values: {

View File

@@ -261,7 +261,7 @@ var RangeFinder = Module("rangefinder", {
get onSubmit() modules.rangefinder.closure.onSubmit
});
},
mappings: function (dactyl, modules, window) {
mappings: function initMappings(dactyl, modules, window) {
const { Buffer, buffer, config, mappings, modes, rangefinder } = modules;
var myModes = config.browserModes.concat([modes.CARET]);
@@ -296,7 +296,7 @@ var RangeFinder = Module("rangefinder", {
});
},
options: function (dactyl, modules, window) {
options: function initOptions(dactyl, modules, window) {
const { options, rangefinder } = modules;
options.add(["hlfind", "hlf"],

View File

@@ -413,7 +413,7 @@ var Help = Module("Help", {
})
}, {
}, {
commands: function init_commands(dactyl, modules, window) {
commands: function initCommands(dactyl, modules, window) {
const { commands, completion, help } = modules;
[
@@ -440,7 +440,7 @@ var Help = Module("Help", {
});
});
},
completion: function init_completion(dactyl, modules, window) {
completion: function initCompletion(dactyl, modules, window) {
const { completion } = modules;
completion.help = function completion_help(context, consolidated) {
@@ -452,7 +452,7 @@ var Help = Module("Help", {
context.keys = { text: 0, description: function () "all" };
};
},
mappings: function init_mappings(dactyl, modules, window) {
mappings: function initMappings(dactyl, modules, window) {
const { help, mappings, modes } = modules;
mappings.add([modes.MAIN], ["<open-help>", "<F1>"],
@@ -463,7 +463,7 @@ var Help = Module("Help", {
"Open the single, consolidated help page",
function () { modules.ex.helpall(); });
},
javascript: function init_javascript(dactyl, modules, window) {
javascript: function initJavascript(dactyl, modules, window) {
modules.JavaScript.setCompleter([modules.help.exportHelp],
[function (context, args) overlay.activeModules.completion.file(context)]);
}

View File

@@ -575,7 +575,7 @@ var IO = Module("io", {
*/
PATH_SEP: deprecated("File.PATH_SEP", { get: function PATH_SEP() File.PATH_SEP })
}, {
commands: function init_commands(dactyl, modules, window) {
commands: function initCommands(dactyl, modules, window) {
const { commands, completion, io } = modules;
commands.add(["cd", "chd[ir]"],
@@ -929,7 +929,7 @@ unlet s:cpo_save
literal: 0
});
},
completion: function init_completion(dactyl, modules, window) {
completion: function initCompletion(dactyl, modules, window) {
const { completion, io } = modules;
completion.charset = function (context) {
@@ -1077,7 +1077,7 @@ unlet s:cpo_save
completion.file(context, full);
});
},
javascript: function init_javascript(dactyl, modules, window) {
javascript: function initJavascript(dactyl, modules, window) {
modules.JavaScript.setCompleter([File, File.expandPath],
[function (context, obj, args) {
context.quote[2] = "";
@@ -1096,7 +1096,7 @@ unlet s:cpo_save
input: true
});
},
options: function init_options(dactyl, modules, window) {
options: function initOptions(dactyl, modules, window) {
const { completion, options } = modules;
var shell, shellcmdflag;

View File

@@ -879,7 +879,7 @@ var JavaScript = Module("javascript", {
bind(["<C-b>", "<PageUp>"], "Scroll up half a page",
function ({ self }) { self.repl.scrollVertical("pages", -1); });
},
options: function (dactyl, modules, window) {
options: function initOptions(dactyl, modules, window) {
modules.options.add(["jsdebugger", "jsd"],
"Enable the JavaScript debugger service for use in JavaScript completion",
"boolean", false, {

View File

@@ -386,12 +386,12 @@ var Sanitizer = Module("sanitizer", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakRef
yield p;
}
}, {
load: function (dactyl, modules, window) {
load: function initLoad(dactyl, modules, window) {
if (!sanitizer.firstRun++ && sanitizer.runAtShutdown && !sanitizer.ranAtShutdown)
sanitizer.sanitizeItems(null, Range(), null, "shutdown");
sanitizer.ranAtShutdown = false;
},
autocommands: function (dactyl, modules, window) {
autocommands: function initAutocommands(dactyl, modules, window) {
const { autocommands } = modules;
storage.addObserver("private-mode",
@@ -406,7 +406,7 @@ var Sanitizer = Module("sanitizer", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakRef
autocommands.trigger("Sanitize", { name: event.substr("clear-".length), domain: value[1] });
}, window);
},
commands: function (dactyl, modules, window) {
commands: function initCommands(dactyl, modules, window) {
const { commands } = modules;
commands.add(["sa[nitize]"],
"Clear private data",
@@ -565,7 +565,7 @@ var Sanitizer = Module("sanitizer", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakRef
},
});
},
completion: function (dactyl, modules, window) {
completion: function initCompletion(dactyl, modules, window) {
modules.completion.visibleHosts = function completeHosts(context) {
let res = util.visibleHosts(window.content);
if (context.filter && !res.some(function (host) host.indexOf(context.filter) >= 0))
@@ -578,7 +578,7 @@ var Sanitizer = Module("sanitizer", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakRef
context.completions = res;
};
},
options: function (dactyl, modules) {
options: function initOptions(dactyl, modules) {
const options = modules.options;
if (services.has("privateBrowsing"))
options.add(["private", "pornmode"],

View File

@@ -547,7 +547,7 @@ var Styles = Module("Styles", {
return '"' + str.replace(/([\\"])/g, "\\$1").replace(/\n/g, "\\00000a") + '"';
},
}, {
commands: function (dactyl, modules, window) {
commands: function initCommands(dactyl, modules, window) {
const { commands, contexts, styles } = modules;
function sheets(context, args, filter) {
@@ -696,7 +696,7 @@ var Styles = Module("Styles", {
});
});
},
contexts: function (dactyl, modules, window) {
contexts: function initContexts(dactyl, modules, window) {
modules.contexts.Hives("styles",
Class("LocalHive", Contexts.Hive, {
init: function init(group) {
@@ -717,7 +717,7 @@ var Styles = Module("Styles", {
}
}));
},
completion: function (dactyl, modules, window) {
completion: function initCompletion(dactyl, modules, window) {
const names = Array.slice(DOM(<div/>, window.document).style);
modules.completion.css = function (context) {
context.title = ["CSS Property"];
@@ -732,7 +732,7 @@ var Styles = Module("Styles", {
}
};
},
javascript: function (dactyl, modules, window) {
javascript: function initJavascript(dactyl, modules, window) {
modules.JavaScript.setCompleter(["get", "add", "remove", "find"].map(function (m) Hive.prototype[m]),
[ // Prototype: (name, filter, css, index)
function (context, obj, args) this.names,
@@ -741,7 +741,7 @@ var Styles = Module("Styles", {
function (context, obj, args) this.sheets
]);
},
template: function () {
template: function initTemplate() {
let patterns = Styles.patterns;
template.highlightCSS = function highlightCSS(css) {
@@ -769,7 +769,7 @@ var Styles = Module("Styles", {
}{ match.postSpace }</>
})
}
},
}
});
endModule();