1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-20 04:07:59 +01:00

Fix more function formatting faux pas as per the style guide.

This commit is contained in:
Doug Kearns
2009-06-01 16:13:38 +10:00
parent cd3364197f
commit 64a9c9554c
12 changed files with 35 additions and 62 deletions

View File

@@ -712,8 +712,7 @@ function Buffer() //{{{
////////////////////// PAGE INFO ///////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////{{{
addPageInfoSection("f", "Feeds", function (verbose)
{
addPageInfoSection("f", "Feeds", function (verbose) {
let doc = window.content.document;
const feedTypes = {
@@ -789,8 +788,7 @@ function Buffer() //{{{
yield nFeed + " feed" + (nFeed > 1 ? "s" : "");
});
addPageInfoSection("g", "General Info", function (verbose)
{
addPageInfoSection("g", "General Info", function (verbose) {
let doc = window.content.document;
// get file size
@@ -850,8 +848,7 @@ function Buffer() //{{{
yield ["Last Modified", lastModVerbose];
});
addPageInfoSection("m", "Meta Tags", function (verbose)
{
addPageInfoSection("m", "Meta Tags", function (verbose) {
// get meta tag data, sort and put into pageMeta[]
let metaNodes = window.content.document.getElementsByTagName("meta");

View File

@@ -392,8 +392,7 @@ function Commands() //{{{
////////////////////// PUBLIC SECTION //////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////{{{
liberator.registerObserver("load_completion", function ()
{
liberator.registerObserver("load_completion", function () {
completion.setFunctionCompleter(commands.get, [function () ([c.name, c.description] for (c in commands))]);
});
@@ -945,8 +944,7 @@ function Commands() //{{{
*/
replaceTokens: function replaceTokens(str, tokens)
{
return str.replace(/<((?:q-)?)([a-zA-Z]+)?>/g, function (match, quote, token)
{
return str.replace(/<((?:q-)?)([a-zA-Z]+)?>/g, function (match, quote, token) {
if (token == "lt") // Don't quote, as in Vim (but, why so in Vim? You'd think people wouldn't say <q-lt> if they didn't want it)
return "<";
let res = tokens[token];
@@ -963,8 +961,7 @@ function Commands() //{{{
////////////////////// MAPPINGS ////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////{{{
liberator.registerObserver("load_mappings", function ()
{
liberator.registerObserver("load_mappings", function () {
mappings.add(config.browserModes,
["@:"], "Repeat the last Ex command",
function (count)

View File

@@ -164,8 +164,7 @@ function AutoCommands() //{{{
////////////////////// PUBLIC SECTION //////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////{{{
liberator.registerObserver("load_completion", function ()
{
liberator.registerObserver("load_completion", function () {
completion.setFunctionCompleter(autocommands.get, [function () config.autocommands]);
});
@@ -343,20 +342,16 @@ function Events() //{{{
let tabcontainer = getBrowser().mTabContainer;
if (tabcontainer) // not every VIM-like extension has a tab container
{
tabcontainer.addEventListener("TabMove", function (event)
{
tabcontainer.addEventListener("TabMove", function (event) {
statusline.updateTabCount();
}, false);
tabcontainer.addEventListener("TabOpen", function (event)
{
tabcontainer.addEventListener("TabOpen", function (event) {
statusline.updateTabCount();
}, false);
tabcontainer.addEventListener("TabClose", function (event)
{
tabcontainer.addEventListener("TabClose", function (event) {
statusline.updateTabCount();
}, false);
tabcontainer.addEventListener("TabSelect", function (event)
{
tabcontainer.addEventListener("TabSelect", function (event) {
// TODO: is all of that necessary?
modes.reset();
statusline.updateTabCount();
@@ -374,16 +369,14 @@ function Events() //{{{
getBrowser().addEventListener("load", onPageLoad, true);
// called when the active document is scrolled
getBrowser().addEventListener("scroll", function (event)
{
getBrowser().addEventListener("scroll", function (event) {
statusline.updateBufferPosition();
modes.show();
}, null);
}
catch (e) {}
// getBrowser().addEventListener("submit", function (event)
// {
// getBrowser().addEventListener("submit", function (event) {
// // reset buffer loading state as early as possible, important for macros
// buffer.loaded = 0;
// }, null);
@@ -420,8 +413,7 @@ function Events() //{{{
window.addEventListener("DOMMenuBarInactive", exitMenuMode, true);
window.addEventListener("resize", onResize, true);
// window.document.addEventListener("DOMTitleChanged", function (event)
// {
// window.document.addEventListener("DOMTitleChanged", function (event) {
// liberator.log("titlechanged");
// }, null);
@@ -564,8 +556,7 @@ function Events() //{{{
function wrapListener(method)
{
return function (event)
{
return function (event) {
try
{
self[method](event);

View File

@@ -612,8 +612,7 @@ function Hints() //{{{
function containsMatcher(hintString) //{{{
{
let tokens = tokenize(/\s+/, hintString);
return function (linkText)
{
return function (linkText) {
linkText = linkText.toLowerCase();
return tokens.every(function (token) linkText.indexOf(token) >= 0);
};
@@ -737,8 +736,7 @@ function Hints() //{{{
return true;
}
return function (linkText)
{
return function (linkText) {
if (hintStrings.length == 1 && hintStrings[0].length == 0)
return true;

View File

@@ -389,8 +389,7 @@ function IO() //{{{
////////////////////// PUBLIC SECTION //////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////{{{
liberator.registerObserver("load_completion", function ()
{
liberator.registerObserver("load_completion", function () {
completion.setFunctionCompleter([self.getFile, self.expandPath],
[function (context, obj, args) {
context.quote[2] = "";

View File

@@ -88,8 +88,8 @@ const liberator = (function () //{{{
}
// Only general options are added here, which are valid for all Vimperator like extensions
registerObserver("load_options", function ()
{
registerObserver("load_options", function () {
options.add(["errorbells", "eb"],
"Ring the bell when an error message is displayed",
"boolean", false);
@@ -191,8 +191,8 @@ const liberator = (function () //{{{
});
});
registerObserver("load_mappings", function ()
{
registerObserver("load_mappings", function () {
mappings.add(modes.all, ["<F1>"],
"Open help window",
function () { liberator.help(); });
@@ -237,8 +237,8 @@ const liberator = (function () //{{{
return items;
}
registerObserver("load_commands", function ()
{
registerObserver("load_commands", function () {
commands.add(["addo[ns]"],
"Manage available Extensions and Themes",
function ()

View File

@@ -301,8 +301,7 @@ function Mappings() //{{{
////////////////////// PUBLIC SECTION //////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////{{{
liberator.registerObserver("load_completion", function ()
{
liberator.registerObserver("load_completion", function () {
completion.setFunctionCompleter(mappings.get,
[
null,

View File

@@ -724,10 +724,8 @@ function Options() //{{{
if (!/keypress/.test(popupAllowedEvents))
{
storePreference("dom.popup_allowed_events", popupAllowedEvents + " keypress");
liberator.registerObserver("shutdown", function ()
{
if (loadPreference("dom.popup_allowed_events", "")
== popupAllowedEvents + " keypress")
liberator.registerObserver("shutdown", function () {
if (loadPreference("dom.popup_allowed_events", "") == popupAllowedEvents + " keypress")
storePreference("dom.popup_allowed_events", popupAllowedEvents);
});
}
@@ -919,8 +917,7 @@ function Options() //{{{
/////////////////////////////////////////////////////////////////////////////{{{
// TODO: Does this belong elsewhere?
liberator.registerObserver("load_completion", function ()
{
liberator.registerObserver("load_completion", function () {
completion.setFunctionCompleter(options.get, [function () ([o.name, o.description] for (o in options))]);
completion.setFunctionCompleter([options.getPref, options.safeSetPref, options.setPref, options.resetPref, options.invertPref],
[function () services.get("pref")

View File

@@ -534,8 +534,7 @@ if (highlight.CSS != Highlights.prototype.CSS)
liberator.triggerObserver("load_styles", "styles");
liberator.triggerObserver("load_highlight", "highlight");
liberator.registerObserver("load_completion", function ()
{
liberator.registerObserver("load_completion", function () {
completion.setFunctionCompleter(["get", "addSheet", "removeSheet", "findSheets"].map(function (m) styles[m]),
[ // Prototype: (system, name, filter, css, index)
null,
@@ -546,8 +545,8 @@ liberator.registerObserver("load_completion", function ()
]);
});
liberator.registerObserver("load_commands", function ()
{
liberator.registerObserver("load_commands", function () {
commands.add(["colo[rscheme]"],
"Load a color scheme",
function (args)

View File

@@ -43,8 +43,7 @@ function Tabs() //{{{
var getBrowser = (function () {
if (config.hostApplication == "Thunderbird")
{
return function ()
{
return function () {
if (!tabmail)
{
tabmail = document.getElementById("tabmail");

View File

@@ -200,8 +200,7 @@ const util = { //{{{
while (cont)
{
cont = false;
str = str.replace(resep, function (match, before)
{
str = str.replace(resep, function (match, before) {
results.push(before);
cont = true;
return "";

View File

@@ -225,8 +225,7 @@ const config = { //{{{
};
// XXX: Hack!
window.document.addEventListener("load", function ()
{
window.document.addEventListener("load", function () {
if (window.messageWasEditedExternally === undefined)
{
window.messageWasEditedExternally = false;
@@ -234,8 +233,7 @@ const config = { //{{{
}
}, true);
window.addEventListener("compose-window-close", function ()
{
window.addEventListener("compose-window-close", function () {
window.messageWasEditedExternally = false;
}, true);