1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-04-27 23:53:30 +02: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
+1 -1
View File
@@ -103,7 +103,7 @@ let JSMLoader = {
return resourceProto.resolveURI(uri);
let chan = Services.io.newChannelFromURI(uri);
try { chan.cancel(Cr.NS_BINDING_ABORTED) } catch (e) {}
try { chan.cancel(Cr.NS_BINDING_ABORTED); } catch (e) {}
return chan.name;
},
+1 -1
View File
@@ -91,4 +91,4 @@ else
var NSGetModule = XPCOMUtils.generateNSGetModule([CommandLineHandler]);
var EXPORTED_SYMBOLS = ["NSGetFactory", "global"];
// vim: set fdm=marker sw=4 ts=4 et:
// vim: set fdm=marker sw=4 sts=4 ts=8 et:
+1 -1
View File
@@ -380,4 +380,4 @@ var Abbreviations = Module("abbreviations", {
}
});
// vim: set fdm=marker sw=4 ts=4 et:
// vim: set fdm=marker sw=4 sts=4 ts=8 et:
+2 -2
View File
@@ -122,7 +122,7 @@ var AutoCommands = Module("autocommands", {
["td", {}, item.filter.toJSONXML ? item.filter.toJSONXML(modules) : String(item.filter)],
["td", {}, String(item.command)]]),
["tr", { style: "height: .5ex;" }]]).toArray(),
["tr", { style: "height: .5ex;" }],
["tr", { style: "height: .5ex;" }]
])]);
commandline.commandOutput(table);
},
@@ -296,4 +296,4 @@ var AutoCommands = Module("autocommands", {
}
});
// vim: set fdm=marker sw=4 ts=4 et:
// vim: set fdm=marker sw=4 sts=4 ts=8 et:
+1 -1
View File
@@ -730,4 +730,4 @@ var Bookmarks = Module("bookmarks", {
}
});
// vim: set fdm=marker sw=4 ts=4 et:
// vim: set fdm=marker sw=4 sts=4 ts=8 et:
+2 -2
View File
@@ -222,7 +222,7 @@ var Browser = Module("browser", XPCOM(Ci.nsISupportsWeakReference, ModuleBase),
if (dactyl.forceTarget in openModes)
mode = openModes[dactyl.forceTarget];
CommandExMode().open(mode + "open " + (args || ""))
CommandExMode().open(mode + "open " + (args || ""));
}
function decode(uri) util.losslessDecodeURI(uri)
@@ -282,4 +282,4 @@ var Browser = Module("browser", XPCOM(Ci.nsISupportsWeakReference, ModuleBase),
}
});
// vim: set fdm=marker sw=4 ts=4 et:
// vim: set fdm=marker sw=4 sts=4 ts=8 et:
+8 -8
View File
@@ -54,7 +54,7 @@ var CommandWidgets = Class("CommandWidgets", {
["vbox", { id: "dactyl-completions-" + s + "commandline-container", class: "dactyl-container", hidden: "false", collapsed: "true" },
["iframe", { class: "dactyl-completions", id: "dactyl-completions-" + s + "commandline", src: "dactyl://content/buffer.xhtml",
contextmenu: "dactyl-contextmenu", flex: "1", hidden: "false", collapsed: "false", highlight: "Events",
events: "mowEvents" }]]]],
events: "mowEvents" }]]]]
});
this.elements = {};
@@ -634,7 +634,7 @@ var CommandLine = Module("commandline", {
node.completionList = ItemList(elem);
node.completionList.isAboveMow = node.id ==
this.widgets.statusbar.commandline.id
this.widgets.statusbar.commandline.id;
}
return node.completionList;
},
@@ -741,7 +741,7 @@ var CommandLine = Module("commandline", {
if (val)
this.widgets["message-pre"] = _("commandline.moreMessages", val) + " ";
else
this.widgets["message-pre"] = null
this.widgets["message-pre"] = null;
},
_lastEcho: null,
@@ -1013,7 +1013,7 @@ var CommandLine = Module("commandline", {
this.store = this.store.filter(function (line) (line.value || line) != str);
dactyl.trapErrors(function () {
this.store.push({ value: str, timestamp: Date.now()*1000, privateData: privateData });
this.store.push({ value: str, timestamp: Date.now() * 1000, privateData: privateData });
}, this);
this.store = this.store.slice(Math.max(0, this.store.length - options["history"]));
},
@@ -1768,7 +1768,7 @@ var CommandLine = Module("commandline", {
});
let bind = function bind()
mappings.add.apply(mappings, [[modes.COMMAND_LINE]].concat(Array.slice(arguments)))
mappings.add.apply(mappings, [[modes.COMMAND_LINE]].concat(Array.slice(arguments)));
bind(["<Esc>", "<C-[>"], "Stop waiting for completions or exit Command Line mode",
function ({ self }) {
@@ -2030,7 +2030,7 @@ var ItemList = Class("ItemList", {
if (start < 0 || start >= this.itemCount)
return null;
group = array.nth(groups, function (g) let (i = start - g.offsets.start) i >= 0 && i < g.itemCount, 0)
group = array.nth(groups, function (g) let (i = start - g.offsets.start) i >= 0 && i < g.itemCount, 0);
return [group.context, start - group.offsets.start];
},
@@ -2342,7 +2342,7 @@ var ItemList = Class("ItemList", {
container.scrollTop = scroll;
if (scrollY != null)
win.scrollTo(0, Math.max(scrollY, 0));
}
};
},
/**
@@ -2455,4 +2455,4 @@ var ItemList = Class("ItemList", {
})
});
// vim: set fdm=marker sw=4 ts=4 et:
// vim: set fdm=marker sw=4 sts=4 ts=8 et:
+5 -6
View File
@@ -83,7 +83,6 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), {
}
},
observers: {
"dactyl-cleanup": function dactyl_cleanup(subject, reason) {
let modules = dactyl.modules;
@@ -682,7 +681,7 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), {
tag = function (map) [
let (c = obj.modes[0].char) c ? c + "_" : "",
map
]
];
link = function (map) {
let [, mode, name, extra] = /^(?:(.)_)?(?:<([^>]+)>)?(.*)$/.exec(map);
let k = ["k", {}, extra];
@@ -710,7 +709,7 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), {
let description = ["description", {},
obj.description ? ["p", {}, template.linkifyHelp(obj.description.replace(/\.?$/, "."), true)] : "",
extraHelp ? extraHelp : "",
!(extraHelp || obj.description) ? ["p", {}, /*L*/ "Sorry, no help available."] : ""]
!(extraHelp || obj.description) ? ["p", {}, /*L*/ "Sorry, no help available."] : ""];
res.push(
["item", {},
@@ -1200,7 +1199,7 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), {
dactyl.reportError(e, true);
}
});
}
};
},
/**
@@ -1829,7 +1828,7 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), {
commandline.commandOutput([
["div", {}, [config.appName, " ", config.version, date, " running on: "].join("")],
["div", {}, [window.navigator.userAgent].join("")]
])
]);
}
}, {
argCount: "0",
@@ -2003,4 +2002,4 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), {
}
});
// vim: set fdm=marker sw=4 ts=4 et:
// vim: set fdm=marker sw=4 sts=4 ts=8 et:
+1 -1
View File
@@ -73,4 +73,4 @@ function chromeDocuments() {
var EXPORTED_SYMBOLS = ["cleanup", "init"];
// vim: set fdm=marker sw=4 ts=4 et ft=javascript:
// vim: set fdm=marker sw=4 sts=4 ts=8 et ft=javascript:
+5 -6
View File
@@ -870,7 +870,7 @@ var Editor = Module("editor", XPCOM(Ci.nsIEditActionListener, ModuleBase), {
function addBeginInsertModeMap(keys, commands, description) {
mappings.add([modes.TEXT_EDIT], keys, description || "",
function () {
commands.forEach(function (cmd) { editor.executeCommand(cmd, 1) });
commands.forEach(function (cmd) { editor.executeCommand(cmd, 1); });
modes.push(modes.INSERT);
},
{ type: "editor" });
@@ -1148,13 +1148,12 @@ var Editor = Module("editor", XPCOM(Ci.nsIEditActionListener, ModuleBase), {
mappings.add([modes.TEXT_EDIT], names, description,
action, update({ type: "editor" }, params));
bind(["<C-a>"], "Increment the next number",
function ({ count }) { editor.modifyNumber(count || 1) },
function ({ count }) { editor.modifyNumber(count || 1); },
{ count: true });
bind(["<C-x>"], "Decrement the next number",
function ({ count }) { editor.modifyNumber(-(count || 1)) },
function ({ count }) { editor.modifyNumber(-(count || 1)); },
{ count: true });
// text edit mode
@@ -1326,7 +1325,7 @@ var Editor = Module("editor", XPCOM(Ci.nsIEditActionListener, ModuleBase), {
{ count: true });
let bind = function bind() mappings.add.apply(mappings,
[[modes.AUTOCOMPLETE]].concat(Array.slice(arguments)))
[[modes.AUTOCOMPLETE]].concat(Array.slice(arguments)));
bind(["<Esc>"], "Return to Insert mode",
function () Events.PASS_THROUGH);
@@ -1407,4 +1406,4 @@ var Editor = Module("editor", XPCOM(Ci.nsIEditActionListener, ModuleBase), {
}
});
// vim: set fdm=marker sw=4 ts=4 et:
// vim: set fdm=marker sw=4 sts=4 ts=8 et:
+1 -1
View File
@@ -9,4 +9,4 @@ catch (e) { __dactyl_eval_error = e; }
// This work is licensed for reuse under an MIT license. Details are
// given in the LICENSE.txt file included with this file.
// vim: set fdm=marker sw=4 ts=4 et:
// vim: set fdm=marker sw=4 sts=4 ts=8 et:
+2 -2
View File
@@ -970,7 +970,7 @@ var Events = Module("events", {
return DOM(elem).isEditable ||
isinstance(elem, [Ci.nsIDOMHTMLEmbedElement,
Ci.nsIDOMHTMLObjectElement,
Ci.nsIDOMHTMLSelectElement])
Ci.nsIDOMHTMLSelectElement]);
},
kill: function kill(event) {
@@ -1172,4 +1172,4 @@ var Events = Module("events", {
}
});
// vim: set fdm=marker sw=4 ts=4 et:
// vim: set fdm=marker sw=4 sts=4 ts=8 et:
+1 -1
View File
@@ -24,4 +24,4 @@ function checkFragment() {
document.addEventListener("load", checkFragment, true);
document.addEventListener("hashChange", checkFragment, true);
// vim: set fdm=marker sw=4 ts=4 et:
// vim: set fdm=marker sw=4 sts=4 ts=8 et:
+2 -2
View File
@@ -1352,7 +1352,7 @@ var Hints = Module("hints", {
{
values: {
"0": "Follow the first hint as soon as typed text uniquely identifies it. Follow the selected hint on <Return>.",
"1": "Follow the selected hint on <Return>.",
"1": "Follow the selected hint on <Return>."
}
});
@@ -1389,4 +1389,4 @@ var Hints = Module("hints", {
}
});
// vim: set fdm=marker sw=4 ts=4 et:
// vim: set fdm=marker sw=4 sts=4 ts=8 et:
+5 -5
View File
@@ -61,12 +61,12 @@ var History = Module("history", {
},
get session() {
let webNav = window.getWebNavigation()
let webNav = window.getWebNavigation();
let sh = webNav.sessionHistory;
let obj = [];
obj.__defineGetter__("index", function () sh.index);
obj.__defineSetter__("index", function (val) { webNav.gotoIndex(val) });
obj.__defineSetter__("index", function (val) { webNav.gotoIndex(val); });
obj.__iterator__ = function () array.iterItems(this);
for (let item in iter(sh.SHistoryEnumerator, Ci.nsIHistoryEntry))
@@ -371,13 +371,13 @@ var History = Module("history", {
{ count: true });
bind(["[d"], "Go back to the previous domain in the browser history",
function ({ count }) { history.search("domain", -Math.max(count, 1)) },
function ({ count }) { history.search("domain", -Math.max(count, 1)); },
{ count: true });
bind(["]d"], "Go forward to the next domain in the browser history",
function ({ count }) { history.search("domain", Math.max(count, 1)) },
function ({ count }) { history.search("domain", Math.max(count, 1)); },
{ count: true });
}
});
// vim: set fdm=marker sw=4 ts=4 et:
// vim: set fdm=marker sw=4 sts=4 ts=8 et:
+1
View File
@@ -322,3 +322,4 @@ var KeyArgProcessor = Class("KeyArgProcessor", KeyProcessor, {
}
});
// vim: set fdm=marker sw=4 sts=4 ts=8 et:
+4 -4
View File
@@ -496,7 +496,7 @@ var Mappings = Module("mappings", {
["td", {}, modeSign],
["td", {}, name],
["td", {}, map.rhs || map.action.toSource()]])),
["tr", { style: "height: .5ex;" }]])]
["tr", { style: "height: .5ex;" }]])];
// E4X-FIXME
// // TODO: Move this to an ItemList to show this automatically
@@ -572,7 +572,7 @@ var Mappings = Module("mappings", {
options: [
{
names: ["-arg", "-a"],
description: "Accept an argument after the requisite key press",
description: "Accept an argument after the requisite key press"
},
{
names: ["-builtin", "-b"],
@@ -828,8 +828,8 @@ var Mappings = Module("mappings", {
mappings: function initMappings(dactyl, modules, window) {
mappings.add([modes.COMMAND],
["\\"], "Emits <Leader> pseudo-key",
function () { events.feedkeys("<Leader>") });
function () { events.feedkeys("<Leader>"); });
}
});
// vim: set fdm=marker sw=4 ts=4 et:
// vim: set fdm=marker sw=4 sts=4 ts=8 et:
+2 -3
View File
@@ -233,7 +233,7 @@ var Marks = Module("marks", {
_scrollTo: function _scrollTo(mark) {
if (!mark.path)
var node = buffer.findScrollable(0, (mark.offset || mark.position).x)
var node = buffer.findScrollable(0, (mark.offset || mark.position).x);
else
for (node in DOM.XPath(mark.path, buffer.focusedFrame.document))
break;
@@ -303,7 +303,6 @@ var Marks = Module("marks", {
Math.round(mark.position.y * 100) + "%)",
(tab && "tab: " + tabs.index(tab))
].filter(util.identity).join(", ");
},
isLocalMark: bind("test", /^[a-z`']$/),
@@ -408,4 +407,4 @@ var Marks = Module("marks", {
}
});
// vim: set fdm=marker sw=4 ts=4 et:
// vim: set fdm=marker sw=4 sts=4 ts=8 et:
+3 -3
View File
@@ -606,7 +606,7 @@ var Modes = Module("modes", {
},
setter: function (vals) {
modes.all.forEach(function (m) { delete m.passUnknown });
modes.all.forEach(function (m) { delete m.passUnknown; });
vals = vals.map(function (v) update(new String(v.toLowerCase()), {
mode: v.replace(/^!/, "").toUpperCase(),
@@ -634,8 +634,8 @@ var Modes = Module("modes", {
},
prefs: function initPrefs() {
prefs.watch("accessibility.browsewithcaret",
function () { modes.onCaretChange.apply(modes, arguments) });
function () { modes.onCaretChange.apply(modes, arguments); });
}
});
// vim: set fdm=marker sw=4 ts=4 et:
// vim: set fdm=marker sw=4 sts=4 ts=8 et:
+1 -1
View File
@@ -399,4 +399,4 @@ var MOW = Module("mow", {
}
});
// vim: set fdm=marker sw=4 ts=4 et:
// vim: set fdm=marker sw=4 sts=4 ts=8 et:
+1 -1
View File
@@ -204,4 +204,4 @@ var QuickMarks = Module("quickmarks", {
}
});
// vim: set fdm=marker sw=4 ts=4 et:
// vim: set fdm=marker sw=4 sts=4 ts=8 et:
+2 -2
View File
@@ -269,7 +269,7 @@ var StatusLine = Module("statusline", {
});
},
updateUrl: deprecated("statusline.status", function updateUrl(url) { this.status = url || buffer.uri }),
updateUrl: deprecated("statusline.status", function updateUrl(url) { this.status = url || buffer.uri; }),
/**
* Set the contents of the status line's input buffer to the given
@@ -393,4 +393,4 @@ var StatusLine = Module("statusline", {
}
});
// vim: set fdm=marker sw=4 ts=4 et:
// vim: set fdm=marker sw=4 sts=4 ts=8 et:
+2 -3
View File
@@ -237,7 +237,7 @@ var Tabs = Module("tabs", {
return this._groups;
if (func)
func = bind(function (func) { func(this._groups) }, this, func);
func = bind(function (func) { func(this._groups); }, this, func);
if (window.TabView && window.TabView._initFrame)
window.TabView._initFrame(func);
@@ -335,7 +335,6 @@ var Tabs = Module("tabs", {
completion.listCompleter("buffer", filter);
},
/**
* Return an iterator of tabs matching the given filter. If no
* *filter* or *count* is provided, returns the currently selected
@@ -1312,4 +1311,4 @@ var Tabs = Module("tabs", {
}
});
// vim: set fdm=marker sw=4 ts=4 et:
// vim: set fdm=marker sw=4 sts=4 ts=8 et:
+4 -4
View File
@@ -40,10 +40,10 @@
</p>
<p>
If the <em>-group</em>=<a>group</a> flag is given, add this autocmd
to the named <t>group</t>. Any filters for <a>group</a> apply in
addition to <oa>filter</oa>. When listing commands this limits the
output to the specified group.
If the <em>-group</em>=<a>group</a> flag is given, add this
autocommand to the named <t>group</t>. Any filters for <a>group</a>
apply in addition to <oa>filter</oa>. When listing commands this
limits the output to the specified group.
</p>
<p>Available <oa>events</oa>:</p>
+4 -4
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:
+5 -5
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:
+1 -1
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:
+1
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:
+9 -9
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:
+2 -2
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:
+5 -5
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:
+3 -3
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:
+4 -4
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:
+1 -1
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:
+1
View File
@@ -51,3 +51,4 @@ function fromXML(node, doc, nodes) {
}
}
// vim: set fdm=marker sw=4 sts=4 ts=8 et ft=javascript:
+20 -22
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:
+1 -2
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:
+1 -1
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:
+1 -4
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:
+1 -1
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:
+7 -7
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:
+1 -1
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:
+1 -2
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:
+1 -1
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:
+5 -3
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:
+4 -5
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:
+1 -1
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:
+4 -4
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:
+4 -4
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:
+3 -3
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:
+3 -4
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:
+5 -5
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:
+2 -5
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:
+14 -16
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:
+1 -1
View File
@@ -324,4 +324,4 @@ const Config = Module("config", ConfigBase, {
}
});
// vim: set fdm=marker sw=4 ts=4 et:
// vim: set fdm=marker sw=4 sts=4 ts=8 et:
+1 -1
View File
@@ -61,4 +61,4 @@ const Library = Module("library", {
}, {
});
// vim: set fdm=marker sw=4 ts=4 et:
// vim: set fdm=marker sw=4 sts=4 ts=8 et:
+1 -1
View File
@@ -830,4 +830,4 @@ const Player = Module("player", {
}
});
// vim: set fdm=marker sw=4 ts=4 et:
// vim: set fdm=marker sw=4 sts=4 ts=8 et:
+1 -1
View File
@@ -252,4 +252,4 @@ var Config = Module("config", ConfigBase, {
}
});
// vim: set fdm=marker sw=4 ts=4 et:
// vim: set fdm=marker sw=4 sts=4 ts=8 et:
+1 -1
View File
@@ -152,4 +152,4 @@ var Addressbook = Module("addressbook", {
}
});
// vim: set fdm=marker sw=4 ts=4 et:
// vim: set fdm=marker sw=4 sts=4 ts=8 et:
+1 -1
View File
@@ -80,4 +80,4 @@ var Compose = Module("compose", {
}
});
// vim: set fdm=marker sw=4 ts=4 et:
// vim: set fdm=marker sw=4 sts=4 ts=8 et:
+1 -1
View File
@@ -165,4 +165,4 @@ var Config = Module("config", ConfigBase, {
}
});
// vim: set fdm=marker sw=4 ts=4 et:
// vim: set fdm=marker sw=4 sts=4 ts=8 et:
+1 -1
View File
@@ -930,4 +930,4 @@ var Mail = Module("mail", {
}
});
// vim: set fdm=marker sw=4 ts=4 et:
// vim: set fdm=marker sw=4 sts=4 ts=8 et: