Skip to content

Commit 0225ccb

Browse files
committed
Merge pull request #4 from netaisllc/master
Jqueryized ui skin
2 parents 4f980fa + 3069312 commit 0225ccb

File tree

7 files changed

+272
-0
lines changed

7 files changed

+272
-0
lines changed

ui/css/app.min.css

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ui/index.html

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
<!DOCTYPE html>
2+
<!--[if IE 8]><html class="no-js lt-ie9" lang="en" ng-app="Lims"> <![endif]-->
3+
<!--[if gt IE 8]><!--><html class="no-js" lang="en" ng-app="JsonToGo"> <!--<![endif]-->
4+
5+
<head>
6+
<meta charset="utf-8" />
7+
<meta name="viewport" content="width=device-width,initial-scale=1">
8+
<title>JSON-to-Go</title>
9+
<link href="http://fonts.googleapis.com/css?family=Open+Sans:300,400,600,700,800" rel='stylesheet' type='text/css'>
10+
<link rel="stylesheet" type="text/css" href="css/app.min.css" />
11+
</head>
12+
<body>
13+
14+
<section class="page hidden nohead">
15+
<div class="grid no-gutters">
16+
<div class="unit whole">
17+
<section class="headlines">
18+
<h1>JSON-to-Go</h1>
19+
<h3>Translate JSON into a rough Go type definition</h3>
20+
</section>
21+
</div>
22+
</div>
23+
24+
<div class="grid no-gutters">
25+
<div class="unit whole">
26+
<section class="features">
27+
<ul class="ui menu horizontal float left">
28+
<li class="tab selected" id="json">JSON</li>
29+
<li class="tab" id="golang">Golang</li>
30+
</ul>
31+
</section>
32+
</div>
33+
</div>
34+
35+
<div class="grid no-left-gutters">
36+
37+
<div class="unit two-fifths">
38+
39+
<section class="ui json go-type show">
40+
<input class="ui inline input" id="inputGoType" type="text" placeholder="Enter a Go type name here." tabindex="1">
41+
<button class="ui inline button medium convert" id="buttonConvert" tabindex="3">Convert</button>
42+
<div class="clear"></div>
43+
</section>
44+
<section class="ui json code show" id="codeJson" >
45+
<textarea class="ui textarea" id="jsoncode" placeholder="Enter JSON here." tabindex="2"></textarea>
46+
</section>
47+
48+
<section class="ui golang go-type hide">
49+
<button class="ui inline button medium reset" id="buttonReset">Reset</button>
50+
<div class="clear"></div>
51+
</section>
52+
<section class="ui golang code hide" id="codeGolang">
53+
<textarea class="ui textarea" id="golangcode" placeholder="Grab the generated Go code here..."></textarea>
54+
</section>
55+
56+
</div>
57+
58+
<div class="unit two-fifths push right">
59+
<section class="meta">
60+
<h5>What's This All About?</h5>
61+
<p>This tool helps when you want to avoid <span class="cited"><b>interface{}</b></span> and type assertions or
62+
writing definitions by hand. The translater makes some assumptions, so be sure to check the results (and then use <span class="cited"><b>go fmt</b></span>.)</p>
63+
<p class="more"><a href="http://blog.golang.org/json-and-go" class="read-more" target="_goblog">Read more about JSON and Go</a></p>
64+
</section>
65+
66+
<section class="meta">
67+
<h5>Usage</h5>
68+
<p>1. Type in a name for the Go type to generate.<br/>
69+
2. Paste in your JSON.<br/>
70+
3. Click the <b>Convert</b> button.</br>
71+
4. Grab your Go code from the <b>Golang</b> tab.<br/>
72+
5. Rinse and repeat.</p>
73+
</section>
74+
75+
<section class="meta">
76+
<h5>Demo</h5>
77+
<p>For a demo, use the sample JSON from the <a class="original" href="http://smartystreets.com/products/liveaddress-api" target="_api">LiveAddress API</a> from <a class="original" href="http://smartystreets.com/" target="_vendor">SmartyStreets.</a></p>
78+
<p class="more">
79+
<a class="read-more" id="buttonLoadDemo">Load some demo JSON</a>
80+
<a class="read-more" id="buttonLoadDemo2">Load some other demo JSON</a>
81+
</p>
82+
</section>
83+
84+
<section class="meta">
85+
<h5>Credits</h5>
86+
<p>The original concept, project, and translation goodness, by <b><a class="original" href="https://github.com/mholt/json-to-go" target="_holt">Matthew Holt</a></b></p>
87+
<p>The fork, with modern UI and behavior, by <b><a class="original" href="http://cssian.com" target="_cssian">CSSian</a></b></p>
88+
</section>
89+
</div>
90+
</div>
91+
</section>
92+
93+
<!-- LIBRARY SCRIPTS -->
94+
<script src="lib/jquery/jquery-1.11.1.min.js"></script>
95+
<!-- APPLICATION SCRIPTS -->
96+
<script src="js/ui.min.js"></script>
97+
<script src="js/json-to-go.min.js"></script>
98+
</body>
99+
</html>

ui/js/json-to-go.min.js

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ui/js/ui.min.js

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ui/json/addresses.json

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
[
2+
{
3+
"input_index": 0,
4+
"candidate_index": 0,
5+
"addressee": "Apple Inc",
6+
"delivery_line_1": "1 Infinite Loop",
7+
"delivery_line_2": "PO Box 42",
8+
"last_line": "Cupertino CA 95014-2083",
9+
"delivery_point_barcode": "950142083017",
10+
"components": {
11+
"primary_number": "1",
12+
"street_name": "Infinite",
13+
"street_suffix": "Loop",
14+
"city_name": "Cupertino",
15+
"state_abbreviation": "CA",
16+
"zipcode": "95014",
17+
"plus4_code": "2083",
18+
"delivery_point": "01",
19+
"delivery_point_check_digit": "7"
20+
},
21+
"metadata": {
22+
"record_type": "S",
23+
"county_fips": "06085",
24+
"county_name": "Santa Clara",
25+
"carrier_route": "C067",
26+
"congressional_district": "15",
27+
"rdi": "Commercial",
28+
"latitude": 37.33118,
29+
"longitude": -122.03062,
30+
"precision": "Zip9"
31+
},
32+
"analysis": {
33+
"dpv_match_code": "Y",
34+
"dpv_footnotes": "AABB",
35+
"dpv_cmra": "N",
36+
"dpv_vacant": "N",
37+
"active": "Y"
38+
}
39+
},
40+
{
41+
"input_index": 0,
42+
"candidate_index": 0,
43+
"addressee": "Apple Inc",
44+
"delivery_line_1": "1 Infinite Loop",
45+
"delivery_line_2": "PO Box 42",
46+
"last_line": "Cupertino CA 95014-2083",
47+
"delivery_point_barcode": "950142083017",
48+
"components": {
49+
"primary_number": "1",
50+
"street_name": "Infinite",
51+
"street_suffix": "Loop",
52+
"city_name": "Cupertino",
53+
"state_abbreviation": "CA",
54+
"zipcode": "95014",
55+
"plus4_code": "2083",
56+
"delivery_point": "01",
57+
"delivery_point_check_digit": "7"
58+
},
59+
"metadata": {
60+
"record_type": "S",
61+
"county_fips": "06085",
62+
"county_name": "Santa Clara",
63+
"carrier_route": "C067",
64+
"congressional_district": "15",
65+
"rdi": "Commercial",
66+
"latitude": 37.33118,
67+
"longitude": -122.03062,
68+
"precision": "Zip9"
69+
},
70+
"analysis": {
71+
"dpv_match_code": "Y",
72+
"dpv_footnotes": "AABB",
73+
"dpv_cmra": "N",
74+
"dpv_vacant": "N",
75+
"active": "Y"
76+
}
77+
}
78+
]

ui/json/sample.json

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
[
2+
{
3+
"input_index": 0,
4+
"candidate_index": 0,
5+
"delivery_line_1": "1 N Rosedale St",
6+
"last_line": "Baltimore MD 21229-3737",
7+
"delivery_point_barcode": "212293737013",
8+
"components": {
9+
"primary_number": "1",
10+
"street_predirection": "N",
11+
"street_name": "Rosedale",
12+
"street_suffix": "St",
13+
"city_name": "Baltimore",
14+
"state_abbreviation": "MD",
15+
"zipcode": "21229",
16+
"plus4_code": "3737",
17+
"delivery_point": "01",
18+
"delivery_point_check_digit": "3"
19+
},
20+
"metadata": {
21+
"record_type": "S",
22+
"zip_type": "Standard",
23+
"county_fips": "24510",
24+
"county_name": "Baltimore City",
25+
"carrier_route": "C047",
26+
"congressional_district": "07",
27+
"rdi": "Residential",
28+
"elot_sequence": "0059",
29+
"elot_sort": "A",
30+
"latitude": 39.28602,
31+
"longitude": -76.6689,
32+
"precision": "Zip9",
33+
"time_zone": "Eastern",
34+
"utc_offset": -5,
35+
"dst": true
36+
},
37+
"analysis": {
38+
"dpv_match_code": "Y",
39+
"dpv_footnotes": "AABB",
40+
"dpv_cmra": "N",
41+
"dpv_vacant": "N",
42+
"active": "Y"
43+
}
44+
},
45+
{
46+
"input_index": 0,
47+
"candidate_index": 1,
48+
"delivery_line_1": "1 S Rosedale St",
49+
"last_line": "Baltimore MD 21229-3739",
50+
"delivery_point_barcode": "212293739011",
51+
"components": {
52+
"primary_number": "1",
53+
"street_predirection": "S",
54+
"street_name": "Rosedale",
55+
"street_suffix": "St",
56+
"city_name": "Baltimore",
57+
"state_abbreviation": "MD",
58+
"zipcode": "21229",
59+
"plus4_code": "3739",
60+
"delivery_point": "01",
61+
"delivery_point_check_digit": "1"
62+
},
63+
"metadata": {
64+
"record_type": "S",
65+
"zip_type": "Standard",
66+
"county_fips": "24510",
67+
"county_name": "Baltimore City",
68+
"carrier_route": "C047",
69+
"congressional_district": "07",
70+
"rdi": "Residential",
71+
"elot_sequence": "0064",
72+
"elot_sort": "A",
73+
"latitude": 39.2858,
74+
"longitude": -76.66889,
75+
"precision": "Zip9",
76+
"time_zone": "Eastern",
77+
"utc_offset": -5,
78+
"dst": true
79+
},
80+
"analysis": {
81+
"dpv_match_code": "Y",
82+
"dpv_footnotes": "AABB",
83+
"dpv_cmra": "N",
84+
"dpv_vacant": "N",
85+
"active": "Y"
86+
}
87+
}
88+
]

ui/lib/jquery/jquery-1.11.1.min.js

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)