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

Formatting fixes.

This commit is contained in:
Doug Kearns
2009-11-14 04:20:09 +11:00
parent 52562f6390
commit 41b9c8e9a1
31 changed files with 82 additions and 91 deletions

View File

@@ -147,7 +147,7 @@ const AutoCommands = Module("autocommands", {
}, {
matchAutoCmd: function (autoCmd, event, regex) {
return (!event || autoCmd.event == event) && (!regex || autoCmd.pattern.source == regex);
},
}
}, {
commands: function () {
commands.add(["au[tocmd]"],
@@ -271,7 +271,7 @@ const AutoCommands = Module("autocommands", {
options.add(["focuscontent", "fc"],
"Try to stay in normal mode after loading a web page",
"boolean", false);
},
}
});
// vim: set fdm=marker sw=4 ts=4 et:

View File

@@ -75,8 +75,8 @@ function set(ary) {
obj[ary[i]] = true;
return obj;
}
set.add = function(set, key) { set[key] = true }
set.remove = function(set, key) { delete set[key] }
set.add = function (set, key) { set[key] = true }
set.remove = function (set, key) { delete set[key] }
function iter(obj) {
if (obj instanceof Ci.nsISimpleEnumerator)
@@ -205,16 +205,16 @@ function curry(fn, length, self, acc) {
if (length == 0)
return fn;
/* Close over function with 'this' */
// Close over function with 'this'
function close(self, fn) function () fn.apply(self, Array.slice(arguments));
if (acc == null)
acc = [];
return function() {
return function () {
let args = acc.concat(Array.slice(arguments));
/* The curried result should preserve 'this' */
// The curried result should preserve 'this'
if (arguments.length == 0)
return close(self || this, arguments.callee);
@@ -247,17 +247,17 @@ function curry(fn, length, self, acc) {
function update(target) {
for (let i=1; i < arguments.length; i++) {
let src = arguments[i];
foreach(keys(src || {}), function(k) {
foreach(keys(src || {}), function (k) {
var get = src.__lookupGetter__(k),
set = src.__lookupSetter__(k);
if (!get && !set) {
var v = src[k];
target[k] = v;
if (target.__proto__ && callable(v)) {
v.superapply = function(self, args) {
v.superapply = function (self, args) {
return target.__proto__[k].apply(self, args);
}
v.supercall = function(self) {
v.supercall = function (self) {
return v.superapply(self, Array.slice(arguments, 1));
}
}
@@ -361,7 +361,7 @@ function Class() {
extend(Constructor, superclass, args[0]);
update(Constructor, args[1]);
args = args.slice(2);
Array.forEach(args, function(obj) {
Array.forEach(args, function (obj) {
if (callable(obj))
obj = obj.prototype;
update(Constructor.prototype, obj);
@@ -374,7 +374,7 @@ Class.prototype = {
* Initializes new instances of this class. Called automatically
* when new instances are created.
*/
init: function() {},
init: function () {},
toString: function () "[instance " + this.constructor.name + "]",

View File

@@ -198,7 +198,6 @@ const Bookmarks = Module("bookmarks", {
storage.addObserver("bookmark-cache", bookmarkObserver, window);
},
get format() ({
anchored: false,
title: ["URL", "Info"],
@@ -680,7 +679,7 @@ const Bookmarks = Module("bookmarks", {
completion.addUrlCompleter("S", "Suggest engines", completion.searchEngineSuggest);
completion.addUrlCompleter("b", "Bookmarks", completion.bookmark);
completion.addUrlCompleter("s", "Search engines and keyword URLs", completion.search);
},
}
});
// vim: set fdm=marker sw=4 ts=4 et:

View File

@@ -1114,7 +1114,7 @@ const Buffer = Module("buffer", {
completer: completion.file,
default: elem.value
});
},
}
}, {
commands: function () {
commands.add(["frameo[nly]"],
@@ -1633,7 +1633,7 @@ const Buffer = Module("buffer", {
setter: function (value) getBrowser().markupDocumentViewer.authorStyleDisabled = value,
getter: function () getBrowser().markupDocumentViewer.authorStyleDisabled
});
},
}
});
// vim: set fdm=marker sw=4 ts=4 et:

View File

@@ -160,7 +160,6 @@ const CommandLine = Module("commandline", {
this._multilineRegexp = null;
this._multilineCallback = null;
this._input = {};
this.registerCallback("submit", modes.EX, function (command) {
@@ -319,8 +318,6 @@ const CommandLine = Module("commandline", {
this._multilineInputWidget.setAttribute("rows", Math.max(lines, 1));
},
HL_NORMAL: "Normal",
HL_ERRORMSG: "ErrorMsg",
HL_MODEMSG: "ModeMsg",
@@ -1398,7 +1395,7 @@ const CommandLine = Module("commandline", {
arg = String(arg);
return arg;
},
}
}, {
commands: function () {
[
@@ -1610,10 +1607,9 @@ const CommandLine = Module("commandline", {
styles.registerSheet("chrome://liberator/skin/liberator.css");
let error = styles.addSheet(true, "font-size", "chrome://liberator/content/buffer.xhtml",
"body { font-size: " + fontSize + "; }");
},
}
});
/**
* The list which is used for the completion box (and QuickFix window in
* future).

View File

@@ -233,7 +233,7 @@ const Command = Class("Command", {
}
return { names: names, longNames: longNames, shortNames: shortNames };
},
}
});
/**
@@ -855,7 +855,7 @@ const Commands = Module("commands", {
}
return [len - str.length, arg, quote];
},
}
}, {
mappings: function () {
mappings.add(config.browserModes,

View File

@@ -618,7 +618,7 @@ const CompletionContext = Class("CompletionContext", {
textDescription: function (item) {
return CompletionContext.Filter.text.call(this, item) || this.match(item.description);
}
},
}
});
/**
@@ -1129,7 +1129,7 @@ const Completion = Module("completion", {
for (let [, obj] in Iterator(objects)) {
let name = obj[1] + " (prototypes)";
this.context.fork(name, top[OFFSET], this, fill,
obj[0], name, function(a, b) compl(a, b, true), compl != orig,
obj[0], name, function (a, b) compl(a, b, true), compl != orig,
filter, last, key.length);
obj[1] += " (substrings)";
this.context.fork(obj[1], top[OFFSET], this, fill,
@@ -1260,7 +1260,7 @@ const Completion = Module("completion", {
top[OFFSET] = o;
}
}
},
}
}, {
EVAL_TMP: "__liberator_eval_tmp",
}),

View File

@@ -62,7 +62,6 @@ const Editor = Module("editor", {
},
// For the record, some of this code I've just finished throwing
// away makes me want to pull someone else's hair out. --Kris
abbrevs: function () {
@@ -1069,7 +1068,7 @@ const Editor = Module("editor", {
options.add(["insertmode", "im"],
"Use Insert mode as the default for text areas",
"boolean", true);
},
}
});
// vim: set fdm=marker sw=4 ts=4 et:

View File

@@ -1337,7 +1337,7 @@ const Events = Module("events", {
statusline.updateBufferPosition();
modes.show();
}, null);
},
}
});
// vim: set fdm=marker sw=4 ts=4 et:

View File

@@ -457,7 +457,7 @@ const Finder = Module("finder", {
options.add(["smartcase", "scs"],
"Override the 'ignorecase' option if the pattern contains uppercase characters",
"boolean", true);
},
}
});
const RangeFinder = Module("rangefinder", {
@@ -635,7 +635,7 @@ const RangeFinder = Module("rangefinder", {
modes.addMode("FIND_BACKWARD", true);
},
options: function () {
},
}
});
const RangeFind = Class("RangeFind", {
@@ -909,7 +909,7 @@ const RangeFind = Class("RangeFind", {
cancel: function () {
this.range.deselect();
this.range.descroll()
},
}
}, {
Range: Class("RangeFind.Range", {
init: function (range, index) {

View File

@@ -987,12 +987,12 @@ const Hints = Module("hints", {
var m, c = chr.charCodeAt(0);
var n = table.length;
var i = 0;
while(n) {
while (n) {
m = Math.floor(n / 2);
var t = table[i + m];
if(c >= t[0] && c <= t[1])
if (c >= t[0] && c <= t[1])
return t[3](c)
if(c < t[0] || m == 0)
if (c < t[0] || m == 0)
n = m;
else {
i += m;

View File

@@ -229,7 +229,7 @@ const History = Module("history", {
["L", "<A-Right>", "<M-Right>"], "Go forward in the browser history",
function (count) { history.stepTo(Math.max(count, 1)); },
{ count: true });
},
}
});
// vim: set fdm=marker sw=4 ts=4 et:

View File

@@ -184,7 +184,7 @@ const File = Class("File", {
ofstream.close();
}
return true;
},
}
}, {
/**
* @property {number} Open for reading only.
@@ -239,7 +239,6 @@ const File = Class("File", {
*/
MODE_EXCL: 0x80,
expandPathList: function (list) list.split(",").map(this.expandPath).join(","),
expandPath: function (path, relative) {
@@ -311,7 +310,7 @@ const File = Class("File", {
catch (e) {
return false;
}
},
}
});
// TODO: why are we passing around strings rather than file objects?
@@ -490,7 +489,6 @@ const IO = Module("io", {
return File(file);
},
/**
* Runs an external program.
*
@@ -798,12 +796,15 @@ lookup:
return rtp;
},
/**
* @property {string} The current platform's path seperator.
*/
get PATH_SEP() {
delete this.PATH_SEP;
let f = services.get("directory").get("CurProcD", Ci.nsIFile);
f.append("foo");
return this.PATH_SEP = f.path.substr(f.parent.path.length, 1);
},
}
}, {
commands: function () {
commands.add(["cd", "chd[ir]"],
@@ -1097,7 +1098,7 @@ lookup:
options.add(["shellcmdflag", "shcf"],
"Flag passed to shell when executing :! and :run commands",
"string", shellcmdflag);
},
}
});
// vim: set fdm=marker sw=4 ts=4 et:

View File

@@ -33,7 +33,7 @@ const Storage = Module("storage", {
catch (e) {}
return this.storage;
},
}
});
function Runnable(self, func, args) {
@@ -46,7 +46,7 @@ function Runnable(self, func, args) {
const FailedAssertion = Class("FailedAssertion", Error, {
init: function (message) {
this.message = message;
},
}
});
const Liberator = Module("liberator", {
@@ -1077,7 +1077,7 @@ const Liberator = Module("liberator", {
liberator.echo(template.usage(items), commandline.FORCE_MULTILINE);
else
liberator.help(tag);
},
}
}, {
// Only general options are added here, which are valid for all Liberator extensions
@@ -1831,7 +1831,7 @@ const Liberator = Module("liberator", {
statusline.update();
liberator.log(config.name + " fully initialized", 0);
},
}
});
// vim: set fdm=marker sw=4 ts=4 et:

View File

@@ -498,7 +498,7 @@ const Mappings = Module("mappings", {
this._main[mode] = [];
this._user[mode] = [];
}
},
}
});
// vim: set fdm=marker sw=4 ts=4 et:

View File

@@ -40,7 +40,6 @@ const Marks = Module("marks", {
return lmarks.concat(umarks);
},
/**
* Add a named mark for the current buffer, at its current position.
* If mark matches [A-Z], it's considered a URL mark, and will jump to
@@ -337,7 +336,7 @@ const Marks = Module("marks", {
context.keys.description = function ([, m]) percent(m.position.y) + "% " + percent(m.position.x) + "% " + m.location;
context.completions = marks.all;
};
},
}
});
// vim: set fdm=marker sw=4 ts=4 et:

View File

@@ -96,7 +96,7 @@ window.addEventListener("load", function () {
init(mod, module)();
delete module.INIT[mod]
}
catch(e) {
catch (e) {
if (modules.liberator)
liberator.reportError(e);
}

View File

@@ -394,7 +394,7 @@ const Option = Class("Option", {
if (!res)
res = context.allItems.items.map(function (item) [item.text]);
return Array.concat(values).every(function (value) res.some(function (item) item[0] == value));
},
}
});
/**
@@ -428,7 +428,6 @@ const Options = Module("options", {
});
}
function optionObserver(key, event, option) {
// Trigger any setters.
let opt = options.get(option);
@@ -890,7 +889,7 @@ const Options = Module("options", {
catch (e) {
return defaultValue;
}
},
}
}, {
SAVED: "extensions.liberator.saved.",
OLD_SAVED: "liberator.saved.",
@@ -1274,7 +1273,7 @@ const Options = Module("options", {
context.keys = { text: function (item) item, description: function (item) options.getPref(item) };
context.completions = options.allPrefs();
};
},
}
});
// vim: set fdm=marker sw=4 ts=4 et:

View File

@@ -167,7 +167,7 @@ const QuickMarks = Module("quickmarks", {
quickmarks.add(arg, buffer.URL);
},
{ arg: true });
},
}
});
// vim: set fdm=marker sw=4 ts=4 et:

View File

@@ -263,7 +263,7 @@ const Sanitizer = Module("sanitizer", {
],
validator: Option.validateCompleter
});
},
}
});
// vim: set fdm=marker sw=4 ts=4 et:

View File

@@ -239,7 +239,7 @@ const StatusLine = Module("statusline", {
],
validator: Option.validateCompleter
});
},
}
});
// vim: set fdm=marker sw=4 ts=4 et:

View File

@@ -583,7 +583,7 @@ Module("styles", {
});
}
return storage.newObject("styles", Styles, { store: false });
},
}
}, {
}, {
commands: function () {
@@ -703,7 +703,7 @@ Module("styles", {
null,
function (context, obj, args) args[0] ? styles.systemSheets : styles.userSheets
]);
},
}
});
Module("highlight", {
@@ -717,7 +717,7 @@ Module("highlight", {
self.loadCSS(self.CSS);
}
return self;
},
}
}, {
}, {
commands: function () {
@@ -821,7 +821,7 @@ Module("highlight", {
context.title = ["Highlight Group", "Value"];
context.completions = [[v.class, v.value] for (v in highlight)];
};
},
}
});
// vim: set fdm=marker sw=4 ts=4 et:

View File

@@ -530,7 +530,6 @@ const Tabs = Module("tabs", {
services.get("sessionStore").setTabState(to, tabState);
},
/**
* @param spec can either be:
* - an absolute integer
@@ -564,7 +563,7 @@ const Tabs = Module("tabs", {
position = wrap ? (position % length) + length : 0;
return position;
},
}
}, {
commands: function () {
commands.add(["bd[elete]", "bw[ipeout]", "bun[load]", "tabc[lose]"],
@@ -1115,7 +1114,7 @@ const Tabs = Module("tabs", {
validator: Option.validateCompleter
});
}
},
}
});
// vim: set fdm=marker sw=4 ts=4 et:

View File

@@ -777,7 +777,7 @@ const Util = Module("util", {
concat: function () [].concat.apply(this.__proto__, arguments),
map: function () this.__noSuchMethod__("map", Array.slice(arguments))
};
},
}
}, {
isinstance: function isinstance(obj) {
return Object.prototype.toString.call(obj) == "[object Array]";
@@ -856,9 +856,8 @@ const Util = Module("util", {
}
}
return ret;
},
}
}),
});
// vim: set fdm=marker sw=4 ts=4 et:

View File

@@ -360,7 +360,7 @@ var storage = {
for (let key in keys)
this.load(key);
return this._privateMode = Boolean(val);
},
}
};
// vim: set fdm=marker sw=4 sts=4 et ft=javascript:

View File

@@ -145,7 +145,7 @@ const Addressbook = Module("addressbook", {
commandline.open(":", "contact " + address + " " + displayName, modes.EX);
});
},
}
});
// vim: set fdm=marker sw=4 ts=4 et:

View File

@@ -183,7 +183,7 @@ const Config = Module("config", ConfigBase, {
},
getter: function () MailOfflineMgr.isOnline()
});
},
}
});
// vim: set fdm=marker sw=4 ts=4 et:

View File

@@ -937,7 +937,7 @@ const Mail = Module("mail", {
return value;
}
});*/
},
}
});
// vim: set fdm=marker sw=4 ts=4 et:

View File

@@ -119,7 +119,7 @@ const Config = Module("config", ConfigBase, {
catch (e) {}
return prefix + ".tmp";
},
}
}, {
}, {
commands: function () {
@@ -289,7 +289,7 @@ const Config = Module("config", ConfigBase, {
},
getter: function () !services.get("io").offline
});
},
}
});
// vim: set fdm=marker sw=4 ts=4 et:

View File

@@ -158,7 +158,7 @@ const Config = Module("config", {
// FIXME: tab arg and media tab exception?
stop: function (tab) {
SBGetBrowser().mCurrentBrowser.stop();
},
}
}, {
// TODO: support 'nrformats'? -> probably not worth it --mst

View File

@@ -709,7 +709,7 @@ const Player = Module("player", {
services: function () {
services.add("mediaPageManager", "@songbirdnest.com/Songbird/MediaPageManager;1", Ci.sbIMediaPageManager);
services.add("propertyManager","@songbirdnest.com/Songbird/Properties/PropertyManager;1", Ci.sbIPropertyManager);
},
}
});
// vim: set fdm=marker sw=4 ts=4 et: