Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix to style and javascript.

  • Loading branch information...
commit b0401e233cb67c540791d6fd5af825734cc81e66 1 parent 66d3760
Juan Germán Castañeda Echevarría juanger authored committed
34 Resources/web-resources/default.css
View
@@ -42,15 +42,6 @@ span.namespace {
color: #c55;
}
-span.block {
- display: block;
- float: left;
-}
-
-div.clear {
- overflow: hidden;
-}
-
/* tag span elements whose content is collapsed */
span.tag.collapsed {
background-color: #88e;
@@ -76,3 +67,28 @@ span.tag.collapsed * {
display: none;
}
+/* JSON Format tweaks */
+
+
+.nomixed > div.collapsed {
+ display: inline-block;
+}
+.nomixed > .mixed {
+ display: inline;
+}
+
+.append-comma:after {
+ content:",";
+}
+
+/* JSON data types */
+
+.key {
+ font-weight: bold;
+}
+.string {
+ color: #438512;
+}
+.boolean, .null, .number {
+ color: #BF1515;
+}
8 Resources/web-resources/default.js
View
@@ -17,12 +17,8 @@ function toggleElementCollapse(e, deep) {
a = [e];
if (deep) a = a.concat(e.select('div.element.mixed'));
a.each(function (e) {
- e.childElements().find(function (x) {return x.match('.mixedcontent')}).toggle();
+ e.childElements().find(function (x) {return x.match('.mixedcontent')}).toggle();
e.childElements().findAll(function (x) {return x.match('span.tag')}).invoke('toggleClassName', 'collapsed');
- if (e.nodeName == 'SPAN') {
- e.parentNode.toggleClassName('clear');
- e.adjacent('.nomixed')[0].toggleClassName('block');
- e.toggleClassName('block');
- }
+ e.toggleClassName('collapsed');
});
}
6 Sources/NSDecimalNumber+PrettyPrint.m
View
@@ -12,7 +12,11 @@
@implementation NSDecimalNumber (PrettyPrint)
- (NSXMLNode *) prettyPrintMe {
- return [NSXMLNode textWithStringValue:[self stringValue]];
+ NSXMLElement *root = [NSXMLNode elementWithName:@"span"];
+ [root addAttribute:[NSXMLNode attributeWithName:@"class" stringValue:@"number"]];
+ [root addChild:[NSXMLNode textWithStringValue:[self stringValue]]];
+
+ return root;
}
@end
10 Sources/NSNumber+PrettyPrint.m
View
@@ -12,12 +12,16 @@
@implementation NSNumber (PrettyPrint)
- (NSXMLNode *) prettyPrintMe {
- NSString *boolValue = [NSString stringWithString:@"false"];
+ NSString *boolValue = @"false";
if ([self boolValue]) {
- boolValue = [NSString stringWithString:@"true"];
+ boolValue = @"true";
}
- return [NSXMLNode textWithStringValue: boolValue];
+ NSXMLElement *root = [NSXMLNode elementWithName:@"span"];
+ [root addAttribute:[NSXMLNode attributeWithName:@"class" stringValue:@"boolean"]];
+ [root addChild:[NSXMLNode textWithStringValue: boolValue]];
+
+ return root;
}
@end
6 Sources/NSString+PrettyPrint.m
View
@@ -12,8 +12,12 @@
@implementation NSString (PrettyPrint)
- (NSXMLNode *) prettyPrintMe {
+ NSXMLElement *root = [NSXMLNode elementWithName:@"span"];
+ [root addAttribute:[NSXMLNode attributeWithName:@"class" stringValue:@"string"]];
NSString *pretty = [NSString stringWithFormat:@"\"%@\"", self];
- return [NSXMLNode textWithStringValue:pretty];
+ [root addChild:[NSXMLNode textWithStringValue:pretty]];
+
+ return root;
}
@end
Please sign in to comment.
Something went wrong with that request. Please try again.