"' +
+ return '"' +
Handlebars.Utils.escapeExpression(json) + '"';
@@ -38,7 +38,7 @@ Ember.Handlebars.registerBoundHelper('parseJSONString', function (json) {
var htmlArray = [];
for(var i = 0, len = keys.length; i < len; i++) {
var k = keys[i];
- var html = "
" + k + '' + ': ' + "" + prettyPrint(json[k]) + "
";
+ var html = "
" + k + '' + ': ' + "" + prettyPrint(json[k]) + "
";
htmlArray.push(html);
}
return '{' + "" + htmlArray.join() + '
' + '
}';
diff --git a/Mongoman/app/assets/stylesheets/_pages/common_classes.scss b/Mongoman/app/assets/stylesheets/_pages/common_classes.scss
index c98666c..ab24eea 100644
--- a/Mongoman/app/assets/stylesheets/_pages/common_classes.scss
+++ b/Mongoman/app/assets/stylesheets/_pages/common_classes.scss
@@ -16,7 +16,7 @@
.footer {
padding-top: 50px;
- padding-bottom: 80px;
+ padding-bottom: 40px;
}
.invisible {
diff --git a/Mongoman/app/assets/stylesheets/_pages/documents.scss b/Mongoman/app/assets/stylesheets/_pages/documents.scss
index 46918e3..13c17e9 100644
--- a/Mongoman/app/assets/stylesheets/_pages/documents.scss
+++ b/Mongoman/app/assets/stylesheets/_pages/documents.scss
@@ -16,6 +16,7 @@
float: left;
margin-top: 38px;
margin-left: 0px;
+ font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace;
}
.document:hover{
@@ -39,6 +40,19 @@
}
+.object-id {
+ color: #dd1144;
+}
+.iso-date {
+ color: rgb(176, 96, 214);
+}
+.character-string {
+ color: rgb(11, 168, 36);
+}
+.field-name {
+ color: rgb(51, 15, 241);
+}
+
.edit-save-button {
background-color: #f9f9f9;
diff --git a/Mongoman/app/controllers/documents_controller.rb b/Mongoman/app/controllers/documents_controller.rb
index 0bf955f..62dfc3e 100644
--- a/Mongoman/app/controllers/documents_controller.rb
+++ b/Mongoman/app/controllers/documents_controller.rb
@@ -75,7 +75,7 @@ def BsonFieldsToString(x)
end
def create
- json_string = request.body().to_a.join()
+ json_string = request.body().to_a[0]
json_object = JSON json_string
new_document = construct_document(json_object)
begin
@@ -122,7 +122,7 @@ def substitutions(value)
object_id = value.match /[0-9a-fA-F]{24}/
substitution = BSON::ObjectId(object_id.to_s)
elsif value.match 'ISODate'
- substitution = Time.parse value.match(/\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}Z/)[0]
+ substitution = Time.parse value.match(/(\d{4}\-\d\d\-\d\d([tT][\d:\.]*)?)([zZ]|([+\-])(\d\d):?(\d\d))?/)[0]
end
end
substitution