summaryrefslogtreecommitdiffstatsabout
diff options
context:
space:
mode:
authorMark Macdonald2012-10-18 14:32:17 (EDT)
committer skaegi2012-10-18 20:00:06 (EDT)
commite51d4da1cd89f982cf82179bf5c2fa8d2b8ac9e2 (patch)
treec69634d5565c1bcd336b26d90bb41e65d97965a5
parenta0ff80624594b0069ed467170673e2e06b9e19d4 (diff)
downloadorg.eclipse.orion.client-e51d4da1cd89f982cf82179bf5c2fa8d2b8ac9e2.zip
org.eclipse.orion.client-e51d4da1cd89f982cf82179bf5c2fa8d2b8ac9e2.tar.gz
org.eclipse.orion.client-e51d4da1cd89f982cf82179bf5c2fa8d2b8ac9e2.tar.bz2
Bug 387831 - fix gcli not honoring command returnType=='string'
-rw-r--r--bundles/org.eclipse.orion.client.core/web/gcli/cli.js7
-rw-r--r--bundles/org.eclipse.orion.client.core/web/gcli/util.js7
2 files changed, 13 insertions, 1 deletions
diff --git a/bundles/org.eclipse.orion.client.core/web/gcli/cli.js b/bundles/org.eclipse.orion.client.core/web/gcli/cli.js
index c99ad86..1d4ceac 100644
--- a/bundles/org.eclipse.orion.client.core/web/gcli/cli.js
+++ b/bundles/org.eclipse.orion.client.core/web/gcli/cli.js
@@ -1685,7 +1685,12 @@ Output.prototype.toDom = function(element) {
node = util.createElement(document, 'p');
}
- util.setContents(node, output.toString());
+ if (this.command.returnType === 'string') {
+ util.setTextContent(node, output);
+ }
+ else {
+ util.setContents(node, output.toString());
+ }
}
// Make sure that links open in a new window.
diff --git a/bundles/org.eclipse.orion.client.core/web/gcli/util.js b/bundles/org.eclipse.orion.client.core/web/gcli/util.js
index d536e8b..15375f6 100644
--- a/bundles/org.eclipse.orion.client.core/web/gcli/util.js
+++ b/bundles/org.eclipse.orion.client.core/web/gcli/util.js
@@ -376,6 +376,13 @@ exports.setContents = function(elem, contents) {
};
/**
+ * Set the textContent of an element.
+ */
+exports.setTextContent = function(elem, contents) {
+ elem.textContent = contents;
+};
+
+/**
* Load some HTML into the given document and return a DOM element.
* This utility assumes that the html has a single root (other than whitespace)
*/