mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2026-04-28 06:33:30 +02:00
Add missing semicolons, fix whitespace and normalise Vim modelines.
This commit is contained in:
Vendored
+1
-1
@@ -103,7 +103,7 @@ let JSMLoader = {
|
|||||||
return resourceProto.resolveURI(uri);
|
return resourceProto.resolveURI(uri);
|
||||||
|
|
||||||
let chan = Services.io.newChannelFromURI(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;
|
return chan.name;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
@@ -91,4 +91,4 @@ else
|
|||||||
var NSGetModule = XPCOMUtils.generateNSGetModule([CommandLineHandler]);
|
var NSGetModule = XPCOMUtils.generateNSGetModule([CommandLineHandler]);
|
||||||
var EXPORTED_SYMBOLS = ["NSGetFactory", "global"];
|
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:
|
||||||
|
|||||||
@@ -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:
|
||||||
|
|||||||
@@ -122,7 +122,7 @@ var AutoCommands = Module("autocommands", {
|
|||||||
["td", {}, item.filter.toJSONXML ? item.filter.toJSONXML(modules) : String(item.filter)],
|
["td", {}, item.filter.toJSONXML ? item.filter.toJSONXML(modules) : String(item.filter)],
|
||||||
["td", {}, String(item.command)]]),
|
["td", {}, String(item.command)]]),
|
||||||
["tr", { style: "height: .5ex;" }]]).toArray(),
|
["tr", { style: "height: .5ex;" }]]).toArray(),
|
||||||
["tr", { style: "height: .5ex;" }],
|
["tr", { style: "height: .5ex;" }]
|
||||||
])]);
|
])]);
|
||||||
commandline.commandOutput(table);
|
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:
|
||||||
|
|||||||
@@ -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:
|
||||||
|
|||||||
@@ -222,7 +222,7 @@ var Browser = Module("browser", XPCOM(Ci.nsISupportsWeakReference, ModuleBase),
|
|||||||
if (dactyl.forceTarget in openModes)
|
if (dactyl.forceTarget in openModes)
|
||||||
mode = openModes[dactyl.forceTarget];
|
mode = openModes[dactyl.forceTarget];
|
||||||
|
|
||||||
CommandExMode().open(mode + "open " + (args || ""))
|
CommandExMode().open(mode + "open " + (args || ""));
|
||||||
}
|
}
|
||||||
|
|
||||||
function decode(uri) util.losslessDecodeURI(uri)
|
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:
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ var CommandWidgets = Class("CommandWidgets", {
|
|||||||
["vbox", { id: "dactyl-completions-" + s + "commandline-container", class: "dactyl-container", hidden: "false", collapsed: "true" },
|
["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",
|
["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",
|
contextmenu: "dactyl-contextmenu", flex: "1", hidden: "false", collapsed: "false", highlight: "Events",
|
||||||
events: "mowEvents" }]]]],
|
events: "mowEvents" }]]]]
|
||||||
});
|
});
|
||||||
|
|
||||||
this.elements = {};
|
this.elements = {};
|
||||||
@@ -634,7 +634,7 @@ var CommandLine = Module("commandline", {
|
|||||||
|
|
||||||
node.completionList = ItemList(elem);
|
node.completionList = ItemList(elem);
|
||||||
node.completionList.isAboveMow = node.id ==
|
node.completionList.isAboveMow = node.id ==
|
||||||
this.widgets.statusbar.commandline.id
|
this.widgets.statusbar.commandline.id;
|
||||||
}
|
}
|
||||||
return node.completionList;
|
return node.completionList;
|
||||||
},
|
},
|
||||||
@@ -741,7 +741,7 @@ var CommandLine = Module("commandline", {
|
|||||||
if (val)
|
if (val)
|
||||||
this.widgets["message-pre"] = _("commandline.moreMessages", val) + " ";
|
this.widgets["message-pre"] = _("commandline.moreMessages", val) + " ";
|
||||||
else
|
else
|
||||||
this.widgets["message-pre"] = null
|
this.widgets["message-pre"] = null;
|
||||||
},
|
},
|
||||||
|
|
||||||
_lastEcho: null,
|
_lastEcho: null,
|
||||||
@@ -1013,7 +1013,7 @@ var CommandLine = Module("commandline", {
|
|||||||
|
|
||||||
this.store = this.store.filter(function (line) (line.value || line) != str);
|
this.store = this.store.filter(function (line) (line.value || line) != str);
|
||||||
dactyl.trapErrors(function () {
|
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);
|
||||||
this.store = this.store.slice(Math.max(0, this.store.length - options["history"]));
|
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()
|
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",
|
bind(["<Esc>", "<C-[>"], "Stop waiting for completions or exit Command Line mode",
|
||||||
function ({ self }) {
|
function ({ self }) {
|
||||||
@@ -2030,7 +2030,7 @@ var ItemList = Class("ItemList", {
|
|||||||
if (start < 0 || start >= this.itemCount)
|
if (start < 0 || start >= this.itemCount)
|
||||||
return null;
|
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];
|
return [group.context, start - group.offsets.start];
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -2342,7 +2342,7 @@ var ItemList = Class("ItemList", {
|
|||||||
container.scrollTop = scroll;
|
container.scrollTop = scroll;
|
||||||
if (scrollY != null)
|
if (scrollY != null)
|
||||||
win.scrollTo(0, Math.max(scrollY, 0));
|
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:
|
||||||
|
|||||||
@@ -83,7 +83,6 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
observers: {
|
observers: {
|
||||||
"dactyl-cleanup": function dactyl_cleanup(subject, reason) {
|
"dactyl-cleanup": function dactyl_cleanup(subject, reason) {
|
||||||
let modules = dactyl.modules;
|
let modules = dactyl.modules;
|
||||||
@@ -682,7 +681,7 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), {
|
|||||||
tag = function (map) [
|
tag = function (map) [
|
||||||
let (c = obj.modes[0].char) c ? c + "_" : "",
|
let (c = obj.modes[0].char) c ? c + "_" : "",
|
||||||
map
|
map
|
||||||
]
|
];
|
||||||
link = function (map) {
|
link = function (map) {
|
||||||
let [, mode, name, extra] = /^(?:(.)_)?(?:<([^>]+)>)?(.*)$/.exec(map);
|
let [, mode, name, extra] = /^(?:(.)_)?(?:<([^>]+)>)?(.*)$/.exec(map);
|
||||||
let k = ["k", {}, extra];
|
let k = ["k", {}, extra];
|
||||||
@@ -710,7 +709,7 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), {
|
|||||||
let description = ["description", {},
|
let description = ["description", {},
|
||||||
obj.description ? ["p", {}, template.linkifyHelp(obj.description.replace(/\.?$/, "."), true)] : "",
|
obj.description ? ["p", {}, template.linkifyHelp(obj.description.replace(/\.?$/, "."), true)] : "",
|
||||||
extraHelp ? extraHelp : "",
|
extraHelp ? extraHelp : "",
|
||||||
!(extraHelp || obj.description) ? ["p", {}, /*L*/ "Sorry, no help available."] : ""]
|
!(extraHelp || obj.description) ? ["p", {}, /*L*/ "Sorry, no help available."] : ""];
|
||||||
|
|
||||||
res.push(
|
res.push(
|
||||||
["item", {},
|
["item", {},
|
||||||
@@ -1200,7 +1199,7 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), {
|
|||||||
dactyl.reportError(e, true);
|
dactyl.reportError(e, true);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -1829,7 +1828,7 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), {
|
|||||||
commandline.commandOutput([
|
commandline.commandOutput([
|
||||||
["div", {}, [config.appName, " ", config.version, date, " running on: "].join("")],
|
["div", {}, [config.appName, " ", config.version, date, " running on: "].join("")],
|
||||||
["div", {}, [window.navigator.userAgent].join("")]
|
["div", {}, [window.navigator.userAgent].join("")]
|
||||||
])
|
]);
|
||||||
}
|
}
|
||||||
}, {
|
}, {
|
||||||
argCount: "0",
|
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:
|
||||||
|
|||||||
@@ -73,4 +73,4 @@ function chromeDocuments() {
|
|||||||
|
|
||||||
var EXPORTED_SYMBOLS = ["cleanup", "init"];
|
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:
|
||||||
|
|||||||
@@ -870,7 +870,7 @@ var Editor = Module("editor", XPCOM(Ci.nsIEditActionListener, ModuleBase), {
|
|||||||
function addBeginInsertModeMap(keys, commands, description) {
|
function addBeginInsertModeMap(keys, commands, description) {
|
||||||
mappings.add([modes.TEXT_EDIT], keys, description || "",
|
mappings.add([modes.TEXT_EDIT], keys, description || "",
|
||||||
function () {
|
function () {
|
||||||
commands.forEach(function (cmd) { editor.executeCommand(cmd, 1) });
|
commands.forEach(function (cmd) { editor.executeCommand(cmd, 1); });
|
||||||
modes.push(modes.INSERT);
|
modes.push(modes.INSERT);
|
||||||
},
|
},
|
||||||
{ type: "editor" });
|
{ type: "editor" });
|
||||||
@@ -1148,13 +1148,12 @@ var Editor = Module("editor", XPCOM(Ci.nsIEditActionListener, ModuleBase), {
|
|||||||
mappings.add([modes.TEXT_EDIT], names, description,
|
mappings.add([modes.TEXT_EDIT], names, description,
|
||||||
action, update({ type: "editor" }, params));
|
action, update({ type: "editor" }, params));
|
||||||
|
|
||||||
|
|
||||||
bind(["<C-a>"], "Increment the next number",
|
bind(["<C-a>"], "Increment the next number",
|
||||||
function ({ count }) { editor.modifyNumber(count || 1) },
|
function ({ count }) { editor.modifyNumber(count || 1); },
|
||||||
{ count: true });
|
{ count: true });
|
||||||
|
|
||||||
bind(["<C-x>"], "Decrement the next number",
|
bind(["<C-x>"], "Decrement the next number",
|
||||||
function ({ count }) { editor.modifyNumber(-(count || 1)) },
|
function ({ count }) { editor.modifyNumber(-(count || 1)); },
|
||||||
{ count: true });
|
{ count: true });
|
||||||
|
|
||||||
// text edit mode
|
// text edit mode
|
||||||
@@ -1326,7 +1325,7 @@ var Editor = Module("editor", XPCOM(Ci.nsIEditActionListener, ModuleBase), {
|
|||||||
{ count: true });
|
{ count: true });
|
||||||
|
|
||||||
let bind = function bind() mappings.add.apply(mappings,
|
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",
|
bind(["<Esc>"], "Return to Insert mode",
|
||||||
function () Events.PASS_THROUGH);
|
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:
|
||||||
|
|||||||
@@ -9,4 +9,4 @@ catch (e) { __dactyl_eval_error = e; }
|
|||||||
// This work is licensed for reuse under an MIT license. Details are
|
// This work is licensed for reuse under an MIT license. Details are
|
||||||
// given in the LICENSE.txt file included with this file.
|
// 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:
|
||||||
|
|||||||
@@ -970,7 +970,7 @@ var Events = Module("events", {
|
|||||||
return DOM(elem).isEditable ||
|
return DOM(elem).isEditable ||
|
||||||
isinstance(elem, [Ci.nsIDOMHTMLEmbedElement,
|
isinstance(elem, [Ci.nsIDOMHTMLEmbedElement,
|
||||||
Ci.nsIDOMHTMLObjectElement,
|
Ci.nsIDOMHTMLObjectElement,
|
||||||
Ci.nsIDOMHTMLSelectElement])
|
Ci.nsIDOMHTMLSelectElement]);
|
||||||
},
|
},
|
||||||
|
|
||||||
kill: function kill(event) {
|
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:
|
||||||
|
|||||||
@@ -24,4 +24,4 @@ function checkFragment() {
|
|||||||
document.addEventListener("load", checkFragment, true);
|
document.addEventListener("load", checkFragment, true);
|
||||||
document.addEventListener("hashChange", 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:
|
||||||
|
|||||||
@@ -1352,7 +1352,7 @@ var Hints = Module("hints", {
|
|||||||
{
|
{
|
||||||
values: {
|
values: {
|
||||||
"0": "Follow the first hint as soon as typed text uniquely identifies it. Follow the selected hint on <Return>.",
|
"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:
|
||||||
|
|||||||
@@ -61,12 +61,12 @@ var History = Module("history", {
|
|||||||
},
|
},
|
||||||
|
|
||||||
get session() {
|
get session() {
|
||||||
let webNav = window.getWebNavigation()
|
let webNav = window.getWebNavigation();
|
||||||
let sh = webNav.sessionHistory;
|
let sh = webNav.sessionHistory;
|
||||||
|
|
||||||
let obj = [];
|
let obj = [];
|
||||||
obj.__defineGetter__("index", function () sh.index);
|
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);
|
obj.__iterator__ = function () array.iterItems(this);
|
||||||
|
|
||||||
for (let item in iter(sh.SHistoryEnumerator, Ci.nsIHistoryEntry))
|
for (let item in iter(sh.SHistoryEnumerator, Ci.nsIHistoryEntry))
|
||||||
@@ -371,13 +371,13 @@ var History = Module("history", {
|
|||||||
{ count: true });
|
{ count: true });
|
||||||
|
|
||||||
bind(["[d"], "Go back to the previous domain in the browser history",
|
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 });
|
{ count: true });
|
||||||
|
|
||||||
bind(["]d"], "Go forward to the next domain in the browser history",
|
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 });
|
{ count: true });
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// vim: set fdm=marker sw=4 ts=4 et:
|
// vim: set fdm=marker sw=4 sts=4 ts=8 et:
|
||||||
|
|||||||
@@ -322,3 +322,4 @@ var KeyArgProcessor = Class("KeyArgProcessor", KeyProcessor, {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// vim: set fdm=marker sw=4 sts=4 ts=8 et:
|
||||||
|
|||||||
@@ -496,7 +496,7 @@ var Mappings = Module("mappings", {
|
|||||||
["td", {}, modeSign],
|
["td", {}, modeSign],
|
||||||
["td", {}, name],
|
["td", {}, name],
|
||||||
["td", {}, map.rhs || map.action.toSource()]])),
|
["td", {}, map.rhs || map.action.toSource()]])),
|
||||||
["tr", { style: "height: .5ex;" }]])]
|
["tr", { style: "height: .5ex;" }]])];
|
||||||
|
|
||||||
// E4X-FIXME
|
// E4X-FIXME
|
||||||
// // TODO: Move this to an ItemList to show this automatically
|
// // TODO: Move this to an ItemList to show this automatically
|
||||||
@@ -572,7 +572,7 @@ var Mappings = Module("mappings", {
|
|||||||
options: [
|
options: [
|
||||||
{
|
{
|
||||||
names: ["-arg", "-a"],
|
names: ["-arg", "-a"],
|
||||||
description: "Accept an argument after the requisite key press",
|
description: "Accept an argument after the requisite key press"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
names: ["-builtin", "-b"],
|
names: ["-builtin", "-b"],
|
||||||
@@ -828,8 +828,8 @@ var Mappings = Module("mappings", {
|
|||||||
mappings: function initMappings(dactyl, modules, window) {
|
mappings: function initMappings(dactyl, modules, window) {
|
||||||
mappings.add([modes.COMMAND],
|
mappings.add([modes.COMMAND],
|
||||||
["\\"], "Emits <Leader> pseudo-key",
|
["\\"], "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:
|
||||||
|
|||||||
@@ -233,7 +233,7 @@ var Marks = Module("marks", {
|
|||||||
|
|
||||||
_scrollTo: function _scrollTo(mark) {
|
_scrollTo: function _scrollTo(mark) {
|
||||||
if (!mark.path)
|
if (!mark.path)
|
||||||
var node = buffer.findScrollable(0, (mark.offset || mark.position).x)
|
var node = buffer.findScrollable(0, (mark.offset || mark.position).x);
|
||||||
else
|
else
|
||||||
for (node in DOM.XPath(mark.path, buffer.focusedFrame.document))
|
for (node in DOM.XPath(mark.path, buffer.focusedFrame.document))
|
||||||
break;
|
break;
|
||||||
@@ -303,7 +303,6 @@ var Marks = Module("marks", {
|
|||||||
Math.round(mark.position.y * 100) + "%)",
|
Math.round(mark.position.y * 100) + "%)",
|
||||||
(tab && "tab: " + tabs.index(tab))
|
(tab && "tab: " + tabs.index(tab))
|
||||||
].filter(util.identity).join(", ");
|
].filter(util.identity).join(", ");
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
isLocalMark: bind("test", /^[a-z`']$/),
|
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:
|
||||||
|
|||||||
@@ -606,7 +606,7 @@ var Modes = Module("modes", {
|
|||||||
},
|
},
|
||||||
|
|
||||||
setter: function (vals) {
|
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()), {
|
vals = vals.map(function (v) update(new String(v.toLowerCase()), {
|
||||||
mode: v.replace(/^!/, "").toUpperCase(),
|
mode: v.replace(/^!/, "").toUpperCase(),
|
||||||
@@ -634,8 +634,8 @@ var Modes = Module("modes", {
|
|||||||
},
|
},
|
||||||
prefs: function initPrefs() {
|
prefs: function initPrefs() {
|
||||||
prefs.watch("accessibility.browsewithcaret",
|
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:
|
||||||
|
|||||||
@@ -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:
|
||||||
|
|||||||
@@ -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:
|
||||||
|
|||||||
@@ -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
|
* 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:
|
||||||
|
|||||||
@@ -237,7 +237,7 @@ var Tabs = Module("tabs", {
|
|||||||
return this._groups;
|
return this._groups;
|
||||||
|
|
||||||
if (func)
|
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)
|
if (window.TabView && window.TabView._initFrame)
|
||||||
window.TabView._initFrame(func);
|
window.TabView._initFrame(func);
|
||||||
@@ -335,7 +335,6 @@ var Tabs = Module("tabs", {
|
|||||||
completion.listCompleter("buffer", filter);
|
completion.listCompleter("buffer", filter);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return an iterator of tabs matching the given filter. If no
|
* Return an iterator of tabs matching the given filter. If no
|
||||||
* *filter* or *count* is provided, returns the currently selected
|
* *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:
|
||||||
|
|||||||
@@ -40,10 +40,10 @@
|
|||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
If the <em>-group</em>=<a>group</a> flag is given, add this autocmd
|
If the <em>-group</em>=<a>group</a> flag is given, add this
|
||||||
to the named <t>group</t>. Any filters for <a>group</a> apply in
|
autocommand to the named <t>group</t>. Any filters for <a>group</a>
|
||||||
addition to <oa>filter</oa>. When listing commands this limits the
|
apply in addition to <oa>filter</oa>. When listing commands this
|
||||||
output to the specified group.
|
limits the output to the specified group.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p>Available <oa>events</oa>:</p>
|
<p>Available <oa>events</oa>:</p>
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ var listener = function listener(action, event)
|
|||||||
this.dactyl[install.error ? "echoerr" : "echomsg"](
|
this.dactyl[install.error ? "echoerr" : "echomsg"](
|
||||||
_("addon.error", action, event, (install.name || install.sourceURI.spec) +
|
_("addon.error", action, event, (install.name || install.sourceURI.spec) +
|
||||||
(install.error ? ": " + addons.errors[install.error] : "")));
|
(install.error ? ": " + addons.errors[install.error] : "")));
|
||||||
}
|
};
|
||||||
|
|
||||||
var AddonListener = Class("AddonListener", {
|
var AddonListener = Class("AddonListener", {
|
||||||
init: function init(modules) {
|
init: function init(modules) {
|
||||||
@@ -120,7 +120,7 @@ var actions = {
|
|||||||
},
|
},
|
||||||
get filter() {
|
get filter() {
|
||||||
return function (addon) !addon.userDisabled &&
|
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"
|
perm: "disable"
|
||||||
},
|
},
|
||||||
@@ -206,7 +206,7 @@ var Addon = Class("Addon", {
|
|||||||
["span", { highlight: pending[0] }, pending[1]],
|
["span", { highlight: pending[0] }, pending[1]],
|
||||||
" on ",
|
" on ",
|
||||||
["a", { href: "#", "dactyl:command": "dactyl.restart" }, "restart"],
|
["a", { href: "#", "dactyl:command": "dactyl.restart" }, "restart"],
|
||||||
")"]
|
")"];
|
||||||
return info;
|
return info;
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -498,4 +498,4 @@ endModule();
|
|||||||
|
|
||||||
} catch(e){ if (isString(e)) e = Error(e); dump(e.fileName+":"+e.lineNumber+": "+e+"\n" + e.stack); }
|
} 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:
|
||||||
|
|||||||
@@ -241,7 +241,7 @@ function properties(obj, prototypes, debugger_) {
|
|||||||
return array.uniq([k for (k in obj)].concat(
|
return array.uniq([k for (k in obj)].concat(
|
||||||
Object.getOwnPropertyNames(
|
Object.getOwnPropertyNames(
|
||||||
XPCNativeWrapper.unwrap(obj))
|
XPCNativeWrapper.unwrap(obj))
|
||||||
.filter(filter)))
|
.filter(filter)));
|
||||||
}
|
}
|
||||||
else if (!e.stack) {
|
else if (!e.stack) {
|
||||||
throw Error(e);
|
throw Error(e);
|
||||||
@@ -1080,7 +1080,7 @@ function XPCOMShim(interfaces) {
|
|||||||
getInterfaces: function (count) { count.value = 0; }
|
getInterfaces: function (count) { count.value = 0; }
|
||||||
});
|
});
|
||||||
return (interfaces || []).reduce(function (shim, iface) shim.QueryInterface(Ci[iface]),
|
return (interfaces || []).reduce(function (shim, iface) shim.QueryInterface(Ci[iface]),
|
||||||
ip.data)
|
ip.data);
|
||||||
};
|
};
|
||||||
let stub = Class.Property({
|
let stub = Class.Property({
|
||||||
configurable: true,
|
configurable: true,
|
||||||
@@ -1097,7 +1097,7 @@ var ErrorBase = Class("ErrorBase", Error, {
|
|||||||
init: function EB_init(message, level) {
|
init: function EB_init(message, level) {
|
||||||
level = level || 0;
|
level = level || 0;
|
||||||
let error = Error(message);
|
let error = Error(message);
|
||||||
update(this, error)
|
update(this, error);
|
||||||
this.stack = error.stack;
|
this.stack = error.stack;
|
||||||
this.message = message;
|
this.message = message;
|
||||||
|
|
||||||
@@ -1172,7 +1172,7 @@ Module.INIT = {
|
|||||||
module.isLocalModule = true;
|
module.isLocalModule = true;
|
||||||
|
|
||||||
modules.jsmodules[this.constructor.className] = module;
|
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);
|
memoize(module, "closure", Class.makeClosure);
|
||||||
module.instance = module;
|
module.instance = module;
|
||||||
@@ -1769,4 +1769,4 @@ endModule();
|
|||||||
|
|
||||||
// catch(e){dump(e.fileName+":"+e.lineNumber+": "+e+"\n" + e.stack);}
|
// 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:
|
||||||
|
|||||||
@@ -262,4 +262,4 @@ var BookmarkCache = Module("BookmarkCache", XPCOM(Ci.nsINavBookmarkObserver), {
|
|||||||
|
|
||||||
endModule();
|
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:
|
||||||
|
|||||||
@@ -19,3 +19,4 @@ this["import"] = function import_(obj) {
|
|||||||
Components.utils.import("resource://gre/modules/Services.jsm");
|
Components.utils.import("resource://gre/modules/Services.jsm");
|
||||||
function loadSubScript() Services.scriptloader.loadSubScript.apply(null, arguments);
|
function loadSubScript() Services.scriptloader.loadSubScript.apply(null, arguments);
|
||||||
|
|
||||||
|
// vim: set fdm=marker sw=4 sts=4 ts=8 et ft=javascript:
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ var Buffer = Module("Buffer", {
|
|||||||
|
|
||||||
let win = services.focus.focusedWindow;
|
let win = services.focus.focusedWindow;
|
||||||
if (!win || win == window || util.topWindow(win) != window)
|
if (!win || win == window || util.topWindow(win) != window)
|
||||||
return window.content
|
return window.content;
|
||||||
if (win.top == window)
|
if (win.top == window)
|
||||||
return win;
|
return win;
|
||||||
return win.top;
|
return win.top;
|
||||||
@@ -219,7 +219,7 @@ var Buffer = Module("Buffer", {
|
|||||||
*/
|
*/
|
||||||
get zoomLevel() {
|
get zoomLevel() {
|
||||||
let v = this.contentViewer;
|
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); },
|
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 distance = reverse ? function (rect) -rect.top : function (rect) rect.top;
|
||||||
let elems = [[e, distance(e.getBoundingClientRect())] for (e in path.matcher(this.focusedFrame.document))]
|
let elems = [[e, distance(e.getBoundingClientRect())] for (e in path.matcher(this.focusedFrame.document))]
|
||||||
.filter(function (e) e[1] > FUDGE)
|
.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)
|
if (offScreen && !reverse)
|
||||||
elems = elems.filter(function (e) e[1] > this, this.topWindow.innerHeight);
|
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 scrollRightMax() this.win.scrollMaxY,
|
||||||
|
|
||||||
get scrollLeft() this.win.scrollX,
|
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,
|
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;
|
return elem;
|
||||||
},
|
},
|
||||||
@@ -1680,7 +1680,7 @@ var Buffer = Module("Buffer", {
|
|||||||
return {
|
return {
|
||||||
x: elem.scrollLeft && elem.scrollLeft / this._exWidth(node),
|
x: elem.scrollLeft && elem.scrollLeft / this._exWidth(node),
|
||||||
y: elem.scrollTop / parseFloat(style.lineHeight)
|
y: elem.scrollTop / parseFloat(style.lineHeight)
|
||||||
}
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
_exWidth: function _exWidth(elem) {
|
_exWidth: function _exWidth(elem) {
|
||||||
@@ -1747,7 +1747,7 @@ var Buffer = Module("Buffer", {
|
|||||||
const BRANCH = "printer_" + PRINTER + ".";
|
const BRANCH = "printer_" + PRINTER + ".";
|
||||||
const BRANCHES = ["print.", BRANCH, "print." + BRANCH];
|
const BRANCHES = ["print.", BRANCH, "print." + BRANCH];
|
||||||
function set(pref, value) {
|
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 () {
|
prefs.withContext(function () {
|
||||||
@@ -2665,7 +2665,7 @@ Buffer.addPageInfoSection("m", "Meta Tags", function (verbose) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
Buffer.addPageInfoSection("s", "Security", function (verbose) {
|
Buffer.addPageInfoSection("s", "Security", function (verbose) {
|
||||||
let { statusline } = this.modules
|
let { statusline } = this.modules;
|
||||||
|
|
||||||
let identity = this.topWindow.gIdentityHandler;
|
let identity = this.topWindow.gIdentityHandler;
|
||||||
|
|
||||||
@@ -2706,4 +2706,4 @@ Buffer.addPageInfoSection("s", "Security", function (verbose) {
|
|||||||
|
|
||||||
endModule();
|
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:
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ var Cache = Module("Cache", XPCOM(Ci.nsIRequestObserver), {
|
|||||||
"cache": function (uri, path) {
|
"cache": function (uri, path) {
|
||||||
let contentType = "text/plain";
|
let contentType = "text/plain";
|
||||||
try {
|
try {
|
||||||
contentType = services.mime.getTypeFromURI(uri)
|
contentType = services.mime.getTypeFromURI(uri);
|
||||||
}
|
}
|
||||||
catch (e) {}
|
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); }
|
// 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:
|
||||||
|
|||||||
@@ -352,7 +352,7 @@ var Command = Class("Command", {
|
|||||||
{ configurable: true, enumerable: true, get: function () opt.default };
|
{ configurable: true, enumerable: true, get: function () opt.default };
|
||||||
|
|
||||||
if (prop.get && !prop.set)
|
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);
|
Object.defineProperty(res, opt.names[0], prop);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -536,7 +536,7 @@ var CommandHive = Class("CommandHive", Contexts.Hive, {
|
|||||||
if (this.cached)
|
if (this.cached)
|
||||||
this.modules.initDependencies("commands");
|
this.modules.initDependencies("commands");
|
||||||
this.cached = false;
|
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. */
|
/** @property {string} The last executed Ex command line. */
|
||||||
@@ -1171,7 +1171,7 @@ var Commands = Module("commands", {
|
|||||||
if (sub.substr(0, 2) === "<<" && hereDoc)
|
if (sub.substr(0, 2) === "<<" && hereDoc)
|
||||||
let ([count, arg] = getNextArg(sub)) {
|
let ([count, arg] = getNextArg(sub)) {
|
||||||
sub = arg + sub.substr(count);
|
sub = arg + sub.substr(count);
|
||||||
}
|
};
|
||||||
|
|
||||||
args.push(sub);
|
args.push(sub);
|
||||||
args.quote = null;
|
args.quote = null;
|
||||||
@@ -1787,7 +1787,7 @@ let quote = function quote(q, list, map) {
|
|||||||
|
|
||||||
Commands.quoteMap = {
|
Commands.quoteMap = {
|
||||||
"\n": "\\n",
|
"\n": "\\n",
|
||||||
"\t": "\\t",
|
"\t": "\\t"
|
||||||
};
|
};
|
||||||
|
|
||||||
Commands.quoteArg = {
|
Commands.quoteArg = {
|
||||||
@@ -1813,4 +1813,4 @@ endModule();
|
|||||||
|
|
||||||
} catch(e){ if (!e.stack) e = Error(e); dump(e.fileName+":"+e.lineNumber+": "+e+"\n" + e.stack); }
|
} 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:
|
||||||
|
|||||||
@@ -943,7 +943,7 @@ var Completion = Module("completion", {
|
|||||||
template.map(contexts, function m(context)
|
template.map(contexts, function m(context)
|
||||||
[template.completionRow(context.title, "CompTitle"),
|
[template.completionRow(context.title, "CompTitle"),
|
||||||
template.map(context.items, function m(item) context.createRow(item), null, 100)])]);
|
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);
|
let words = context.filter.toLowerCase().split(/\s+/g);
|
||||||
context.hasItems = true;
|
context.hasItems = true;
|
||||||
context.completions = context.completions.filter(function f({ url, title })
|
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.format = this.modules.bookmarks.format;
|
||||||
context.keys.extra = function k_extra(item) {
|
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); }
|
// 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:
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ AboutHandler.prototype = {
|
|||||||
return channel;
|
return channel;
|
||||||
},
|
},
|
||||||
|
|
||||||
getURIFlags: function (uri) Ci.nsIAboutModule.ALLOW_SCRIPT,
|
getURIFlags: function (uri) Ci.nsIAboutModule.ALLOW_SCRIPT
|
||||||
};
|
};
|
||||||
var ConfigBase = Class("ConfigBase", {
|
var ConfigBase = Class("ConfigBase", {
|
||||||
/**
|
/**
|
||||||
@@ -415,7 +415,7 @@ var ConfigBase = Class("ConfigBase", {
|
|||||||
"list.href": Class.Memoize(function () "http://groups.google.com/group/" + config.name),
|
"list.href": Class.Memoize(function () "http://groups.google.com/group/" + config.name),
|
||||||
|
|
||||||
"hg.latest": Class.Memoize(function () this.code + "source/browse/"), // XXX
|
"hg.latest": Class.Memoize(function () this.code + "source/browse/"), // XXX
|
||||||
"irc": "irc://irc.oftc.net/#pentadactyl",
|
"irc": "irc://irc.oftc.net/#pentadactyl"
|
||||||
}),
|
}),
|
||||||
|
|
||||||
dtdExtra: {
|
dtdExtra: {
|
||||||
@@ -494,7 +494,7 @@ var ConfigBase = Class("ConfigBase", {
|
|||||||
*/
|
*/
|
||||||
get outputHeight() this.browser.mPanelContainer.boxObject.height,
|
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); }
|
// 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:
|
||||||
|
|||||||
@@ -819,4 +819,4 @@ endModule();
|
|||||||
|
|
||||||
// catch(e){ if (!e.stack) e = Error(e); dump(e.fileName+":"+e.lineNumber+": "+e+"\n" + e.stack); }
|
// 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:
|
||||||
|
|||||||
@@ -51,3 +51,4 @@ function fromXML(node, doc, nodes) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// vim: set fdm=marker sw=4 sts=4 ts=8 et ft=javascript:
|
||||||
|
|||||||
+20
-22
@@ -100,7 +100,7 @@ var DOM = Class("DOM", {
|
|||||||
href: { get: function (elem) elem.href || elem.getAttribute("href") },
|
href: { get: function (elem) elem.href || elem.getAttribute("href") },
|
||||||
src: { get: function (elem) elem.src || elem.getAttribute("src") },
|
src: { get: function (elem) elem.src || elem.getAttribute("src") },
|
||||||
checked: { get: function (elem) elem.hasAttribute("checked") ? elem.getAttribute("checked") == "true" : elem.checked,
|
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"),
|
collapsed: BooleanAttribute("collapsed"),
|
||||||
disabled: BooleanAttribute("disabled"),
|
disabled: BooleanAttribute("disabled"),
|
||||||
hidden: BooleanAttribute("hidden"),
|
hidden: BooleanAttribute("hidden"),
|
||||||
@@ -193,8 +193,8 @@ var DOM = Class("DOM", {
|
|||||||
let res = this.Empty();
|
let res = this.Empty();
|
||||||
|
|
||||||
this.each(function (elem) {
|
this.each(function (elem) {
|
||||||
while(true) {
|
while (true) {
|
||||||
elem = fn.call(this, elem)
|
elem = fn.call(this, elem);
|
||||||
if (elem instanceof Ci.nsIDOMNode)
|
if (elem instanceof Ci.nsIDOMNode)
|
||||||
res[res.length++] = elem;
|
res[res.length++] = elem;
|
||||||
else if (elem && "length" in elem)
|
else if (elem && "length" in elem)
|
||||||
@@ -272,7 +272,7 @@ var DOM = Class("DOM", {
|
|||||||
each: function each(meth, arg) {
|
each: function each(meth, arg) {
|
||||||
return self.each(function (elem) {
|
return self.each(function (elem) {
|
||||||
elem.classList[meth](arg);
|
elem.classList[meth](arg);
|
||||||
})
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
add: function add(cls) this.each("add", cls),
|
add: function add(cls) this.each("add", cls),
|
||||||
@@ -312,7 +312,7 @@ var DOM = Class("DOM", {
|
|||||||
let { highlight } = this;
|
let { highlight } = this;
|
||||||
let v = callable(val) ? val.call(thisObj || this, elem, i) : val;
|
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,
|
get bottom() this.top + this.height,
|
||||||
left: r.left + node.clientLeft,
|
left: r.left + node.clientLeft,
|
||||||
get right() this.left + this.width
|
get right() this.left + this.width
|
||||||
}
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
scrollPos: function scrollPos(left, top) {
|
scrollPos: function scrollPos(left, top) {
|
||||||
@@ -578,7 +578,7 @@ var DOM = Class("DOM", {
|
|||||||
let res = [];
|
let res = [];
|
||||||
this.each(function (elem) {
|
this.each(function (elem) {
|
||||||
try {
|
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)
|
if (color)
|
||||||
res.push(["span", { highlight: "HelpXML" },
|
res.push(["span", { highlight: "HelpXML" },
|
||||||
["span", { highlight: "HelpXMLTagStart" },
|
["span", { highlight: "HelpXMLTagStart" },
|
||||||
@@ -593,7 +593,7 @@ var DOM = Class("DOM", {
|
|||||||
],
|
],
|
||||||
!hasChildren ? "" :
|
!hasChildren ? "" :
|
||||||
["", "...",
|
["", "...",
|
||||||
["span", { highlight: "HtmlTagEnd" },"<", namespaced(elem), ">"]]
|
["span", { highlight: "HtmlTagEnd" }, "<", namespaced(elem), ">"]]
|
||||||
]);
|
]);
|
||||||
else {
|
else {
|
||||||
let tag = "<" + [namespaced(elem)].concat(
|
let tag = "<" + [namespaced(elem)].concat(
|
||||||
@@ -794,19 +794,19 @@ var DOM = Class("DOM", {
|
|||||||
html: function html(txt, self) {
|
html: function html(txt, self) {
|
||||||
return this.getSet(arguments,
|
return this.getSet(arguments,
|
||||||
function (elem) elem.innerHTML,
|
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) {
|
text: function text(txt, self) {
|
||||||
return this.getSet(arguments,
|
return this.getSet(arguments,
|
||||||
function (elem) elem.textContent,
|
function (elem) elem.textContent,
|
||||||
function (elem, val) { elem.textContent = val });
|
function (elem, val) { elem.textContent = val; });
|
||||||
},
|
},
|
||||||
|
|
||||||
val: function val(txt) {
|
val: function val(txt) {
|
||||||
return this.getSet(arguments,
|
return this.getSet(arguments,
|
||||||
function (elem) elem.value,
|
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) {
|
listen: function listen(event, listener, capture) {
|
||||||
@@ -905,7 +905,7 @@ var DOM = Class("DOM", {
|
|||||||
return true;
|
return true;
|
||||||
if (rect.top > viewport.bottom)
|
if (rect.top > viewport.bottom)
|
||||||
return false;
|
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;
|
let rect;
|
||||||
@@ -1066,7 +1066,6 @@ var DOM = Class("DOM", {
|
|||||||
return this;
|
return this;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
code_key: Class.Memoize(function (prop) this.init()[prop]),
|
code_key: Class.Memoize(function (prop) this.init()[prop]),
|
||||||
code_nativeKey: Class.Memoize(function (prop) this.init()[prop]),
|
code_nativeKey: Class.Memoize(function (prop) this.init()[prop]),
|
||||||
keyTable: 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 + ">";
|
return "<" + modifier + key + ">";
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
defaults: {
|
defaults: {
|
||||||
load: { bubbles: false },
|
load: { bubbles: false },
|
||||||
submit: { cancelable: true }
|
submit: { cancelable: true }
|
||||||
@@ -1616,7 +1614,7 @@ var DOM = Class("DOM", {
|
|||||||
else
|
else
|
||||||
elem.setAttributeNS(vals[0] || "", key, val);
|
elem.setAttributeNS(vals[0] || "", key, val);
|
||||||
}
|
}
|
||||||
args.forEach(function(e) {
|
args.forEach(function (e) {
|
||||||
elem.appendChild(tag(e, namespaces));
|
elem.appendChild(tag(e, namespaces));
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -1630,7 +1628,7 @@ var DOM = Class("DOM", {
|
|||||||
else
|
else
|
||||||
namespaces = fromJSON.namespaces;
|
namespaces = fromJSON.namespaces;
|
||||||
|
|
||||||
return tag(xml, namespaces)
|
return tag(xml, namespaces);
|
||||||
}, {
|
}, {
|
||||||
namespaces: {
|
namespaces: {
|
||||||
"": "http://www.w3.org/1999/xhtml",
|
"": "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 isFragment(args) !isString(args[0]) || args.length == 0 || args[0] === "";
|
||||||
|
|
||||||
function hasString(args) {
|
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) {
|
function isStrings(args) {
|
||||||
if (!isArray(args))
|
if (!isArray(args))
|
||||||
return util.dump("ARGS: " + {}.toString.call(args) + " " + args), false;
|
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) {
|
function tag(args, namespaces, indent) {
|
||||||
@@ -1727,7 +1725,7 @@ var DOM = Class("DOM", {
|
|||||||
contents.push(string);
|
contents.push(string);
|
||||||
});
|
});
|
||||||
if (contents.length)
|
if (contents.length)
|
||||||
res.push(contents.join("\n"), join)
|
res.push(contents.join("\n"), join);
|
||||||
});
|
});
|
||||||
if (res[res.length - 1] == join)
|
if (res[res.length - 1] == join)
|
||||||
res.pop();
|
res.pop();
|
||||||
@@ -1788,7 +1786,7 @@ var DOM = Class("DOM", {
|
|||||||
"</", name, ">");
|
"</", name, ">");
|
||||||
else {
|
else {
|
||||||
let contents = [];
|
let contents = [];
|
||||||
args.forEach(function(e) {
|
args.forEach(function (e) {
|
||||||
let string = tag(e, namespaces, indent + INDENT);
|
let string = tag(e, namespaces, indent + INDENT);
|
||||||
if (string)
|
if (string)
|
||||||
contents.push(string);
|
contents.push(string);
|
||||||
@@ -1806,7 +1804,7 @@ var DOM = Class("DOM", {
|
|||||||
else
|
else
|
||||||
namespaces = DOM.fromJSON.namespaces;
|
namespaces = DOM.fromJSON.namespaces;
|
||||||
|
|
||||||
return tag(xml, namespaces, "")
|
return tag(xml, namespaces, "");
|
||||||
},
|
},
|
||||||
|
|
||||||
parseNamespace: function parseNamespace(name, 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); }
|
// 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:
|
||||||
|
|||||||
@@ -419,7 +419,6 @@ var Downloads = Module("downloads", XPCOM(Ci.nsIDownloadProgressListener), {
|
|||||||
let file = download.targetFile.path;
|
let file = download.targetFile.path;
|
||||||
let size = download.size;
|
let size = download.size;
|
||||||
|
|
||||||
|
|
||||||
overlay.modules.forEach(function (modules) {
|
overlay.modules.forEach(function (modules) {
|
||||||
modules.dactyl.echomsg({ domains: [util.getHost(url)], message: _("io.downloadFinished", title, file) },
|
modules.dactyl.echomsg({ domains: [util.getHost(url)], message: _("io.downloadFinished", title, file) },
|
||||||
1, modules.commandline.ACTIVE_WINDOW);
|
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); }
|
// 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:
|
||||||
|
|||||||
@@ -851,4 +851,4 @@ var RangeFind = Class("RangeFind", {
|
|||||||
|
|
||||||
endModule();
|
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:
|
||||||
|
|||||||
@@ -131,12 +131,10 @@ var Help = Module("Help", {
|
|||||||
let beta = array(betas.iterate(NEWS))
|
let beta = array(betas.iterate(NEWS))
|
||||||
.map(function (m) m[1]).uniq().slice(-1)[0];
|
.map(function (m) m[1]).uniq().slice(-1)[0];
|
||||||
|
|
||||||
|
|
||||||
function rec(text, level, li) {
|
function rec(text, level, li) {
|
||||||
let res = [];
|
let res = [];
|
||||||
let list, space, i = 0;
|
let list, space, i = 0;
|
||||||
|
|
||||||
|
|
||||||
for (let match in re.iterate(text)) {
|
for (let match in re.iterate(text)) {
|
||||||
if (match.comment)
|
if (match.comment)
|
||||||
continue;
|
continue;
|
||||||
@@ -195,7 +193,6 @@ var Help = Module("Help", {
|
|||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
|
|
||||||
|
|
||||||
return '<?xml version="1.0"?>\n' +
|
return '<?xml version="1.0"?>\n' +
|
||||||
'<?xml-stylesheet type="text/xsl" href="dactyl://content/help.xsl"?>\n' +
|
'<?xml-stylesheet type="text/xsl" href="dactyl://content/help.xsl"?>\n' +
|
||||||
DOM.toXML(["document", { xmlns: "dactyl", name: "versions",
|
DOM.toXML(["document", { xmlns: "dactyl", name: "versions",
|
||||||
@@ -453,4 +450,4 @@ var Help = Module("Help", {
|
|||||||
|
|
||||||
endModule();
|
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:
|
||||||
|
|||||||
@@ -452,4 +452,4 @@ var Highlights = Module("Highlight", {
|
|||||||
|
|
||||||
endModule();
|
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:
|
||||||
|
|||||||
@@ -149,7 +149,7 @@ var IO = Module("io", {
|
|||||||
let sourceJSM = function sourceJSM() {
|
let sourceJSM = function sourceJSM() {
|
||||||
context = contexts.Module(uri);
|
context = contexts.Module(uri);
|
||||||
dactyl.triggerObserver("io.source", context, file, file.lastModifiedTime);
|
dactyl.triggerObserver("io.source", context, file, file.lastModifiedTime);
|
||||||
}
|
};
|
||||||
|
|
||||||
if (/\.jsm$/.test(filename))
|
if (/\.jsm$/.test(filename))
|
||||||
sourceJSM();
|
sourceJSM();
|
||||||
@@ -675,13 +675,13 @@ var IO = Module("io", {
|
|||||||
item.file = file;
|
item.file = file;
|
||||||
}
|
}
|
||||||
|
|
||||||
rtItems.ftdetect.template = // {{{
|
rtItems.ftdetect.template = //{{{
|
||||||
literal(/*" Vim filetype detection file
|
literal(/*" Vim filetype detection file
|
||||||
<header>
|
<header>
|
||||||
|
|
||||||
au BufNewFile,BufRead *<name>rc*,*.<fileext> set filetype=<name>
|
au BufNewFile,BufRead *<name>rc*,*.<fileext> set filetype=<name>
|
||||||
*/);//}}}
|
*/);//}}}
|
||||||
rtItems.ftplugin.template = // {{{
|
rtItems.ftplugin.template = //{{{
|
||||||
literal(/*" Vim filetype plugin file
|
literal(/*" Vim filetype plugin file
|
||||||
<header>
|
<header>
|
||||||
|
|
||||||
@@ -708,7 +708,7 @@ endif
|
|||||||
let &cpo = s:cpo_save
|
let &cpo = s:cpo_save
|
||||||
unlet s:cpo_save
|
unlet s:cpo_save
|
||||||
*/);//}}}
|
*/);//}}}
|
||||||
rtItems.syntax.template = // {{{
|
rtItems.syntax.template = //{{{
|
||||||
literal(/*" Vim syntax file
|
literal(/*" Vim syntax file
|
||||||
<header>
|
<header>
|
||||||
|
|
||||||
@@ -812,7 +812,7 @@ unlet s:cpo_save
|
|||||||
return lines.map(function (l) l.join("")).join("\n").replace(/\s+\n/gm, "\n");
|
return lines.map(function (l) l.join("")).join("\n").replace(/\s+\n/gm, "\n");
|
||||||
}//}}}
|
}//}}}
|
||||||
|
|
||||||
let params = { // {{{
|
let params = { //{{{
|
||||||
header: ['" Language: ' + config.appName + ' configuration file',
|
header: ['" Language: ' + config.appName + ' configuration file',
|
||||||
'" Maintainer: Doug Kearns <dougkearns@gmail.com>',
|
'" Maintainer: Doug Kearns <dougkearns@gmail.com>',
|
||||||
'" Version: ' + config.version].join("\n"),
|
'" Version: ' + config.version].join("\n"),
|
||||||
@@ -830,7 +830,7 @@ unlet s:cpo_save
|
|||||||
array(o.realNames for (o in options) if (o.type == "boolean"))
|
array(o.realNames for (o in options) if (o.type == "boolean"))
|
||||||
.flatten().map(String.quote),
|
.flatten().map(String.quote),
|
||||||
", ") + "]"
|
", ") + "]"
|
||||||
}; // }}}
|
}; //}}}
|
||||||
|
|
||||||
for (let { file, template } in values(rtItems)) {
|
for (let { file, template } in values(rtItems)) {
|
||||||
try {
|
try {
|
||||||
@@ -1165,4 +1165,4 @@ endModule();
|
|||||||
|
|
||||||
} catch(e){ if (isString(e)) e = Error(e); dump(e.fileName+":"+e.lineNumber+": "+e+"\n" + e.stack); }
|
} 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:
|
||||||
|
|||||||
@@ -900,4 +900,4 @@ endModule();
|
|||||||
|
|
||||||
} catch(e){ if (!e.stack) e = Error(e); dump(e.fileName+":"+e.lineNumber+": "+e+"\n" + e.stack); }
|
} 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:
|
||||||
|
|||||||
@@ -92,7 +92,6 @@ var Modules = function Modules(window) {
|
|||||||
|
|
||||||
const create = window.Object.create.bind(window.Object);
|
const create = window.Object.create.bind(window.Object);
|
||||||
|
|
||||||
|
|
||||||
const BASES = [BASE, "resource://dactyl-local-content/"];
|
const BASES = [BASE, "resource://dactyl-local-content/"];
|
||||||
|
|
||||||
jsmodules = Cu.createObjectIn(window);
|
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); }
|
} 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:
|
||||||
|
|||||||
@@ -205,4 +205,4 @@ endModule();
|
|||||||
|
|
||||||
// catch(e){ if (!e.stack) e = Error(e); dump(e.fileName+":"+e.lineNumber+": "+e+"\n" + e.stack); }
|
// 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:
|
||||||
|
|||||||
@@ -258,7 +258,7 @@ var Option = Class("Option", {
|
|||||||
return null;
|
return null;
|
||||||
},
|
},
|
||||||
|
|
||||||
// Properties {{{2
|
// Properties {{{
|
||||||
|
|
||||||
/** @property {string} The option's canonical name. */
|
/** @property {string} The option's canonical name. */
|
||||||
name: null,
|
name: null,
|
||||||
@@ -400,7 +400,8 @@ var Option = Class("Option", {
|
|||||||
hasChanged: false,
|
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,
|
get lastSet() options.store.get(this.name).time,
|
||||||
set lastSet(val) { options.store.set(this.name, { value: this.globalValue, time: Date.now() }); },
|
set lastSet(val) { options.store.set(this.name, { value: this.globalValue, time: Date.now() }); },
|
||||||
@@ -411,6 +412,7 @@ var Option = Class("Option", {
|
|||||||
*/
|
*/
|
||||||
setFrom: null
|
setFrom: null
|
||||||
|
|
||||||
|
//}}}
|
||||||
}, {
|
}, {
|
||||||
/**
|
/**
|
||||||
* @property {number} Global option scope.
|
* @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); }
|
} 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:
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ var setAttr = function setAttr(elem, ns, name, val) {
|
|||||||
elem.removeAttributeNS(ns, name);
|
elem.removeAttributeNS(ns, name);
|
||||||
else
|
else
|
||||||
elem.setAttributeNS(ns, name, val);
|
elem.setAttributeNS(ns, name, val);
|
||||||
}
|
};
|
||||||
|
|
||||||
var Overlay = Class("Overlay", {
|
var Overlay = Class("Overlay", {
|
||||||
init: function init(window) {
|
init: function init(window) {
|
||||||
@@ -42,7 +42,6 @@ var Overlay = Class("Overlay", {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
var Overlay = Module("Overlay", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakReference]), {
|
var Overlay = Module("Overlay", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakReference]), {
|
||||||
init: function init() {
|
init: function init() {
|
||||||
util.addObserver(this);
|
util.addObserver(this);
|
||||||
@@ -234,7 +233,7 @@ var Overlay = Module("Overlay", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakReferen
|
|||||||
let iterator = Iterator(obj[key]);
|
let iterator = Iterator(obj[key]);
|
||||||
if (isArray(obj[key])) {
|
if (isArray(obj[key])) {
|
||||||
iterator = ([elem[1].id, elem.slice(2), elem[1]]
|
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) {
|
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);
|
Object.defineProperty(object, k, desc);
|
||||||
|
|
||||||
if (callable(value)) {
|
if (callable(value)) {
|
||||||
var sentinel = "(function DactylOverlay() {}())"
|
var sentinel = "(function DactylOverlay() {}())";
|
||||||
value.toString = function toString() toString.toString.call(this).replace(/\}?$/, sentinel + "; $&");
|
value.toString = function toString() toString.toString.call(this).replace(/\}?$/, sentinel + "; $&");
|
||||||
value.toSource = function toSource() toSource.toSource.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); }
|
} 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:
|
||||||
|
|||||||
@@ -439,4 +439,4 @@ endModule();
|
|||||||
|
|
||||||
} catch(e){ if (!e.stack) e = Error(e); dump(e.fileName+":"+e.lineNumber+": "+e+"\n" + e.stack); }
|
} 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:
|
||||||
|
|||||||
@@ -44,9 +44,9 @@ function NetError(orig, error) {
|
|||||||
|
|
||||||
originalURI: orig,
|
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);
|
}).data.QueryInterface(Ci.nsIChannel);
|
||||||
}
|
}
|
||||||
function RedirectChannel(to, orig, time, message) {
|
function RedirectChannel(to, orig, time, message) {
|
||||||
@@ -72,7 +72,7 @@ function Protocol(scheme, classID, contentBase) {
|
|||||||
|
|
||||||
contentBase: contentBase,
|
contentBase: contentBase,
|
||||||
|
|
||||||
_xpcom_factory: JSMLoader.Factory(Protocol),
|
_xpcom_factory: JSMLoader.Factory(Protocol)
|
||||||
};
|
};
|
||||||
return Protocol;
|
return Protocol;
|
||||||
}
|
}
|
||||||
@@ -259,4 +259,4 @@ XMLChannel.prototype = {
|
|||||||
|
|
||||||
endModule();
|
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:
|
||||||
|
|||||||
@@ -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)
|
template.map(util.range(0, Math.ceil(items.length / 2)), function (i)
|
||||||
["row", {},
|
["row", {},
|
||||||
template.map(items.slice(i * 2, i * 2 + 2), function (item)
|
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])
|
template.map(ourItems(), function ([item, desc])
|
||||||
["listitem", { xmlns: "xul", preference: branch + item,
|
["listitem", { xmlns: "xul", preference: branch + item,
|
||||||
type: "checkbox", label: config.appName + ", " + desc,
|
type: "checkbox", label: config.appName + ", " + desc,
|
||||||
onsyncfrompreference: "return gSanitizePromptDialog.onReadGeneric();" }]),
|
onsyncfrompreference: "return gSanitizePromptDialog.onReadGeneric();" }])
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
ready: function ready(win) {
|
ready: function ready(win) {
|
||||||
@@ -507,7 +507,7 @@ var Sanitizer = Module("sanitizer", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakRef
|
|||||||
description: "Timespan for which to sanitize items",
|
description: "Timespan for which to sanitize items",
|
||||||
completer: function (context) modules.options.get("sanitizetimespan").completer(context),
|
completer: function (context) modules.options.get("sanitizetimespan").completer(context),
|
||||||
type: modules.CommandOption.STRING,
|
type: modules.CommandOption.STRING,
|
||||||
validator: function (arg) modules.options.get("sanitizetimespan").validator(arg),
|
validator: function (arg) modules.options.get("sanitizetimespan").validator(arg)
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
privateData: true
|
privateData: true
|
||||||
@@ -730,4 +730,4 @@ endModule();
|
|||||||
|
|
||||||
// catch(e){dump(e.fileName+":"+e.lineNumber+": "+e+"\n" + e.stack);}
|
// 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:
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ var Services = Module("Services", {
|
|||||||
this.add("downloadManager", "@mozilla.org/download-manager;1", "nsIDownloadManager");
|
this.add("downloadManager", "@mozilla.org/download-manager;1", "nsIDownloadManager");
|
||||||
this.add("environment", "@mozilla.org/process/environment;1", "nsIEnvironment");
|
this.add("environment", "@mozilla.org/process/environment;1", "nsIEnvironment");
|
||||||
this.add("extensionManager", "@mozilla.org/extensions/manager;1", "nsIExtensionManager");
|
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("externalProtocol", "@mozilla.org/uriloader/external-protocol-service;1", "nsIExternalProtocolService");
|
||||||
this.add("favicon", "@mozilla.org/browser/favicon-service;1", "nsIFaviconService");
|
this.add("favicon", "@mozilla.org/browser/favicon-service;1", "nsIFaviconService");
|
||||||
this.add("file:", this.PROTOCOL + "file", "nsIFileProtocolHandler");
|
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("Persist", "@mozilla.org/embedding/browser/nsWebBrowserPersist;1", "nsIWebBrowserPersist");
|
||||||
this.addClass("Pipe", "@mozilla.org/pipe;1", "nsIPipe", "init");
|
this.addClass("Pipe", "@mozilla.org/pipe;1", "nsIPipe", "init");
|
||||||
this.addClass("Process", "@mozilla.org/process/util;1", "nsIProcess", "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",
|
this.addClass("StreamChannel","@mozilla.org/network/input-stream-channel;1",
|
||||||
["nsIInputStreamChannel", "nsIChannel"], "setURI");
|
["nsIInputStreamChannel", "nsIChannel"], "setURI");
|
||||||
this.addClass("StreamCopier", "@mozilla.org/network/async-stream-copier;1","nsIAsyncStreamCopier", "init");
|
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);}
|
} 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:
|
||||||
|
|||||||
@@ -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", {
|
var Storage = Module("Storage", {
|
||||||
Local: function Local(dactyl, modules, window) ({
|
Local: function Local(dactyl, modules, window) ({
|
||||||
@@ -762,7 +762,6 @@ var File = Class("File", {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
isAbsolutePath: function isAbsolutePath(path) {
|
isAbsolutePath: function isAbsolutePath(path) {
|
||||||
try {
|
try {
|
||||||
services.File().initWithPath(path);
|
services.File().initWithPath(path);
|
||||||
@@ -793,7 +792,7 @@ let (file = services.directory.get("ProfD", Ci.nsIFile)) {
|
|||||||
if (!(prop in File.prototype)) {
|
if (!(prop in File.prototype)) {
|
||||||
let isFunction;
|
let isFunction;
|
||||||
try {
|
try {
|
||||||
isFunction = callable(file[prop])
|
isFunction = callable(file[prop]);
|
||||||
}
|
}
|
||||||
catch (e) {}
|
catch (e) {}
|
||||||
|
|
||||||
@@ -814,4 +813,4 @@ endModule();
|
|||||||
|
|
||||||
// catch(e){ dump(e + "\n" + (e.stack || Error().stack)); Components.utils.reportError(e) }
|
// 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:
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ Sheet.liveProperty = function (name) {
|
|||||||
this[i] = val;
|
this[i] = val;
|
||||||
this.enabled = this.enabled;
|
this.enabled = this.enabled;
|
||||||
});
|
});
|
||||||
}
|
};
|
||||||
Sheet.liveProperty("agent");
|
Sheet.liveProperty("agent");
|
||||||
Sheet.liveProperty("css");
|
Sheet.liveProperty("css");
|
||||||
Sheet.liveProperty("sites");
|
Sheet.liveProperty("sites");
|
||||||
@@ -763,9 +763,9 @@ var Styles = Module("Styles", {
|
|||||||
]);
|
]);
|
||||||
}),
|
}),
|
||||||
match.postSpace
|
match.postSpace
|
||||||
]
|
];
|
||||||
})
|
});
|
||||||
}
|
};
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -773,4 +773,4 @@ endModule();
|
|||||||
|
|
||||||
// catch(e){dump(e.fileName+":"+e.lineNumber+": "+e+"\n" + e.stack);}
|
// 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:
|
||||||
|
|||||||
@@ -168,7 +168,6 @@ var Template = Module("Template", {
|
|||||||
return res;
|
return res;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
bookmarkDescription: function (item, text) [
|
bookmarkDescription: function (item, text) [
|
||||||
!(item.extra && item.extra.length) ? [] :
|
!(item.extra && item.extra.length) ? [] :
|
||||||
["span", { highlight: "URLExtra" },
|
["span", { highlight: "URLExtra" },
|
||||||
@@ -264,7 +263,6 @@ var Template = Module("Template", {
|
|||||||
})(), this[help ? "HelpLink" : "helpLink"]);
|
})(), this[help ? "HelpLink" : "helpLink"]);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
// Fixes some strange stack rewinds on NS_ERROR_OUT_OF_MEMORY
|
// Fixes some strange stack rewinds on NS_ERROR_OUT_OF_MEMORY
|
||||||
// exceptions that we can't catch.
|
// exceptions that we can't catch.
|
||||||
stringify: function stringify(arg) {
|
stringify: function stringify(arg) {
|
||||||
@@ -417,7 +415,6 @@ var Template = Module("Template", {
|
|||||||
util.losslessDecodeURI(val.URI.spec)]]])];
|
util.losslessDecodeURI(val.URI.spec)]]])];
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
options: function options(title, opts, verbose) {
|
options: function options(title, opts, verbose) {
|
||||||
return ["table", {},
|
return ["table", {},
|
||||||
["tr", { highlight: "Title", align: "left" },
|
["tr", { highlight: "Title", align: "left" },
|
||||||
@@ -505,10 +502,10 @@ var Template = Module("Template", {
|
|||||||
_("io.definedAt"), " ",
|
_("io.definedAt"), " ",
|
||||||
sourceLink(frame)]]]],
|
sourceLink(frame)]]]],
|
||||||
item.columns ? self.map(item.columns, function (c) ["td", {}, c]) : [],
|
item.columns ? self.map(item.columns, function (c) ["td", {}, c]) : [],
|
||||||
["td", {}, desc(item)]])]]
|
["td", {}, desc(item)]])]];
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
endModule();
|
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
@@ -467,7 +467,7 @@ var Util = Module("Util", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakReference]),
|
|||||||
acc.push(vals);
|
acc.push(vals);
|
||||||
|
|
||||||
if (acc.length == pattern.length)
|
if (acc.length == pattern.length)
|
||||||
this.res.push(acc.join(""))
|
this.res.push(acc.join(""));
|
||||||
else
|
else
|
||||||
for (let val in values(vals))
|
for (let val in values(vals))
|
||||||
this.rec(acc.concat(val));
|
this.rec(acc.concat(val));
|
||||||
@@ -492,7 +492,7 @@ var Util = Module("Util", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakReference]),
|
|||||||
}
|
}
|
||||||
res.push(pattern.substr(end));
|
res.push(pattern.substr(end));
|
||||||
return res.map(function (s) util.dequote(s, dequote));
|
return res.map(function (s) util.dequote(s, dequote));
|
||||||
}
|
};
|
||||||
|
|
||||||
let patterns = [];
|
let patterns = [];
|
||||||
let substrings = split(pattern, /((?:[^\\{]|\\.)*)\{((?:[^\\}]|\\.)*)\}/gy,
|
let substrings = split(pattern, /((?:[^\\{]|\\.)*)\{((?:[^\\}]|\\.)*)\}/gy,
|
||||||
@@ -507,7 +507,7 @@ var Util = Module("Util", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakReference]),
|
|||||||
else
|
else
|
||||||
for (let [, pattern] in Iterator(patterns[acc.length]))
|
for (let [, pattern] in Iterator(patterns[acc.length]))
|
||||||
rec(acc.concat(pattern));
|
rec(acc.concat(pattern));
|
||||||
}
|
};
|
||||||
rec([]);
|
rec([]);
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
@@ -659,7 +659,7 @@ var Util = Module("Util", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakReference]),
|
|||||||
[hours, minutes] = div(minutes, 60);
|
[hours, minutes] = div(minutes, 60);
|
||||||
[days, hours] = div(hours, 24);
|
[days, hours] = div(hours, 24);
|
||||||
if (days)
|
if (days)
|
||||||
return /*L*/days + " days " + hours + " hours"
|
return /*L*/days + " days " + hours + " hours";
|
||||||
if (hours)
|
if (hours)
|
||||||
return /*L*/hours + "h " + minutes + "m";
|
return /*L*/hours + "h " + minutes + "m";
|
||||||
if (minutes)
|
if (minutes)
|
||||||
@@ -755,11 +755,10 @@ var Util = Module("Util", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakReference]),
|
|||||||
|
|
||||||
let async = params.callback || params.onload || params.onerror;
|
let async = params.callback || params.onload || params.onerror;
|
||||||
if (async) {
|
if (async) {
|
||||||
xmlhttp.addEventListener("load", function handler(event) { util.trapErrors(params.onload || 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);
|
xmlhttp.addEventListener("error", function handler(event) { util.trapErrors(params.onerror || params.callback, params, xmlhttp, event); }, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (isObject(params.params)) {
|
if (isObject(params.params)) {
|
||||||
let data = [encodeURIComponent(k) + "=" + encodeURIComponent(v)
|
let data = [encodeURIComponent(k) + "=" + encodeURIComponent(v)
|
||||||
for ([k, v] in iter(params.params))];
|
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) {
|
let (viewer = docShells.getNext().QueryInterface(Ci.nsIDocShell).contentViewer) {
|
||||||
if (viewer)
|
if (viewer)
|
||||||
yield viewer.DOMDocument;
|
yield viewer.DOMDocument;
|
||||||
}
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -1017,7 +1016,7 @@ var Util = Module("Util", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakReference]),
|
|||||||
}
|
}
|
||||||
let keyIter = object;
|
let keyIter = object;
|
||||||
if ("__iterator__" in object && !callable(object.__iterator__))
|
if ("__iterator__" in object && !callable(object.__iterator__))
|
||||||
keyIter = keys(object)
|
keyIter = keys(object);
|
||||||
|
|
||||||
for (let i in keyIter) {
|
for (let i in keyIter) {
|
||||||
let value = Magic("<no value>");
|
let value = Magic("<no value>");
|
||||||
@@ -1097,28 +1096,28 @@ var Util = Module("Util", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakReference]),
|
|||||||
if (data.length == 0)
|
if (data.length == 0)
|
||||||
res.push("[]");
|
res.push("[]");
|
||||||
else {
|
else {
|
||||||
res.push("[\n")
|
res.push("[\n");
|
||||||
for (let [i, val] in Iterator(data)) {
|
for (let [i, val] in Iterator(data)) {
|
||||||
if (i)
|
if (i)
|
||||||
res.push(",\n");
|
res.push(",\n");
|
||||||
res.push(prefix)
|
res.push(prefix);
|
||||||
rec(val, prefix, seen);
|
rec(val, prefix, seen);
|
||||||
}
|
}
|
||||||
res.push("\n", level, "]");
|
res.push("\n", level, "]");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (isObject(data)) {
|
else if (isObject(data)) {
|
||||||
res.push("{\n")
|
res.push("{\n");
|
||||||
|
|
||||||
let i = 0;
|
let i = 0;
|
||||||
for (let [key, val] in Iterator(data)) {
|
for (let [key, val] in Iterator(data)) {
|
||||||
if (i++)
|
if (i++)
|
||||||
res.push(",\n");
|
res.push(",\n");
|
||||||
res.push(prefix, JSON.stringify(key), ": ")
|
res.push(prefix, JSON.stringify(key), ": ");
|
||||||
rec(val, prefix, seen);
|
rec(val, prefix, seen);
|
||||||
}
|
}
|
||||||
if (i > 0)
|
if (i > 0)
|
||||||
res.push("\n", level, "}")
|
res.push("\n", level, "}");
|
||||||
else
|
else
|
||||||
res[res.length - 1] = "{}";
|
res[res.length - 1] = "{}";
|
||||||
}
|
}
|
||||||
@@ -1721,7 +1720,6 @@ var Util = Module("Util", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakReference]),
|
|||||||
Array: array
|
Array: array
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Math utility methods.
|
* Math utility methods.
|
||||||
* @singleton
|
* @singleton
|
||||||
@@ -1743,4 +1741,4 @@ endModule();
|
|||||||
|
|
||||||
} catch(e){ if (!e.stack) e = Error(e); dump(e.fileName+":"+e.lineNumber+": "+e+"\n" + e.stack); }
|
} 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:
|
||||||
|
|||||||
@@ -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:
|
||||||
|
|||||||
@@ -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:
|
||||||
|
|||||||
@@ -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:
|
||||||
|
|||||||
@@ -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:
|
||||||
|
|||||||
@@ -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:
|
||||||
|
|||||||
@@ -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:
|
||||||
|
|||||||
@@ -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:
|
||||||
|
|||||||
@@ -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:
|
||||||
|
|||||||
Reference in New Issue
Block a user