1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-20 05:37:58 +01:00

Update :extensions with live update and buttons like :downloads. Rename to :addons.

--HG--
branch : key-processing
This commit is contained in:
Kris Maglione
2011-01-24 03:56:27 -05:00
parent 37719fdf1f
commit 93b9aade1d
9 changed files with 544 additions and 361 deletions

View File

@@ -1188,17 +1188,19 @@ var CommandLine = Module("commandline", {
},
withOutputToString: function (fn, self) {
let buffer = [];
dactyl.registerObserver("echoLine", observe, true);
dactyl.registerObserver("echoMultiline", observe, true);
let output = [];
function observe(str, highlight, dom) {
buffer.push(dom && !isString(str) ? util.domToString(dom) : str);
output.push(dom && !isString(str) ? dom : str);
}
this.savingOutput = true;
dactyl.trapErrors.apply(dactyl, [fn, self].concat(Array.slice(arguments, 2)));
this.savingOutput = false;
return buffer.join("\n");
return output.map(function (elem) elem instanceof Node ? util.domToString(elem) : elem)
.join("\n");
}
}, {
/**