forked from mholt/json-to-go
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request mholt#4 from netaisllc/master
Jqueryized ui skin
- Loading branch information
Showing
7 changed files
with
272 additions
and
0 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
<!DOCTYPE html> | ||
<!--[if IE 8]><html class="no-js lt-ie9" lang="en" ng-app="Lims"> <![endif]--> | ||
<!--[if gt IE 8]><!--><html class="no-js" lang="en" ng-app="JsonToGo"> <!--<![endif]--> | ||
|
||
<head> | ||
<meta charset="utf-8" /> | ||
<meta name="viewport" content="width=device-width,initial-scale=1"> | ||
<title>JSON-to-Go</title> | ||
<link href="http://fonts.googleapis.com/css?family=Open+Sans:300,400,600,700,800" rel='stylesheet' type='text/css'> | ||
<link rel="stylesheet" type="text/css" href="css/app.min.css" /> | ||
</head> | ||
<body> | ||
|
||
<section class="page hidden nohead"> | ||
<div class="grid no-gutters"> | ||
<div class="unit whole"> | ||
<section class="headlines"> | ||
<h1>JSON-to-Go</h1> | ||
<h3>Translate JSON into a rough Go type definition</h3> | ||
</section> | ||
</div> | ||
</div> | ||
|
||
<div class="grid no-gutters"> | ||
<div class="unit whole"> | ||
<section class="features"> | ||
<ul class="ui menu horizontal float left"> | ||
<li class="tab selected" id="json">JSON</li> | ||
<li class="tab" id="golang">Golang</li> | ||
</ul> | ||
</section> | ||
</div> | ||
</div> | ||
|
||
<div class="grid no-left-gutters"> | ||
|
||
<div class="unit two-fifths"> | ||
|
||
<section class="ui json go-type show"> | ||
<input class="ui inline input" id="inputGoType" type="text" placeholder="Enter a Go type name here." tabindex="1"> | ||
<button class="ui inline button medium convert" id="buttonConvert" tabindex="3">Convert</button> | ||
<div class="clear"></div> | ||
</section> | ||
<section class="ui json code show" id="codeJson" > | ||
<textarea class="ui textarea" id="jsoncode" placeholder="Enter JSON here." tabindex="2"></textarea> | ||
</section> | ||
|
||
<section class="ui golang go-type hide"> | ||
<button class="ui inline button medium reset" id="buttonReset">Reset</button> | ||
<div class="clear"></div> | ||
</section> | ||
<section class="ui golang code hide" id="codeGolang"> | ||
<textarea class="ui textarea" id="golangcode" placeholder="Grab the generated Go code here..."></textarea> | ||
</section> | ||
|
||
</div> | ||
|
||
<div class="unit two-fifths push right"> | ||
<section class="meta"> | ||
<h5>What's This All About?</h5> | ||
<p>This tool helps when you want to avoid <span class="cited"><b>interface{}</b></span> and type assertions or | ||
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> | ||
<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> | ||
</section> | ||
|
||
<section class="meta"> | ||
<h5>Usage</h5> | ||
<p>1. Type in a name for the Go type to generate.<br/> | ||
2. Paste in your JSON.<br/> | ||
3. Click the <b>Convert</b> button.</br> | ||
4. Grab your Go code from the <b>Golang</b> tab.<br/> | ||
5. Rinse and repeat.</p> | ||
</section> | ||
|
||
<section class="meta"> | ||
<h5>Demo</h5> | ||
<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> | ||
<p class="more"> | ||
<a class="read-more" id="buttonLoadDemo">Load some demo JSON</a> | ||
<a class="read-more" id="buttonLoadDemo2">Load some other demo JSON</a> | ||
</p> | ||
</section> | ||
|
||
<section class="meta"> | ||
<h5>Credits</h5> | ||
<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> | ||
<p>The fork, with modern UI and behavior, by <b><a class="original" href="http://cssian.com" target="_cssian">CSSian</a></b></p> | ||
</section> | ||
</div> | ||
</div> | ||
</section> | ||
|
||
<!-- LIBRARY SCRIPTS --> | ||
<script src="lib/jquery/jquery-1.11.1.min.js"></script> | ||
<!-- APPLICATION SCRIPTS --> | ||
<script src="js/ui.min.js"></script> | ||
<script src="js/json-to-go.min.js"></script> | ||
</body> | ||
</html> |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
[ | ||
{ | ||
"input_index": 0, | ||
"candidate_index": 0, | ||
"addressee": "Apple Inc", | ||
"delivery_line_1": "1 Infinite Loop", | ||
"delivery_line_2": "PO Box 42", | ||
"last_line": "Cupertino CA 95014-2083", | ||
"delivery_point_barcode": "950142083017", | ||
"components": { | ||
"primary_number": "1", | ||
"street_name": "Infinite", | ||
"street_suffix": "Loop", | ||
"city_name": "Cupertino", | ||
"state_abbreviation": "CA", | ||
"zipcode": "95014", | ||
"plus4_code": "2083", | ||
"delivery_point": "01", | ||
"delivery_point_check_digit": "7" | ||
}, | ||
"metadata": { | ||
"record_type": "S", | ||
"county_fips": "06085", | ||
"county_name": "Santa Clara", | ||
"carrier_route": "C067", | ||
"congressional_district": "15", | ||
"rdi": "Commercial", | ||
"latitude": 37.33118, | ||
"longitude": -122.03062, | ||
"precision": "Zip9" | ||
}, | ||
"analysis": { | ||
"dpv_match_code": "Y", | ||
"dpv_footnotes": "AABB", | ||
"dpv_cmra": "N", | ||
"dpv_vacant": "N", | ||
"active": "Y" | ||
} | ||
}, | ||
{ | ||
"input_index": 0, | ||
"candidate_index": 0, | ||
"addressee": "Apple Inc", | ||
"delivery_line_1": "1 Infinite Loop", | ||
"delivery_line_2": "PO Box 42", | ||
"last_line": "Cupertino CA 95014-2083", | ||
"delivery_point_barcode": "950142083017", | ||
"components": { | ||
"primary_number": "1", | ||
"street_name": "Infinite", | ||
"street_suffix": "Loop", | ||
"city_name": "Cupertino", | ||
"state_abbreviation": "CA", | ||
"zipcode": "95014", | ||
"plus4_code": "2083", | ||
"delivery_point": "01", | ||
"delivery_point_check_digit": "7" | ||
}, | ||
"metadata": { | ||
"record_type": "S", | ||
"county_fips": "06085", | ||
"county_name": "Santa Clara", | ||
"carrier_route": "C067", | ||
"congressional_district": "15", | ||
"rdi": "Commercial", | ||
"latitude": 37.33118, | ||
"longitude": -122.03062, | ||
"precision": "Zip9" | ||
}, | ||
"analysis": { | ||
"dpv_match_code": "Y", | ||
"dpv_footnotes": "AABB", | ||
"dpv_cmra": "N", | ||
"dpv_vacant": "N", | ||
"active": "Y" | ||
} | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
[ | ||
{ | ||
"input_index": 0, | ||
"candidate_index": 0, | ||
"delivery_line_1": "1 N Rosedale St", | ||
"last_line": "Baltimore MD 21229-3737", | ||
"delivery_point_barcode": "212293737013", | ||
"components": { | ||
"primary_number": "1", | ||
"street_predirection": "N", | ||
"street_name": "Rosedale", | ||
"street_suffix": "St", | ||
"city_name": "Baltimore", | ||
"state_abbreviation": "MD", | ||
"zipcode": "21229", | ||
"plus4_code": "3737", | ||
"delivery_point": "01", | ||
"delivery_point_check_digit": "3" | ||
}, | ||
"metadata": { | ||
"record_type": "S", | ||
"zip_type": "Standard", | ||
"county_fips": "24510", | ||
"county_name": "Baltimore City", | ||
"carrier_route": "C047", | ||
"congressional_district": "07", | ||
"rdi": "Residential", | ||
"elot_sequence": "0059", | ||
"elot_sort": "A", | ||
"latitude": 39.28602, | ||
"longitude": -76.6689, | ||
"precision": "Zip9", | ||
"time_zone": "Eastern", | ||
"utc_offset": -5, | ||
"dst": true | ||
}, | ||
"analysis": { | ||
"dpv_match_code": "Y", | ||
"dpv_footnotes": "AABB", | ||
"dpv_cmra": "N", | ||
"dpv_vacant": "N", | ||
"active": "Y" | ||
} | ||
}, | ||
{ | ||
"input_index": 0, | ||
"candidate_index": 1, | ||
"delivery_line_1": "1 S Rosedale St", | ||
"last_line": "Baltimore MD 21229-3739", | ||
"delivery_point_barcode": "212293739011", | ||
"components": { | ||
"primary_number": "1", | ||
"street_predirection": "S", | ||
"street_name": "Rosedale", | ||
"street_suffix": "St", | ||
"city_name": "Baltimore", | ||
"state_abbreviation": "MD", | ||
"zipcode": "21229", | ||
"plus4_code": "3739", | ||
"delivery_point": "01", | ||
"delivery_point_check_digit": "1" | ||
}, | ||
"metadata": { | ||
"record_type": "S", | ||
"zip_type": "Standard", | ||
"county_fips": "24510", | ||
"county_name": "Baltimore City", | ||
"carrier_route": "C047", | ||
"congressional_district": "07", | ||
"rdi": "Residential", | ||
"elot_sequence": "0064", | ||
"elot_sort": "A", | ||
"latitude": 39.2858, | ||
"longitude": -76.66889, | ||
"precision": "Zip9", | ||
"time_zone": "Eastern", | ||
"utc_offset": -5, | ||
"dst": true | ||
}, | ||
"analysis": { | ||
"dpv_match_code": "Y", | ||
"dpv_footnotes": "AABB", | ||
"dpv_cmra": "N", | ||
"dpv_vacant": "N", | ||
"active": "Y" | ||
} | ||
} | ||
] |
Large diffs are not rendered by default.
Oops, something went wrong.