1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-20 10:17: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 /////////////////////////////////////////////// ////////////////////// PAGE INFO ///////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////{{{ /////////////////////////////////////////////////////////////////////////////{{{
addPageInfoSection("f", "Feeds", function (verbose) addPageInfoSection("f", "Feeds", function (verbose) {
{
let doc = window.content.document; let doc = window.content.document;
const feedTypes = { const feedTypes = {
@@ -789,8 +788,7 @@ function Buffer() //{{{
yield nFeed + " feed" + (nFeed > 1 ? "s" : ""); yield nFeed + " feed" + (nFeed > 1 ? "s" : "");
}); });
addPageInfoSection("g", "General Info", function (verbose) addPageInfoSection("g", "General Info", function (verbose) {
{
let doc = window.content.document; let doc = window.content.document;
// get file size // get file size
@@ -850,8 +848,7 @@ function Buffer() //{{{
yield ["Last Modified", lastModVerbose]; 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[] // get meta tag data, sort and put into pageMeta[]
let metaNodes = window.content.document.getElementsByTagName("meta"); let metaNodes = window.content.document.getElementsByTagName("meta");

View File

@@ -392,8 +392,7 @@ function Commands() //{{{
////////////////////// PUBLIC SECTION ////////////////////////////////////////// ////////////////////// 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))]); completion.setFunctionCompleter(commands.get, [function () ([c.name, c.description] for (c in commands))]);
}); });
@@ -945,8 +944,7 @@ function Commands() //{{{
*/ */
replaceTokens: function replaceTokens(str, tokens) 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) 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 "<"; return "<";
let res = tokens[token]; let res = tokens[token];
@@ -963,8 +961,7 @@ function Commands() //{{{
////////////////////// MAPPINGS //////////////////////////////////////////////// ////////////////////// MAPPINGS ////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////{{{ /////////////////////////////////////////////////////////////////////////////{{{
liberator.registerObserver("load_mappings", function () liberator.registerObserver("load_mappings", function () {
{
mappings.add(config.browserModes, mappings.add(config.browserModes,
["@:"], "Repeat the last Ex command", ["@:"], "Repeat the last Ex command",
function (count) function (count)

View File

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

View File

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

View File

@@ -389,8 +389,7 @@ function IO() //{{{
////////////////////// PUBLIC SECTION ////////////////////////////////////////// ////////////////////// PUBLIC SECTION //////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////{{{ /////////////////////////////////////////////////////////////////////////////{{{
liberator.registerObserver("load_completion", function () liberator.registerObserver("load_completion", function () {
{
completion.setFunctionCompleter([self.getFile, self.expandPath], completion.setFunctionCompleter([self.getFile, self.expandPath],
[function (context, obj, args) { [function (context, obj, args) {
context.quote[2] = ""; 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 // 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"], options.add(["errorbells", "eb"],
"Ring the bell when an error message is displayed", "Ring the bell when an error message is displayed",
"boolean", false); "boolean", false);
@@ -191,8 +191,8 @@ const liberator = (function () //{{{
}); });
}); });
registerObserver("load_mappings", function () registerObserver("load_mappings", function () {
{
mappings.add(modes.all, ["<F1>"], mappings.add(modes.all, ["<F1>"],
"Open help window", "Open help window",
function () { liberator.help(); }); function () { liberator.help(); });
@@ -237,8 +237,8 @@ const liberator = (function () //{{{
return items; return items;
} }
registerObserver("load_commands", function () registerObserver("load_commands", function () {
{
commands.add(["addo[ns]"], commands.add(["addo[ns]"],
"Manage available Extensions and Themes", "Manage available Extensions and Themes",
function () function ()

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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