diff options
author | Kris Maglione <maglione.k@gmail.com> | 2012-12-16 19:58:35 -0800 |
---|---|---|
committer | Kris Maglione <maglione.k@gmail.com> | 2012-12-16 19:58:35 -0800 |
commit | 2f0af0a3f128f4769001b6c01034745b2cee92ce (patch) | |
tree | 00177ba3746638b720d4a8332542031163df8874 /common/content/mow.js | |
parent | 1aaf3f75aaf54bb24c8931a0adfcd9976454495b (diff) | |
download | pentadactyl-2f0af0a3f128f4769001b6c01034745b2cee92ce.tar.gz |
Death to E4X and stuff.
Diffstat (limited to 'common/content/mow.js')
-rw-r--r-- | common/content/mow.js | 16 |
1 files changed, 2 insertions, 14 deletions
diff --git a/common/content/mow.js b/common/content/mow.js index 0aade542..1d880f10 100644 --- a/common/content/mow.js +++ b/common/content/mow.js @@ -4,7 +4,7 @@ // // This work is licensed for reuse under an MIT license. Details are // given in the LICENSE.txt file included with this file. -/* use strict */ +"use strict"; var MOW = Module("mow", { init: function init() { @@ -104,12 +104,6 @@ var MOW = Module("mow", { this.messages = []; } - // If it's already XML, assume it knows what it's doing. - // Otherwise, white space is significant. - // The problem elsewhere is that E4X tends to insert new lines - // after interpolated data. - XML.ignoreWhitespace = XML.prettyPrinting = false; - highlightGroup = "CommandOutput " + (highlightGroup || ""); if (isObject(data) && !isinstance(data, _) && !DOM.isJSONXML(data)) { @@ -127,19 +121,13 @@ var MOW = Module("mow", { } this.messages.push(data); } - else if (DOM.isJSONXML(data) || isString(data)) { + else { 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: nowrap" highlight={highlightGroup}>{data}</div>; - - var output = DOM(this.lastOutput, this.document); - } // FIXME: need to make sure an open MOW is closed when commands // that don't generate output are executed |