Revert "#141 Removed parser snippet"

This reverts commit a6626d98b716f68b3f2aa3f06f7305df7c6cdf9b.
This commit is contained in:
Mike Koch 2015-04-30 17:31:33 -04:00
parent a6626d98b7
commit b3830b8b6f
3 changed files with 6433 additions and 0 deletions

File diff suppressed because it is too large Load Diff

13
snippets/parser.html Normal file
View File

@ -0,0 +1,13 @@
<!DOCTYPE html>
<html>
<head>
<title>JSON Parser</title>
<script src="http://code.jquery.com/jquery-1.11.2.min.js"></script>
<script src="parser.js"></script>
</head>
<body>
<ul id="output">
</ul>
<script>parseInput();</script>
</body>
</html>

17
snippets/parser.js Normal file
View File

@ -0,0 +1,17 @@
var parseInput = function() {
var json = '';
$.getJSON('font-awesome-icons.json', function(data) {
json = data;
$.each(data.icons, function(key, val) {
$('#output').append('<li>' + parseCategories(val.categories) + '</li>');
});
});
}
var parseCategories = function(categories) {
var categoriesString = '';
$.each(categories, function(key, val) {
categoriesString += val + ',';
});
return categoriesString;
}