forked from fadamiao/json-formatter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
191 lines (172 loc) · 15.1 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>JSON Formatter</title>
<meta author="Fernando A. Damião">
<meta description="An offline tool to format JSON">
<style>
body{
margin: 0px;
padding: 0px;
border-top: 4px solid #FC4F08;
background-color: #E6E6E6;
font-family: Verdana;
}
a {
text-decoration: none;
color: #003366;
}
a:hover {
text-decoration: underline;
}
.container {
width: 960px;
margin: 0px auto;
}
.header {
padding: 10px 20px 0px;
margin-bottom: 10px;
}
.header h1 {
margin: 0px;
padding: 0px;
color: #fc4f08;
border-bottom: solid 1px #000000;
}
.header h1 span {
color: #454545;
font: bold 18px Verdana;
}
.content {
padding: 0px 20px 10px;
min-height: 600px;
font: bold 13px Verdana;
text-align: justify;
}
.content .bar {
margin-bottom: 5px;
}
.content textarea {
height: 400px;
width: 49%;
background-color: #000000;
color: #00FF00;
}
.footer {
padding: 0px 20px 10px;
text-align: center;
border-top: solid 1px #000000;
}
.footer span {
color: #003366;
font: bold 13px Verdana;
}
</style>
</head>
<body onload="verify();">
<a href="https://github.com/fadamiao/json-formatter"><img style="position: fixed; top: 0; right: 0; border: 0;" src="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wqHhkdo2Piy6CgoLCye8l6hSH8iFboxBem0lZaVwdLQUEgbZQoihLoQ756agijuxOSZIJhKhMd7hSp3YggODhZMJcI7jBUZGWnl7sRlk9grFEJdiPdJifeq6hqqvMfHx+kGCIj0J1LhNFNhS3OzjbsTJ0+wVyjSn0iFUzQFCbdyd2I8Yq+YggimEozlgXivrXPQbED0ucLRJ4KpRHjKWMHyucLH0J24q6eHGv3Q+EwwlQhPGOv4wED/Ke5OvHPHNiqUitWfiOmuCvH7RrrbHT/H26GhoQPoToyGtaWyKYgAlYipAsspM9kwA9ZLBjAM375953uyOzEU2UtE+hMx7VRI6bCrvf5YX2/Pa9ydGPveBVOJmCpjcaYakTV5UHtLzfPDIyPDTTebf4DuxIKpRHjCWC7m6mqr+9md2wMvOxoaPC8phEclzrF1tHZm3qjnagCNp7jLrdftrGGDm88FRnS03Biv3MAnu6vvU0TFJv+Hx6ASEdDhDlhqIPGP1d/rFJpKxLjZUAaLmnlGVJ83yB8bBKhEeAosp469NBpAgErEVIHlVLOSO0EpQCViqsACHbicgqlEeAos0IFL/zUBKhEegUu/ShSgEjEzIBMVdRFeDwEqEV4Pg+jcFCGYSoQAlQgBKhEiBKhE+F/8vwADAJj2WoQSWcV+AAAAAElFTkSuQmCC" alt="Fork me on GitHub"></a>
<div class="container">
<div class="header">
<h1>JSON Formatter</h1>
</div>
<div class="content">
<div class="bar">
<input type="radio" name="json-option" value="compact"> Compact |
<input type="radio" name="json-option" value="tab">Tab |
<input type="radio" name="json-option" value="2">2 Spaces |
<input type="radio" name="json-option" value="4">4 Spaces
<button type="button" onclick="format();">Format</button>
<a id="json-download" download="output.json">Download JSON</a>
</div>
<textarea id="json-input"></textarea>
<textarea id="json-output"></textarea><br><br>
<p>Sample:</p>
<pre><code>{"foo":"lorem","bar":"ipsum"}</code></pre>
</div>
<div class="footer">
<span>Made by <a href="https://github.com/fadamiao">Fernando A. Damião</a></span>
</div>
</div>
<script>
function verify() {
if (!navigator.userAgent.match(/Chrome|Firefox/i)) {
alert("Your browser have issues with 'Blob' function.\nYou may have issues to use JSON Formatter.");
}
}
/*
* Format and Download JSON via Blob
*
* @author Fernando A. Damião <[email protected]>
* @note Created At: 2013-09-04 13:55
* @note Last Update: 2013-09-05 10:01
*
*/
function format() {
var input = document.getElementById("json-input");
var output = document.getElementById("json-output");
var option = document.getElementsByName("json-option");
var link = document.getElementById("json-download");
for (var i = 0; i < option.length; i++) {
if (option[i].checked) {
option = option[i].value;
break;
}
}
output.innerHTML = jsonFormatter(input.value, option);
link.href = jsonDownload(input.value, option);
alert('Done!');
}
/*
* Download JSON via Blob
*
* @author Fernando A. Damião <[email protected]>
* @note Created At: 2013-08-12 08:55
* @note Last Update: 2013-09-05 10:00
* @return String Download URL via Blob
*
*/
function jsonDownload(json, option) {
window.URL = window.URL || window.webkitURL;
var json = jsonFormatter(json, option);
var blob = new Blob([json], {type: 'application/octet-stream'});
return window.URL.createObjectURL(blob);
}
/*
* Format JSON
*
* @author Fernando A. Damião <[email protected]>
* @note Created At: 2013-09-05 08:43
* @note Last Update: 2013-09-05 09:59
* @return String Formated JSON
*
*/
function jsonFormatter(json, option) {
var json = JSON.parse(json);
if (option == "compact") {
if (typeof json === 'object') {
json = JSON.stringify(json);
}
} else {
if (option == "2" || option == "4") {
option = parseInt(option);
} else {
option = '\t';
}
if (typeof json === 'object') {
json = JSON.stringify(json, null, option);
}
}
return json;
}
</script>
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-42571831-2', 'fadamiao.github.io');
ga('send', 'pageview');
</script>
</body>
</html>