1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-01-09 06:54:11 +01:00

Death to E4X and stuff.

This commit is contained in:
Kris Maglione
2012-11-27 22:57:45 -08:00
parent 6200b08c13
commit a0f0668166
5 changed files with 104 additions and 36 deletions

View File

@@ -112,7 +112,7 @@ var MOW = Module("mow", {
highlightGroup = "CommandOutput " + (highlightGroup || "");
if (isObject(data) && !isinstance(data, _)) {
if (isObject(data) && !isinstance(data, _) && !DOM.isJSONXML(data)) {
this.lastOutput = null;
var output = DOM(["div", { style: "white-space: nowrap", highlight: highlightGroup }],
@@ -127,9 +127,16 @@ var MOW = Module("mow", {
}
this.messages.push(data);
}
else if (DOM.isJSONXML(data) || isString(data)) {
let style = isString(data) ? "pre-wrap" : "nowrap";
this.lastOutput = ["div", { style: "white-space: " + style, highlight: highlightGroup },
data];
var output = DOM(this.lastOutput, this.document);
}
else {
let style = isString(data) ? "pre-wrap" : "nowrap";
this.lastOutput = <div style={"white-space: " + style} highlight={highlightGroup}>{data}</div>;
this.lastOutput = <div style="white-space: nowrap" highlight={highlightGroup}>{data}</div>;
var output = DOM(this.lastOutput, this.document);
}