summaryrefslogtreecommitdiff
path: root/share
diff options
context:
space:
mode:
authorChristopher Lenz <cmlenz@apache.org>2009-12-12 00:08:47 +0000
committerChristopher Lenz <cmlenz@apache.org>2009-12-12 00:08:47 +0000
commit77473d79f5b0d9362fb3b7fb00a5725ad000de12 (patch)
treebc737527d14ca9b64157181b6b11145bd8be17b4 /share
parent95464554aaadb9d8cac554ada84a4db9328793fa (diff)
Futon: Improve display of multi-line strings in tabular document view.
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@889867 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'share')
-rw-r--r--share/www/script/futon.format.js10
-rw-r--r--share/www/style/layout.css5
2 files changed, 9 insertions, 6 deletions
diff --git a/share/www/script/futon.format.js b/share/www/script/futon.format.js
index 601a91d3..5feee817 100644
--- a/share/www/script/futon.format.js
+++ b/share/www/script/futon.format.js
@@ -42,7 +42,7 @@
case "string":
var retval = val;
if (type == "string" && !options.escapeStrings) {
- retval = indentLines(retval, tab);
+ retval = indentLines(retval.replace(/\r\n/g, "\n"), tab.substr(options.indent));
} else {
retval = escape(JSON.stringify(val));
}
@@ -70,7 +70,9 @@
buf.push(index > 0 ? itemsep : options.linesep);
buf.push(tab, format(val[index], depth + 1));
}
- if (index >= 0) buf.push(options.linesep, tab.substr(options.indent));
+ if (index >= 0) {
+ buf.push(options.linesep, tab.substr(options.indent));
+ }
buf.push("]");
if (options.html) {
return "<code class='array'>" + buf.join("") + "</code>";
@@ -95,7 +97,9 @@
": ", format(val[key], depth + 1));
index++;
}
- if (index >= 0) buf.push(options.linesep, tab.substr(options.indent));
+ if (index >= 0) {
+ buf.push(options.linesep, tab.substr(options.indent));
+ }
buf.push("}");
if (options.html) {
return "<code class='object'>" + buf.join("") + "</code>";
diff --git a/share/www/style/layout.css b/share/www/style/layout.css
index 8be40b95..1d9a7873 100644
--- a/share/www/style/layout.css
+++ b/share/www/style/layout.css
@@ -427,6 +427,7 @@ body.fullwidth #wrap { margin-right: 0; }
#fields tbody.content td code { display: block; font-size: 11px;
padding: 2px 2px 2px 3px; position: relative;
}
+#fields tbody.content td code.string { white-space: pre-wrap; }
#fields tbody.content td code.string:before { color: #ccc; content: "“";
position: absolute; left: -4px;
}
@@ -448,9 +449,7 @@ body.fullwidth #wrap { margin-right: 0; }
float: left; margin-left: 0; padding-left: 2px; padding-right: .5em;
padding-top: 2px;
}
-#fields tbody.content td dd code.string { left: 4px; text-indent: -6px;
- white-space: pre-wrap;
-}
+#fields tbody.content td dd code.string { left: 4px; text-indent: -6px; }
#fields tbody.content td dd code.string:before { position: static; }
#fields tbody.content input, #fields tbody.content textarea,
#fields tbody.source textarea {