1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-01-09 18:14:12 +01:00

Add missing semicolons, fix whitespace and normalise Vim modelines.

This commit is contained in:
Doug Kearns
2013-08-03 01:37:19 +10:00
parent bbb14eaf83
commit f291454e23
62 changed files with 182 additions and 195 deletions

View File

@@ -25,7 +25,7 @@ var listener = function listener(action, event)
this.dactyl[install.error ? "echoerr" : "echomsg"](
_("addon.error", action, event, (install.name || install.sourceURI.spec) +
(install.error ? ": " + addons.errors[install.error] : "")));
}
};
var AddonListener = Class("AddonListener", {
init: function init(modules) {
@@ -120,7 +120,7 @@ var actions = {
},
get filter() {
return function (addon) !addon.userDisabled &&
!(addon.operationsRequiringRestart & (AddonManager.OP_NEEDS_RESTART_ENABLE | AddonManager.OP_NEEDS_RESTART_DISABLE))
!(addon.operationsRequiringRestart & (AddonManager.OP_NEEDS_RESTART_ENABLE | AddonManager.OP_NEEDS_RESTART_DISABLE));
},
perm: "disable"
},
@@ -206,7 +206,7 @@ var Addon = Class("Addon", {
["span", { highlight: pending[0] }, pending[1]],
" on ",
["a", { href: "#", "dactyl:command": "dactyl.restart" }, "restart"],
")"]
")"];
return info;
},
@@ -498,4 +498,4 @@ endModule();
} catch(e){ if (isString(e)) e = Error(e); dump(e.fileName+":"+e.lineNumber+": "+e+"\n" + e.stack); }
// vim: set fdm=marker sw=4 ts=4 et ft=javascript:
// vim: set fdm=marker sw=4 sts=4 ts=8 et ft=javascript:

View File

@@ -241,7 +241,7 @@ function properties(obj, prototypes, debugger_) {
return array.uniq([k for (k in obj)].concat(
Object.getOwnPropertyNames(
XPCNativeWrapper.unwrap(obj))
.filter(filter)))
.filter(filter)));
}
else if (!e.stack) {
throw Error(e);
@@ -1080,7 +1080,7 @@ function XPCOMShim(interfaces) {
getInterfaces: function (count) { count.value = 0; }
});
return (interfaces || []).reduce(function (shim, iface) shim.QueryInterface(Ci[iface]),
ip.data)
ip.data);
};
let stub = Class.Property({
configurable: true,
@@ -1097,7 +1097,7 @@ var ErrorBase = Class("ErrorBase", Error, {
init: function EB_init(message, level) {
level = level || 0;
let error = Error(message);
update(this, error)
update(this, error);
this.stack = error.stack;
this.message = message;
@@ -1172,7 +1172,7 @@ Module.INIT = {
module.isLocalModule = true;
modules.jsmodules[this.constructor.className] = module;
locals.reverse().forEach(function (fn, i) update(objs[i], fn.apply(module, args)))
locals.reverse().forEach(function (fn, i) update(objs[i], fn.apply(module, args)));
memoize(module, "closure", Class.makeClosure);
module.instance = module;
@@ -1769,4 +1769,4 @@ endModule();
// catch(e){dump(e.fileName+":"+e.lineNumber+": "+e+"\n" + e.stack);}
// vim: set fdm=marker sw=4 ts=4 et ft=javascript:
// vim: set fdm=marker sw=4 sts=4 ts=8 et ft=javascript:

View File

@@ -262,4 +262,4 @@ var BookmarkCache = Module("BookmarkCache", XPCOM(Ci.nsINavBookmarkObserver), {
endModule();
// vim: set fdm=marker sw=4 sts=4 et ft=javascript:
// vim: set fdm=marker sw=4 sts=4 ts=8 et ft=javascript:

View File

@@ -19,3 +19,4 @@ this["import"] = function import_(obj) {
Components.utils.import("resource://gre/modules/Services.jsm");
function loadSubScript() Services.scriptloader.loadSubScript.apply(null, arguments);
// vim: set fdm=marker sw=4 sts=4 ts=8 et ft=javascript:

View File

@@ -33,7 +33,7 @@ var Buffer = Module("Buffer", {
let win = services.focus.focusedWindow;
if (!win || win == window || util.topWindow(win) != window)
return window.content
return window.content;
if (win.top == window)
return win;
return win.top;
@@ -219,7 +219,7 @@ var Buffer = Module("Buffer", {
*/
get zoomLevel() {
let v = this.contentViewer;
return v[v.textZoom == 1 ? "fullZoom" : "textZoom"] * 100
return v[v.textZoom == 1 ? "fullZoom" : "textZoom"] * 100;
},
set zoomLevel(value) { this.setZoom(value, this.fullZoom); },
@@ -907,7 +907,7 @@ var Buffer = Module("Buffer", {
let distance = reverse ? function (rect) -rect.top : function (rect) rect.top;
let elems = [[e, distance(e.getBoundingClientRect())] for (e in path.matcher(this.focusedFrame.document))]
.filter(function (e) e[1] > FUDGE)
.sort(function (a, b) a[1] - b[1])
.sort(function (a, b) a[1] - b[1]);
if (offScreen && !reverse)
elems = elems.filter(function (e) e[1] > this, this.topWindow.innerHeight);
@@ -1368,10 +1368,10 @@ var Buffer = Module("Buffer", {
get scrollRightMax() this.win.scrollMaxY,
get scrollLeft() this.win.scrollX,
set scrollLeft(val) { this.win.scrollTo(val, this.win.scrollY) },
set scrollLeft(val) { this.win.scrollTo(val, this.win.scrollY); },
get scrollTop() this.win.scrollY,
set scrollTop(val) { this.win.scrollTo(this.win.scrollX, val) }
set scrollTop(val) { this.win.scrollTo(this.win.scrollX, val); }
};
return elem;
},
@@ -1680,7 +1680,7 @@ var Buffer = Module("Buffer", {
return {
x: elem.scrollLeft && elem.scrollLeft / this._exWidth(node),
y: elem.scrollTop / parseFloat(style.lineHeight)
}
};
},
_exWidth: function _exWidth(elem) {
@@ -1747,7 +1747,7 @@ var Buffer = Module("Buffer", {
const BRANCH = "printer_" + PRINTER + ".";
const BRANCHES = ["print.", BRANCH, "print." + BRANCH];
function set(pref, value) {
BRANCHES.forEach(function (branch) { prefs.set(branch + pref, value) });
BRANCHES.forEach(function (branch) { prefs.set(branch + pref, value); });
}
prefs.withContext(function () {
@@ -2665,7 +2665,7 @@ Buffer.addPageInfoSection("m", "Meta Tags", function (verbose) {
});
Buffer.addPageInfoSection("s", "Security", function (verbose) {
let { statusline } = this.modules
let { statusline } = this.modules;
let identity = this.topWindow.gIdentityHandler;
@@ -2706,4 +2706,4 @@ Buffer.addPageInfoSection("s", "Security", function (verbose) {
endModule();
// vim: set fdm=marker sw=4 ts=4 et ft=javascript:
// vim: set fdm=marker sw=4 sts=4 ts=8 et ft=javascript:

View File

@@ -28,7 +28,7 @@ var Cache = Module("Cache", XPCOM(Ci.nsIRequestObserver), {
"cache": function (uri, path) {
let contentType = "text/plain";
try {
contentType = services.mime.getTypeFromURI(uri)
contentType = services.mime.getTypeFromURI(uri);
}
catch (e) {}
@@ -268,4 +268,4 @@ endModule();
// catch(e){ if (typeof e === "string") e = Error(e); dump(e.fileName+":"+e.lineNumber+": "+e+"\n" + e.stack); }
// vim: set fdm=marker sw=4 sts=4 et ft=javascript:
// vim: set fdm=marker sw=4 sts=4 ts=8 et ft=javascript:

View File

@@ -352,7 +352,7 @@ var Command = Class("Command", {
{ configurable: true, enumerable: true, get: function () opt.default };
if (prop.get && !prop.set)
prop.set = function (val) { Class.replaceProperty(this, opt.names[0], val) };
prop.set = function (val) { Class.replaceProperty(this, opt.names[0], val); };
Object.defineProperty(res, opt.names[0], prop);
}
});
@@ -536,7 +536,7 @@ var CommandHive = Class("CommandHive", Contexts.Hive, {
if (this.cached)
this.modules.initDependencies("commands");
this.cached = false;
return array.iterValues(this._list.sort(function (a, b) a.name > b.name))
return array.iterValues(this._list.sort(function (a, b) a.name > b.name));
},
/** @property {string} The last executed Ex command line. */
@@ -1171,7 +1171,7 @@ var Commands = Module("commands", {
if (sub.substr(0, 2) === "<<" && hereDoc)
let ([count, arg] = getNextArg(sub)) {
sub = arg + sub.substr(count);
}
};
args.push(sub);
args.quote = null;
@@ -1787,7 +1787,7 @@ let quote = function quote(q, list, map) {
Commands.quoteMap = {
"\n": "\\n",
"\t": "\\t",
"\t": "\\t"
};
Commands.quoteArg = {
@@ -1813,4 +1813,4 @@ endModule();
} catch(e){ if (!e.stack) e = Error(e); dump(e.fileName+":"+e.lineNumber+": "+e+"\n" + e.stack); }
// vim: set fdm=marker sw=4 ts=4 et ft=javascript:
// vim: set fdm=marker sw=4 sts=4 ts=8 et ft=javascript:

View File

@@ -943,7 +943,7 @@ var Completion = Module("completion", {
template.map(contexts, function m(context)
[template.completionRow(context.title, "CompTitle"),
template.map(context.items, function m(item) context.createRow(item), null, 100)])]);
},
}
}),
////////////////////////////////////////////////////////////////////////////////
@@ -1019,7 +1019,7 @@ var Completion = Module("completion", {
let words = context.filter.toLowerCase().split(/\s+/g);
context.hasItems = true;
context.completions = context.completions.filter(function f({ url, title })
words.every(function e(w) (url + " " + title).toLowerCase().indexOf(w) >= 0))
words.every(function e(w) (url + " " + title).toLowerCase().indexOf(w) >= 0));
context.format = this.modules.bookmarks.format;
context.keys.extra = function k_extra(item) {
@@ -1229,4 +1229,4 @@ endModule();
// catch(e){ if (!e.stack) e = Error(e); dump(e.fileName+":"+e.lineNumber+": "+e+"\n" + e.stack); }
// vim: set fdm=marker sw=4 ts=4 et ft=javascript:
// vim: set fdm=marker sw=4 sts=4 ts=8 et ft=javascript:

View File

@@ -37,7 +37,7 @@ AboutHandler.prototype = {
return channel;
},
getURIFlags: function (uri) Ci.nsIAboutModule.ALLOW_SCRIPT,
getURIFlags: function (uri) Ci.nsIAboutModule.ALLOW_SCRIPT
};
var ConfigBase = Class("ConfigBase", {
/**
@@ -415,7 +415,7 @@ var ConfigBase = Class("ConfigBase", {
"list.href": Class.Memoize(function () "http://groups.google.com/group/" + config.name),
"hg.latest": Class.Memoize(function () this.code + "source/browse/"), // XXX
"irc": "irc://irc.oftc.net/#pentadactyl",
"irc": "irc://irc.oftc.net/#pentadactyl"
}),
dtdExtra: {
@@ -494,7 +494,7 @@ var ConfigBase = Class("ConfigBase", {
*/
get outputHeight() this.browser.mPanelContainer.boxObject.height,
tabStrip: Class.Memoize(function () document.getElementById("TabsToolbar") || this.tabbrowser.mTabContainer),
tabStrip: Class.Memoize(function () document.getElementById("TabsToolbar") || this.tabbrowser.mTabContainer)
}),
/**
@@ -620,4 +620,4 @@ endModule();
// catch(e){ if (typeof e === "string") e = Error(e); dump(e.fileName+":"+e.lineNumber+": "+e+"\n" + e.stack); }
// vim: set fdm=marker sw=4 sts=4 et ft=javascript:
// vim: set fdm=marker sw=4 sts=4 ts=8 et ft=javascript:

View File

@@ -819,4 +819,4 @@ endModule();
// catch(e){ if (!e.stack) e = Error(e); dump(e.fileName+":"+e.lineNumber+": "+e+"\n" + e.stack); }
// vim: set fdm=marker sw=4 ts=4 et ft=javascript:
// vim: set fdm=marker sw=4 sts=4 ts=8 et ft=javascript:

View File

@@ -51,3 +51,4 @@ function fromXML(node, doc, nodes) {
}
}
// vim: set fdm=marker sw=4 sts=4 ts=8 et ft=javascript:

View File

@@ -100,7 +100,7 @@ var DOM = Class("DOM", {
href: { get: function (elem) elem.href || elem.getAttribute("href") },
src: { get: function (elem) elem.src || elem.getAttribute("src") },
checked: { get: function (elem) elem.hasAttribute("checked") ? elem.getAttribute("checked") == "true" : elem.checked,
set: function (elem, val) { elem.setAttribute("checked", !!val); elem.checked = val } },
set: function (elem, val) { elem.setAttribute("checked", !!val); elem.checked = val; } },
collapsed: BooleanAttribute("collapsed"),
disabled: BooleanAttribute("disabled"),
hidden: BooleanAttribute("hidden"),
@@ -193,8 +193,8 @@ var DOM = Class("DOM", {
let res = this.Empty();
this.each(function (elem) {
while(true) {
elem = fn.call(this, elem)
while (true) {
elem = fn.call(this, elem);
if (elem instanceof Ci.nsIDOMNode)
res[res.length++] = elem;
else if (elem && "length" in elem)
@@ -272,7 +272,7 @@ var DOM = Class("DOM", {
each: function each(meth, arg) {
return self.each(function (elem) {
elem.classList[meth](arg);
})
});
},
add: function add(cls) this.each("add", cls),
@@ -312,7 +312,7 @@ var DOM = Class("DOM", {
let { highlight } = this;
let v = callable(val) ? val.call(thisObj || this, elem, i) : val;
highlight[(v == null ? highlight.has(hl) : !v) ? "remove" : "add"](hl)
highlight[(v == null ? highlight.has(hl) : !v) ? "remove" : "add"](hl);
}),
}),
@@ -346,7 +346,7 @@ var DOM = Class("DOM", {
get bottom() this.top + this.height,
left: r.left + node.clientLeft,
get right() this.left + this.width
}
};
},
scrollPos: function scrollPos(left, top) {
@@ -578,7 +578,7 @@ var DOM = Class("DOM", {
let res = [];
this.each(function (elem) {
try {
let hasChildren = elem.firstChild && (!/^\s*$/.test(elem.firstChild) || elem.firstChild.nextSibling)
let hasChildren = elem.firstChild && (!/^\s*$/.test(elem.firstChild) || elem.firstChild.nextSibling);
if (color)
res.push(["span", { highlight: "HelpXML" },
["span", { highlight: "HelpXMLTagStart" },
@@ -593,7 +593,7 @@ var DOM = Class("DOM", {
],
!hasChildren ? "" :
["", "...",
["span", { highlight: "HtmlTagEnd" },"<", namespaced(elem), ">"]]
["span", { highlight: "HtmlTagEnd" }, "<", namespaced(elem), ">"]]
]);
else {
let tag = "<" + [namespaced(elem)].concat(
@@ -794,19 +794,19 @@ var DOM = Class("DOM", {
html: function html(txt, self) {
return this.getSet(arguments,
function (elem) elem.innerHTML,
util.wrapCallback(function (elem, val) { elem.innerHTML = val }));
util.wrapCallback(function (elem, val) { elem.innerHTML = val; }));
},
text: function text(txt, self) {
return this.getSet(arguments,
function (elem) elem.textContent,
function (elem, val) { elem.textContent = val });
function (elem, val) { elem.textContent = val; });
},
val: function val(txt) {
return this.getSet(arguments,
function (elem) elem.value,
function (elem, val) { elem.value = val == null ? "" : val });
function (elem, val) { elem.value = val == null ? "" : val; });
},
listen: function listen(event, listener, capture) {
@@ -905,7 +905,7 @@ var DOM = Class("DOM", {
return true;
if (rect.top > viewport.bottom)
return false;
return Math.abs(rect.top) < Math.abs(viewport.bottom - rect.bottom)
return Math.abs(rect.top) < Math.abs(viewport.bottom - rect.bottom);
}
let rect;
@@ -1066,7 +1066,6 @@ var DOM = Class("DOM", {
return this;
},
code_key: Class.Memoize(function (prop) this.init()[prop]),
code_nativeKey: Class.Memoize(function (prop) this.init()[prop]),
keyTable: Class.Memoize(function (prop) this.init()[prop]),
@@ -1334,7 +1333,6 @@ var DOM = Class("DOM", {
return "<" + modifier + key + ">";
},
defaults: {
load: { bubbles: false },
submit: { cancelable: true }
@@ -1616,7 +1614,7 @@ var DOM = Class("DOM", {
else
elem.setAttributeNS(vals[0] || "", key, val);
}
args.forEach(function(e) {
args.forEach(function (e) {
elem.appendChild(tag(e, namespaces));
});
@@ -1630,7 +1628,7 @@ var DOM = Class("DOM", {
else
namespaces = fromJSON.namespaces;
return tag(xml, namespaces)
return tag(xml, namespaces);
}, {
namespaces: {
"": "http://www.w3.org/1999/xhtml",
@@ -1666,13 +1664,13 @@ var DOM = Class("DOM", {
function isFragment(args) !isString(args[0]) || args.length == 0 || args[0] === "";
function hasString(args) {
return args.some(function (a) isString(a) || isFragment(a) && hasString(a))
return args.some(function (a) isString(a) || isFragment(a) && hasString(a));
}
function isStrings(args) {
if (!isArray(args))
return util.dump("ARGS: " + {}.toString.call(args) + " " + args), false;
return args.every(function (a) isinstance(a, ["String", DOM.DOMString]) || isFragment(a) && isStrings(a))
return args.every(function (a) isinstance(a, ["String", DOM.DOMString]) || isFragment(a) && isStrings(a));
}
function tag(args, namespaces, indent) {
@@ -1727,7 +1725,7 @@ var DOM = Class("DOM", {
contents.push(string);
});
if (contents.length)
res.push(contents.join("\n"), join)
res.push(contents.join("\n"), join);
});
if (res[res.length - 1] == join)
res.pop();
@@ -1788,7 +1786,7 @@ var DOM = Class("DOM", {
"</", name, ">");
else {
let contents = [];
args.forEach(function(e) {
args.forEach(function (e) {
let string = tag(e, namespaces, indent + INDENT);
if (string)
contents.push(string);
@@ -1806,7 +1804,7 @@ var DOM = Class("DOM", {
else
namespaces = DOM.fromJSON.namespaces;
return tag(xml, namespaces, "")
return tag(xml, namespaces, "");
},
parseNamespace: function parseNamespace(name, namespaces) {
@@ -1911,4 +1909,4 @@ endModule();
// catch(e){ if (!e.stack) e = Error(e); dump(e.fileName+":"+e.lineNumber+": "+e+"\n" + e.stack); }
// vim: set sw=4 ts=4 et ft=javascript:
// vim: set fdm=marker sw=4 sts=4 ts=8 et ft=javascript:

View File

@@ -419,7 +419,6 @@ var Downloads = Module("downloads", XPCOM(Ci.nsIDownloadProgressListener), {
let file = download.targetFile.path;
let size = download.size;
overlay.modules.forEach(function (modules) {
modules.dactyl.echomsg({ domains: [util.getHost(url)], message: _("io.downloadFinished", title, file) },
1, modules.commandline.ACTIVE_WINDOW);
@@ -516,4 +515,4 @@ endModule();
// catch(e){ if (isString(e)) e = Error(e); dump(e.fileName+":"+e.lineNumber+": "+e+"\n" + e.stack); }
// vim: set fdm=marker sw=4 ts=4 et ft=javascript:
// vim: set fdm=marker sw=4 sts=4 ts=8 et ft=javascript:

View File

@@ -851,4 +851,4 @@ var RangeFind = Class("RangeFind", {
endModule();
// vim: set fdm=marker sw=4 ts=4 et ft=javascript:
// vim: set fdm=marker sw=4 sts=4 ts=8 et ft=javascript:

View File

@@ -131,12 +131,10 @@ var Help = Module("Help", {
let beta = array(betas.iterate(NEWS))
.map(function (m) m[1]).uniq().slice(-1)[0];
function rec(text, level, li) {
let res = [];
let list, space, i = 0;
for (let match in re.iterate(text)) {
if (match.comment)
continue;
@@ -195,7 +193,6 @@ var Help = Module("Help", {
// }
// }
return '<?xml version="1.0"?>\n' +
'<?xml-stylesheet type="text/xsl" href="dactyl://content/help.xsl"?>\n' +
DOM.toXML(["document", { xmlns: "dactyl", name: "versions",
@@ -453,4 +450,4 @@ var Help = Module("Help", {
endModule();
// vim: set fdm=marker sw=4 ts=4 et ft=javascript:
// vim: set fdm=marker sw=4 sts=4 ts=8 et ft=javascript:

View File

@@ -452,4 +452,4 @@ var Highlights = Module("Highlight", {
endModule();
// vim: set fdm=marker sw=4 ts=4 et ft=javascript:
// vim: set fdm=marker sw=4 sts=4 ts=8 et ft=javascript:

View File

@@ -149,7 +149,7 @@ var IO = Module("io", {
let sourceJSM = function sourceJSM() {
context = contexts.Module(uri);
dactyl.triggerObserver("io.source", context, file, file.lastModifiedTime);
}
};
if (/\.jsm$/.test(filename))
sourceJSM();
@@ -675,13 +675,13 @@ var IO = Module("io", {
item.file = file;
}
rtItems.ftdetect.template = // {{{
rtItems.ftdetect.template = //{{{
literal(/*" Vim filetype detection file
<header>
au BufNewFile,BufRead *<name>rc*,*.<fileext> set filetype=<name>
*/);//}}}
rtItems.ftplugin.template = // {{{
rtItems.ftplugin.template = //{{{
literal(/*" Vim filetype plugin file
<header>
@@ -708,7 +708,7 @@ endif
let &cpo = s:cpo_save
unlet s:cpo_save
*/);//}}}
rtItems.syntax.template = // {{{
rtItems.syntax.template = //{{{
literal(/*" Vim syntax file
<header>
@@ -812,7 +812,7 @@ unlet s:cpo_save
return lines.map(function (l) l.join("")).join("\n").replace(/\s+\n/gm, "\n");
}//}}}
let params = { // {{{
let params = { //{{{
header: ['" Language: ' + config.appName + ' configuration file',
'" Maintainer: Doug Kearns <dougkearns@gmail.com>',
'" Version: ' + config.version].join("\n"),
@@ -830,7 +830,7 @@ unlet s:cpo_save
array(o.realNames for (o in options) if (o.type == "boolean"))
.flatten().map(String.quote),
", ") + "]"
}; // }}}
}; //}}}
for (let { file, template } in values(rtItems)) {
try {
@@ -1165,4 +1165,4 @@ endModule();
} catch(e){ if (isString(e)) e = Error(e); dump(e.fileName+":"+e.lineNumber+": "+e+"\n" + e.stack); }
// vim: set fdm=marker sw=4 ts=4 et ft=javascript:
// vim: set fdm=marker sw=4 sts=4 ts=8 et ft=javascript:

View File

@@ -900,4 +900,4 @@ endModule();
} catch(e){ if (!e.stack) e = Error(e); dump(e.fileName+":"+e.lineNumber+": "+e+"\n" + e.stack); }
// vim: set fdm=marker sw=4 ts=4 et ft=javascript:
// vim: set fdm=marker sw=4 sts=4 ts=8 et ft=javascript:

View File

@@ -92,7 +92,6 @@ var Modules = function Modules(window) {
const create = window.Object.create.bind(window.Object);
const BASES = [BASE, "resource://dactyl-local-content/"];
jsmodules = Cu.createObjectIn(window);
@@ -357,4 +356,4 @@ endModule();
} catch(e){ if (!e.stack) e = Error(e); dump(e.fileName+":"+e.lineNumber+": "+e+"\n" + e.stack); }
// vim: set fdm=marker sw=4 ts=4 et ft=javascript:
// vim: set fdm=marker sw=4 sts=4 ts=8 et ft=javascript:

View File

@@ -205,4 +205,4 @@ endModule();
// catch(e){ if (!e.stack) e = Error(e); dump(e.fileName+":"+e.lineNumber+": "+e+"\n" + e.stack); }
// vim: set fdm=marker sw=4 ts=4 et ft=javascript:
// vim: set fdm=marker sw=4 sts=4 ts=8 et ft=javascript:

View File

@@ -258,7 +258,7 @@ var Option = Class("Option", {
return null;
},
// Properties {{{2
// Properties {{{
/** @property {string} The option's canonical name. */
name: null,
@@ -400,7 +400,8 @@ var Option = Class("Option", {
hasChanged: false,
/**
* Returns the timestamp when the option's value was last changed.
* @property {number} Returns the timestamp when the option's value was
* last changed.
*/
get lastSet() options.store.get(this.name).time,
set lastSet(val) { options.store.set(this.name, { value: this.globalValue, time: Date.now() }); },
@@ -411,6 +412,7 @@ var Option = Class("Option", {
*/
setFrom: null
//}}}
}, {
/**
* @property {number} Global option scope.
@@ -1566,4 +1568,4 @@ endModule();
} catch(e){ if (!e.stack) e = Error(e); dump(e.fileName+":"+e.lineNumber+": "+e+"\n" + e.stack); }
// vim: set fdm=marker sw=4 ts=4 et ft=javascript:
// vim: set fdm=marker sw=4 sts=4 ts=8 et ft=javascript:

View File

@@ -20,7 +20,7 @@ var setAttr = function setAttr(elem, ns, name, val) {
elem.removeAttributeNS(ns, name);
else
elem.setAttributeNS(ns, name, val);
}
};
var Overlay = Class("Overlay", {
init: function init(window) {
@@ -42,7 +42,6 @@ var Overlay = Class("Overlay", {
}
});
var Overlay = Module("Overlay", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakReference]), {
init: function init() {
util.addObserver(this);
@@ -234,7 +233,7 @@ var Overlay = Module("Overlay", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakReferen
let iterator = Iterator(obj[key]);
if (isArray(obj[key])) {
iterator = ([elem[1].id, elem.slice(2), elem[1]]
for each (elem in obj[key]))
for each (elem in obj[key]));
}
for (let [elem, xml, attrs] in iterator) {
@@ -381,7 +380,7 @@ var Overlay = Module("Overlay", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakReferen
Object.defineProperty(object, k, desc);
if (callable(value)) {
var sentinel = "(function DactylOverlay() {}())"
var sentinel = "(function DactylOverlay() {}())";
value.toString = function toString() toString.toString.call(this).replace(/\}?$/, sentinel + "; $&");
value.toSource = function toSource() toSource.toSource.call(this).replace(/\}?$/, sentinel + "; $&");
}
@@ -432,4 +431,4 @@ endModule();
} catch(e){ if (!e.stack) e = Error(e); dump(e.fileName+":"+e.lineNumber+": "+e+"\n" + e.stack); }
// vim: set fdm=marker sw=4 ts=4 et ft=javascript:
// vim: set fdm=marker sw=4 sts=4 ts=8 et ft=javascript:

View File

@@ -439,4 +439,4 @@ endModule();
} catch(e){ if (!e.stack) e = Error(e); dump(e.fileName+":"+e.lineNumber+": "+e+"\n" + e.stack); }
// vim: set fdm=marker sw=4 ts=4 et ft=javascript:
// vim: set fdm=marker sw=4 sts=4 ts=8 et ft=javascript:

View File

@@ -44,9 +44,9 @@ function NetError(orig, error) {
originalURI: orig,
asyncOpen: function () { throw error || Cr.NS_ERROR_FILE_NOT_FOUND },
asyncOpen: function () { throw error || Cr.NS_ERROR_FILE_NOT_FOUND; },
open: function () { throw error || Cr.NS_ERROR_FILE_NOT_FOUND }
open: function () { throw error || Cr.NS_ERROR_FILE_NOT_FOUND; }
}).data.QueryInterface(Ci.nsIChannel);
}
function RedirectChannel(to, orig, time, message) {
@@ -72,7 +72,7 @@ function Protocol(scheme, classID, contentBase) {
contentBase: contentBase,
_xpcom_factory: JSMLoader.Factory(Protocol),
_xpcom_factory: JSMLoader.Factory(Protocol)
};
return Protocol;
}
@@ -259,4 +259,4 @@ XMLChannel.prototype = {
endModule();
// vim: set fdm=marker sw=4 ts=4 et ft=javascript:
// vim: set fdm=marker sw=4 sts=4 ts=8 et ft=javascript:

View File

@@ -200,7 +200,7 @@ var Sanitizer = Module("sanitizer", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakRef
template.map(util.range(0, Math.ceil(items.length / 2)), function (i)
["row", {},
template.map(items.slice(i * 2, i * 2 + 2), function (item)
["checkbox", { xmlns: XUL, label: item.description, preference: branch + item.name }])])]]],
["checkbox", { xmlns: XUL, label: item.description, preference: branch + item.name }])])]]]
}
}));
}
@@ -214,7 +214,7 @@ var Sanitizer = Module("sanitizer", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakRef
template.map(ourItems(), function ([item, desc])
["listitem", { xmlns: "xul", preference: branch + item,
type: "checkbox", label: config.appName + ", " + desc,
onsyncfrompreference: "return gSanitizePromptDialog.onReadGeneric();" }]),
onsyncfrompreference: "return gSanitizePromptDialog.onReadGeneric();" }])
]
},
ready: function ready(win) {
@@ -507,7 +507,7 @@ var Sanitizer = Module("sanitizer", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakRef
description: "Timespan for which to sanitize items",
completer: function (context) modules.options.get("sanitizetimespan").completer(context),
type: modules.CommandOption.STRING,
validator: function (arg) modules.options.get("sanitizetimespan").validator(arg),
validator: function (arg) modules.options.get("sanitizetimespan").validator(arg)
}
],
privateData: true
@@ -730,4 +730,4 @@ endModule();
// catch(e){dump(e.fileName+":"+e.lineNumber+": "+e+"\n" + e.stack);}
// vim: set fdm=marker sw=4 ts=4 et ft=javascript:
// vim: set fdm=marker sw=4 sts=4 ts=8 et ft=javascript:

View File

@@ -47,7 +47,7 @@ var Services = Module("Services", {
this.add("downloadManager", "@mozilla.org/download-manager;1", "nsIDownloadManager");
this.add("environment", "@mozilla.org/process/environment;1", "nsIEnvironment");
this.add("extensionManager", "@mozilla.org/extensions/manager;1", "nsIExtensionManager");
this.add("externalApp", "@mozilla.org/uriloader/external-helper-app-service;1", "nsPIExternalAppLauncher")
this.add("externalApp", "@mozilla.org/uriloader/external-helper-app-service;1", "nsPIExternalAppLauncher");
this.add("externalProtocol", "@mozilla.org/uriloader/external-protocol-service;1", "nsIExternalProtocolService");
this.add("favicon", "@mozilla.org/browser/favicon-service;1", "nsIFaviconService");
this.add("file:", this.PROTOCOL + "file", "nsIFileProtocolHandler");
@@ -99,7 +99,7 @@ var Services = Module("Services", {
this.addClass("Persist", "@mozilla.org/embedding/browser/nsWebBrowserPersist;1", "nsIWebBrowserPersist");
this.addClass("Pipe", "@mozilla.org/pipe;1", "nsIPipe", "init");
this.addClass("Process", "@mozilla.org/process/util;1", "nsIProcess", "init");
this.addClass("Pump", "@mozilla.org/network/input-stream-pump;1", "nsIInputStreamPump", "init")
this.addClass("Pump", "@mozilla.org/network/input-stream-pump;1", "nsIInputStreamPump", "init");
this.addClass("StreamChannel","@mozilla.org/network/input-stream-channel;1",
["nsIInputStreamChannel", "nsIChannel"], "setURI");
this.addClass("StreamCopier", "@mozilla.org/network/async-stream-copier;1","nsIAsyncStreamCopier", "init");
@@ -214,4 +214,4 @@ endModule();
} catch(e){dump(e.fileName+":"+e.lineNumber+": "+e+"\n" + e.stack);}
// vim: set fdm=marker sw=4 sts=4 et ft=javascript:
// vim: set fdm=marker sw=4 sts=4 ts=8 et ft=javascript:

View File

@@ -162,7 +162,7 @@ var ObjectStore = Class("ObjectStore", StoreBase, {
}
});
var sessionGlobal = Cu.import("resource://gre/modules/Services.jsm", {})
var sessionGlobal = Cu.import("resource://gre/modules/Services.jsm", {});
var Storage = Module("Storage", {
Local: function Local(dactyl, modules, window) ({
@@ -762,7 +762,6 @@ var File = Class("File", {
}
},
isAbsolutePath: function isAbsolutePath(path) {
try {
services.File().initWithPath(path);
@@ -793,7 +792,7 @@ let (file = services.directory.get("ProfD", Ci.nsIFile)) {
if (!(prop in File.prototype)) {
let isFunction;
try {
isFunction = callable(file[prop])
isFunction = callable(file[prop]);
}
catch (e) {}
@@ -814,4 +813,4 @@ endModule();
// catch(e){ dump(e + "\n" + (e.stack || Error().stack)); Components.utils.reportError(e) }
// vim: set fdm=marker sw=4 sts=4 et ft=javascript:
// vim: set fdm=marker sw=4 sts=4 ts=8 et ft=javascript:

View File

@@ -29,7 +29,7 @@ Sheet.liveProperty = function (name) {
this[i] = val;
this.enabled = this.enabled;
});
}
};
Sheet.liveProperty("agent");
Sheet.liveProperty("css");
Sheet.liveProperty("sites");
@@ -763,9 +763,9 @@ var Styles = Module("Styles", {
]);
}),
match.postSpace
]
})
}
];
});
};
}
});
@@ -773,4 +773,4 @@ endModule();
// catch(e){dump(e.fileName+":"+e.lineNumber+": "+e+"\n" + e.stack);}
// vim: set fdm=marker sw=4 ts=4 et ft=javascript:
// vim: set fdm=marker sw=4 sts=4 ts=8 et ft=javascript:

View File

@@ -168,7 +168,6 @@ var Template = Module("Template", {
return res;
},
bookmarkDescription: function (item, text) [
!(item.extra && item.extra.length) ? [] :
["span", { highlight: "URLExtra" },
@@ -264,7 +263,6 @@ var Template = Module("Template", {
})(), this[help ? "HelpLink" : "helpLink"]);
},
// Fixes some strange stack rewinds on NS_ERROR_OUT_OF_MEMORY
// exceptions that we can't catch.
stringify: function stringify(arg) {
@@ -417,7 +415,6 @@ var Template = Module("Template", {
util.losslessDecodeURI(val.URI.spec)]]])];
},
options: function options(title, opts, verbose) {
return ["table", {},
["tr", { highlight: "Title", align: "left" },
@@ -505,10 +502,10 @@ var Template = Module("Template", {
_("io.definedAt"), " ",
sourceLink(frame)]]]],
item.columns ? self.map(item.columns, function (c) ["td", {}, c]) : [],
["td", {}, desc(item)]])]]
["td", {}, desc(item)]])]];
}
});
endModule();
// vim: set fdm=marker sw=4 ts=4 et ft=javascript:
// vim: set fdm=marker sw=4 sts=4 ts=8 et ft=javascript:

View File

@@ -467,7 +467,7 @@ var Util = Module("Util", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakReference]),
acc.push(vals);
if (acc.length == pattern.length)
this.res.push(acc.join(""))
this.res.push(acc.join(""));
else
for (let val in values(vals))
this.rec(acc.concat(val));
@@ -492,7 +492,7 @@ var Util = Module("Util", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakReference]),
}
res.push(pattern.substr(end));
return res.map(function (s) util.dequote(s, dequote));
}
};
let patterns = [];
let substrings = split(pattern, /((?:[^\\{]|\\.)*)\{((?:[^\\}]|\\.)*)\}/gy,
@@ -507,7 +507,7 @@ var Util = Module("Util", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakReference]),
else
for (let [, pattern] in Iterator(patterns[acc.length]))
rec(acc.concat(pattern));
}
};
rec([]);
return res;
}
@@ -659,7 +659,7 @@ var Util = Module("Util", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakReference]),
[hours, minutes] = div(minutes, 60);
[days, hours] = div(hours, 24);
if (days)
return /*L*/days + " days " + hours + " hours"
return /*L*/days + " days " + hours + " hours";
if (hours)
return /*L*/hours + "h " + minutes + "m";
if (minutes)
@@ -755,11 +755,10 @@ var Util = Module("Util", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakReference]),
let async = params.callback || params.onload || params.onerror;
if (async) {
xmlhttp.addEventListener("load", function handler(event) { util.trapErrors(params.onload || params.callback, params, xmlhttp, event) }, false);
xmlhttp.addEventListener("error", function handler(event) { util.trapErrors(params.onerror || params.callback, params, xmlhttp, event) }, false);
xmlhttp.addEventListener("load", function handler(event) { util.trapErrors(params.onload || params.callback, params, xmlhttp, event); }, false);
xmlhttp.addEventListener("error", function handler(event) { util.trapErrors(params.onerror || params.callback, params, xmlhttp, event); }, false);
}
if (isObject(params.params)) {
let data = [encodeURIComponent(k) + "=" + encodeURIComponent(v)
for ([k, v] in iter(params.params))];
@@ -882,7 +881,7 @@ var Util = Module("Util", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakReference]),
let (viewer = docShells.getNext().QueryInterface(Ci.nsIDocShell).contentViewer) {
if (viewer)
yield viewer.DOMDocument;
}
};
}
}
},
@@ -1017,7 +1016,7 @@ var Util = Module("Util", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakReference]),
}
let keyIter = object;
if ("__iterator__" in object && !callable(object.__iterator__))
keyIter = keys(object)
keyIter = keys(object);
for (let i in keyIter) {
let value = Magic("<no value>");
@@ -1097,28 +1096,28 @@ var Util = Module("Util", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakReference]),
if (data.length == 0)
res.push("[]");
else {
res.push("[\n")
res.push("[\n");
for (let [i, val] in Iterator(data)) {
if (i)
res.push(",\n");
res.push(prefix)
res.push(prefix);
rec(val, prefix, seen);
}
res.push("\n", level, "]");
}
}
else if (isObject(data)) {
res.push("{\n")
res.push("{\n");
let i = 0;
for (let [key, val] in Iterator(data)) {
if (i++)
res.push(",\n");
res.push(prefix, JSON.stringify(key), ": ")
res.push(prefix, JSON.stringify(key), ": ");
rec(val, prefix, seen);
}
if (i > 0)
res.push("\n", level, "}")
res.push("\n", level, "}");
else
res[res.length - 1] = "{}";
}
@@ -1721,7 +1720,6 @@ var Util = Module("Util", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakReference]),
Array: array
});
/**
* Math utility methods.
* @singleton
@@ -1743,4 +1741,4 @@ endModule();
} catch(e){ if (!e.stack) e = Error(e); dump(e.fileName+":"+e.lineNumber+": "+e+"\n" + e.stack); }
// vim: set fdm=marker sw=4 ts=4 et ft=javascript:
// vim: set fdm=marker sw=4 sts=4 ts=8 et ft=javascript: