Always call humanize(); minor style changes.
authorDave Longley <dlongley@digitalbazaar.com>
Mon, 03 Mar 2014 09:32:49 -0500
changeset 2131 cdd188f1d6f2
parent 2130 8526a7d307da
child 2132 735083b40389
Always call humanize(); minor style changes.
playground/playground.js
--- a/playground/playground.js	Mon Mar 03 12:58:07 2014 +0100
+++ b/playground/playground.js	Mon Mar 03 09:32:49 2014 -0500
@@ -58,16 +58,16 @@
   };
 
   /**
-   * Consistent human-readable JSON formatting
+   * Consistent human-readable JSON formatting.
    *
-   * @param the object or string to humanize
+   * @param the object or string to humanize.
    *
-   * @return a string containing the humanized string
+   * @return a string containing the humanized string.
    */
   playground.humanize = function(value) {
-    return ($.type(value) === "string")
+    return ($.type(value) === 'string')
       ? value
-      : JSON.stringify(value, null, '  ');
+      : JSON.stringify(value, null, 2);
   };
 
   /**
@@ -367,10 +367,7 @@
 
     return promise.then(function(result) {
       var outputTab = playground.activeTab.substr('tab-'.length);
-      if(['compacted', 'expanded', 'flattened', 'framed']
-        .indexOf(outputTab) !== -1) {
-        result = playground.humanize(result);
-      }
+      result = playground.humanize(result);
       playground.outputs[outputTab].setValue(result);
     });
   };